Skip to main content

tags

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

Overview

Nametags
TypeResource
Idazure.api_management.tags

Fields

The following fields are returned by SELECT queries:

Gets the details of the tag specified by its identifier.

NameDatatypeDescription
propertiesobjectTag entity contract properties.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_operationselectresourceGroupName, serviceName, apiId, operationId, tagId, subscriptionIdGet tag associated with the Operation.
list_by_operationselectresourceGroupName, serviceName, apiId, operationId, subscriptionId$filter, $top, $skipLists all Tags associated with the Operation.
get_by_apiselectresourceGroupName, serviceName, apiId, tagId, subscriptionIdGet tag associated with the API.
get_by_productselectresourceGroupName, serviceName, productId, tagId, subscriptionIdGet tag associated with the Product.
getselectresourceGroupName, serviceName, tagId, subscriptionIdGets the details of the tag specified by its identifier.
list_by_apiselectresourceGroupName, serviceName, apiId, subscriptionId$filter, $top, $skipLists all Tags associated with the API.
list_by_productselectresourceGroupName, serviceName, productId, subscriptionId$filter, $top, $skipLists all Tags associated with the Product.
list_by_serviceselectresourceGroupName, serviceName, subscriptionId$filter, $top, $skip, scopeLists a collection of tags defined within a service instance.
create_or_updateinsertresourceGroupName, serviceName, tagId, subscriptionIdIf-MatchCreates a tag.
updateupdateresourceGroupName, serviceName, tagId, If-Match, subscriptionIdUpdates the details of the tag specified by its identifier.
deletedeleteresourceGroupName, serviceName, tagId, If-Match, subscriptionIdDeletes specific tag of the API Management service instance.
assign_to_operationexecresourceGroupName, serviceName, apiId, operationId, tagId, subscriptionIdAssign tag to the Operation.
detach_from_operationexecresourceGroupName, serviceName, apiId, operationId, tagId, subscriptionIdDetach the tag from the Operation.
assign_to_apiexecresourceGroupName, serviceName, apiId, tagId, subscriptionIdAssign tag to the Api.
detach_from_apiexecresourceGroupName, serviceName, apiId, tagId, subscriptionIdDetach the tag from the Api.
assign_to_productexecresourceGroupName, serviceName, productId, tagId, subscriptionIdAssign tag to the Product.
detach_from_productexecresourceGroupName, serviceName, productId, tagId, subscriptionIdDetach the tag from the Product.

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.
apiIdstringAPI revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
operationIdstringThe ID of an ongoing async operation.
productIdstringProduct identifier. Must be unique in the current API Management service instance.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
serviceNamestringThe name of the API Management service.
subscriptionIdstringThe ID of the target subscription.
tagIdstringTag identifier. Must be unique in the current API Management service instance.
$filterstring| Field | Usage | Supported operators | Supported functions |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>
$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.
scopestringScope like 'apis', 'products' or 'apis/{apiId}

SELECT examples

Get tag associated with the Operation.

SELECT
properties
FROM azure.api_management.tags
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND apiId = '{{ apiId }}' -- required
AND operationId = '{{ operationId }}' -- required
AND tagId = '{{ tagId }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates a tag.

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

UPDATE examples

Updates the details of the tag specified by its identifier.

UPDATE azure.api_management.tags
SET
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND tagId = '{{ tagId }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
properties;

DELETE examples

Deletes specific tag of the API Management service instance.

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

Lifecycle Methods

Assign tag to the Operation.

EXEC azure.api_management.tags.assign_to_operation 
@resourceGroupName='{{ resourceGroupName }}' --required,
@serviceName='{{ serviceName }}' --required,
@apiId='{{ apiId }}' --required,
@operationId='{{ operationId }}' --required,
@tagId='{{ tagId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;