Skip to main content

api_schema

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

Overview

Nameapi_schema
TypeResource
Idazure.api_management.api_schema

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.
contentTypestringMust be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). - Swagger Schema use application/vnd.ms-azure-apim.swagger.definitions+json - WSDL Schema use application/vnd.ms-azure-apim.xsd+xml - OpenApi Schema use application/vnd.oai.openapi.components+json - WADL Schema use application/vnd.ms-azure-apim.wadl.grammars+xml - OData Schema use application/vnd.ms-azure-apim.odata.schema - gRPC Schema use text/protobuf. Required.
documentobjectCreate or update Properties of the API Schema Document. Required.
provisioningStatestringThe provisioning state.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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, schema_id, subscription_idGet the schema configuration at the API level.
list_by_apiselectresource_group_name, service_name, api_id, subscription_id$filter, $top, $skipGet the schema configuration at the API level.
create_or_updateinsertresource_group_name, service_name, api_id, schema_id, subscription_idCreates or updates schema configuration for the API.
create_or_updatereplaceresource_group_name, service_name, api_id, schema_id, subscription_idCreates or updates schema configuration for the API.
deletedeleteresource_group_name, service_name, api_id, schema_id, subscription_idforceDeletes the schema configuration at the Api.
get_entity_tagexecresource_group_name, service_name, api_id, schema_id, subscription_idGets the entity state (Etag) version of the schema specified by its identifier.

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.
schema_idstringSchema id identifier. Must be unique in the current API Management service instance. Required.
service_namestringThe name of the API Management service. Required.
subscription_idstring
$filterstring| Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| contentType | 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.
forcebooleanIf true removes all references to the schema before deleting it. Default value is None.

SELECT examples

Get the schema configuration at the API level.

SELECT
id,
name,
contentType,
document,
provisioningState,
systemData,
type
FROM azure.api_management.api_schema
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND api_id = '{{ api_id }}' -- required
AND schema_id = '{{ schema_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates schema configuration for the API.

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

REPLACE examples

Creates or updates schema configuration for the API.

REPLACE azure.api_management.api_schema
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND schema_id = '{{ schema_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Deletes the schema configuration at the Api.

DELETE FROM azure.api_management.api_schema
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND schema_id = '{{ schema_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND force = '{{ force }}'
;

Lifecycle Methods

Gets the entity state (Etag) version of the schema specified by its identifier.

EXEC azure.api_management.api_schema.get_entity_tag 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@api_id='{{ api_id }}' --required,
@schema_id='{{ schema_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;