你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzApiManagementApiRelease
获取 API 版本。
语法
Get-AzApiManagementApiRelease
-Context <PsApiManagementContext>
-ApiId <String>
[-ReleaseId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzApiManagementApiRelease
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzApiManagementApiRelease cmdlet 获取 Azure API 管理 API 的一个或多个版本。
示例
示例 1:获取 API 的所有版本
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApiRelease -Context $ApiMgmtContext -ApiId 5adf6fbf0faadf3ad8558065
ReleaseId : 5afccaf6b89fd067426d402e
ApiId : 5adf6fbf0faadf3ad8558065
CreatedDateTime : 5/17/2018 12:21:12 AM
UpdatedDateTime : 5/17/2018 12:21:12 AM
Notes : creating a new release
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Microsoft.ApiManagement/service/contoso/apis/5adf6fbf0faadf3ad8558065/releases/5afccaf6b89fd067426d402e
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
此命令获取指定上下文 echo-api
API 的所有版本。
示例 2:获取特定 API 版本的发布信息
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApiRelease -Context $ApiMgmtContext -ApiId 5adf6fbf0faadf3ad8558065 -ReleaseId 5afccaf6b89fd067426d402e
ReleaseId : 5afccaf6b89fd067426d402e
ApiId : 5adf6fbf0faadf3ad8558065
CreatedDateTime : 5/17/2018 12:21:12 AM
UpdatedDateTime : 5/17/2018 12:21:12 AM
Notes : creating a new release
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Mi
crosoft.ApiManagement/service/contoso/apis/5adf6fbf0faadf3ad8558065/releases/5afccaf6b89fd067426d402
e
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
此命令使用指定的 releaseId 获取特定 API 的发布信息。
参数
-ApiId
要查找的 API 标识符。 如果指定,将尝试按 ID 获取 API。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Context
PsApiManagementContext 的实例。 此参数是必需的。
类型: | PsApiManagementContext |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ReleaseId
Release 的标识符。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ResourceId
API 版本的 Arm 资源标识符。 如果指定,将尝试按标识符查找 API 发布。 此参数是必需的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |