Skip to main content

api_operation

Creates, updates, deletes, gets or lists an api_operation resource.

Overview

Nameapi_operation
TypeResource
Idazure.api_management.api_operation

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
descriptionstringDescription of the operation. May include HTML formatting tags.
displayNamestringOperation Name. Required.
methodstringA Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. Required.
policiesstringOperation Policies.
requestobjectAn entity containing request details.
responsesarrayArray of Operation responses.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
templateParametersarrayCollection of URL template parameters.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
urlTemplatestringRelative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, service_name, api_id, operation_id, subscription_idGets the details of the API Operation specified by its identifier.
list_by_apiselectresource_group_name, service_name, api_id, subscription_id$filter, $top, $skip, tagsLists a collection of the operations for the specified API.
create_or_updateinsertresource_group_name, service_name, api_id, operation_id, subscription_idCreates a new operation in the API or updates an existing one.
updateupdateresource_group_name, service_name, api_id, operation_id, subscription_idUpdates the details of the operation in the API specified by its identifier.
create_or_updatereplaceresource_group_name, service_name, api_id, operation_id, subscription_idCreates a new operation in the API or updates an existing one.
deletedeleteresource_group_name, service_name, api_id, operation_id, subscription_idDeletes the specified operation in the API.
get_entity_tagexecresource_group_name, service_name, api_id, operation_id, subscription_idGets the entity state (Etag) version of the API operation specified by its identifier.

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
api_idstringAPI 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. Required.
operation_idstringOperation identifier within an API. Must be unique in the current API Management service instance. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
service_namestringThe name of the API Management service. Required.
subscription_idstring
$filterstring| Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |. Default value is None.
$skipintegerNumber of records to skip. Default value is None.
$topintegerNumber of records to return. Default value is None.
tagsstringInclude tags in the response. Default value is None.

SELECT examples

Gets the details of the API Operation specified by its identifier.

SELECT
id,
name,
description,
displayName,
method,
policies,
request,
responses,
systemData,
templateParameters,
type,
urlTemplate
FROM azure.api_management.api_operation
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND api_id = '{{ api_id }}' -- required
AND operation_id = '{{ operation_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a new operation in the API or updates an existing one.

INSERT INTO azure.api_management.api_operation (
properties,
resource_group_name,
service_name,
api_id,
operation_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ api_id }}',
'{{ operation_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

UPDATE examples

Updates the details of the operation in the API specified by its identifier.

UPDATE azure.api_management.api_operation
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND operation_id = '{{ operation_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

REPLACE examples

Creates a new operation in the API or updates an existing one.

REPLACE azure.api_management.api_operation
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND operation_id = '{{ operation_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Deletes the specified operation in the API.

DELETE FROM azure.api_management.api_operation
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND operation_id = '{{ operation_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Gets the entity state (Etag) version of the API operation specified by its identifier.

EXEC azure.api_management.api_operation.get_entity_tag 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@api_id='{{ api_id }}' --required,
@operation_id='{{ operation_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;