Set-AzApiManagementApiSchema
修改 API 架構
語法
Set-AzApiManagementApiSchema
-Context <PsApiManagementContext>
-ApiId <String>
-SchemaId <String>
[-SchemaDocumentContentType <String>]
[-SchemaDocument <String>]
[-SchemaDocumentFilePath <String>]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzApiManagementApiSchema
-InputObject <PsApiManagementApiSchema>
[-SchemaDocumentContentType <String>]
[-SchemaDocument <String>]
[-SchemaDocumentFilePath <String>]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzApiManagementApiSchema
-ResourceId <String>
[-SchemaDocumentContentType <String>]
[-SchemaDocument <String>]
[-SchemaDocumentFilePath <String>]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Set-AzApiManagementApiSchema Cmdlet 會修改 Azure API 管理 API 架構。
範例
範例 1:修改 API 架構
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Set-AzApiManagementApiSchema -Context $ApiMgmtContext -ApiId "echo-api" -SchemaId "2"
此範例會更新 Api 架構
範例 2
修改 API 架構。 ( 自動產生 )
Set-AzApiManagementApiSchema -ApiId 'echo-api' -Context <PsApiManagementContext> -SchemaDocumentContentType swaggerdefinition -SchemaDocumentFilePath C:\Users\sasolank\Downloads\petstoreschema.json -SchemaId '2'
參數
-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 |
-InputObject
PsApiManagementApiSchema 的實例。 這是必要參數。
類型: | PsApiManagementApiSchema |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-PassThru
如果指定,則表示設定 API 的 Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi 類型的實例。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ResourceId
診斷或 API 架構的 Arm ResourceId。 這是必要參數。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-SchemaDocument
API 架構檔做為字串。 不需要此參數,-SchemaDocumentFile 未指定。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-SchemaDocumentContentType
API 架構的 ContentType。 這個參數是選擇性的。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-SchemaDocumentFilePath
Api 架構檔檔路徑。 不需要此參數,-SchemaDocument 未指定。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-SchemaId
現有架構的標識碼。 這是必要參數。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |