共用方式為


New-AzApiManagementApiSchema

在 ApiManagement 服務中建立新的 API 架構

語法

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

建立 API 的新 API 架構。

範例

範例 1:建立 Swagger Petstore 廣泛 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

Cmdlet New-AzApiManagementApiSchema 建立或更新 swagger-petstore-extensive aPI 的架構。

參數

-ApiId

api的標識碼。 這是必要參數。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Context

PsApiManagementContext 的實例。 這是必要參數。

類型:PsApiManagementContext
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SchemaDocument

API 架構檔做為字串。 不需要此參數,-SchemaDocumentFile 未指定。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-SchemaDocumentContentType

API 架構的 ContentType。 這是必要參數。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-SchemaDocumentFilePath

Api 架構檔檔路徑。 不需要此參數,-SchemaDocument 未指定。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-SchemaId

新架構的標識碼。 這個參數是選擇性的。 如果未指定,則會產生 。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

PsApiManagementContext

String

輸出

PsApiManagementApiSchema