Azure Native

Pulumi Official
Package maintained by Pulumi
v1.64.1 published on Wednesday, May 18, 2022 by Pulumi

Schema

Schema Contract details. API Version: 2021-04-01-preview.

Example Usage

ApiManagementCreateSchema1

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var schema = new AzureNative.ApiManagement.Schema("schema", new AzureNative.ApiManagement.SchemaArgs
        {
            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>",
        });
    }

}
package main

import (
	apimanagement "github.com/pulumi/pulumi-azure-native/sdk/go/azure/apimanagement"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apimanagement.NewSchema(ctx, "schema", &apimanagement.SchemaArgs{
			Description:       pulumi.String("sample schema description"),
			ResourceGroupName: pulumi.String("rg1"),
			SchemaId:          pulumi.String("schema1"),
			SchemaType:        pulumi.String("xml"),
			ServiceName:       pulumi.String("apimService1"),
			Value: pulumi.String("<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"
\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"
\n           elementFormDefault=\"qualified\">
\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>
\n <xsd:complexType name=\"PurchaseOrderType\">
\n  <xsd:sequence>
\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>
\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>
\n  </xsd:sequence>
\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>
\n </xsd:complexType>
\n
\n <xsd:complexType name=\"USAddress\">
\n  <xsd:sequence>
\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>
\n   <xsd:element name=\"street\" type=\"xsd:string\"/>
\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>
\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>
\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>
\n  </xsd:sequence>
\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>
\n </xsd:complexType>
\n</xsd:schema>"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var schema = new Schema("schema", SchemaArgs.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>            """)
            .build());

        }
}
import pulumi
import pulumi_azure_native as azure_native

schema = azure_native.apimanagement.Schema("schema",
    description="sample schema description",
    resource_group_name="rg1",
    schema_id="schema1",
    schema_type="xml",
    service_name="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>""")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const schema = new azure_native.apimanagement.Schema("schema", {
    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>`,
});
resources:
  schema:
    type: azure-native:apimanagement:Schema
    properties:
      description: sample schema description
      resourceGroupName: rg1
      schemaId: schema1
      schemaType: xml
      serviceName: apimService1
      value: "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>"

ApiManagementCreateSchema2

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var schema = new AzureNative.ApiManagement.Schema("schema", new AzureNative.ApiManagement.SchemaArgs
        {
            Description = "sample schema description",
            ResourceGroupName = "rg1",
            SchemaId = "schema1",
            SchemaType = "json",
            ServiceName = "apimService1",
        });
    }

}
package main

import (
	apimanagement "github.com/pulumi/pulumi-azure-native/sdk/go/azure/apimanagement"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apimanagement.NewSchema(ctx, "schema", &apimanagement.SchemaArgs{
			Description:       pulumi.String("sample schema description"),
			ResourceGroupName: pulumi.String("rg1"),
			SchemaId:          pulumi.String("schema1"),
			SchemaType:        pulumi.String("json"),
			ServiceName:       pulumi.String("apimService1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var schema = new Schema("schema", SchemaArgs.builder()        
            .description("sample schema description")
            .resourceGroupName("rg1")
            .schemaId("schema1")
            .schemaType("json")
            .serviceName("apimService1")
            .build());

        }
}
import pulumi
import pulumi_azure_native as azure_native

schema = azure_native.apimanagement.Schema("schema",
    description="sample schema description",
    resource_group_name="rg1",
    schema_id="schema1",
    schema_type="json",
    service_name="apimService1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const schema = new azure_native.apimanagement.Schema("schema", {
    description: "sample schema description",
    resourceGroupName: "rg1",
    schemaId: "schema1",
    schemaType: "json",
    serviceName: "apimService1",
});
resources:
  schema:
    type: azure-native:apimanagement:Schema
    properties:
      description: sample schema description
      resourceGroupName: rg1
      schemaId: schema1
      schemaType: json
      serviceName: apimService1

Create a Schema Resource

new Schema(name: string, args: SchemaArgs, opts?: CustomResourceOptions);
@overload
def Schema(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           description: Optional[str] = None,
           resource_group_name: Optional[str] = None,
           schema_id: Optional[str] = None,
           schema_type: Optional[Union[str, SchemaType]] = None,
           service_name: Optional[str] = None,
           value: Optional[str] = None)
@overload
def Schema(resource_name: str,
           args: SchemaArgs,
           opts: Optional[ResourceOptions] = None)
func NewSchema(ctx *Context, name string, args SchemaArgs, opts ...ResourceOption) (*Schema, error)
public Schema(string name, SchemaArgs args, CustomResourceOptions? opts = null)
public Schema(String name, SchemaArgs args)
public Schema(String name, SchemaArgs args, CustomResourceOptions options)
type: azure-native:apimanagement:Schema
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SchemaArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SchemaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SchemaArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Schema Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Schema resource accepts the following input properties:

ResourceGroupName string

The name of the resource group.

SchemaType string | Pulumi.AzureNative.ApiManagement.SchemaType

Schema Type. Immutable.

ServiceName string

The name of the API Management service.

Description string

Free-form schema entity description.

SchemaId string

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

Value string

Json-encoded string for non json-based schema.

ResourceGroupName string

The name of the resource group.

SchemaType string | SchemaType

Schema Type. Immutable.

ServiceName string

The name of the API Management service.

Description string

Free-form schema entity description.

SchemaId string

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

Value string

Json-encoded string for non json-based schema.

resourceGroupName String

The name of the resource group.

schemaType String | SchemaType

Schema Type. Immutable.

serviceName String

The name of the API Management service.

description String

Free-form schema entity description.

schemaId String

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

value String

Json-encoded string for non json-based schema.

resourceGroupName string

The name of the resource group.

schemaType string | SchemaType

Schema Type. Immutable.

serviceName string

The name of the API Management service.

description string

Free-form schema entity description.

schemaId string

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

value string

Json-encoded string for non json-based schema.

resource_group_name str

The name of the resource group.

schema_type str | SchemaType

Schema Type. Immutable.

service_name str

The name of the API Management service.

description str

Free-form schema entity description.

schema_id str

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

value str

Json-encoded string for non json-based schema.

resourceGroupName String

The name of the resource group.

schemaType String | "xml" | "json"

Schema Type. Immutable.

serviceName String

The name of the API Management service.

description String

Free-form schema entity description.

schemaId String

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

value String

Json-encoded string for non json-based schema.

Outputs

All input properties are implicitly available as output properties. Additionally, the Schema resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the resource

Type string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the resource

Type string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the resource

type String

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the resource

type string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the resource

type str

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the resource

type String

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Supporting Types

SchemaType

Xml
xml

Xml schema type.

Json
json

Json schema type.

SchemaTypeXml
xml

Xml schema type.

SchemaTypeJson
json

Json schema type.

Xml
xml

Xml schema type.

Json
json

Json schema type.

Xml
xml

Xml schema type.

Json
json

Json schema type.

XML
xml

Xml schema type.

JSON
json

Json schema type.

"xml"
xml

Xml schema type.

"json"
json

Json schema type.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:apimanagement:Schema schema1 /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0