Skip to main content

workspace_policy_fragments

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

Overview

Nameworkspace_policy_fragments
TypeResource
Idazure.api_management.workspace_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, workspaceId, id, subscriptionIdformatGets a policy fragment.
list_by_serviceselectresourceGroupName, serviceName, workspaceId, subscriptionId$filter, $orderby, $top, $skipGets all policy fragments defined within a workspace.
create_or_updateinsertresourceGroupName, serviceName, workspaceId, id, subscriptionIdIf-MatchCreates or updates a policy fragment.
deletedeleteresourceGroupName, serviceName, workspaceId, 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.
workspaceIdstringWorkspace identifier. Must be unique in the current API Management service instance.
$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.workspace_policy_fragments
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND workspaceId = '{{ workspaceId }}' -- 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.workspace_policy_fragments (
data__properties,
resourceGroupName,
serviceName,
workspaceId,
id,
subscriptionId,
If-Match
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ workspaceId }}',
'{{ id }}',
'{{ subscriptionId }}',
'{{ If-Match }}'
RETURNING
properties
;

DELETE examples

Deletes a policy fragment.

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