Workspace Global Schema
Global Schema Contract 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
ApiManagementCreateWorkspaceSchema
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var workspaceGlobalSchema = new AzureNative.ApiManagement.WorkspaceGlobalSchema("workspaceGlobalSchema", new()
{
Description = "sample schema description",
ResourceGroupName = "rg1",
SchemaId = "schema1",
SchemaType = AzureNative.ApiManagement.SchemaType.Xml,
ServiceName = "apimService1",
Value = @"<xsd:schema xmlns:xsd=""http://www.w3.org/2001/XMLSchema""
xmlns:tns=""http://tempuri.org/PurchaseOrderSchema.xsd""
targetNamespace=""http://tempuri.org/PurchaseOrderSchema.xsd""
elementFormDefault=""qualified"">
<xsd:element name=""PurchaseOrder"" type=""tns:PurchaseOrderType""/>
<xsd:complexType name=""PurchaseOrderType"">
<xsd:sequence>
<xsd:element name=""ShipTo"" type=""tns:USAddress"" maxOccurs=""2""/>
<xsd:element name=""BillTo"" type=""tns:USAddress""/>
</xsd:sequence>
<xsd:attribute name=""OrderDate"" type=""xsd:date""/>
</xsd:complexType>
<xsd:complexType name=""USAddress"">
<xsd:sequence>
<xsd:element name=""name"" type=""xsd:string""/>
<xsd:element name=""street"" type=""xsd:string""/>
<xsd:element name=""city"" type=""xsd:string""/>
<xsd:element name=""state"" type=""xsd:string""/>
<xsd:element name=""zip"" type=""xsd:integer""/>
</xsd:sequence>
<xsd:attribute name=""country"" type=""xsd:NMTOKEN"" fixed=""US""/>
</xsd:complexType>
</xsd:schema>",
WorkspaceId = "wks1",
});
});
Content copied to clipboard
package main
import (
apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apimanagement.NewWorkspaceGlobalSchema(ctx, "workspaceGlobalSchema", &apimanagement.WorkspaceGlobalSchemaArgs{
Description: pulumi.String("sample schema description"),
ResourceGroupName: pulumi.String("rg1"),
SchemaId: pulumi.String("schema1"),
SchemaType: pulumi.String(apimanagement.SchemaTypeXml),
ServiceName: pulumi.String("apimService1"),
Value: pulumi.Any(`<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd"
targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd"
elementFormDefault="qualified">
<xsd:element name="PurchaseOrder" type="tns:PurchaseOrderType"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="ShipTo" type="tns:USAddress" maxOccurs="2"/>
<xsd:element name="BillTo" type="tns:USAddress"/>
</xsd:sequence>
<xsd:attribute name="OrderDate" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:integer"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>
</xsd:schema>`),
WorkspaceId: pulumi.String("wks1"),
})
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.WorkspaceGlobalSchema;
import com.pulumi.azurenative.apimanagement.WorkspaceGlobalSchemaArgs;
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 workspaceGlobalSchema = new WorkspaceGlobalSchema("workspaceGlobalSchema", WorkspaceGlobalSchemaArgs.builder()
.description("sample schema description")
.resourceGroupName("rg1")
.schemaId("schema1")
.schemaType("xml")
.serviceName("apimService1")
.value("""
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd"
targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd"
elementFormDefault="qualified">
<xsd:element name="PurchaseOrder" type="tns:PurchaseOrderType"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="ShipTo" type="tns:USAddress" maxOccurs="2"/>
<xsd:element name="BillTo" type="tns:USAddress"/>
</xsd:sequence>
<xsd:attribute name="OrderDate" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:integer"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>
</xsd:schema> """)
.workspaceId("wks1")
.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:WorkspaceGlobalSchema schema1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/schemas/{schemaId}
Content copied to clipboard