你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Set-AzApiManagementApiVersionSet
更新 API 管理上下文中的 API 版本集。
语法
Set-AzApiManagementApiVersionSet
-Context <PsApiManagementContext>
-ApiVersionSetId <String>
[-Name <String>]
[-Scheme <PsApiManagementVersioningScheme>]
[-HeaderName <String>]
[-QueryName <String>]
[-Description <String>]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzApiManagementApiVersionSet
-InputObject <PsApiManagementApiVersionSet>
[-Name <String>]
[-Scheme <PsApiManagementVersioningScheme>]
[-HeaderName <String>]
[-QueryName <String>]
[-Description <String>]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Set-AzApiManagementApiVersionSet cmdlet 修改 Azure API 管理 API 版本集。
示例
示例 1
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Set-AzApiManagementApiVersionSet -Context $ApiMgmtContext -ApiVersionSetId "query-verion-set" -Scheme Header -HeaderName "api-version" -Description "Azure version header string"
此命令使用版本控制方案更新现有 API 版本集 Header
和标头参数 api-version
。
参数
-ApiVersionSetId
新 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 |
-Description
Api 版本集的说明。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-HeaderName
将包含版本控制信息的标头值。 如果选择了版本控制方案标头,则必须指定此值。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-InputObject
PsApiManagementApiVersionSet 的实例。 此参数是必需的。
类型: | PsApiManagementApiVersionSet |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
ApiVersion 集的名称。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-PassThru
如果指定,则表示修改后的 apiVersionSet 类型的 Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApiVersionSet 类型的实例将写入输出。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-QueryName
将包含版本控制信息的查询值。 如果选择版本控制方案查询,则必须指定此值。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Scheme
要为 Api 版本控制集选择的版本控制方案。 此参数是可选的。
类型: | PsApiManagementVersioningScheme |
接受的值: | Segment, Query, Header |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |