product_api
Creates, updates, deletes, gets or lists a product_api resource.
Overview
| Name | product_api |
| Type | Resource |
| Id | azure.api_management.product_api |
Fields
The following fields are returned by SELECT queries:
- list_by_product
| 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 |
|---|---|---|---|---|
list_by_product | select | resource_group_name, service_name, product_id, subscription_id | $filter, $top, $skip | Lists a collection of the APIs associated with a product. |
create_or_update | insert | resource_group_name, service_name, product_id, api_id, subscription_id | Adds an API to the specified product. | |
create_or_update | replace | resource_group_name, service_name, product_id, api_id, subscription_id | Adds an API to the specified product. | |
delete | delete | resource_group_name, service_name, product_id, api_id, subscription_id | Deletes the specified API from the specified product. | |
check_entity_exists | exec | resource_group_name, service_name, product_id, api_id, subscription_id | Checks 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.
| 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. |
product_id | string | Product identifier. 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 || 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. |
$skip | integer | Number of records to skip. Default value is None. |
$top | integer | Number of records to return. Default value is None. |
SELECT examples
- list_by_product
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
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: product_api
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the product_api resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the product_api resource.
- name: product_id
value: "{{ product_id }}"
description: Required parameter for the product_api resource.
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the product_api resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the product_api resource.
REPLACE examples
- create_or_update
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
- delete
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
- check_entity_exists
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
;