product_subscriptions
Creates, updates, deletes, gets or lists a product_subscriptions resource.
Overview
| Name | product_subscriptions |
| Type | Resource |
| Id | azure.api_management.product_subscriptions |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
allowTracing | boolean | Determines whether tracing is enabled. |
createdDate | string (date-time) | Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. |
displayName | string | The name of the subscription, or null if the subscription has no name. |
endDate | string (date-time) | Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. |
expirationDate | string (date-time) | Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. |
notificationDate | string (date-time) | Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. |
ownerId | string | The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier. |
primaryKey | string | Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. |
scope | string | Scope like /products/{productId} or /apis or /apis/{apiId}. Required. |
secondaryKey | string | Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. |
startDate | string (date-time) | Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. |
state | string | Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Required. Known values are: "suspended", "active", "expired", "submitted", "rejected", and "cancelled". (suspended, active, expired, submitted, rejected, cancelled) |
stateComment | string | Optional subscription comment added by an administrator when the state is changed to the 'rejected'. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | resource_group_name, service_name, product_id, subscription_id | $filter, $top, $skip | Lists the collection of subscriptions to the specified product. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
product_id | string | Product identifier. Must be unique in the current API Management service instance. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
service_name | string | The name of the API Management service. Required. |
subscription_id | string | |
$filter | string | | Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| 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 || state | filter | eq | || user | expand | | |. Default value is None. |
$skip | integer | Number of records to skip. Default value is None. |
$top | integer | Number of records to return. Default value is None. |
SELECT examples
- list
Lists the collection of subscriptions to the specified product.
SELECT
id,
name,
allowTracing,
createdDate,
displayName,
endDate,
expirationDate,
notificationDate,
ownerId,
primaryKey,
scope,
secondaryKey,
startDate,
state,
stateComment,
systemData,
type
FROM azure.api_management.product_subscriptions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND product_id = '{{ product_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
;