Workspace Api Operation
API Operation details. Uses Azure REST API version 2022-09-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-09-01-preview. Other available API versions: 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01, 2024-06-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native apimanagement [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
Example Usage
ApiManagementCreateWorkspaceApiOperation
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var workspaceApiOperation = new AzureNative.ApiManagement.WorkspaceApiOperation("workspaceApiOperation", new()
{
ApiId = "PetStoreTemplate2",
Description = "This can only be done by the logged in user.",
DisplayName = "createUser2",
Method = "POST",
OperationId = "newoperations",
Request = new AzureNative.ApiManagement.Inputs.RequestContractArgs
{
Description = "Created user object",
Headers = new() { },
QueryParameters = new() { },
Representations = new[]
{
new AzureNative.ApiManagement.Inputs.RepresentationContractArgs
{
ContentType = "application/json",
SchemaId = "592f6c1d0af5840ca8897f0c",
TypeName = "User",
},
},
},
ResourceGroupName = "rg1",
Responses = new[]
{
new AzureNative.ApiManagement.Inputs.ResponseContractArgs
{
Description = "successful operation",
Headers = new() { },
Representations = new[]
{
new AzureNative.ApiManagement.Inputs.RepresentationContractArgs
{
ContentType = "application/xml",
},
new AzureNative.ApiManagement.Inputs.RepresentationContractArgs
{
ContentType = "application/json",
},
},
StatusCode = 200,
},
},
ServiceName = "apimService1",
TemplateParameters = new[] {},
UrlTemplate = "/user1",
WorkspaceId = "wks1",
});
});
package main
import (
apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apimanagement.NewWorkspaceApiOperation(ctx, "workspaceApiOperation", &apimanagement.WorkspaceApiOperationArgs{
ApiId: pulumi.String("PetStoreTemplate2"),
Description: pulumi.String("This can only be done by the logged in user."),
DisplayName: pulumi.String("createUser2"),
Method: pulumi.String("POST"),
OperationId: pulumi.String("newoperations"),
Request: &apimanagement.RequestContractArgs{
Description: pulumi.String("Created user object"),
Headers: apimanagement.ParameterContractArray{},
QueryParameters: apimanagement.ParameterContractArray{},
Representations: apimanagement.RepresentationContractArray{
&apimanagement.RepresentationContractArgs{
ContentType: pulumi.String("application/json"),
SchemaId: pulumi.String("592f6c1d0af5840ca8897f0c"),
TypeName: pulumi.String("User"),
},
},
},
ResourceGroupName: pulumi.String("rg1"),
Responses: apimanagement.ResponseContractArray{
&apimanagement.ResponseContractArgs{
Description: pulumi.String("successful operation"),
Headers: apimanagement.ParameterContractArray{},
Representations: apimanagement.RepresentationContractArray{
&apimanagement.RepresentationContractArgs{
ContentType: pulumi.String("application/xml"),
},
&apimanagement.RepresentationContractArgs{
ContentType: pulumi.String("application/json"),
},
},
StatusCode: pulumi.Int(200),
},
},
ServiceName: pulumi.String("apimService1"),
TemplateParameters: apimanagement.ParameterContractArray{},
UrlTemplate: pulumi.String("/user1"),
WorkspaceId: pulumi.String("wks1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.apimanagement.WorkspaceApiOperation;
import com.pulumi.azurenative.apimanagement.WorkspaceApiOperationArgs;
import com.pulumi.azurenative.apimanagement.inputs.RequestContractArgs;
import com.pulumi.azurenative.apimanagement.inputs.ResponseContractArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var workspaceApiOperation = new WorkspaceApiOperation("workspaceApiOperation", WorkspaceApiOperationArgs.builder()
.apiId("PetStoreTemplate2")
.description("This can only be done by the logged in user.")
.displayName("createUser2")
.method("POST")
.operationId("newoperations")
.request(RequestContractArgs.builder()
.description("Created user object")
.headers()
.queryParameters()
.representations(RepresentationContractArgs.builder()
.contentType("application/json")
.schemaId("592f6c1d0af5840ca8897f0c")
.typeName("User")
.build())
.build())
.resourceGroupName("rg1")
.responses(ResponseContractArgs.builder()
.description("successful operation")
.headers()
.representations(
RepresentationContractArgs.builder()
.contentType("application/xml")
.build(),
RepresentationContractArgs.builder()
.contentType("application/json")
.build())
.statusCode(200)
.build())
.serviceName("apimService1")
.templateParameters()
.urlTemplate("/user1")
.workspaceId("wks1")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:apimanagement:WorkspaceApiOperation newoperations /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}
Properties
The Azure API version of the resource.
Description of the operation. May include HTML formatting tags.
Operation Name.
An entity containing request details.
Array of Operation responses.
Collection of URL template parameters.
Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}