ApiManagementClient
Use these REST APIs for performing operations on Global Policies in Azure API Management deployment
COMMUNITYBEARER0 INSTALLS
OpenAPI Specificationv3.0
{
"swagger": "2.0",
"schemes": [
"https"
],
"host": "management.azure.com",
"info": {
"description": "Use these REST APIs for performing operations on Global Policies in Azure API Management deployment.",
"title": "ApiManagementClient",
"version": "2019-01-01",
"x-apisguru-categories": [
"cloud"
],
"x-logo": {
"url": "https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png"
},
"x-origin": [
{
"format": "swagger",
"url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2019-01-01/apimpolicies.json",
"version": "2.0"
}
],
"x-preferred": true,
"x-providerName": "azure.com",
"x-serviceName": "apimanagement-apimpolicies",
"x-tags": [
"Azure",
"Microsoft"
]
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"securityDefinitions": {
"azure_auth": {
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"description": "Azure Active Directory OAuth2 Flow.",
"flow": "implicit",
"scopes": {
"user_impersonation": "impersonate your user account"
},
"type": "oauth2"
}
},
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"parameters": {},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies": {
"get": {
"description": "Lists all the Global Policy definitions of the Api Management service.",
"operationId": "Policy_ListByService",
"parameters": [
{
"description": "The name of the resource group.",
"in": "path",
"name": "resourceGroupName",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The name of the API Management service.",
"in": "path",
"maxLength": 50,
"minLength": 1,
"name": "serviceName",
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "Version of the API to be used with the client request.",
"in": "query",
"name": "api-version",
"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.",
"in": "path",
"name": "subscriptionId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Returns an array of Policy Contracts.",
"schema": {
"description": "The response of the list policy operation.",
"properties": {
"nextLink": {
"description": "Next page link if any.",
"type": "string"
},
"value": {
"description": "Policy Contract value.",
"items": {
"allOf": [
{
"description": "The Resource definition.",
"properties": {
"id": {
"description": "Resource ID.",
"readOnly": true,
"type": "string"
},
"name": {
"description": "Resource name.",
"readOnly": true,
"type": "string"
},
"type": {
"description": "Resource type for API Management resource.",
"readOnly": true,
"type": "string"
}
},
"x-ms-azure-resource": true
}
],
"description": "Policy Contract details.",
"properties": {
"properties": {
"description": "Policy contract Properties.",
"properties": {
"format": {
"default": "xml",
"description": "Format of the policyContent.",
"enum": [
"xml",
"xml-link",
"rawxml",
"rawxml-link"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyContentFormat",
"values": [
{
"description": "The contents are inline and Content type is an XML document.",
"value": "xml"
},
{
"description": "The policy XML document is hosted on a http endpoint accessible from the API Management service.",
"value": "xml-link"
},
{
"description": "The contents are inline and Content type is a non XML encoded policy document.",
"value": "rawxml"
},
{
"description": "The policy document is not Xml encoded and is hosted on a http endpoint accessible from the API Management service.",
"value": "rawxml-link"
}
]
}
},
"value": {
"description": "Contents of the Policy as defined by the format.",
"type": "string"
}
},
"required": [
"value"
]
}
}
},
"type": "array"
}
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"description": "Error Response.",
"properties": {
"error": {
"description": "Error Body contract.",
"properties": {
"code": {
"description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.",
"type": "string"
},
"details": {
"description": "The list of invalid fields send in request, in case of validation error.",
"items": {
"description": "Error Field contract.",
"properties": {
"code": {
"description": "Property level error code.",
"type": "string"
},
"message": {
"description": "Human-readable representation of property-level error.",
"type": "string"
},
"target": {
"description": "Property name.",
"type": "string"
}
}
},
"type": "array"
},
"message": {
"description": "Human-readable representation of the error.",
"type": "string"
}
}
}
}
}
}
},
"tags": [
"Policy"
],
"x-ms-examples": {
"ApiManagementListPolicies": {
"parameters": {
"api-version": "2019-01-01",
"resourceGroupName": "rg1",
"serviceName": "apimService1",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"nextLink": "",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"name": "policy",
"properties": {
"value": "<!--\r\n IMPORTANT:\r\n - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n - Only the <forward-request> policy element can appear within the <backend> section element.\r\n - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n - To remove a policy, delete the corresponding policy statement from the policy document.\r\n - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n <inbound />\r\n <backend>\r\n <forward-request />\r\n </backend>\r\n <outbound />\r\n</policies>"
},
"type": "Microsoft.ApiManagement/service/policies"
}
]
}
}
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}": {
"delete": {
"description": "Deletes the global policy configuration of the Api Management Service.",
"operationId": "Policy_Delete",
"parameters": [
{
"description": "The name of the resource group.",
"in": "path",
"name": "resourceGroupName",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The name of the API Management service.",
"in": "path",
"maxLength": 50,
"minLength": 1,
"name": "serviceName",
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The identifier of the Policy.",
"enum": [
"policy"
],
"in": "path",
"name": "policyId",
"required": true,
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyIdName"
},
"x-ms-parameter-location": "method"
},
{
"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.",
"in": "header",
"name": "If-Match",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "Version of the API to be used with the client request.",
"in": "query",
"name": "api-version",
"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.",
"in": "path",
"name": "subscriptionId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Policy was successfully removed"
},
"204": {
"description": "Policy successfully removed by previous request or does not exist"
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"description": "Error Response.",
"properties": {
"error": {
"description": "Error Body contract.",
"properties": {
"code": {
"description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.",
"type": "string"
},
"details": {
"description": "The list of invalid fields send in request, in case of validation error.",
"items": {
"description": "Error Field contract.",
"properties": {
"code": {
"description": "Property level error code.",
"type": "string"
},
"message": {
"description": "Human-readable representation of property-level error.",
"type": "string"
},
"target": {
"description": "Property name.",
"type": "string"
}
}
},
"type": "array"
},
"message": {
"description": "Human-readable representation of the error.",
"type": "string"
}
}
}
}
}
}
},
"tags": [
"Policy"
],
"x-ms-examples": {
"ApiManagementDeletePolicy": {
"parameters": {
"If-Match": "*",
"api-version": "2019-01-01",
"policyId": "policy",
"resourceGroupName": "rg1",
"serviceName": "apimService1",
"subscriptionId": "subid"
},
"responses": {
"200": {},
"204": {}
}
}
}
},
"get": {
"description": "Get the Global policy definition of the Api Management service.",
"operationId": "Policy_Get",
"parameters": [
{
"description": "The name of the resource group.",
"in": "path",
"name": "resourceGroupName",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The name of the API Management service.",
"in": "path",
"maxLength": 50,
"minLength": 1,
"name": "serviceName",
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The identifier of the Policy.",
"enum": [
"policy"
],
"in": "path",
"name": "policyId",
"required": true,
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyIdName"
},
"x-ms-parameter-location": "method"
},
{
"default": "xml",
"description": "Policy Export Format.",
"enum": [
"xml",
"rawxml"
],
"in": "query",
"name": "format",
"required": false,
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyExportFormat",
"values": [
{
"description": "The contents are inline and Content type is an XML document.",
"value": "xml"
},
{
"description": "The contents are inline and Content type is a non XML encoded policy document.",
"value": "rawxml"
}
]
},
"x-ms-parameter-location": "method"
},
{
"description": "Version of the API to be used with the client request.",
"in": "query",
"name": "api-version",
"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.",
"in": "path",
"name": "subscriptionId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get the Global policy definition of the Api Management service.",
"headers": {
"ETag": {
"description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
"type": "string"
}
},
"schema": {
"allOf": [
{
"description": "The Resource definition.",
"properties": {
"id": {
"description": "Resource ID.",
"readOnly": true,
"type": "string"
},
"name": {
"description": "Resource name.",
"readOnly": true,
"type": "string"
},
"type": {
"description": "Resource type for API Management resource.",
"readOnly": true,
"type": "string"
}
},
"x-ms-azure-resource": true
}
],
"description": "Policy Contract details.",
"properties": {
"properties": {
"description": "Policy contract Properties.",
"properties": {
"format": {
"default": "xml",
"description": "Format of the policyContent.",
"enum": [
"xml",
"xml-link",
"rawxml",
"rawxml-link"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyContentFormat",
"values": [
{
"description": "The contents are inline and Content type is an XML document.",
"value": "xml"
},
{
"description": "The policy XML document is hosted on a http endpoint accessible from the API Management service.",
"value": "xml-link"
},
{
"description": "The contents are inline and Content type is a non XML encoded policy document.",
"value": "rawxml"
},
{
"description": "The policy document is not Xml encoded and is hosted on a http endpoint accessible from the API Management service.",
"value": "rawxml-link"
}
]
}
},
"value": {
"description": "Contents of the Policy as defined by the format.",
"type": "string"
}
},
"required": [
"value"
]
}
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"description": "Error Response.",
"properties": {
"error": {
"description": "Error Body contract.",
"properties": {
"code": {
"description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.",
"type": "string"
},
"details": {
"description": "The list of invalid fields send in request, in case of validation error.",
"items": {
"description": "Error Field contract.",
"properties": {
"code": {
"description": "Property level error code.",
"type": "string"
},
"message": {
"description": "Human-readable representation of property-level error.",
"type": "string"
},
"target": {
"description": "Property name.",
"type": "string"
}
}
},
"type": "array"
},
"message": {
"description": "Human-readable representation of the error.",
"type": "string"
}
}
}
}
}
}
},
"tags": [
"Policy"
],
"x-ms-examples": {
"ApiManagementGetPolicy": {
"parameters": {
"api-version": "2019-01-01",
"policyId": "policy",
"resourceGroupName": "rg1",
"serviceName": "apimService1",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"name": "policy",
"properties": {
"value": "<!--\r\n IMPORTANT:\r\n - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n - Only the <forward-request> policy element can appear within the <backend> section element.\r\n - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n - To remove a policy, delete the corresponding policy statement from the policy document.\r\n - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n <inbound />\r\n <backend>\r\n <forward-request />\r\n </backend>\r\n <outbound />\r\n</policies>"
},
"type": "Microsoft.ApiManagement/service/policies"
}
}
}
},
"ApiManagementGetPolicyFormat": {
"parameters": {
"api-version": "2019-01-01",
"format": "rawxml",
"policyId": "policy",
"resourceGroupName": "rg1",
"serviceName": "apimService1",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"name": "policy",
"properties": {
"format": "rawxml",
"value": "<!--\n IMPORTANT:\n - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\n - Only the <forward-request> policy element can appear within the <backend> section element.\n - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\n - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\n - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\n - To remove a policy, delete the corresponding policy statement from the policy document.\n - Policies are applied in the order of their appearance, from the top down.\n-->\r\n<policies>\r\n\t<inbound>\r\n\t\t<set-header name=\"correlationid\" exists-action=\"skip\">\r\n\t\t\t<value>@{\n var guidBinary = new byte[16];\n Array.Copy(Guid.NewGuid().ToByteArray(), 0, guidBinary, 0, 10);\n long time = DateTime.Now.Ticks;\n byte[] bytes = new byte[6];\n unchecked\n {\n bytes[5] = (byte)(time >> 40);\n bytes[4] = (byte)(time >> 32);\n bytes[3] = (byte)(time >> 24);\n bytes[2] = (byte)(time >> 16);\n bytes[1] = (byte)(time >> 8);\n bytes[0] = (byte)(time);\n }\n Array.Copy(bytes, 0, guidBinary, 10, 6);\n return new Guid(guidBinary).ToString();\n }\n </value>\r\n\t\t</set-header>\r\n\t</inbound>\r\n\t<backend>\r\n\t\t<forward-request />\r\n\t</backend>\r\n\t<outbound />\r\n\t<on-error />\r\n</policies>"
},
"type": "Microsoft.ApiManagement/service/policies"
}
}
}
}
}
},
"head": {
"description": "Gets the entity state (Etag) version of the Global policy definition in the Api Management service.",
"operationId": "Policy_GetEntityTag",
"parameters": [
{
"description": "The name of the resource group.",
"in": "path",
"name": "resourceGroupName",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The name of the API Management service.",
"in": "path",
"maxLength": 50,
"minLength": 1,
"name": "serviceName",
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The identifier of the Policy.",
"enum": [
"policy"
],
"in": "path",
"name": "policyId",
"required": true,
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyIdName"
},
"x-ms-parameter-location": "method"
},
{
"description": "Version of the API to be used with the client request.",
"in": "query",
"name": "api-version",
"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.",
"in": "path",
"name": "subscriptionId",
"required": true,
"type": "string"
}
],
"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": {
"description": "Error Response.",
"properties": {
"error": {
"description": "Error Body contract.",
"properties": {
"code": {
"description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.",
"type": "string"
},
"details": {
"description": "The list of invalid fields send in request, in case of validation error.",
"items": {
"description": "Error Field contract.",
"properties": {
"code": {
"description": "Property level error code.",
"type": "string"
},
"message": {
"description": "Human-readable representation of property-level error.",
"type": "string"
},
"target": {
"description": "Property name.",
"type": "string"
}
}
},
"type": "array"
},
"message": {
"description": "Human-readable representation of the error.",
"type": "string"
}
}
}
}
}
}
},
"tags": [
"Policy"
],
"x-ms-examples": {
"ApiManagementHeadPolicy": {
"parameters": {
"api-version": "2019-01-01",
"policyId": "policy",
"resourceGroupName": "rg1",
"serviceName": "apimService1",
"subscriptionId": "subid"
},
"responses": {
"200": {
"headers": {
"etag": "AAAAAAAAAAa="
}
}
}
}
}
},
"put": {
"description": "Creates or updates the global policy configuration of the Api Management service.",
"operationId": "Policy_CreateOrUpdate",
"parameters": [
{
"description": "The name of the resource group.",
"in": "path",
"name": "resourceGroupName",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The name of the API Management service.",
"in": "path",
"maxLength": 50,
"minLength": 1,
"name": "serviceName",
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "The identifier of the Policy.",
"enum": [
"policy"
],
"in": "path",
"name": "policyId",
"required": true,
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyIdName"
},
"x-ms-parameter-location": "method"
},
{
"description": "The policy contents to apply.",
"in": "body",
"name": "parameters",
"required": true,
"schema": {
"allOf": [
{
"description": "The Resource definition.",
"properties": {
"id": {
"description": "Resource ID.",
"readOnly": true,
"type": "string"
},
"name": {
"description": "Resource name.",
"readOnly": true,
"type": "string"
},
"type": {
"description": "Resource type for API Management resource.",
"readOnly": true,
"type": "string"
}
},
"x-ms-azure-resource": true
}
],
"description": "Policy Contract details.",
"properties": {
"properties": {
"description": "Policy contract Properties.",
"properties": {
"format": {
"default": "xml",
"description": "Format of the policyContent.",
"enum": [
"xml",
"xml-link",
"rawxml",
"rawxml-link"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyContentFormat",
"values": [
{
"description": "The contents are inline and Content type is an XML document.",
"value": "xml"
},
{
"description": "The policy XML document is hosted on a http endpoint accessible from the API Management service.",
"value": "xml-link"
},
{
"description": "The contents are inline and Content type is a non XML encoded policy document.",
"value": "rawxml"
},
{
"description": "The policy document is not Xml encoded and is hosted on a http endpoint accessible from the API Management service.",
"value": "rawxml-link"
}
]
}
},
"value": {
"description": "Contents of the Policy as defined by the format.",
"type": "string"
}
},
"required": [
"value"
]
}
}
}
},
{
"description": "ETag of the Entity. Not required when creating an entity, but required when updating an entity.",
"in": "header",
"name": "If-Match",
"required": false,
"type": "string",
"x-ms-parameter-location": "method"
},
{
"description": "Version of the API to be used with the client request.",
"in": "query",
"name": "api-version",
"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.",
"in": "path",
"name": "subscriptionId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Global policy configuration of the Api Management service was successfully updated.",
"headers": {
"ETag": {
"description": "Current entity state version",
"type": "string"
}
},
"schema": {
"allOf": [
{
"description": "The Resource definition.",
"properties": {
"id": {
"description": "Resource ID.",
"readOnly": true,
"type": "string"
},
"name": {
"description": "Resource name.",
"readOnly": true,
"type": "string"
},
"type": {
"description": "Resource type for API Management resource.",
"readOnly": true,
"type": "string"
}
},
"x-ms-azure-resource": true
}
],
"description": "Policy Contract details.",
"properties": {
"properties": {
"description": "Policy contract Properties.",
"properties": {
"format": {
"default": "xml",
"description": "Format of the policyContent.",
"enum": [
"xml",
"xml-link",
"rawxml",
"rawxml-link"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyContentFormat",
"values": [
{
"description": "The contents are inline and Content type is an XML document.",
"value": "xml"
},
{
"description": "The policy XML document is hosted on a http endpoint accessible from the API Management service.",
"value": "xml-link"
},
{
"description": "The contents are inline and Content type is a non XML encoded policy document.",
"value": "rawxml"
},
{
"description": "The policy document is not Xml encoded and is hosted on a http endpoint accessible from the API Management service.",
"value": "rawxml-link"
}
]
}
},
"value": {
"description": "Contents of the Policy as defined by the format.",
"type": "string"
}
},
"required": [
"value"
]
}
}
}
},
"201": {
"description": "Global policy configuration was successfully created.",
"headers": {
"ETag": {
"description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
"type": "string"
}
},
"schema": {
"allOf": [
{
"description": "The Resource definition.",
"properties": {
"id": {
"description": "Resource ID.",
"readOnly": true,
"type": "string"
},
"name": {
"description": "Resource name.",
"readOnly": true,
"type": "string"
},
"type": {
"description": "Resource type for API Management resource.",
"readOnly": true,
"type": "string"
}
},
"x-ms-azure-resource": true
}
],
"description": "Policy Contract details.",
"properties": {
"properties": {
"description": "Policy contract Properties.",
"properties": {
"format": {
"default": "xml",
"description": "Format of the policyContent.",
"enum": [
"xml",
"xml-link",
"rawxml",
"rawxml-link"
],
"type": "string",
"x-ms-enum": {
"modelAsString": true,
"name": "PolicyContentFormat",
"values": [
{
"description": "The contents are inline and Content type is an XML document.",
"value": "xml"
},
{
"description": "The policy XML document is hosted on a http endpoint accessible from the API Management service.",
"value": "xml-link"
},
{
"description": "The contents are inline and Content type is a non XML encoded policy document.",
"value": "rawxml"
},
{
"description": "The policy document is not Xml encoded and is hosted on a http endpoint accessible from the API Management service.",
"value": "rawxml-link"
}
]
}
},
"value": {
"description": "Contents of the Policy as defined by the format.",
"type": "string"
}
},
"required": [
"value"
]
}
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"description": "Error Response.",
"properties": {
"error": {
"description": "Error Body contract.",
"properties": {
"code": {
"description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.",
"type": "string"
},
"details": {
"description": "The list of invalid fields send in request, in case of validation error.",
"items": {
"description": "Error Field contract.",
"properties": {
"code": {
"description": "Property level error code.",
"type": "string"
},
"message": {
"description": "Human-readable representation of property-level error.",
"type": "string"
},
"target": {
"description": "Property name.",
"type": "string"
}
}
},
"type": "array"
},
"message": {
"description": "Human-readable representation of the error.",
"type": "string"
}
}
}
}
}
}
},
"tags": [
"Policy"
],
"x-ms-examples": {
"ApiManagementCreatePolicy": {
"parameters": {
"api-version": "2019-01-01",
"parameters": {
"properties": {
"format": "xml",
"value": "<policies>\r\n <inbound />\r\n <backend>\r\n <forward-request />\r\n </backend>\r\n <outbound />\r\n</policies>"
}
},
"policyId": "policy",
"resourceGroupName": "rg1",
"serviceName": "apimService1",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"name": "policy",
"properties": {
"value": "<policies>\r\n <inbound />\r\n <backend>\r\n <forward-request />\r\n </backend>\r\n <outbound />\r\n</policies>"
},
"type": "Microsoft.ApiManagement/service/policies"
}
},
"201": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"name": "policy",
"properties": {
"value": "<policies>\r\n <inbound />\r\n <backend>\r\n <forward-request />\r\n </backend>\r\n <outbound />\r\n</policies>"
},
"type": "Microsoft.ApiManagement/service/policies"
}
}
}
}
}
}
}
},
"definitions": {}
}