workspace_subscriptions
Creates, updates, deletes, gets or lists a workspace_subscriptions
resource.
Overview
Name | workspace_subscriptions |
Type | Resource |
Id | azure.api_management.workspace_subscriptions |
Fields
The following fields are returned by SELECT
queries:
- get
- list
The response body contains the specified Subscription entity.
Name | Datatype | Description |
---|---|---|
properties | object | Subscription contract properties. |
A collection of the Subscription entities for the specified workspace in an API Management service instance.
Name | Datatype | Description |
---|---|---|
properties | object | Subscription contract properties. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceGroupName , serviceName , workspaceId , sid , subscriptionId | Gets the specified Subscription entity. | |
list | select | resourceGroupName , serviceName , workspaceId , subscriptionId | $filter , $top , $skip | Lists all subscriptions of the workspace in an API Management service instance. |
create_or_update | insert | resourceGroupName , serviceName , workspaceId , sid , subscriptionId | notify , If-Match , appType | Creates or updates the subscription of specified user to the specified product. |
update | update | resourceGroupName , serviceName , workspaceId , sid , If-Match , subscriptionId | notify , appType | Updates the details of a subscription specified by its identifier. |
delete | delete | resourceGroupName , serviceName , workspaceId , sid , If-Match , subscriptionId | Deletes the specified subscription. | |
regenerate_primary_key | exec | resourceGroupName , serviceName , workspaceId , sid , subscriptionId | Regenerates primary key of existing subscription of the workspace in an API Management service instance. | |
regenerate_secondary_key | exec | resourceGroupName , serviceName , workspaceId , sid , subscriptionId | Regenerates secondary key of existing subscription of the workspace in an API Management service instance. |
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 |
---|---|---|
If-Match | string | ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. |
resourceGroupName | string | The name of the resource group. The name is case insensitive. |
serviceName | string | The name of the API Management service. |
sid | string | Subscription entity Identifier. The entity represents the association between a user and a product in API Management. |
subscriptionId | string | The ID of the target subscription. |
workspaceId | string | Workspace identifier. Must be unique in the current API Management service instance. |
$filter | string | | Field | Usage | Supported operators | Supported functions |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | | |</br> |
$skip | integer (int32) | Number of records to skip. |
$top | integer (int32) | Number of records to return. |
If-Match | string | ETag of the Entity. Not required when creating an entity, but required when updating an entity. |
appType | string | Determines the type of application which send the create user request. Default is legacy publisher portal. |
notify | boolean | Notify change in Subscription State. - If false, do not send any email notification for change of state of subscription - If true, send email notification of change of state of subscription |
SELECT
examples
- get
- list
Gets the specified Subscription entity.
SELECT
properties
FROM azure.api_management.workspace_subscriptions
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND workspaceId = '{{ workspaceId }}' -- required
AND sid = '{{ sid }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
Lists all subscriptions of the workspace in an API Management service instance.
SELECT
properties
FROM azure.api_management.workspace_subscriptions
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND workspaceId = '{{ workspaceId }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
;
INSERT
examples
- create_or_update
- Manifest
Creates or updates the subscription of specified user to the specified product.
INSERT INTO azure.api_management.workspace_subscriptions (
data__properties,
resourceGroupName,
serviceName,
workspaceId,
sid,
subscriptionId,
notify,
If-Match,
appType
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ workspaceId }}',
'{{ sid }}',
'{{ subscriptionId }}',
'{{ notify }}',
'{{ If-Match }}',
'{{ appType }}'
RETURNING
properties
;
# Description fields are for documentation purposes
- name: workspace_subscriptions
props:
- name: resourceGroupName
value: string
description: Required parameter for the workspace_subscriptions resource.
- name: serviceName
value: string
description: Required parameter for the workspace_subscriptions resource.
- name: workspaceId
value: string
description: Required parameter for the workspace_subscriptions resource.
- name: sid
value: string
description: Required parameter for the workspace_subscriptions resource.
- name: subscriptionId
value: string
description: Required parameter for the workspace_subscriptions resource.
- name: properties
value: object
description: |
Subscription contract properties.
- name: notify
value: boolean
description: Notify change in Subscription State. - If false, do not send any email notification for change of state of subscription - If true, send email notification of change of state of subscription
- name: If-Match
value: string
description: ETag of the Entity. Not required when creating an entity, but required when updating an entity.
- name: appType
value: string
description: Determines the type of application which send the create user request. Default is legacy publisher portal.
UPDATE
examples
- update
Updates the details of a subscription specified by its identifier.
UPDATE azure.api_management.workspace_subscriptions
SET
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND workspaceId = '{{ workspaceId }}' --required
AND sid = '{{ sid }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND notify = {{ notify}}
AND appType = '{{ appType}}'
RETURNING
properties;
DELETE
examples
- delete
Deletes the specified subscription.
DELETE FROM azure.api_management.workspace_subscriptions
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND workspaceId = '{{ workspaceId }}' --required
AND sid = '{{ sid }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;
Lifecycle Methods
- regenerate_primary_key
- regenerate_secondary_key
Regenerates primary key of existing subscription of the workspace in an API Management service instance.
EXEC azure.api_management.workspace_subscriptions.regenerate_primary_key
@resourceGroupName='{{ resourceGroupName }}' --required,
@serviceName='{{ serviceName }}' --required,
@workspaceId='{{ workspaceId }}' --required,
@sid='{{ sid }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Regenerates secondary key of existing subscription of the workspace in an API Management service instance.
EXEC azure.api_management.workspace_subscriptions.regenerate_secondary_key
@resourceGroupName='{{ resourceGroupName }}' --required,
@serviceName='{{ serviceName }}' --required,
@workspaceId='{{ workspaceId }}' --required,
@sid='{{ sid }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;