你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

User Subscription - List

列出指定用户的订阅集合。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions?api-version=2021-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions?$filter={$filter}&$top={$top}&$skip={$skip}&api-version=2021-08-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。

serviceName
path True

string

API 管理服务的名称。

正则表达式模式: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。

userId
path True

string

用户标识符。 在当前API 管理服务实例中必须是唯一的。

api-version
query True

string

要与客户端请求一起使用的 API 的版本。

$filter
query

string

|字段 |用法 |支持的运算符 |支持的函数 |
|-------------|------------------------|-----------------------------------|
|name |filter |ge、le、eq、ne、gt、lt |substringof、contains、startswith、endswith |
|displayName |filter |ge、le、eq、ne、gt、lt |substringof、contains、startswith、endswith |
|stateComment |filter |ge、le、eq、ne、gt、lt |substringof、contains、startswith、endswith |
|ownerId |filter |ge、le、eq、ne、gt、lt |substringof、contains、startswith、endswith |
|scope |filter |ge、le、eq、ne、gt、lt |substringof、contains、startswith、endswith |
|userId |filter |ge、le、eq、ne、gt、lt |substringof、contains、startswith、endswith |
|productId |filter |ge、le、eq、ne、gt、lt |substringof、contains、startswith、endswith |

$skip
query

integer

int32

要跳过的记录数。

$top
query

integer

int32

要返回的记录数。

响应

名称 类型 说明
200 OK

SubscriptionCollection

列出订阅实体的集合。

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

ApiManagementListUserSubscriptions

示例请求

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf/subscriptions?api-version=2021-08-01

示例响应

{
  "value": [
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf/subscriptions/57681850a40f7eb6c49f6ae3",
      "type": "Microsoft.ApiManagement/service/users/subscriptions",
      "name": "57681850a40f7eb6c49f6ae3",
      "properties": {
        "ownerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf",
        "scope": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5768181ea40f7eb6c49f6ac7",
        "displayName": "57681850a40f7eb6c49f6ae5",
        "state": "active",
        "createdDate": "2016-06-20T16:22:39.547Z",
        "startDate": "2016-06-20T00:00:00Z"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf/subscriptions/57681850a40f7eb6c49f6b2b",
      "type": "Microsoft.ApiManagement/service/users/subscriptions",
      "name": "57681850a40f7eb6c49f6b2b",
      "properties": {
        "ownerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf",
        "scope": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5768181ea40f7eb6c49f6ac7",
        "displayName": "57681850a40f7eb6c49f6b2d",
        "state": "active",
        "createdDate": "2016-06-20T16:22:41.103Z",
        "startDate": "2016-06-20T00:00:00Z"
      }
    }
  ],
  "nextLink": ""
}

定义

名称 说明
ErrorFieldContract

错误字段协定。

ErrorResponse

错误响应。

SubscriptionCollection

分页订阅列表表示形式。

SubscriptionContract

订阅详细信息。

SubscriptionState

订阅状态。 可能的状态为 * 活动 - 订阅处于活动状态,* 已暂停 - 订阅被阻止,订阅者无法调用产品的任何 API,* 已提交 - 订阅请求已由开发人员提出,但尚未批准或拒绝,* 已拒绝 - 订阅请求已被管理员拒绝,* 已取消 - 开发人员或管理员已取消订阅, * 已过期 – 订阅已过期并已停用。

ErrorFieldContract

错误字段协定。

名称 类型 说明
code

string

属性级错误代码。

message

string

属性级错误的可读表示形式。

target

string

属性名称。

ErrorResponse

错误响应。

名称 类型 说明
error.code

string

服务定义的错误代码。 此代码用作响应中指定的 HTTP 错误代码的子状态。

error.details

ErrorFieldContract[]

在发生验证错误时,请求中发送的无效字段列表。

error.message

string

错误的用户可读表示形式。

SubscriptionCollection

分页订阅列表表示形式。

名称 类型 说明
count

integer

所有页面的总记录计数数。

nextLink

string

下一页链接(如果有)。

value

SubscriptionContract[]

页面值。

SubscriptionContract

订阅详细信息。

名称 类型 说明
id

string

资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

资源的名称

properties.allowTracing

boolean

确定是否启用跟踪

properties.createdDate

string

订阅创建日期。 日期符合以下格式: yyyy-MM-ddTHH:mm:ssZ 由 ISO 8601 标准指定。

properties.displayName

string

订阅的名称;如果订阅没有名称,则为 null。

properties.endDate

string

订阅取消或过期的日期。 该设置仅用于审核目的,订阅不会自动取消。 可以使用 属性管理 state 订阅生命周期。 日期符合以下格式: yyyy-MM-ddTHH:mm:ssZ 由 ISO 8601 标准指定。

properties.expirationDate

string

订阅到期日期。 设置仅用于审核目的,订阅不会自动过期。 可以使用 属性管理 state 订阅生命周期。 日期符合以下格式: yyyy-MM-ddTHH:mm:ssZ 由 ISO 8601 标准指定。

properties.notificationDate

string

即将到期的订阅通知日期。 日期符合以下格式: yyyy-MM-ddTHH:mm:ssZ 由 ISO 8601 标准指定。

properties.ownerId

string

订阅所有者的用户资源标识符。 该值是 /users/{userId} 格式的有效相对 URL,其中 {userId} 是用户标识符。

properties.primaryKey

string

订阅主密钥。 此属性不会在“GET”操作上填充! 使用“/listSecrets”POST 请求获取值。

properties.scope

string

范围类似于 /products/{productId} 或 /apis 或 /apis/{apiId}。

properties.secondaryKey

string

订阅辅助密钥。 此属性不会在“GET”操作上填充! 使用“/listSecrets”POST 请求获取值。

properties.startDate

string

订阅激活日期。 该设置仅用于审核目的,订阅不会自动激活。 可以使用 属性管理 state 订阅生命周期。 日期符合以下格式: yyyy-MM-ddTHH:mm:ssZ 由 ISO 8601 标准指定。

properties.state

SubscriptionState

订阅状态。 可能的状态为 * 活动 - 订阅处于活动状态,* 已暂停 - 订阅被阻止,订阅者无法调用产品的任何 API,* 已提交 - 订阅请求已由开发人员提出,但尚未批准或拒绝,* 已拒绝 - 订阅请求已被管理员拒绝,* 已取消 - 开发人员或管理员已取消订阅, * 已过期 – 订阅已过期并已停用。

properties.stateComment

string

状态更改为“已拒绝”时,管理员添加的可选订阅注释。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

SubscriptionState

订阅状态。 可能的状态为 * 活动 - 订阅处于活动状态,* 已暂停 - 订阅被阻止,订阅者无法调用产品的任何 API,* 已提交 - 订阅请求已由开发人员提出,但尚未批准或拒绝,* 已拒绝 - 订阅请求已被管理员拒绝,* 已取消 - 开发人员或管理员已取消订阅, * 已过期 – 订阅已过期并已停用。

名称 类型 说明
active

string

cancelled

string

expired

string

rejected

string

submitted

string

suspended

string