你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzApiManagementApiVersionSet
获取 API 版本集的详细信息
语法
Get-AzApiManagementApiVersionSet
-Context <PsApiManagementContext>
[-ApiVersionSetId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzApiManagementApiVersionSet
-Context <PsApiManagementContext>
[-ApiVersionSetId <String>]
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzApiManagementApiVersionSet cmdlet 获取API 管理上下文中配置的 API 版本集的详细信息。
示例
示例 1:获取所有 API 版本集
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApiVersionSet -Context $ApiMgmtContext
ApiVersionSetId : a93316c8-8b88-46cc-8260-380789a5d598
Description :
VersionQueryName :
VersionHeaderName :
DisplayName : Echo API
VersioningScheme : Segment
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Microsoft.ApiManagement/service/contoso/api-version-sets/a916c8-8b88-46cc-8260-380789a5d598
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
ApiVersionSetId : 4cbdfa34-25f3-4a93-a9b6-76b6eade7562
Description :
VersionQueryName : api-version
VersionHeaderName :
DisplayName : getproduct old
VersioningScheme : Query
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Microsoft.ApiManagement/service/contoso/api-version-sets/4cbdfa34-25f3-4a93-a9b6-76b6eade7562
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
ApiVersionSetId : 8c441e0e-a0cd-47d8-8d88-f944a83b41bd
Description :
VersionQueryName :
VersionHeaderName : Api-Version
DisplayName : ordersapi
VersioningScheme : Header
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Microsoft.ApiManagement/service/contoso/api-version-sets/8c441e0e-a0cd-47d8-8d88-f944a83b41bd
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
此命令获取指定上下文的所有 API 版本集。
示例 2:按 ID 获取 API 版本集
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApiVersionSet -Context $ApiMgmtContext -ApiVersionSetId $ApiVersionSetId
ApiVersionSetId : 8c441e0e-a0cd-47d8-8d88-f944a83b41bd
Description :
VersionQueryName :
VersionHeaderName : Api-Version
DisplayName : ordersapi
VersioningScheme : Header
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Microsoft.ApiManagement/service/contoso/api-version-sets/8c441e0e-a0cd-47d8-8d88-f944a83b41bd
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
此命令获取具有指定 ID 的 API 版本集。
参数
-ApiVersionSetId
要查找的 API 标识符。 如果指定,将尝试按 ID 获取 API。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Context
PsApiManagementContext 的实例。 此参数是必需的。
类型: | PsApiManagementContext |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
ApiVersionSet 的 Arm 资源标识符。 如果指定,将尝试按标识符查找 apiVersionSet。 此参数是必需的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |