policy
Creates, updates, deletes, gets or lists a policy resource.
Overview
| Name | policy |
| Type | Resource |
| Id | azure.api_management.policy |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_service
| 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, service_name, policy_id, subscription_id | format | Get the Global policy definition of the Api Management service. |
list_by_service | select | resource_group_name, service_name, subscription_id | Lists all the Global Policy definitions of the Api Management service. | |
create_or_update | insert | resource_group_name, service_name, policy_id, subscription_id | Creates or updates the global policy configuration of the Api Management service. | |
create_or_update | replace | resource_group_name, service_name, policy_id, subscription_id | Creates or updates the global policy configuration of the Api Management service. | |
delete | delete | resource_group_name, service_name, policy_id, subscription_id | Deletes the global policy configuration of the Api Management Service. | |
get_entity_tag | exec | resource_group_name, service_name, policy_id, subscription_id | Gets the entity state (Etag) version of the Global policy definition in the Api Management service. |
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. |
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 | |
format | string | Policy Export Format. Known values are: "xml" and "rawxml". Default value is None. |
SELECT examples
- get
- list_by_service
Get the Global policy definition of the Api Management service.
SELECT
id,
name,
format,
systemData,
type,
value
FROM azure.api_management.policy
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND policy_id = '{{ policy_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND format = '{{ format }}'
;
Lists all the Global Policy definitions of the Api Management service.
SELECT
id,
name,
format,
systemData,
type,
value
FROM azure.api_management.policy
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates the global policy configuration of the Api Management service.
INSERT INTO azure.api_management.policy (
properties,
resource_group_name,
service_name,
policy_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ policy_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: policy
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the policy resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the policy resource.
- name: policy_id
value: "{{ policy_id }}"
description: Required parameter for the policy resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the policy resource.
- name: properties
description: |
Properties of the Policy.
value:
value: "{{ value }}"
format: "{{ format }}"
REPLACE examples
- create_or_update
Creates or updates the global policy configuration of the Api Management service.
REPLACE azure.api_management.policy
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND policy_id = '{{ policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the global policy configuration of the Api Management Service.
DELETE FROM azure.api_management.policy
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND policy_id = '{{ policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- get_entity_tag
Gets the entity state (Etag) version of the Global policy definition in the Api Management service.
EXEC azure.api_management.policy.get_entity_tag
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@policy_id='{{ policy_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;