{ "swagger": "2.0", "info": { "title": "ApiManagementClient", "description": "Use these REST APIs for performing operations on entities like API, Product, and Subscription associated with your Azure API Management deployment.", "version": "2018-01-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}/policies": { "get": { "tags": [ "Policy" ], "operationId": "Policy_ListByService", "description": "Lists all the Global Policy definitions of the Api Management service.", "x-ms-examples": { "ApiManagementListPolicies": { "$ref": "./examples/ApiManagementListPolicies.json" } }, "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServiceNameParameter" }, { "name": "scope", "in": "query", "required": false, "type": "string", "description": "Policy scope.", "enum": [ "Tenant", "Product", "Api", "Operation", "All" ], "x-ms-enum": { "name": "PolicyScopeContract", "modelAsString": false } }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Returns an array of Policy Contracts.", "schema": { "$ref": "#/definitions/PolicyCollection" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}": { "head": { "tags": [ "Policy" ], "operationId": "Policy_GetEntityTag", "description": "Gets the entity state (Etag) version of the Global policy definition in the Api Management service.", "x-ms-examples": { "ApiManagementHeadPolicy": { "$ref": "./examples/ApiManagementHeadPolicy.json" } }, "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/PolicyIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "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": "./apimanagement.json#/definitions/ErrorResponse" } } } }, "get": { "tags": [ "Policy" ], "operationId": "Policy_Get", "description": "Get the Global policy definition of the Api Management service.", "x-ms-examples": { "ApiManagementGetPolicy": { "$ref": "./examples/ApiManagementGetPolicy.json" } }, "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/PolicyIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Returns the Policy Contracts.", "schema": { "$ref": "#/definitions/PolicyContract" }, "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": "#/definitions/ErrorResponse" } } } }, "put": { "tags": [ "Policy" ], "operationId": "Policy_CreateOrUpdate", "description": "Creates or updates the global policy configuration of the Api Management service.", "x-ms-examples": { "ApiManagementCreatePolicy": { "$ref": "./examples/ApiManagementCreatePolicy.json" } }, "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/PolicyIdParameter" }, { "name": "parameters", "in": "body", "schema": { "$ref": "#/definitions/PolicyContract" }, "required": true, "description": "The policy contents to apply." }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Global policy configuration was successfully created.", "schema": { "$ref": "#/definitions/PolicyContract" } }, "200": { "description": "Global policy configuration of the Api Management service was successfully updated.", "schema": { "$ref": "#/definitions/PolicyContract" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "delete": { "tags": [ "Policy" ], "operationId": "Policy_Delete", "description": "Deletes the global policy configuration of the Api Management Service.", "x-ms-examples": { "ApiManagementDeletePolicy": { "$ref": "./examples/ApiManagementDeletePolicy.json" } }, "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/PolicyIdParameter" }, { "$ref": "#/parameters/IfMatchRequiredParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successfully deleted the policy configuration at the Global level." }, "204": { "description": "Successfully deleted the policy configuration at the Global level." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policySnippets": { "get": { "tags": [ "PolicySnippets" ], "operationId": "PolicySnippets_ListByService", "description": "Lists all policy snippets.", "x-ms-examples": { "ApiManagementListPolicySnippets": { "$ref": "./examples/ApiManagementListPolicySnippets.json" } }, "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServiceNameParameter" }, { "name": "scope", "in": "query", "required": false, "type": "string", "description": "Policy scope.", "enum": [ "Tenant", "Product", "Api", "Operation", "All" ], "x-ms-enum": { "name": "PolicyScopeContract", "modelAsString": false } }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Returns an array of Policy Contracts.", "schema": { "$ref": "#/definitions/PolicySnippetsCollection" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions": { "get": { "tags": [ "Regions" ], "operationId": "Regions_ListByService", "description": "Lists all azure regions in which the service exists.", "x-ms-examples": { "ApiManagementListRegions": { "$ref": "./examples/ApiManagementListRegions.json" } }, "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists of Regions in which the service is deployed.", "schema": { "$ref": "#/definitions/RegionListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "ErrorFieldContract": { "properties": { "code": { "type": "string", "description": "Property level error code." }, "message": { "type": "string", "description": "Human-readable representation of property-level error." }, "target": { "type": "string", "description": "Property name." } }, "description": "Error Field contract." }, "ErrorResponse": { "properties": { "error": { "x-ms-client-flatten": true, "$ref": "#/definitions/ErrorResponseBody", "description": "Properties of the Error Response." } }, "description": "Error Response." }, "ErrorResponseBody": { "properties": { "code": { "type": "string", "description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response." }, "message": { "type": "string", "description": "Human-readable representation of the error." }, "details": { "type": "array", "items": { "$ref": "#/definitions/ErrorFieldContract" }, "description": "The list of invalid fields send in request, in case of validation error." } }, "description": "Error Body contract." }, "PolicyCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PolicyContract" }, "description": "Policy Contract value." }, "nextLink": { "type": "string", "description": "Next page link if any." } }, "description": "The response of the list policy operation." }, "PolicyContract": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PolicyContractProperties", "description": "Properties of the Policy." } }, "allOf": [ { "$ref": "#/definitions/Resource" } ], "description": "Policy Contract details." }, "PolicyContractProperties": { "properties": { "policyContent": { "type": "string", "description": "Json escaped Xml Encoded contents of the Policy." }, "contentFormat": { "type": "string", "description": "Format of the policyContent.", "enum": [ "xml", "xml-link", "rawxml", "rawxml-link" ], "x-ms-enum": { "name": "PolicyContentFormat", "modelAsString": true, "values": [ { "value": "xml", "description": "The contents are inline and Content type is an XML document." }, { "value": "xml-link", "description": "The policy XML document is hosted on a http endpoint accessible from the API Management service." }, { "value": "rawxml", "description": "The contents are inline and Content type is a non XML encoded policy document." }, { "value": "rawxml-link", "description": "The policy document is not Xml encoded and is hosted on a http endpoint accessible from the API Management service." } ] }, "default": "xml" } }, "required": [ "policyContent" ], "description": "Policy contract Properties." }, "PolicySnippetsCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PolicySnippetContract" }, "description": "Policy snippet value." } }, "description": "The response of the list policy snippets operation." }, "PolicySnippetContract": { "properties": { "name": { "type": "string", "description": "Snippet name.", "readOnly": true }, "content": { "type": "string", "description": "Snippet content.", "readOnly": true }, "toolTip": { "type": "string", "description": "Snippet toolTip.", "readOnly": true }, "scope": { "type": "integer", "description": "Binary OR value of the Snippet scope.", "readOnly": true } }, "description": "Policy snippet." }, "RegionContract": { "properties": { "name": { "type": "string", "description": "Region name.", "readOnly": true }, "isMasterRegion": { "description": "whether Region is the master region.", "type": "boolean" }, "isDeleted": { "description": "whether Region is deleted.", "type": "boolean" } }, "description": "Region profile." }, "RegionListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/RegionContract" }, "description": "Lists of Regions." }, "count": { "type": "integer", "format": "int64", "description": "Total record count number across all pages." }, "nextLink": { "type": "string", "description": "Next page link if any." } }, "description": "Lists Regions operation response details." }, "Resource": { "description": "The Resource definition.", "x-ms-azure-resource": true, "properties": { "id": { "readOnly": true, "type": "string", "description": "Resource ID." }, "name": { "type": "string", "description": "Resource name.", "readOnly": true }, "type": { "readOnly": true, "type": "string", "description": "Resource type for API Management resource." } } } }, "parameters": { "ApiVersionParameter": { "name": "api-version", "in": "query", "required": true, "type": "string", "description": "Version of the API to be used with the client request." }, "ResourceGroupNameParameter": { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group.", "x-ms-parameter-location": "method" }, "ServiceNameParameter": { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the API Management service.", "minLength": 1, "maxLength": 50, "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$", "x-ms-parameter-location": "method" }, "SkipQueryParameter": { "name": "$skip", "in": "query", "required": false, "type": "integer", "format": "int32", "description": "Number of records to skip.", "minimum": 0, "x-ms-parameter-location": "method" }, "SubscriptionIdParameter": { "name": "subscriptionId", "in": "path", "required": true, "type": "string", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." }, "TopQueryParameter": { "name": "$top", "in": "query", "required": false, "type": "integer", "format": "int32", "description": "Number of records to return.", "minimum": 1, "x-ms-parameter-location": "method" }, "PolicyIdParameter": { "name": "policyId", "in": "path", "required": true, "type": "string", "enum": [ "policy" ], "description": "The identifier of the Policy.", "x-ms-enum": { "modelAsString": true, "name": "PolicyIdName" }, "x-ms-parameter-location": "method" }, "IfMatchRequiredParameter": { "name": "If-Match", "in": "header", "required": true, "description": "ETag 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.", "type": "string", "x-ms-parameter-location": "method" }, "IfMatchOptionalParameter": { "name": "If-Match", "in": "header", "required": false, "description": "ETag of the Entity. Not required when creating an entity, but required when updating an entity.", "type": "string", "x-ms-parameter-location": "method" } } }