Skip to main content

product_api

Creates, updates, deletes, gets or lists a product_api resource.

Overview

Nameproduct_api
TypeResource
Idazure.api_management.product_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
list_by_productselectresource_group_name, service_name, product_id, subscription_id$filter, $top, $skipLists a collection of the APIs associated with a product.
create_or_updateinsertresource_group_name, service_name, product_id, api_id, subscription_idAdds an API to the specified product.
create_or_updatereplaceresource_group_name, service_name, product_id, api_id, subscription_idAdds an API to the specified product.
deletedeleteresource_group_name, service_name, product_id, api_id, subscription_idDeletes the specified API from the specified product.
check_entity_existsexecresource_group_name, service_name, product_id, api_id, subscription_idChecks that API entity specified by identifier is associated with the Product entity.

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.
product_idstringProduct identifier. 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 || description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || path | 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.

SELECT examples

Lists a collection of the APIs associated with a product.

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.product_api
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND product_id = '{{ product_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
;

INSERT examples

Adds an API to the specified product.

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

REPLACE examples

Adds an API to the specified product.

REPLACE azure.api_management.product_api
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND product_id = '{{ product_id }}' --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 from the specified product.

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

Lifecycle Methods

Checks that API entity specified by identifier is associated with the Product entity.

EXEC azure.api_management.product_api.check_entity_exists 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@product_id='{{ product_id }}' --required,
@api_id='{{ api_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;