Set-AzApiManagementApiSchema
修改 API 架構
Syntax
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 的識別碼。 此為必要參數。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
執行 Cmdlet 之前先提示您確認。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Context
PsApiManagementContext 的實例。 此為必要參數。
Type: | PsApiManagementContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
PsApiManagementApiSchema 的實例。 此為必要參數。
Type: | PsApiManagementApiSchema |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
如果指定,則為代表設定 API 的 Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi 類型的實例。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceId
診斷或 API 架構的 Arm ResourceId。 此為必要參數。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SchemaDocument
API 架構檔做為字串。 此參數為 -SchemaDocumentFile 未指定。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SchemaDocumentContentType
API 架構的 ContentType。 這是選擇性參數。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SchemaDocumentFilePath
Api 架構檔檔路徑。 此參數為 -SchemaDocument 未指定。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SchemaId
現有架構的標識碼。 此為必要參數。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |