Skip to main content

api

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

Overview

Nameapi
TypeResource
Idazure.api_management.api

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.
apiRevisionstringDescribes the revision of the API. If no value is provided, default revision 1 is created.
apiRevisionDescriptionstringDescription of the API Revision.
apiVersionstringIndicates the version identifier of the API if the API is versioned.
apiVersionDescriptionstringDescription of the API Version.
apiVersionSetobjectVersion set details.
apiVersionSetIdstringA resource identifier for the related ApiVersionSet.
authenticationSettingsobjectCollection of authentication settings included into this API.
contactobjectContact information for the API.
descriptionstringDescription of the API. May include HTML formatting tags.
displayNamestringAPI name. Must be 1 to 300 characters long.
isCurrentbooleanIndicates if API revision is current api revision.
isOnlinebooleanIndicates if API revision is accessible via the gateway.
licenseobjectLicense information for the API.
pathstringRelative 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.
protocolsarrayDescribes on which protocols the operations in this API can be invoked.
provisioningStatestringThe provisioning state.
serviceUrlstringAbsolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
sourceApiIdstringAPI identifier of the source API.
subscriptionKeyParameterNamesobjectProtocols over which API is made available.
subscriptionRequiredbooleanSpecifies whether an API or Product subscription is required for accessing the API.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
termsOfServiceUrlstringA URL to the Terms of Service for the API. MUST be in the format of a URL.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, service_name, api_id, subscription_idGets the details of the API specified by its identifier.
list_by_serviceselectresource_group_name, service_name, subscription_id$filter, $top, $skip, tags, expandApiVersionSetLists all APIs of the API Management service instance.
create_or_updateinsertresource_group_name, service_name, api_id, subscription_idCreates new or updates existing specified API of the API Management service instance.
updateupdateresource_group_name, service_name, api_id, subscription_idUpdates the specified API of the API Management service instance.
create_or_updatereplaceresource_group_name, service_name, api_id, subscription_idCreates new or updates existing specified API of the API Management service instance.
deletedeleteresource_group_name, service_name, api_id, subscription_iddeleteRevisionsDeletes the specified API of the API Management service instance.
get_entity_tagexecresource_group_name, service_name, api_id, subscription_idGets the entity state (Etag) version of the API specified by its identifier.
list_by_tagsexecresource_group_name, service_name, subscription_id$filter, $top, $skip, includeNotTaggedApisLists 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.

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.
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 || 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.
$skipintegerNumber of records to skip. Default value is None.
$topintegerNumber of records to return. Default value is None.
deleteRevisionsbooleanDelete all revisions of the Api. Default value is None.
expandApiVersionSetbooleanInclude full ApiVersionSet resource in response. Default value is None.
includeNotTaggedApisbooleanInclude not tagged APIs. Default value is None.
tagsstringInclude tags in the response. Default value is None.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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

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
;