Subscription - Get
取得指定的訂閱實體。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}?api-version=2024-05-01
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
API 管理服務的名稱。 |
sid
|
path | True |
string maxLength: 256pattern: ^[^*#&+:<>?]+$ |
訂用帳戶實體標識碼。 實體代表使用者與 API 管理中產品之間的關聯。 |
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
api-version
|
query | True |
string minLength: 1 |
要用於這項作業的 API 版本。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
回應主體包含指定的訂用帳戶實體。 標題 ETag: string |
|
Other Status Codes |
描述作業失敗原因的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
範例
ApiManagementGetSubscription
範例要求
範例回覆
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/5931a769d8d14f0ad8ce13b8",
"type": "Microsoft.ApiManagement/service/subscriptions",
"name": "5931a769d8d14f0ad8ce13b8",
"properties": {
"ownerId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b",
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002",
"displayName": "Unlimited",
"state": "submitted",
"createdDate": "2017-06-02T17:59:06.223Z"
}
}
定義
名稱 | Description |
---|---|
Error |
資源管理錯誤其他資訊。 |
Error |
錯誤詳細數據。 |
Error |
錯誤回應 |
Subscription |
訂用帳戶詳細數據。 |
Subscription |
訂用帳戶狀態。 可能的狀態為 * 作用中 – 訂用帳戶為作用中、 * 已暫停 – 已封鎖訂用帳戶,且訂閱者無法呼叫產品的任何 API* 已提交 – 已由開發人員提出訂閱要求,但尚未核准或拒絕,* 已拒絕 – 系統管理員已拒絕訂閱要求,* 已取消 – 開發人員或系統管理員已取消訂用帳戶要求, * 已過期 – 訂用帳戶已達到到期日且已停用。 |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
名稱 | 類型 | Description |
---|---|---|
info |
object |
其他資訊。 |
type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
名稱 | 類型 | Description |
---|---|---|
additionalInfo |
錯誤其他資訊。 |
|
code |
string |
錯誤碼。 |
details |
錯誤詳細數據。 |
|
message |
string |
錯誤訊息。 |
target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
名稱 | 類型 | Description |
---|---|---|
error |
error 物件。 |
SubscriptionContract
訂用帳戶詳細數據。
名稱 | 類型 | Description |
---|---|---|
id |
string |
資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
資源的名稱 |
properties.allowTracing |
boolean |
判斷是否啟用追蹤 |
properties.createdDate |
string (date-time) |
訂用帳戶建立日期。 日期符合下列格式: |
properties.displayName |
string minLength: 0maxLength: 100 |
訂閱的名稱,如果訂用帳戶沒有名稱,則為 null。 |
properties.endDate |
string (date-time) |
取消或過期訂閱的日期。 此設定僅供稽核之用,且不會自動取消訂用帳戶。 您可以使用 |
properties.expirationDate |
string (date-time) |
訂閱到期日。 此設定僅供稽核之用,且訂用帳戶不會自動過期。 您可以使用 |
properties.notificationDate |
string (date-time) |
即將推出的訂用帳戶到期通知日期。 日期符合下列格式: |
properties.ownerId |
string |
訂用帳戶擁有者的用戶資源標識碼。 值是 /users/{userId} 格式的有效相對 URL,其中 {userId} 是使用者標識符。 |
properties.primaryKey |
string minLength: 1maxLength: 256 |
訂用帳戶主鍵。 此屬性不會填入 『GET』 作業! 使用 '/listSecrets' POST 要求來取得值。 |
properties.scope |
string |
範圍,例如 /products/{productId} 或 /apis 或 /apis/{apiId}。 |
properties.secondaryKey |
string minLength: 1maxLength: 256 |
訂用帳戶次要金鑰。 此屬性不會填入 『GET』 作業! 使用 '/listSecrets' POST 要求來取得值。 |
properties.startDate |
string (date-time) |
訂用帳戶啟用日期。 此設定僅供稽核之用,而且不會自動啟用訂用帳戶。 您可以使用 |
properties.state |
訂用帳戶狀態。 可能的狀態為 * 作用中 – 訂用帳戶為作用中、 * 已暫停 – 已封鎖訂用帳戶,且訂閱者無法呼叫產品的任何 API* 已提交 – 已由開發人員提出訂閱要求,但尚未核准或拒絕,* 已拒絕 – 系統管理員已拒絕訂閱要求,* 已取消 – 開發人員或系統管理員已取消訂用帳戶要求, * 已過期 – 訂用帳戶已達到到期日且已停用。 |
|
properties.stateComment |
string |
當狀態變更為「已拒絕」時,系統管理員新增的選擇性訂用帳戶批注。 |
type |
string |
資源的型別。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts” |
SubscriptionState
訂用帳戶狀態。 可能的狀態為 * 作用中 – 訂用帳戶為作用中、 * 已暫停 – 已封鎖訂用帳戶,且訂閱者無法呼叫產品的任何 API* 已提交 – 已由開發人員提出訂閱要求,但尚未核准或拒絕,* 已拒絕 – 系統管理員已拒絕訂閱要求,* 已取消 – 開發人員或系統管理員已取消訂用帳戶要求, * 已過期 – 訂用帳戶已達到到期日且已停用。
值 | Description |
---|---|
active | |
cancelled | |
expired | |
rejected | |
submitted | |
suspended |