Api Operation Args
data class ApiOperationArgs(val apiId: Output<String>? = null, val description: Output<String>? = null, val displayName: Output<String>? = null, val method: Output<String>? = null, val operationId: Output<String>? = null, val policies: Output<String>? = null, val request: Output<RequestContractArgs>? = null, val resourceGroupName: Output<String>? = null, val responses: Output<List<ResponseContractArgs>>? = null, val serviceName: Output<String>? = null, val templateParameters: Output<List<ParameterContractArgs>>? = null, val urlTemplate: Output<String>? = null) : ConvertibleToJava<ApiOperationArgs>
Api Operation details. API Version: 2020-12-01.
Example Usage
ApiManagementCreateApiOperation
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var apiOperation = new AzureNative.ApiManagement.ApiOperation("apiOperation", 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",
});
});
Content copied to clipboard
package main
import (
apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apimanagement.NewApiOperation(ctx, "apiOperation", &apimanagement.ApiOperationArgs{
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.RequestContractResponse{
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.ResponseContractArgs{
{
Description: pulumi.String("successful operation"),
Headers: apimanagement.ParameterContractArray{},
Representations: apimanagement.RepresentationContractArray{
{
ContentType: pulumi.String("application/xml"),
},
{
ContentType: pulumi.String("application/json"),
},
},
StatusCode: pulumi.Int(200),
},
},
ServiceName: pulumi.String("apimService1"),
TemplateParameters: apimanagement.ParameterContractArray{},
UrlTemplate: pulumi.String("/user1"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.apimanagement.ApiOperation;
import com.pulumi.azurenative.apimanagement.ApiOperationArgs;
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 apiOperation = new ApiOperation("apiOperation", ApiOperationArgs.builder()
.apiId("PetStoreTemplate2")
.description("This can only be done by the logged in user.")
.displayName("createUser2")
.method("POST")
.operationId("newoperations")
.request(Map.ofEntries(
Map.entry("description", "Created user object"),
Map.entry("headers", ),
Map.entry("queryParameters", ),
Map.entry("representations", Map.ofEntries(
Map.entry("contentType", "application/json"),
Map.entry("schemaId", "592f6c1d0af5840ca8897f0c"),
Map.entry("typeName", "User")
))
))
.resourceGroupName("rg1")
.responses(Map.ofEntries(
Map.entry("description", "successful operation"),
Map.entry("headers", ),
Map.entry("representations",
Map.of("contentType", "application/xml"),
Map.of("contentType", "application/json")),
Map.entry("statusCode", 200)
))
.serviceName("apimService1")
.templateParameters()
.urlTemplate("/user1")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:apimanagement:ApiOperation newoperations /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/PetStoreTemplate2/operations/newoperations
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(apiId: Output<String>? = null, description: Output<String>? = null, displayName: Output<String>? = null, method: Output<String>? = null, operationId: Output<String>? = null, policies: Output<String>? = null, request: Output<RequestContractArgs>? = null, resourceGroupName: Output<String>? = null, responses: Output<List<ResponseContractArgs>>? = null, serviceName: Output<String>? = null, templateParameters: Output<List<ParameterContractArgs>>? = null, urlTemplate: Output<String>? = null)
Properties
Link copied to clipboard
Description of the operation. May include HTML formatting tags.
Link copied to clipboard
Operation Name.
Link copied to clipboard
Operation identifier within an API. Must be unique in the current API Management service instance.
Link copied to clipboard
An entity containing request details.
Link copied to clipboard
The name of the resource group.
Link copied to clipboard
Array of Operation responses.
Link copied to clipboard
The name of the API Management service.
Link copied to clipboard
Collection of URL template parameters.
Link copied to clipboard
Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}