Skip to main content

policy_fragments

Creates, updates, deletes, gets or lists a policy_fragments resource.

Overview

Namepolicy_fragments
TypeResource
Idazure.api_management.policy_fragments

Fields

The following fields are returned by SELECT queries:

Successfully returned a policy fragment.

NameDatatypeDescription
propertiesobjectProperties of the Policy Fragment.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, serviceName, id, subscriptionIdformatGets a policy fragment.
list_by_serviceselectresourceGroupName, serviceName, subscriptionId$filter, $orderby, $top, $skipGets all policy fragments.
create_or_updateinsertresourceGroupName, serviceName, id, subscriptionIdIf-MatchCreates or updates a policy fragment.
deletedeleteresourceGroupName, serviceName, id, If-Match, subscriptionIdDeletes a policy fragment.

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.

NameDatatypeDescription
If-MatchstringETag 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.
idstringA resource identifier.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
serviceNamestringThe name of the API Management service.
subscriptionIdstringThe ID of the target subscription.
$filterstring| Field | Usage | Supported operators | Supported functions |</br>|-------------|-------------|-------------|-------------|</br>| name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| value | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>
$orderbystringOData order by query option.
$skipinteger (int32)Number of records to skip.
$topinteger (int32)Number of records to return.
If-MatchstringETag of the Entity. Not required when creating an entity, but required when updating an entity.
formatstringPolicy fragment content format.

SELECT examples

Gets a policy fragment.

SELECT
properties
FROM azure.api_management.policy_fragments
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND id = '{{ id }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND format = '{{ format }}'
;

INSERT examples

Creates or updates a policy fragment.

INSERT INTO azure.api_management.policy_fragments (
data__properties,
resourceGroupName,
serviceName,
id,
subscriptionId,
If-Match
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ id }}',
'{{ subscriptionId }}',
'{{ If-Match }}'
RETURNING
properties
;

DELETE examples

Deletes a policy fragment.

DELETE FROM azure.api_management.policy_fragments
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND id = '{{ id }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;