WorkspaceApiOperationArgs

data class WorkspaceApiOperationArgs(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, val workspaceId: Output<String>? = null) : ConvertibleToJava<WorkspaceApiOperationArgs>

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}

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, workspaceId: Output<String>? = null)

Properties

Link copied to clipboard
val apiId: Output<String>? = null

API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

Link copied to clipboard
val description: Output<String>? = null

Description of the operation. May include HTML formatting tags.

Link copied to clipboard
val displayName: Output<String>? = null

Operation Name.

Link copied to clipboard
val method: Output<String>? = null

A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.

Link copied to clipboard
val operationId: Output<String>? = null

Operation identifier within an API. Must be unique in the current API Management service instance.

Link copied to clipboard
val policies: Output<String>? = null

Operation Policies

Link copied to clipboard
val request: Output<RequestContractArgs>? = null

An entity containing request details.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val responses: Output<List<ResponseContractArgs>>? = null

Array of Operation responses.

Link copied to clipboard
val serviceName: Output<String>? = null

The name of the API Management service.

Link copied to clipboard

Collection of URL template parameters.

Link copied to clipboard
val urlTemplate: Output<String>? = null

Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}

Link copied to clipboard
val workspaceId: Output<String>? = null

Workspace identifier. Must be unique in the current API Management service instance.

Functions

Link copied to clipboard
open override fun toJava(): WorkspaceApiOperationArgs