Merge "Remove Swagger UI"
[so.git] / bpmn / so-bpmn-tasks / src / main / resources / naming-service / swagger.json
1 {
2         "swagger": "2.0",
3         "info": {
4                 "version": "2018.08.01",
5                 "title": "networkelementnamegenprodtest Service"
6         },
7         "basePath": "/web",
8         "paths": {
9                 "/service/v1/addPolicy": {
10                         "post": {
11                                 "summary": "Respond Hello <name>!",
12                                 "description": "Returns a JSON object with a string to say hello. Uses 'world' if a name is not specified",
13                                 "operationId": "addPolicyToDB",
14                                 "produces": [
15                                         "application/json"
16                                 ],
17                                 "responses": {
18                                         "200": {
19                                                 "description": "successful operation",
20                                                 "schema": {
21                                                         "type": "object",
22                                                         "additionalProperties": {
23                                                                 "type": "object"
24                                                         }
25                                                 }
26                                         },
27                                         "404": {
28                                                 "description": "Service not available"
29                                         },
30                                         "500": {
31                                                 "description": "Unexpected Runtime error"
32                                         }
33                                 }
34                         }
35                 },
36                 "/service/v1/genNetworkElementName": {
37                         "post": {
38                                 "summary": "Generates name",
39                                 "description": "Generates network element name based on a naming policy1 ",
40                                 "operationId": "generateNetworkElementName",
41                                 "produces": [
42                                         "application/json"
43                                 ],
44                                 "parameters": [
45                                         {
46                                                 "in": "body",
47                                                 "name": "body",
48                                                 "required": true,
49                                                 "schema": {
50                                                         "$ref": "#/definitions/NameGenRequest"
51                                                 }
52                                         }
53                                 ],
54                                 "responses": {
55                                         "200": {
56                                                 "description": "successful operation",
57                                                 "schema": {
58                                                         "$ref": "#/definitions/NameGenResponse"
59                                                 }
60                                         },
61                                         "404": {
62                                                 "description": "Service not available"
63                                         },
64                                         "500": {
65                                                 "description": "Unexpected Runtime error"
66                                         }
67                                 }
68                         },
69                         "delete": {
70                                 "summary": "Release an existing name by external key",
71                                 "description": "Release network element name ",
72                                 "operationId": "releaseNetworkElementName",
73                                 "produces": [
74                                         "application/json"
75                                 ],"parameters": [ 
76                                         {
77                                                 "in": "body",
78                                                 "name": "body",
79                                                 "required": true,
80                                                 "schema": {
81                                                         "$ref": "#/definitions/NameGenDeleteRequest"
82                                                 }
83                                         }
84                                 ],
85                                 "responses": {
86                                         "200": {
87                                                 "description": "successful operation",
88                                                 "schema": {
89                                                         "$ref": "#/definitions/NameGenDeleteResponse"
90                                                 }
91                                         },
92                                         "404": {
93                                                 "description": "Service not available"
94                                         },
95                                         "500": {
96                                                 "description": "Unexpected Runtime error"
97                                         }
98                                 }
99                         }
100                 }, 
101                 "/service/v1/getpolicyresponse/{policyName}": {
102                         "get": {
103                                 "summary": "Respond Hello <name>!",
104                                 "description": "Returns a JSON object with a string to say hello. Uses 'world' if a name is not specified",
105                                 "operationId": "getPolicyResponse",
106                                 "produces": [
107                                         "application/json"
108                                 ],
109                                 "responses": {
110                                         "200": {
111                                                 "description": "successful operation",
112                                                 "schema": {
113                                                         "type": "object",
114                                                         "additionalProperties": {
115                                                                 "type": "object"
116                                                         }
117                                                 }
118                                         },
119                                         "404": {
120                                                 "description": "Service not available"
121                                         },
122                                         "500": {
123                                                 "description": "Unexpected Runtime error"
124                                         }
125                                 }
126                         }
127                 }
128         },
129         "definitions": {
130                 "HelloWorld": {
131                         "type": "object",
132                         "properties": {
133                                 "message": {
134                                         "type": "string"
135                                 }
136                         }
137                 },
138                 "NameGenRequest": {
139                         "title": "NameGenRequest",
140                         "$schema": "http://json-schema.org/draft-07/schema#",
141                         "type": "object",
142                         "required": [
143                                 "elements"
144                         ],
145                         "properties": {
146                                 "elements": {
147                                         "type": "array",
148                                         "items": {
149                                                 "$ref": "#/definitions/element"
150                                         }
151                                 }
152                         },
153                         "additionalProperties": false,
154                         "definitions": {
155                                 "element": {
156                                         "type": "object",
157                                         "required": [
158                                                 "resource-name",
159                                                 "external-key",
160                                                 "policy-instance-name",
161                                                 "naming-type"
162                                         ],
163                                         "properties": {
164                                                 "resource-name": {
165                                                         "type": "string",
166                                                         "description": "Name of the resource"
167                                                 },
168                                                 "resource-value": {
169                                                         "type": "string",
170                                                         "description": "Optional. If given, request will be considered as update request"
171                                                 },
172                                                 "external-key": {
173                                                         "type": "string",
174                                                         "description": "Key identifier for generated name. This will be used in release/update request"
175                                                 },
176                                                 "policy-instance-name": {
177                                                         "type": "string",
178                                                         "description": "Name of the policy to be used for name generation"
179                                                 },
180                                                 "naming-type": {
181                                                         "type": "string",
182                                                         "description": "Naming type of the resource"
183                                                 }
184                                         },
185                                         "additionalProperties": {
186                                                 "type": "string"
187                                         }
188                                 }
189                         }
190                 },
191                 "NameGenResponse": {
192                         "type": "object",
193                           "description":"Response with generated names for each naming type. Either elements(one or more) or an error block will be present",
194                           "properties": {
195                                 "elements" : {
196                                         "type":"array",
197                                         "items": { "$ref": "#/definitions/respelement" }
198                                 },
199                                 "error" : {
200                                         "type":"object",
201                                 "required": ["errorId", "message"],
202                                         "properties":{
203                                                 "errorId":{"type":"string" , "description":"error code"},
204                                                 "message": {"type":"string", "description":"error message"}
205                                                 }
206                                 }
207                           }
208                 },
209                 "element": {
210                         "type": "object",
211                         "required": [
212                                 "resource-name",
213                                 "external-key",
214                                 "policy-instance-name",
215                                 "naming-type"
216                         ],
217                         "properties": {
218                                 "resource-name": {
219                                         "type": "string",
220                                         "description": "Name of the resource"
221                                 },
222                                 "resource-value": {
223                                         "type": "string",
224                                         "description": "Optional. If given, request will be considered as update request"
225                                 },
226                                 "external-key": {
227                                         "type": "string",
228                                         "description": "Key identifier for generated name. This will be used in release/update request"
229                                 },
230                                 "policy-instance-name": {
231                                         "type": "string",
232                                         "description": "Name of the policy to be used for name generation"
233                                 },
234                                 "naming-type": {
235                                         "type": "string",
236                                         "description": "Naming type of the resource"
237                                 },
238                                 "${naming-ingredients(zero or more)}": {
239                                         "type": "string",
240                                         "description": "values to subsitute in the naming recipe"
241                                 }
242                         },
243                         "additionalProperties": {
244                                 "type": "string"
245                         }
246                 },
247                 "respelement": {
248                 "type":"object",
249                 "required": [ "resource-name","resource-value","external-key"],
250                  "properties": {
251            "resource-value": {
252                                 "type": "string",
253                                 "description": "Optional. If given, request will be considered as update request"
254                         },
255                         "resource-name": {
256                                 "type": "string",
257                                  "description": "Name of the resource"
258                         },
259                         "external-key": { 
260                                 "type": "string",
261                                 "description": "Key identifier for generated name. This will be used in release/update request"
262                         }
263                  }
264                 },
265                 "NameGenDeleteRequest": {
266                         "title": "NameGenRequest",
267                         "$schema": "http://json-schema.org/draft-07/schema#",
268                         "type": "object",
269                         "required": [
270                                 "elements"
271                         ],
272                         "properties": {
273                                 "elements": {
274                                         "type": "array",
275                                         "items": {
276                                                 "$ref": "#/definitions/deleteelement"
277                                         }
278                                 }
279                         }
280                 },
281                 "deleteelement": {
282                         "type": "object",
283                         "required": [ "external-key" ],
284                         "properties": {
285                                 "external-key": {
286                                         "type": "string",
287                                         "description": "External key of the name that is being released"
288                                 }
289                         }
290                 },"NameGenDeleteResponse": {
291                         "title": "NameGenRequest",
292                         "$schema": "http://json-schema.org/draft-07/schema#",
293                         "type": "object",
294                         "required": [
295                                 "elements"
296                         ],
297                         "properties": {
298                                 "elements": {
299                                         "type": "array",
300                                         "items": {
301                                                 "$ref": "#/definitions/deleteresponseelement"
302                                         }
303                                 }
304                         }
305                 },
306                 "deleteresponseelement": {
307                         "type": "object",
308                         "required": [ "resource-value","resource_name","external-key" ],
309                         "properties": {
310                                 "resource-value": {
311                                         "type": "string",
312                                         "description": "Name that is being release"
313                                 },
314                                 "resource-name": {
315                                         "type": "string",
316                                         "description": "Resource Name"
317                                 },
318                                 "external-key": {
319                                         "type": "string",
320                                         "description": "External key of the name that is being released"
321                                 }
322                         }
323                 }
324         }
325 }