{ "swagger": "2.0", "info": { "title": "ApiManagementClient", "description": "REST API for performing operations on policy fragments in an Azure API Management deployment.", "version": "2024-05-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments": { "get": { "tags": [ "PolicyFragment" ], "operationId": "PolicyFragment_ListByService", "description": "Gets all policy fragments.", "x-ms-examples": { "ApiManagementListPolicyFragments": { "$ref": "./examples/ApiManagementListPolicyFragments.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
" }, { "name": "$orderby", "in": "query", "required": false, "type": "string", "description": "OData order by query option." }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" } ], "responses": { "200": { "description": "Successfully returned an array of policy fragments.", "schema": { "$ref": "./definitions.json#/definitions/PolicyFragmentCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}": { "head": { "tags": [ "PolicyFragment" ], "operationId": "PolicyFragment_GetEntityTag", "description": "Gets the entity state (Etag) version of a policy fragment.", "x-ms-examples": { "ApiManagementHeadPolicyFragment": { "$ref": "./examples/ApiManagementHeadPolicyFragment.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "./apimanagement.json#/parameters/IdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The specified policy fragment exists and the current entity state version is present in the ETag header.", "headers": { "ETag": { "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } } }, "get": { "tags": [ "PolicyFragment" ], "operationId": "PolicyFragment_Get", "description": "Gets a policy fragment.", "x-ms-examples": { "ApiManagementGetPolicyFragment": { "$ref": "./examples/ApiManagementGetPolicyFragment.json" }, "ApiManagementGetPolicyFragmentFormat": { "$ref": "./examples/ApiManagementGetPolicyFragmentFormat.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "./apimanagement.json#/parameters/IdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "./apimanagement.json#/parameters/PolicyFragmentContentFormat" } ], "responses": { "200": { "description": "Successfully returned a policy fragment.", "schema": { "$ref": "./definitions.json#/definitions/PolicyFragmentContract" }, "headers": { "ETag": { "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } } }, "put": { "tags": [ "PolicyFragment" ], "operationId": "PolicyFragment_CreateOrUpdate", "description": "Creates or updates a policy fragment.", "x-ms-examples": { "ApiManagementCreatePolicy": { "$ref": "./examples/ApiManagementCreatePolicyFragment.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "./apimanagement.json#/parameters/IdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./definitions.json#/definitions/PolicyFragmentContract" }, "description": "The policy fragment contents to apply." }, { "$ref": "./apimanagement.json#/parameters/IfMatchOptionalParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The policy fragment was successfully updated.", "schema": { "$ref": "./definitions.json#/definitions/PolicyFragmentContract" }, "headers": { "ETag": { "description": "Current entity state version", "type": "string" }, "location": { "description": "Location header contains the URL where the status of the long running operation can be checked", "type": "string" }, "Azure-AsyncOperation": { "description": "Azure-AsyncOperation header contains the URL where the status of the long running operation can be checked", "type": "string" } } }, "201": { "description": "The policy fragment was successfully created.", "schema": { "$ref": "./definitions.json#/definitions/PolicyFragmentContract" }, "headers": { "ETag": { "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", "type": "string" }, "location": { "description": "Location header contains the URL where the status of the long running operation can be checked", "type": "string" }, "Azure-AsyncOperation": { "description": "Azure-AsyncOperation header contains the URL where the status of the long running operation can be checked", "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "delete": { "tags": [ "PolicyFragment" ], "operationId": "PolicyFragment_Delete", "description": "Deletes a policy fragment.", "x-ms-examples": { "ApiManagementDeletePolicy": { "$ref": "./examples/ApiManagementDeletePolicyFragment.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "./apimanagement.json#/parameters/IdParameter" }, { "$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The policy fragment was successfully removed." }, "204": { "description": "The policy fragment successfully removed by previous request or does not exist." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}/listReferences": { "post": { "tags": [ "PolicyFragment" ], "operationId": "PolicyFragment_ListReferences", "description": "Lists policy resources that reference the policy fragment.", "x-ms-examples": { "ApiManagementListPolicyFragmentReferences": { "$ref": "./examples/ApiManagementListPolicyFragmentReferences.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "./apimanagement.json#/parameters/IdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" } ], "responses": { "200": { "description": "Successfully returned an array of references to policy resources that include the policy fragment in their definitions.", "schema": { "$ref": "./definitions.json#/definitions/ResourceCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } } } } }, "definitions": {}, "parameters": {} }