Skip to main content

apis

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

Overview

Nameapis
TypeResource
Idazure.api_management.apis

Fields

The following fields are returned by SELECT queries:

The response body contains the specified API entity.

NameDatatypeDescription
propertiesobjectAPI entity contract properties.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, serviceName, apiId, subscriptionIdGets the details of the API specified by its identifier.
list_by_tagsselectresourceGroupName, serviceName, subscriptionId$filter, $top, $skip, includeNotTaggedApisLists a collection of apis associated with tags.
list_by_serviceselectresourceGroupName, serviceName, subscriptionId$filter, $top, $skip, tags, expandApiVersionSetLists all APIs of the API Management service instance.
create_or_updateinsertresourceGroupName, serviceName, apiId, subscriptionIdIf-MatchCreates new or updates existing specified API of the API Management service instance.
updateupdateresourceGroupName, serviceName, apiId, If-Match, subscriptionIdUpdates the specified API of the API Management service instance.
deletedeleteresourceGroupName, serviceName, apiId, If-Match, subscriptionIddeleteRevisionsDeletes the specified API of the API Management service instance.

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.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
serviceNamestringThe name of the API Management service.
subscriptionIdstringThe ID of the target subscription.
$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>| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</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.
deleteRevisionsbooleanDelete all revisions of the Api.
expandApiVersionSetbooleanInclude full ApiVersionSet resource in response
includeNotTaggedApisbooleanInclude not tagged APIs.
tagsstringInclude tags in the response.

SELECT examples

Gets the details of the API specified by its identifier.

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

INSERT examples

Creates new or updates existing specified API of the API Management service instance.

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

UPDATE examples

Updates the specified API of the API Management service instance.

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

DELETE examples

Deletes the specified API of the API Management service instance.

DELETE FROM azure.api_management.apis
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND apiId = '{{ apiId }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND deleteRevisions = '{{ deleteRevisions }}'
;