policy_restriction
Creates, updates, deletes, gets or lists a policy_restriction resource.
Overview
| Name | policy_restriction |
| Type | Resource |
| Id | azure.api_management.policy_restriction |
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. |
requireBase | string | Indicates if base policy should be enforced for the policy document. Known values are: "true" and "false". (true, false) |
scope | string | Path to the policy document. |
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". |
| 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. |
requireBase | string | Indicates if base policy should be enforced for the policy document. Known values are: "true" and "false". (true, false) |
scope | string | Path to the policy document. |
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 |
|---|---|---|---|---|
get | select | resource_group_name, service_name, policy_restriction_id, subscription_id | Get the policy restriction of the Api Management service. | |
list_by_service | select | resource_group_name, service_name, subscription_id | Gets all policy restrictions of API Management services. | |
create_or_update | insert | resource_group_name, service_name, policy_restriction_id, subscription_id | Creates or updates the policy restriction configuration of the Api Management service. | |
update | update | resource_group_name, service_name, policy_restriction_id, subscription_id | Updates the policy restriction configuration of the Api Management service. | |
create_or_update | replace | resource_group_name, service_name, policy_restriction_id, subscription_id | Creates or updates the policy restriction configuration of the Api Management service. | |
delete | delete | resource_group_name, service_name, policy_restriction_id, subscription_id | Deletes the policy restriction configuration of the Api Management Service. | |
get_entity_tag | exec | resource_group_name, service_name, policy_restriction_id, subscription_id | Gets the entity state (Etag) version of the policy restriction 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_restriction_id | string | Policy restrictions after an entity level. 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 |
SELECT examples
- get
- list_by_service
Get the policy restriction of the Api Management service.
SELECT
id,
name,
requireBase,
scope,
systemData,
type
FROM azure.api_management.policy_restriction
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND policy_restriction_id = '{{ policy_restriction_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all policy restrictions of API Management services.
SELECT
id,
name,
requireBase,
scope,
systemData,
type
FROM azure.api_management.policy_restriction
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 policy restriction configuration of the Api Management service.
INSERT INTO azure.api_management.policy_restriction (
properties,
resource_group_name,
service_name,
policy_restriction_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ policy_restriction_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: policy_restriction
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the policy_restriction resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the policy_restriction resource.
- name: policy_restriction_id
value: "{{ policy_restriction_id }}"
description: Required parameter for the policy_restriction resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the policy_restriction resource.
- name: properties
description: |
Properties of the Policy Restriction.
value:
scope: "{{ scope }}"
requireBase: "{{ requireBase }}"
UPDATE examples
- update
Updates the policy restriction configuration of the Api Management service.
UPDATE azure.api_management.policy_restriction
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND policy_restriction_id = '{{ policy_restriction_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Creates or updates the policy restriction configuration of the Api Management service.
REPLACE azure.api_management.policy_restriction
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND policy_restriction_id = '{{ policy_restriction_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the policy restriction configuration of the Api Management Service.
DELETE FROM azure.api_management.policy_restriction
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND policy_restriction_id = '{{ policy_restriction_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- get_entity_tag
Gets the entity state (Etag) version of the policy restriction in the Api Management service.
EXEC azure.api_management.policy_restriction.get_entity_tag
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@policy_restriction_id='{{ policy_restriction_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;