api
Creates, updates, deletes, gets or lists an api resource.
Overview
| Name | api |
| Type | Resource |
| Id | azure.api_management.api |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_service
| 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. |
apiRevision | string | Describes the revision of the API. If no value is provided, default revision 1 is created. |
apiRevisionDescription | string | Description of the API Revision. |
apiVersion | string | Indicates the version identifier of the API if the API is versioned. |
apiVersionDescription | string | Description of the API Version. |
apiVersionSet | object | Version set details. |
apiVersionSetId | string | A resource identifier for the related ApiVersionSet. |
authenticationSettings | object | Collection of authentication settings included into this API. |
contact | object | Contact information for the API. |
description | string | Description of the API. May include HTML formatting tags. |
displayName | string | API name. Must be 1 to 300 characters long. |
isCurrent | boolean | Indicates if API revision is current api revision. |
isOnline | boolean | Indicates if API revision is accessible via the gateway. |
license | object | License information for the API. |
path | string | Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. Required. |
protocols | array | Describes on which protocols the operations in this API can be invoked. |
provisioningState | string | The provisioning state. |
serviceUrl | string | Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. |
sourceApiId | string | API identifier of the source API. |
subscriptionKeyParameterNames | object | Protocols over which API is made available. |
subscriptionRequired | boolean | Specifies whether an API or Product subscription is required for accessing the API. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
termsOfServiceUrl | string | A URL to the Terms of Service for the API. MUST be in the format of a URL. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| 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. |
apiRevision | string | Describes the revision of the API. If no value is provided, default revision 1 is created. |
apiRevisionDescription | string | Description of the API Revision. |
apiVersion | string | Indicates the version identifier of the API if the API is versioned. |
apiVersionDescription | string | Description of the API Version. |
apiVersionSet | object | Version set details. |
apiVersionSetId | string | A resource identifier for the related ApiVersionSet. |
authenticationSettings | object | Collection of authentication settings included into this API. |
contact | object | Contact information for the API. |
description | string | Description of the API. May include HTML formatting tags. |
displayName | string | API name. Must be 1 to 300 characters long. |
isCurrent | boolean | Indicates if API revision is current api revision. |
isOnline | boolean | Indicates if API revision is accessible via the gateway. |
license | object | License information for the API. |
path | string | Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. Required. |
protocols | array | Describes on which protocols the operations in this API can be invoked. |
provisioningState | string | The provisioning state. |
serviceUrl | string | Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. |
sourceApiId | string | API identifier of the source API. |
subscriptionKeyParameterNames | object | Protocols over which API is made available. |
subscriptionRequired | boolean | Specifies whether an API or Product subscription is required for accessing the API. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
termsOfServiceUrl | string | A URL to the Terms of Service for the API. MUST be in the format of a URL. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
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, subscription_id | Gets the details of the API specified by its identifier. | |
list_by_service | select | resource_group_name, service_name, subscription_id | $filter, $top, $skip, tags, expandApiVersionSet | Lists all APIs of the API Management service instance. |
create_or_update | insert | resource_group_name, service_name, api_id, subscription_id | Creates new or updates existing specified API of the API Management service instance. | |
update | update | resource_group_name, service_name, api_id, subscription_id | Updates the specified API of the API Management service instance. | |
create_or_update | replace | resource_group_name, service_name, api_id, subscription_id | Creates new or updates existing specified API of the API Management service instance. | |
delete | delete | resource_group_name, service_name, api_id, subscription_id | deleteRevisions | Deletes the specified API of the API Management service instance. |
get_entity_tag | exec | resource_group_name, service_name, api_id, subscription_id | Gets the entity state (Etag) version of the API specified by its identifier. | |
list_by_tags | exec | resource_group_name, service_name, subscription_id | $filter, $top, $skip, includeNotTaggedApis | Lists a collection of apis associated with tags. |
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. |
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 || apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || isCurrent | filter | eq | |. 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. |
deleteRevisions | boolean | Delete all revisions of the Api. Default value is None. |
expandApiVersionSet | boolean | Include full ApiVersionSet resource in response. Default value is None. |
includeNotTaggedApis | boolean | Include not tagged APIs. Default value is None. |
tags | string | Include tags in the response. Default value is None. |
SELECT examples
- get
- list_by_service
Gets the details of the API specified by its identifier.
SELECT
id,
name,
apiRevision,
apiRevisionDescription,
apiVersion,
apiVersionDescription,
apiVersionSet,
apiVersionSetId,
authenticationSettings,
contact,
description,
displayName,
isCurrent,
isOnline,
license,
path,
protocols,
provisioningState,
serviceUrl,
sourceApiId,
subscriptionKeyParameterNames,
subscriptionRequired,
systemData,
termsOfServiceUrl,
type
FROM azure.api_management.api
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
;
Lists all APIs of the API Management service instance.
SELECT
id,
name,
apiRevision,
apiRevisionDescription,
apiVersion,
apiVersionDescription,
apiVersionSet,
apiVersionSetId,
authenticationSettings,
contact,
description,
displayName,
isCurrent,
isOnline,
license,
path,
protocols,
provisioningState,
serviceUrl,
sourceApiId,
subscriptionKeyParameterNames,
subscriptionRequired,
systemData,
termsOfServiceUrl,
type
FROM azure.api_management.api
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
AND tags = '{{ tags }}'
AND expandApiVersionSet = '{{ expandApiVersionSet }}'
;
INSERT examples
- create_or_update
- Manifest
Creates new or updates existing specified API of the API Management service instance.
INSERT INTO azure.api_management.api (
properties,
resource_group_name,
service_name,
api_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ api_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: api
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the api resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the api resource.
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the api resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the api resource.
- name: properties
description: |
API entity create of update properties.
value:
description: "{{ description }}"
authenticationSettings:
oAuth2:
authorizationServerId: "{{ authorizationServerId }}"
scope: "{{ scope }}"
openid:
openidProviderId: "{{ openidProviderId }}"
bearerTokenSendingMethods:
- "{{ bearerTokenSendingMethods }}"
oAuth2AuthenticationSettings:
- authorizationServerId: "{{ authorizationServerId }}"
scope: "{{ scope }}"
openidAuthenticationSettings:
- openidProviderId: "{{ openidProviderId }}"
bearerTokenSendingMethods: "{{ bearerTokenSendingMethods }}"
subscriptionKeyParameterNames:
header: "{{ header }}"
query: "{{ query }}"
type: "{{ type }}"
apiRevision: "{{ apiRevision }}"
apiVersion: "{{ apiVersion }}"
isCurrent: {{ isCurrent }}
isOnline: {{ isOnline }}
apiRevisionDescription: "{{ apiRevisionDescription }}"
apiVersionDescription: "{{ apiVersionDescription }}"
apiVersionSetId: "{{ apiVersionSetId }}"
subscriptionRequired: {{ subscriptionRequired }}
termsOfServiceUrl: "{{ termsOfServiceUrl }}"
contact:
name: "{{ name }}"
url: "{{ url }}"
email: "{{ email }}"
license:
name: "{{ name }}"
url: "{{ url }}"
sourceApiId: "{{ sourceApiId }}"
displayName: "{{ displayName }}"
serviceUrl: "{{ serviceUrl }}"
path: "{{ path }}"
protocols:
- "{{ protocols }}"
apiVersionSet:
id: "{{ id }}"
name: "{{ name }}"
description: "{{ description }}"
versioningScheme: "{{ versioningScheme }}"
versionQueryName: "{{ versionQueryName }}"
versionHeaderName: "{{ versionHeaderName }}"
provisioningState: "{{ provisioningState }}"
value: "{{ value }}"
format: "{{ format }}"
wsdlSelector:
wsdlServiceName: "{{ wsdlServiceName }}"
wsdlEndpointName: "{{ wsdlEndpointName }}"
apiType: "{{ apiType }}"
translateRequiredQueryParameters: "{{ translateRequiredQueryParameters }}"
UPDATE examples
- update
Updates the specified API of the API Management service instance.
UPDATE azure.api_management.api
SET
properties = '{{ properties }}'
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
RETURNING
id,
name,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Creates new or updates existing specified API of the API Management service instance.
REPLACE azure.api_management.api
SET
properties = '{{ properties }}'
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
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the specified API of the API Management service instance.
DELETE FROM azure.api_management.api
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 deleteRevisions = '{{ deleteRevisions }}'
;
Lifecycle Methods
- get_entity_tag
- list_by_tags
Gets the entity state (Etag) version of the API specified by its identifier.
EXEC azure.api_management.api.get_entity_tag
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@api_id='{{ api_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Lists a collection of apis associated with tags.
EXEC azure.api_management.api.list_by_tags
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@$filter='{{ $filter }}',
@$top='{{ $top }}',
@$skip='{{ $skip }}',
@includeNotTaggedApis={{ includeNotTaggedApis }}
;