New-AzApiManagementApiSchema

Creates the new API Schema in the ApiManagement service

Syntax

New-AzApiManagementApiSchema
   -Context <PsApiManagementContext>
   -ApiId <String>
   [-SchemaId <String>]
   -SchemaDocumentContentType <String>
   -SchemaDocument <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzApiManagementApiSchema
   -Context <PsApiManagementContext>
   -ApiId <String>
   [-SchemaId <String>]
   -SchemaDocumentContentType <String>
   -SchemaDocumentFilePath <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates the new API Schema of the API.

Examples

Example 1: Create new Schema for Swagger Petstore Extensive API

$context = New-AzApiManagementContext -ResourceId /subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ApiManagement/service/sdktestapim4163
New-AzApiManagementApiSchema -Context $context -ApiId swagger-petstore-extensive -SchemaDocumentContentType swaggerdefinition -SchemaDocumentFilePath C:\Users\sasolank\Downloads\petstoreschema.json

Schema Id                            Api Id                     Schema ContentType
---------                            ------                     ------------------
3e8892eb-98e4-408d-b77a-f424185c1044 swagger-petstore-extensive swaggerdefinition

The cmdlet New-AzApiManagementApiSchema creates or updates the schema of the swagger-petstore-extensive aPI.

Parameters

-ApiId

Identifier of api. This parameter is required.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Context

Instance of PsApiManagementContext. This parameter is required.

Type:PsApiManagementContext
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SchemaDocument

Api schema document as a string. This parameter is required is -SchemaDocumentFile is not specified.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SchemaDocumentContentType

ContentType of the api Schema. This parameter is required.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SchemaDocumentFilePath

Api schema document file path. This parameter is required is -SchemaDocument is not specified.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SchemaId

Identifier of new schema. This parameter is optional. If not specified will be generated.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PsApiManagementContext

String

Outputs

PsApiManagementApiSchema