workspace_product_policy
Creates, updates, deletes, gets or lists a workspace_product_policy resource.
Overview
| Name | workspace_product_policy |
| Type | Resource |
| Id | azure.api_management.workspace_product_policy |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_product
| 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. |
format | string | Format of the policyContent. Known values are: "xml", "xml-link", "rawxml", and "rawxml-link". (xml, xml-link, rawxml, rawxml-link) |
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". |
value | string | Contents of the Policy as defined by the format. Required. |
| 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. |
format | string | Format of the policyContent. Known values are: "xml", "xml-link", "rawxml", and "rawxml-link". (xml, xml-link, rawxml, rawxml-link) |
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". |
value | string | Contents of the Policy as defined by the format. Required. |
Methods
The following methods are available for this resource:
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 |
|---|---|---|
policy_id | string | The identifier of the Policy. "policy" Required. |
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 | |
workspace_id | string | Workspace identifier. Must be unique in the current API Management service instance. Required. |
format | string | Policy Export Format. Known values are: "xml" and "rawxml". Default value is None. |
SELECT examples
- get
- list_by_product
Get the policy configuration at the Product level.
SELECT
id,
name,
format,
systemData,
type,
value
FROM azure.api_management.workspace_product_policy
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND product_id = '{{ product_id }}' -- required
AND policy_id = '{{ policy_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND format = '{{ format }}'
;
Get the policy configuration at the Product level.
SELECT
id,
name,
format,
systemData,
type,
value
FROM azure.api_management.workspace_product_policy
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND product_id = '{{ product_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates policy configuration for the Product.
INSERT INTO azure.api_management.workspace_product_policy (
properties,
resource_group_name,
service_name,
workspace_id,
product_id,
policy_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ workspace_id }}',
'{{ product_id }}',
'{{ policy_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: workspace_product_policy
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the workspace_product_policy resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the workspace_product_policy resource.
- name: workspace_id
value: "{{ workspace_id }}"
description: Required parameter for the workspace_product_policy resource.
- name: product_id
value: "{{ product_id }}"
description: Required parameter for the workspace_product_policy resource.
- name: policy_id
value: "{{ policy_id }}"
description: Required parameter for the workspace_product_policy resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the workspace_product_policy resource.
- name: properties
description: |
Properties of the Policy.
value:
value: "{{ value }}"
format: "{{ format }}"
REPLACE examples
- create_or_update
Creates or updates policy configuration for the Product.
REPLACE azure.api_management.workspace_product_policy
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND product_id = '{{ product_id }}' --required
AND policy_id = '{{ policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the policy configuration at the Product.
DELETE FROM azure.api_management.workspace_product_policy
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND product_id = '{{ product_id }}' --required
AND policy_id = '{{ policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- get_entity_tag
Get the ETag of the policy configuration at the Product level.
EXEC azure.api_management.workspace_product_policy.get_entity_tag
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@workspace_id='{{ workspace_id }}' --required,
@product_id='{{ product_id }}' --required,
@policy_id='{{ policy_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;