Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,43 @@
"pattern": "^[^*#&+:<>?]+$",
"x-ms-parameter-location": "method"
},
"PolicyExportFormat": {
"name": "format",
"in": "query",
"required": false,
"type": "string",
"description": "Policy Export Format.",
"enum": [
"xml",
"xml-link",
"rawxml",
"rawxml-link"
],
"x-ms-enum": {
"name": "PolicyExportFormat",
"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 exported to a storage blob with SAS key valid for 5 minutes."
},
{
"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 is exported to a storage blob with SAS Key valid for 5 minutes."
}
]
},
"default": "xml",
"x-ms-parameter-location": "method"
},
"PolicyIdParameter": {
"name": "policyId",
"in": "path",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,9 @@
{
"$ref": "./apimanagement.json#/parameters/PolicyIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PolicyExportFormat"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
Expand Down Expand Up @@ -1941,6 +1944,9 @@
{
"$ref": "./apimanagement.json#/parameters/PolicyIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PolicyExportFormat"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
"x-ms-examples": {
"ApiManagementGetPolicy": {
"$ref": "./examples/ApiManagementGetPolicy.json"
},
"ApiManagementGetPolicyFormat": {
"$ref": "./examples/ApiManagementGetPolicyFormat.json"
}
},
"parameters": [
Expand All @@ -144,6 +147,9 @@
{
"$ref": "./apimanagement.json#/parameters/PolicyIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PolicyExportFormat"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,9 @@
{
"$ref": "./apimanagement.json#/parameters/PolicyIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PolicyExportFormat"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,29 @@
"resourceGroupName": "rg1",
"api-version": "2019-01-01",
"subscriptionId": "subid",
"apiId": "echo-api;rev=2",
"apiId": "echo-api;rev=3",
"parameters": {
"properties": {
"displayName": "httpbin",
"description": "Existing Http Bin Api",
"serviceUrl": "http://httpbin.org",
"path": "bin",
"protocols": [
"http",
"https"
],
"sourceApiId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59793a3c4679c754636c520e",
"apiRevisionDescription": "Creating a Revision of an existing API",
"isCurrent": false
"path": "echo",
"serviceUrl": "http://echoapi.cloudapp.net/apiv3",
"sourceApiId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api",
"apiRevisionDescription": "Creating a Revision of an existing API"
}
}
},
"responses": {
"201": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59793a3c4679c754636c520e;rev=2",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api;rev=3",
"type": "Microsoft.ApiManagement/service/apis",
"name": "59793a3c4679c754636c520e;rev=2",
"name": "echo-api;rev=3",
"properties": {
"displayName": "httpbin",
"apiRevision": "2",
"description": "",
"serviceUrl": "http://httpbin.org",
"path": "bin",
"displayName": "Echo API",
"apiRevision": "3",
"subscriptionRequired": true,
"serviceUrl": "http://echoapi.cloudapp.net/apiv3",
"path": "echo",
"protocols": [
"http",
"https"
],
"subscriptionKeyParameterNames": {
Expand All @@ -52,17 +44,16 @@
},
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59793a3c4679c754636c520e;rev=2",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api;rev=3",
"type": "Microsoft.ApiManagement/service/apis",
"name": "59793a3c4679c754636c520e;rev=2",
"name": "echo-api;rev=3",
"properties": {
"displayName": "httpbin",
"apiRevision": "2",
"description": "",
"serviceUrl": "http://httpbin.org",
"path": "bin",
"displayName": "Echo API",
"apiRevision": "3",
"subscriptionRequired": true,
"serviceUrl": "http://echoapi.cloudapp.net/apiv3",
"path": "echo",
"protocols": [
"http",
"https"
],
"subscriptionKeyParameterNames": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"parameters": {
"serviceName": "apimService1",
"resourceGroupName": "rg1",
"api-version": "2019-01-01",
"subscriptionId": "subid",
"policyId": "policy"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"type": "Microsoft.ApiManagement/service/policies",
"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>"
}
}
"parameters": {
"serviceName": "apimService1",
"resourceGroupName": "rg1",
"api-version": "2019-01-01",
"subscriptionId": "subid",
"policyId": "policy"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"type": "Microsoft.ApiManagement/service/policies",
"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>"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parameters": {
"serviceName": "apimService1",
"resourceGroupName": "rg1",
"api-version": "2019-01-01",
"subscriptionId": "subid",
"policyId": "policy",
"format": "rawxml"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
"type": "Microsoft.ApiManagement/service/policies",
"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>"
}
}
}
}
}