Skip to content

Commit f8e922c

Browse files
author
Milan Zolota
committed
Policy Fragment REST API documentation
1 parent df36b4f commit f8e922c

File tree

8 files changed

+581
-0
lines changed

8 files changed

+581
-0
lines changed

specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimanagement.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,48 @@
548548
"default": "xml",
549549
"x-ms-parameter-location": "method"
550550
},
551+
"PolicyFragmentExportFormat": {
552+
"name": "format",
553+
"in": "query",
554+
"required": false,
555+
"type": "string",
556+
"description": "Policy Fragment Export Format.",
557+
"enum": [
558+
"xml",
559+
"rawxml"
560+
],
561+
"x-ms-enum": {
562+
"name": "PolicyFragmentExportFormat",
563+
"modelAsString": true,
564+
"values": [
565+
{
566+
"value": "xml",
567+
"description": "The contents are inline and Content type is an XML document."
568+
},
569+
{
570+
"value": "rawxml",
571+
"description": "The contents are inline and Content type is a non XML encoded policy fragment document."
572+
}
573+
]
574+
},
575+
"default": "xml",
576+
"x-ms-parameter-location": "method"
577+
},
578+
"PolicyFragmentIdParameter": {
579+
"name": "policyFragmentId",
580+
"in": "path",
581+
"required": true,
582+
"type": "string",
583+
"enum": [
584+
"policyFragment"
585+
],
586+
"description": "The identifier of the Policy Fragment.",
587+
"x-ms-enum": {
588+
"modelAsString": true,
589+
"name": "PolicyFragmentIdName"
590+
},
591+
"x-ms-parameter-location": "method"
592+
},
551593
"PolicyIdParameter": {
552594
"name": "policyId",
553595
"in": "path",
Lines changed: 346 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,346 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "ApiManagementClient",
5+
"description": "Use this REST API for performing operations on policy fragments in Azure API Management deployment.",
6+
"version": "2021-04-01-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow.",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments": {
38+
"get": {
39+
"tags": [
40+
"PolicyFragment"
41+
],
42+
"operationId": "PolicyFragment_ListByService",
43+
"description": "Lists all the policy fragment definitions of the Api Management service.",
44+
"x-ms-examples": {
45+
"ApiManagementListPolicyFragments": {
46+
"$ref": "./examples/ApiManagementListPolicyFragments.json"
47+
}
48+
},
49+
"parameters": [
50+
{
51+
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
52+
},
53+
{
54+
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
55+
},
56+
{
57+
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
58+
},
59+
{
60+
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
61+
}
62+
],
63+
"responses": {
64+
"200": {
65+
"description": "Returns an array of Policy Fragments.",
66+
"schema": {
67+
"$ref": "./definitions.json#/definitions/PolicyFragmentCollection"
68+
}
69+
},
70+
"default": {
71+
"description": "Error response describing why the operation failed.",
72+
"schema": {
73+
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
74+
}
75+
}
76+
}
77+
}
78+
},
79+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{policyFragmentId}": {
80+
"head": {
81+
"tags": [
82+
"PolicyFragment"
83+
],
84+
"operationId": "PolicyFragment_GetEntityTag",
85+
"description": "Gets the entity state (Etag) version of the policy fragment definition in the Api Management service.",
86+
"x-ms-examples": {
87+
"ApiManagementHeadPolicyFragment": {
88+
"$ref": "./examples/ApiManagementHeadPolicyFragment.json"
89+
}
90+
},
91+
"parameters": [
92+
{
93+
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
94+
},
95+
{
96+
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
97+
},
98+
{
99+
"$ref": "./apimanagement.json#/parameters/PolicyFragmentIdParameter"
100+
},
101+
{
102+
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
103+
},
104+
{
105+
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
106+
}
107+
],
108+
"responses": {
109+
"200": {
110+
"description": "The specified policy pragment exists and the current entity state version is present in the ETag header.",
111+
"headers": {
112+
"ETag": {
113+
"description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
114+
"type": "string"
115+
}
116+
}
117+
},
118+
"default": {
119+
"description": "Error response describing why the operation failed.",
120+
"schema": {
121+
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
122+
}
123+
}
124+
}
125+
},
126+
"get": {
127+
"tags": [
128+
"PolicyFragment"
129+
],
130+
"operationId": "PolicyFragment_Get",
131+
"description": "Get the policy fragment definition of the Api Management service.",
132+
"x-ms-examples": {
133+
"ApiManagementGetPolicyFragment": {
134+
"$ref": "./examples/ApiManagementGetPolicyFragment.json"
135+
},
136+
"ApiManagementGetPolicyFragmentFormat": {
137+
"$ref": "./examples/ApiManagementGetPolicyFragmentFormat.json"
138+
}
139+
},
140+
"parameters": [
141+
{
142+
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
143+
},
144+
{
145+
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
146+
},
147+
{
148+
"$ref": "./apimanagement.json#/parameters/PolicyFragmentIdParameter"
149+
},
150+
{
151+
"$ref": "./apimanagement.json#/parameters/PolicyFragmentExportFormat"
152+
},
153+
{
154+
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
155+
},
156+
{
157+
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
158+
}
159+
],
160+
"responses": {
161+
"200": {
162+
"description": "Get the Global policy definition of the Api Management service.",
163+
"schema": {
164+
"$ref": "./definitions.json#/definitions/PolicyFragmentContract"
165+
},
166+
"headers": {
167+
"ETag": {
168+
"description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
169+
"type": "string"
170+
}
171+
}
172+
},
173+
"default": {
174+
"description": "Error response describing why the operation failed.",
175+
"schema": {
176+
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
177+
}
178+
}
179+
}
180+
},
181+
"put": {
182+
"tags": [
183+
"PolicyFragment"
184+
],
185+
"operationId": "PolicyFragment_CreateOrUpdate",
186+
"description": "Creates or updates the policy fragment configuration of the Api Management service.",
187+
"x-ms-examples": {
188+
"ApiManagementCreatePolicy": {
189+
"$ref": "./examples/ApiManagementCreatePolicyFragment.json"
190+
}
191+
},
192+
"parameters": [
193+
{
194+
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
195+
},
196+
{
197+
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
198+
},
199+
{
200+
"$ref": "./apimanagement.json#/parameters/PolicyFragmentIdParameter"
201+
},
202+
{
203+
"name": "parameters",
204+
"in": "body",
205+
"required": true,
206+
"schema": {
207+
"$ref": "./definitions.json#/definitions/PolicyFragmentContract"
208+
},
209+
"description": "The policy fragment contents to apply."
210+
},
211+
{
212+
"$ref": "./apimanagement.json#/parameters/IfMatchOptionalParameter"
213+
},
214+
{
215+
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
216+
},
217+
{
218+
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
219+
}
220+
],
221+
"responses": {
222+
"201": {
223+
"description": "Policy fragment configuration was successfully created.",
224+
"schema": {
225+
"$ref": "./definitions.json#/definitions/PolicyFragmentContract"
226+
},
227+
"headers": {
228+
"ETag": {
229+
"description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
230+
"type": "string"
231+
}
232+
}
233+
},
234+
"200": {
235+
"description": "Policy fragment configuration of the Api Management service was successfully updated.",
236+
"schema": {
237+
"$ref": "./definitions.json#/definitions/PolicyContract"
238+
},
239+
"headers": {
240+
"ETag": {
241+
"description": "Current entity state version",
242+
"type": "string"
243+
}
244+
}
245+
},
246+
"default": {
247+
"description": "Error response describing why the operation failed.",
248+
"schema": {
249+
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
250+
}
251+
}
252+
}
253+
},
254+
"delete": {
255+
"tags": [
256+
"PolicyFragment"
257+
],
258+
"operationId": "PolicyFragment_Delete",
259+
"description": "Deletes the policy fragmenty configuration of the Api Management Service.",
260+
"x-ms-examples": {
261+
"ApiManagementDeletePolicy": {
262+
"$ref": "./examples/ApiManagementDeletePolicyFragment.json"
263+
}
264+
},
265+
"parameters": [
266+
{
267+
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
268+
},
269+
{
270+
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
271+
},
272+
{
273+
"$ref": "./apimanagement.json#/parameters/PolicyFragmentIdParameter"
274+
},
275+
{
276+
"$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter"
277+
},
278+
{
279+
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
280+
},
281+
{
282+
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
283+
}
284+
],
285+
"responses": {
286+
"200": {
287+
"description": "Policy Fragment was successfully removed"
288+
},
289+
"204": {
290+
"description": "Policy Fragment successfully removed by previous request or does not exist"
291+
},
292+
"default": {
293+
"description": "Error response describing why the operation failed.",
294+
"schema": {
295+
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
296+
}
297+
}
298+
}
299+
}
300+
},
301+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{policyFragmentId}/references": {
302+
"get": {
303+
"tags": [
304+
"PolicyFragment"
305+
],
306+
"operationId": "PolicyFragment_GetReferences",
307+
"description": "Lists policy documents that reference the policy fragment of the Api Management service.",
308+
"x-ms-examples": {
309+
"ApiManagementListPolicyFragments": {
310+
"$ref": "./examples/ApiManagementListPolies.json"
311+
}
312+
},
313+
"parameters": [
314+
{
315+
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
316+
},
317+
{
318+
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
319+
},
320+
{
321+
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
322+
},
323+
{
324+
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
325+
}
326+
],
327+
"responses": {
328+
"200": {
329+
"description": "Returns an array of Policy Documents that reference the policy fragment.",
330+
"schema": {
331+
"$ref": "./definitions.json#/definitions/PolicyCollection"
332+
}
333+
},
334+
"default": {
335+
"description": "Error response describing why the operation failed.",
336+
"schema": {
337+
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
338+
}
339+
}
340+
}
341+
}
342+
}
343+
},
344+
"definitions": {},
345+
"parameters": {}
346+
}

0 commit comments

Comments
 (0)