api_operation
Creates, updates, deletes, gets or lists an api_operation resource.
Overview
| Name | api_operation |
| Type | Resource |
| Id | azure.api_management.api_operation |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_api
| 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. |
description | string | Description of the operation. May include HTML formatting tags. |
displayName | string | Operation Name. Required. |
method | string | A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. Required. |
policies | string | Operation Policies. |
request | object | An entity containing request details. |
responses | array | Array of Operation responses. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
templateParameters | array | Collection of URL template parameters. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
urlTemplate | string | Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. Required. |
| 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. |
description | string | Description of the operation. May include HTML formatting tags. |
displayName | string | Operation Name. Required. |
method | string | A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. Required. |
policies | string | Operation Policies. |
request | object | An entity containing request details. |
responses | array | Array of Operation responses. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
templateParameters | array | Collection of URL template parameters. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
urlTemplate | string | Relative 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, service_name, api_id, operation_id, subscription_id | Gets the details of the API Operation specified by its identifier. | |
list_by_api | select | resource_group_name, service_name, api_id, subscription_id | $filter, $top, $skip, tags | Lists a collection of the operations for the specified API. |
create_or_update | insert | resource_group_name, service_name, api_id, operation_id, subscription_id | Creates a new operation in the API or updates an existing one. | |
update | update | resource_group_name, service_name, api_id, operation_id, subscription_id | Updates the details of the operation in the API specified by its identifier. | |
create_or_update | replace | resource_group_name, service_name, api_id, operation_id, subscription_id | Creates a new operation in the API or updates an existing one. | |
delete | delete | resource_group_name, service_name, api_id, operation_id, subscription_id | Deletes the specified operation in the API. | |
get_entity_tag | exec | resource_group_name, service_name, api_id, operation_id, subscription_id | Gets 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.
| Name | Datatype | Description |
|---|---|---|
api_id | string | API 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_id | string | Operation identifier within an API. Must be unique in the current API Management service instance. 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 | |
$filter | string | | 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. |
$skip | integer | Number of records to skip. Default value is None. |
$top | integer | Number of records to return. Default value is None. |
tags | string | Include tags in the response. Default value is None. |
SELECT examples
- get
- list_by_api
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
;
Lists a collection of the operations for the specified API.
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 subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
AND tags = '{{ tags }}'
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: api_operation
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the api_operation resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the api_operation resource.
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the api_operation resource.
- name: operation_id
value: "{{ operation_id }}"
description: Required parameter for the api_operation resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the api_operation resource.
- name: properties
description: |
Properties of the Operation Contract.
value:
templateParameters:
- name: "{{ name }}"
description: "{{ description }}"
type: "{{ type }}"
defaultValue: "{{ defaultValue }}"
required: {{ required }}
values: "{{ values }}"
schemaId: "{{ schemaId }}"
typeName: "{{ typeName }}"
examples: "{{ examples }}"
description: "{{ description }}"
request:
description: "{{ description }}"
queryParameters:
- name: "{{ name }}"
description: "{{ description }}"
type: "{{ type }}"
defaultValue: "{{ defaultValue }}"
required: {{ required }}
values: "{{ values }}"
schemaId: "{{ schemaId }}"
typeName: "{{ typeName }}"
examples: "{{ examples }}"
headers:
- name: "{{ name }}"
description: "{{ description }}"
type: "{{ type }}"
defaultValue: "{{ defaultValue }}"
required: {{ required }}
values: "{{ values }}"
schemaId: "{{ schemaId }}"
typeName: "{{ typeName }}"
examples: "{{ examples }}"
representations:
- contentType: "{{ contentType }}"
schemaId: "{{ schemaId }}"
typeName: "{{ typeName }}"
formParameters: "{{ formParameters }}"
examples: "{{ examples }}"
responses:
- statusCode: {{ statusCode }}
description: "{{ description }}"
representations: "{{ representations }}"
headers: "{{ headers }}"
policies: "{{ policies }}"
displayName: "{{ displayName }}"
method: "{{ method }}"
urlTemplate: "{{ urlTemplate }}"
UPDATE examples
- update
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
- create_or_update
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
- delete
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
- get_entity_tag
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
;