clean up some sphinx warnings
[dcaegen2.git] / docs / sections / services / pm-subscription-handler / offeredapi.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2022 Nordix Foundation
4
5
6 API
7 ===
8
9 GET /healthcheck
10 ---------------------------------------------------
11
12 Description
13 ~~~~~~~~~~~
14
15 This is the health check endpoint. If this returns a 200, the server is alive.
16
17
18 Responses
19 ~~~~~~~~~
20
21 +-----------+--------------------------+
22 | HTTP Code | Description              |
23 +===========+==========================+
24 | **200**   | Successful response      |
25 +-----------+--------------------------+
26 | **503**   | Service unavailable      |
27 +-----------+--------------------------+
28
29
30 POST /subscription
31 --------------------------------------------------
32
33 Description
34 ~~~~~~~~~~~
35
36 Create a PM Subscription
37
38 Responses
39 ~~~~~~~~~
40
41 +-----------+--------------------------------------+
42 | HTTP Code | Description                          |
43 +===========+======================================+
44 | **201**   | Successfully created PM Subscription |
45 +-----------+--------------------------------------+
46 | **400**   | Invalid Input                        |
47 +-----------+--------------------------------------+
48 | **409**   | Duplicate Data                       |
49 +-----------+--------------------------------------+
50
51 Sample Subscription Body
52 ~~~~~~~~~~~~~~~~~~~~~~~~
53
54 .. code-block:: json
55
56     {
57         "subscription": {
58             "subscriptionName": "new_sub",
59             "policyName": "pmsh_policy",
60             "nfFilter": {
61                 "nfNames": [
62                     "^pnf.*",
63                     "^vnf.*"
64                 ],
65                 "modelInvariantIDs": [
66
67                 ],
68                 "modelVersionIDs": [
69
70                 ],
71                 "modelNames": []
72             },
73             "measurementGroups": [{
74                 "measurementGroup": {
75                     "measurementGroupName": "msr_grp_name",
76                     "fileBasedGP": 15,
77                     "fileLocation": "\/pm\/pm.xml",
78                     "administrativeState": "UNLOCKED",
79                     "measurementTypes": [{
80                         "measurementType": "counter_a"
81                     }],
82                     "managedObjectDNsBasic": [{
83                         "DN": "string"
84                     }]
85                 }
86             }]
87         }
88     }
89
90
91 GET /subscription
92 --------------------------------------------------
93
94 Description
95 ~~~~~~~~~~~
96
97 Get all the subscriptions from PMSH
98
99
100 Responses
101 ~~~~~~~~~
102
103 +-----------+----------------------------------------+
104 | HTTP Code | Description                            |
105 +===========+========================================+
106 | **200**   | Successfully fetched all subscriptions |
107 +-----------+----------------------------------------+
108 | **500**   | Exception occured when querying DB     |
109 +-----------+----------------------------------------+
110
111
112 GET /subscription/{subscription_name}
113 ---------------------------------------------------
114
115 Description
116 ~~~~~~~~~~~
117
118 Get the Subscription from PMSH specified by Name
119
120 Responses
121 ~~~~~~~~~
122
123 +-----------+--------------------------------------------+
124 | HTTP Code | Description                                |
125 +===========+============================================+
126 | **200**   | OK; Requested Subscription was returned    |
127 +-----------+--------------------------------------------+
128 | **404**   | Subscription with specified name not found |
129 +-----------+--------------------------------------------+
130 | **500**   | Exception occurred while querying database |
131 +-----------+--------------------------------------------+
132
133
134 DELETE /subscription/{subscription_name}
135 ---------------------------------------------------
136
137 Description
138 ~~~~~~~~~~~
139
140 Deletes the Subscription from PMSH specified by Name
141
142 Responses
143 ~~~~~~~~~
144
145 +-----------+---------------------------------------------------------------------+
146 | HTTP Code | Description                                                         |
147 +===========+=====================================================================+
148 | **204**   | Successfully deleted the subscription and returns NO Content        |
149 +-----------+---------------------------------------------------------------------+
150 | **404**   | Subscription with specified name not found                          |
151 +-----------+---------------------------------------------------------------------+
152 | **409**   | Subscription could not be deleted as it contains measurement groups |
153 |           | with state UNLOCKED OR state change to LOCKED was under process     |
154 +-----------+---------------------------------------------------------------------+
155 | **500**   | Exception occurred on the server                                    |
156 +-----------+---------------------------------------------------------------------+
157
158
159 PUT /subscription/{subscription_name}/nfFilter
160 ----------------------------------------------
161
162 Description
163 ~~~~~~~~~~~
164
165 Update a Subscription nf filter
166
167
168 Sample NF Filter Body
169 ~~~~~~~~~~~~~~~~~~~~~~~~
170
171 .. code-block:: json
172
173     {
174         "nfFilter": {
175             "nfNames": [
176             "^pnf.*",
177             "^vnf.*"
178             ],
179             "modelInvariantIDs": [
180
181             ],
182             "modelVersionIDs": [
183
184             ],
185             "modelNames": [
186
187             ]
188         }
189     }
190
191 Responses
192 ~~~~~~~~~
193
194 +-----------+---------------------------------------------------------------------+
195 | HTTP Code | Description                                                         |
196 +===========+=====================================================================+
197 | **201**   | Successfully updated nf filter                                      |
198 +-----------+---------------------------------------------------------------------+
199 | **400**   | Invalid input                                                       |
200 +-----------+---------------------------------------------------------------------+
201 | **409**   | Conflicting data                                                    |
202 +-----------+---------------------------------------------------------------------+
203 | **500**   | Exception occurred while querying database                          |
204 +-----------+---------------------------------------------------------------------+
205
206
207 POST /subscription/{subscription_name}/measurementGroups/{measurement_group_name}
208 ----------------------------------------------------------------------------------
209
210 Description
211 ~~~~~~~~~~~
212
213 Create a measurement group for a given subscription
214
215
216 Sample Measurement Group Body
217 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
218
219 .. code-block:: json
220
221     {
222         "measurementGroup": {
223             "measurementGroupName": "msg_grp_03",
224             "fileBasedGP":15,
225             "fileLocation":"pm.xml",
226             "administrativeState": "UNLOCKED",
227             "measurementTypes": [
228                 {
229                     "measurementType": "counter_a"
230                 }
231             ],
232             "managedObjectDNsBasic": [
233                 {
234                     "DN": "string"
235                 }
236             ]
237         }
238     }
239
240 Responses
241 ~~~~~~~~~
242
243 +-----------+---------------------------------------------------------------------+
244 | HTTP Code | Description                                                         |
245 +===========+=====================================================================+
246 | **201**   | Successfully created measurement group                              |
247 +-----------+---------------------------------------------------------------------+
248 | **404**   | Subscription with the specified name not found                      |
249 +-----------+---------------------------------------------------------------------+
250 | **409**   | Duplicate data                                                      |
251 +-----------+---------------------------------------------------------------------+
252 | **500**   | Internal server error                                               |
253 +-----------+---------------------------------------------------------------------+
254
255
256 GET /subscription/{subscription_name}/measurementGroups/{measurement_group_name}
257 ----------------------------------------------------------------------------------
258
259 Description
260 ~~~~~~~~~~~
261
262 Get the  measurement group and associated network functions from PMSH by using sub name and meas group name
263
264 Responses
265 ~~~~~~~~~
266
267 +-----------+---------------------------------------------------------------------+
268 | HTTP Code | Description                                                         |
269 +===========+=====================================================================+
270 | **200**   | OK; Received requested measurement group with associated NF's       |
271 +-----------+---------------------------------------------------------------------+
272 | **404**   | Measurement group with specified name not found                     |
273 +-----------+---------------------------------------------------------------------+
274 | **500**   | Exception occurred on the server                                    |
275 +-----------+---------------------------------------------------------------------+
276
277
278 DELETE /subscription/{subscription_name}/measurementGroups/{measurement_group_name}
279 ------------------------------------------------------------------------------------
280
281 Description
282 ~~~~~~~~~~~
283
284 Delete a measurement group
285
286 Responses
287 ~~~~~~~~~
288
289 +-----------+--------------------------------------------------------------------------------------------------+
290 | HTTP Code | Description                                                                                      |
291 +===========+==================================================================================================+
292 | **204**   | Successfully deleted the measurement group and returns NO Content                                |
293 +-----------+--------------------------------------------------------------------------------------------------+
294 | **404**   | Measurement group with the specified name not found                                              |
295 +-----------+--------------------------------------------------------------------------------------------------+
296 | **409**   | Measurement group not deleted because state UNLOCKED OR state change to LOCKED was under process |
297 +-----------+--------------------------------------------------------------------------------------------------+
298 | **500**   | Exception occurred on the server                                                                 |
299 +-----------+--------------------------------------------------------------------------------------------------+
300
301
302 PUT /subscription/{subscription_name}/measurementGroups/{measurement_group_name}/{administrativeState}
303 -------------------------------------------------------------------------------------------------------
304
305 Description
306 ~~~~~~~~~~~
307
308 Update administrative state for a measurement group
309
310 Responses
311 ~~~~~~~~~
312
313 +-----------+---------------------------------------------------------------------+
314 | HTTP Code | Description                                                         |
315 +===========+=====================================================================+
316 | **201**   | Successfully updated administrative state                           |
317 +-----------+---------------------------------------------------------------------+
318 | **409**   | Duplicate data                                                      |
319 +-----------+---------------------------------------------------------------------+
320 | **500**   | Invalid input                                                       |
321 +-----------+---------------------------------------------------------------------+