elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. SPDX-License-Identifier: CC-BY-4.0 |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 3 | .. Copyright (C) 2021 Nordix |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 4 | |
| 5 | .. _simulator-api: |
| 6 | |
| 7 | ============= |
| 8 | Simulator API |
| 9 | ============= |
| 10 | |
| 11 | This document describes the API used to manage policy types and manipulate the simulator. |
| 12 | |
maximesson | 59e2b2a | 2021-06-02 12:45:34 +0200 | [diff] [blame] | 13 | The simulator supports different versions of the A1 interface. Some functions are common for all versions, and some are |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 14 | specific for a certain version. |
| 15 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 16 | Common Functions |
| 17 | ================ |
| 18 | |
| 19 | Health Check |
| 20 | ------------ |
| 21 | |
| 22 | The status of the simulator. |
| 23 | |
| 24 | / |
| 25 | ~~ |
| 26 | |
| 27 | GET |
| 28 | +++ |
| 29 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 30 | Returns the status of the simulator. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 31 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 32 | **URL path:** |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 33 | / |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 34 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 35 | **Parameters:** |
| 36 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 37 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 38 | **Responses:** |
| 39 | 200: |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 40 | OK |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 41 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 42 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 43 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 44 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 45 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 46 | curl -X GET "http://localhost:8085/" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 47 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 48 | **Result**: |
| 49 | |
| 50 | 200: :: |
| 51 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 52 | OK |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 53 | |
| 54 | Supported Interfaces |
| 55 | -------------------- |
| 56 | |
| 57 | The simulator can support different versions of the A1 interface. With this API the supported versions can be listed. |
| 58 | |
| 59 | /container_interfaces |
| 60 | ~~~~~~~~~~~~~~~~~~~~~ |
| 61 | |
| 62 | GET |
| 63 | +++ |
| 64 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 65 | Returns the status of the simulator. (Not available for A1 Standard 1.1.3) |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 66 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 67 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 68 | |
| 69 | /container_interfaces |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 70 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 71 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 72 | |
| 73 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 74 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 75 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 76 | |
| 77 | 200: |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 78 | List of supported interfaces. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 79 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 80 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 81 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 82 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 83 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 84 | curl -X GET "http://localhost:8085/container_interfaces" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 85 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 86 | |
| 87 | **Result**: |
| 88 | |
| 89 | 200: :: |
| 90 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 91 | Current interface: STD_2.0.0 All supported A1 interface yamls in this container: ['OSC_2.1.0', 'STD_1.1.3', 'STD_2.0.0'] |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 92 | |
| 93 | Counters |
| 94 | -------- |
| 95 | |
| 96 | The simulator keeps counts of different things that can be accessed. |
| 97 | |
| 98 | /counter |
| 99 | ~~~~~~~~ |
| 100 | |
| 101 | GET |
| 102 | +++ |
| 103 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 104 | Get a counter. Counter-name can be one of the following: 'num_instances', 'num_types', 'interface', 'remote_hosts' or 'datadelivery'. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 105 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 106 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 107 | |
| 108 | /counter/{counter-name} |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 109 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 110 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 111 | |
| 112 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 113 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 114 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 115 | |
| 116 | 200: |
| 117 | |
| 118 | The counter value for the given counter. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 119 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 120 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 121 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 122 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 123 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 124 | curl -X GET "http://localhost:8085/counter/num_instances" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 125 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 126 | **Result**: |
| 127 | |
| 128 | 200: :: |
| 129 | |
| 130 | 10 |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 131 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 132 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 133 | Reset simulator |
| 134 | --------------- |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 135 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 136 | There are two ways to reset the simulator, delete all instances or make a complete reset which resets the simulator to its original state. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 137 | |
| 138 | /deleteinstances |
| 139 | ~~~~~~~~~~~~~~~~ |
| 140 | |
| 141 | POST |
| 142 | ++++ |
| 143 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 144 | Delete all policy instances. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 145 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 146 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 147 | |
| 148 | /deleteinstances |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 149 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 150 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 151 | |
| 152 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 153 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 154 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 155 | |
| 156 | 200: |
| 157 | |
| 158 | All policy instances deleted. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 159 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 160 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 161 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 162 | **Call**: :: |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 163 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 164 | curl -X POST "http://localhost:8085/deleteinstances" |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 165 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 166 | **Result**: |
| 167 | |
| 168 | 200: :: |
| 169 | |
| 170 | All policy instances deleted. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 171 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 172 | /deleteall |
| 173 | ~~~~~~~~~~~~~~~~ |
| 174 | |
| 175 | POST |
| 176 | ++++ |
| 177 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 178 | Full reset. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 179 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 180 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 181 | |
| 182 | /deleteall |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 183 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 184 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 185 | |
| 186 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 187 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 188 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 189 | |
| 190 | 200: |
| 191 | |
| 192 | All policy instances and types deleted. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 193 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 194 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 195 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 196 | **Call**: :: |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 197 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 198 | curl -X POST "http://localhost:8085/deleteall" |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 199 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 200 | **Result**: |
| 201 | |
| 202 | 200: :: |
| 203 | |
| 204 | All policy instances and types deleted. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 205 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 206 | 200 :: |
| 207 | All policy instances deleted (Only for STD_1.1.3 since it has no types) |
| 208 | |
| 209 | Response manipulation |
| 210 | --------------------- |
| 211 | It is possible to manipulate the response of all operations on the A1 interface (admin interface is not affected) |
| 212 | |
| 213 | /forceresponse |
| 214 | ~~~~~~~~~~~~~~ |
| 215 | |
| 216 | POST |
| 217 | ++++ |
| 218 | |
| 219 | Force a specific response code for one (the next) A1 operation. After that response, the reponse code will go back to normal. |
| 220 | |
| 221 | **URL path:** |
| 222 | |
| 223 | /forceresponse?code=<http-response-code> |
| 224 | |
| 225 | **Parameters:** |
| 226 | |
| 227 | code: (*Required*) |
| 228 | |
| 229 | The HTTP response code to return. |
| 230 | |
| 231 | **Responses:** |
| 232 | |
| 233 | 200: |
| 234 | |
| 235 | Force response code: <expected code> set for one single A1 response |
| 236 | |
| 237 | **Examples:** |
| 238 | |
| 239 | **Call**: :: |
| 240 | |
| 241 | curl -X POST "http://localhost:8085/forceresponse?code=400" |
| 242 | |
| 243 | **Result**: |
| 244 | |
| 245 | 200: :: |
| 246 | |
| 247 | Force response code: 400 set for one single A1 response |
| 248 | |
| 249 | /forcedelay |
| 250 | ~~~~~~~~~~~ |
| 251 | |
| 252 | POST |
| 253 | ++++ |
| 254 | |
| 255 | Force delayed response of all A1 responses. The setting will remain until the delay is set to '0' |
| 256 | |
| 257 | **URL path:** |
| 258 | |
| 259 | /forcedelay?delay=<delay-time-seconds> |
| 260 | |
| 261 | **Parameters:** |
| 262 | |
| 263 | delay: (*Required*) |
| 264 | |
| 265 | The time in seconds to delay all responses. |
| 266 | |
| 267 | **Responses:** |
| 268 | |
| 269 | 200: |
| 270 | |
| 271 | Force delay: <expected delay> sec set for all A1 responses |
| 272 | |
| 273 | **Examples:** |
| 274 | |
| 275 | **Call**: :: |
| 276 | |
| 277 | curl -X POST "http://localhost:8085/forcedelay?delay=2" |
| 278 | |
| 279 | **Result**: |
| 280 | |
| 281 | 200: :: |
| 282 | |
| 283 | Force delay: 2 sec set for all A1 responses |
| 284 | |
| 285 | |
| 286 | Configure logging |
| 287 | ----------------- |
| 288 | Detailed logging of the http headers and payload are activated by default. However, it is possible to turn this logging on or off. |
| 289 | The 'off' state will only logg ip, url and respose code. |
| 290 | |
| 291 | /payload_logging/ |
| 292 | ~~~~~~~~~~~~~~~~~ |
| 293 | |
| 294 | POST |
| 295 | ++++ |
| 296 | |
| 297 | Configure detailed logging on or off |
| 298 | **URL path:** |
| 299 | |
| 300 | /payload_logging/<state> |
| 301 | |
| 302 | **Parameters:** |
| 303 | |
| 304 | state: (*Required*) |
| 305 | |
| 306 | The state, 'on' or 'off'. |
| 307 | |
| 308 | **Responses:** |
| 309 | |
| 310 | 200: |
| 311 | |
| 312 | Force delay: <expected delay> sec set for all A1 responses |
| 313 | |
| 314 | **Examples:** |
| 315 | |
| 316 | **Call**: :: |
| 317 | |
| 318 | curl -X POST "http://localhost:8085/payload_logging/on" |
| 319 | |
| 320 | **Result**: |
| 321 | |
| 322 | 200: :: |
| 323 | |
| 324 | Payload and header logging set to: on |
| 325 | |
| 326 | |
| 327 | Version Specific Functions |
| 328 | ========================== |
| 329 | |
| 330 | The methods available to control the simulator depends on the version of the A1 API the simulator is simulating. |
| 331 | |
| 332 | OSC_2.1.0 |
| 333 | --------- |
| 334 | |
| 335 | This section describes the available administrative functions for the OSC_2.1.0 version of A1. |
| 336 | |
| 337 | To see the A1 functions for this version, see `OSC_2.1.0 API`_. |
| 338 | |
| 339 | .. _OSC_2.1.0 API: https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=blob;f=near-rt-ric-simulator/api/OSC_2.1.0/openapi.yaml |
| 340 | |
| 341 | |
| 342 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 343 | /policytype |
| 344 | ~~~~~~~~~~~ |
| 345 | |
| 346 | PUT |
| 347 | +++ |
| 348 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 349 | Create a policy type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 350 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 351 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 352 | |
| 353 | /policytype?id=<policy-type-id> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 354 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 355 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 356 | |
| 357 | id: (*Required*) |
| 358 | |
| 359 | The ID of the policy type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 360 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 361 | **Body:** (*Required*) |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 362 | |
| 363 | A JSON object containing the schema for the type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 364 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 365 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 366 | |
| 367 | 200: |
| 368 | |
| 369 | Policy type <policy-type-id> is OK. |
| 370 | |
| 371 | 201: |
| 372 | |
| 373 | Policy type <policy-type-id> is OK. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 374 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 375 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 376 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 377 | **Call**: :: |
| 378 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 379 | curl -X PUT "http://localhost:8085/policytype?id=1" |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 380 | -H "Content-Type: application/json" |
| 381 | -d '{ |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 382 | "name": "pt1", |
| 383 | "description": "pt1 policy type", |
| 384 | "policy_type_id": 1, |
| 385 | "create_schema": { |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 386 | "$schema": "http://json-schema.org/draft-07/schema#", |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 387 | "title": "STD_QoSNudging_0.2.0", |
| 388 | "description": "QoS policy type", |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 389 | "type": "object", |
| 390 | "properties": { |
| 391 | "scope": { |
| 392 | "type": "object", |
| 393 | "properties": { |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 394 | "ueId": { |
| 395 | "type": "string" |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 396 | }, |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 397 | "qosId": { |
| 398 | "type": "string" |
| 399 | } |
| 400 | }, |
| 401 | "additionalProperties": false, |
| 402 | "required": [ |
| 403 | "ueId", |
| 404 | "qosId" |
| 405 | ] |
| 406 | }, |
| 407 | "statement": { |
| 408 | "type": "object", |
| 409 | "properties": { |
| 410 | "priorityLevel": { |
| 411 | "type": "number" |
| 412 | } |
| 413 | }, |
| 414 | "additionalProperties": false, |
| 415 | "required": [ |
| 416 | "priorityLevel" |
| 417 | ] |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 418 | } |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 419 | } |
| 420 | } |
| 421 | }' |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 422 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 423 | **Result**: |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 424 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 425 | 201: :: |
| 426 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 427 | Policy type 1 is OK |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 428 | |
| 429 | DELETE |
| 430 | ++++++ |
| 431 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 432 | Delete a policy type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 433 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 434 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 435 | |
| 436 | /policytype?id=<policy-type-id> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 437 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 438 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 439 | |
| 440 | id: (*Required*) |
| 441 | |
| 442 | The ID of the policy type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 443 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 444 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 445 | |
| 446 | 204: |
| 447 | |
| 448 | Policy type <policy-type-id> is OK. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 449 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 450 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 451 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 452 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 453 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 454 | curl -X DELETE "http://localhost:8085/policytype?id=1" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 455 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 456 | **Result**: |
| 457 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 458 | 204 |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 459 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 460 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 461 | |
| 462 | /policytypes |
| 463 | ~~~~~~~~~~~~ |
| 464 | |
| 465 | GET |
| 466 | +++ |
| 467 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 468 | Get a list of policy types. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 469 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 470 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 471 | |
| 472 | /policytypes |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 473 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 474 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 475 | |
| 476 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 477 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 478 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 479 | |
| 480 | 200: |
| 481 | |
| 482 | A list of policy types. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 483 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 484 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 485 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 486 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 487 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 488 | curl -X GET "http://localhost:8085/policytypes" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 489 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 490 | **Result**: |
| 491 | |
| 492 | 200: :: |
| 493 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 494 | ["1"] |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 495 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 496 | |
| 497 | /status |
| 498 | ~~~~~~~ |
| 499 | |
| 500 | PUT |
| 501 | +++ |
| 502 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 503 | Set status and optional reason, delete and time stamp. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 504 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 505 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 506 | |
| 507 | /status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 508 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 509 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 510 | |
| 511 | policyid: (*Required*) |
| 512 | |
| 513 | The ID of a policy. |
| 514 | |
| 515 | status: (*Required*) |
| 516 | |
| 517 | The status of a policy. |
| 518 | |
| 519 | deleted: (*Optional*) |
| 520 | |
| 521 | True or false for real values, but accepts anything for error testing. |
| 522 | |
| 523 | created_at: (*Optional*) |
| 524 | |
| 525 | Time stamp for the status. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 526 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 527 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 528 | |
| 529 | 200: |
| 530 | |
| 531 | Status set to <status> for policy <policy-id> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 532 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 533 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 534 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 535 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 536 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 537 | curl -X PUT "http://localhost:8085/status?policyid=1&status=Accepted" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 538 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 539 | **Result**: |
| 540 | |
| 541 | 200: :: |
| 542 | |
| 543 | Status set to Accepted for policy Policy1. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 544 | |
| 545 | A1 Standard 1.1.3 |
| 546 | ----------------- |
| 547 | |
elinuxhenrik | b11c353 | 2020-04-22 11:01:08 +0200 | [diff] [blame] | 548 | This section describes the available administrative functions for the A1 Standard 1.1.3 version of A1. |
| 549 | |
| 550 | To see the A1 functions for this version, see `A1 Standard 1.1.3 API`_. |
| 551 | |
| 552 | .. _A1 Standard 1.1.3 API: https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=blob;f=near-rt-ric-simulator/api/STD_1.1.3/STD_A1.yaml |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 553 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 554 | |
| 555 | /status |
| 556 | ~~~~~~~ |
| 557 | |
| 558 | PUT |
| 559 | +++ |
| 560 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 561 | Set status and optional reason, delete and time stamp. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 562 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 563 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 564 | |
| 565 | /status?policyid=<policyid>&status=<status>&reason=<reason> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 566 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 567 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 568 | |
| 569 | policyid: (*Required*) |
| 570 | |
| 571 | The ID of a policy. |
| 572 | |
| 573 | status: (*Required*) |
| 574 | |
| 575 | The status of a policy. |
| 576 | |
| 577 | reason: (*Optional*) |
| 578 | |
| 579 | The reason for the status. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 580 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 581 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 582 | |
| 583 | 200: |
| 584 | |
| 585 | Status set to <status> for policy <policy-id> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 586 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 587 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 588 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 589 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 590 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 591 | curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 592 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 593 | **Result**: |
| 594 | |
| 595 | 200: :: |
| 596 | |
| 597 | Status set to Accepted for policy Policy1 |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 598 | |
| 599 | /sendstatus |
| 600 | ~~~~~~~~~~~ |
| 601 | |
| 602 | POST |
| 603 | ++++ |
| 604 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 605 | Send status for policy. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 606 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 607 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 608 | |
| 609 | /sendstatus?policyid=<policy-id> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 610 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 611 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 612 | |
| 613 | policyid: (*Required*) |
| 614 | |
| 615 | The ID of the policy to send status for. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 616 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 617 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 618 | |
| 619 | 200: |
| 620 | |
| 621 | Is a JSON with the response of the actual post request to the callback server, whatever that is. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 622 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 623 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 624 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 625 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 626 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 627 | curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2" |
| 628 | |
| 629 | **Result**: |
| 630 | |
| 631 | 200 |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 632 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 633 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 634 | A1 Standard 2.0.0 |
| 635 | ----------------- |
elinuxhenrik | b11c353 | 2020-04-22 11:01:08 +0200 | [diff] [blame] | 636 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 637 | This section describes the available administrative functions for the A1 Standard 2.0.0 version of A1. |
elinuxhenrik | b11c353 | 2020-04-22 11:01:08 +0200 | [diff] [blame] | 638 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 639 | To see the A1 functions for this version, see `A1 Standard 2.0.0 API`_. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 640 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 641 | .. _A1 Standard 2.0.0 API: https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=blob;f=near-rt-ric-simulator/api/STD_2.0.0/ORAN_A1-p_V2.0.0_api.yaml |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 642 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 643 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 644 | /policytype |
| 645 | ~~~~~~~~~~~ |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 646 | |
| 647 | PUT |
| 648 | +++ |
| 649 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 650 | Create or update a policy type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 651 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 652 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 653 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 654 | /policytype?id={policy-type-id} |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 655 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 656 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 657 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 658 | policy-type-id: (*Required*) |
| 659 | |
| 660 | The ID of the policy type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 661 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 662 | **Body:** (*Required*) |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 663 | |
| 664 | A JSON object containing the schema for the type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 665 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 666 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 667 | |
| 668 | 200: |
| 669 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 670 | The policy type <policy-type-id> is ok |
| 671 | |
| 672 | 201: |
| 673 | |
| 674 | The policy type <policy-type-id> is ok |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 675 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 676 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 677 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 678 | **Call**: :: |
| 679 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 680 | curl -X PUT "http://localhost:8085/policytype?id=STD_PolicyModelUnconstrained_0.2.0" |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 681 | -H "Content-Type: application/json" |
| 682 | -d '{ |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 683 | "policySchema": { |
| 684 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 685 | "title": "STD_1_0.2.0", |
| 686 | "description": "STD 1 policy type", |
| 687 | "type": "object", |
| 688 | "properties": { |
| 689 | "scope": { |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 690 | "type": "object", |
| 691 | "properties": { |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 692 | "ueId": { |
| 693 | "type": "string" |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 694 | }, |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 695 | "qosId": { |
| 696 | "type": "string" |
| 697 | } |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 698 | }, |
| 699 | "additionalProperties": false, |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 700 | "required": [ |
| 701 | "ueId", |
| 702 | "qosId" |
| 703 | ] |
| 704 | }, |
| 705 | "statement": { |
| 706 | "type": "object", |
| 707 | "properties": { |
| 708 | "priorityLevel": { |
| 709 | "type": "number" |
| 710 | } |
| 711 | }, |
| 712 | "additionalProperties": false, |
| 713 | "required": [ |
| 714 | "priorityLevel" |
| 715 | ] |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 716 | } |
| 717 | } |
| 718 | }, |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 719 | "statusSchema": { |
| 720 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 721 | "title": "STD_1_0.2.0", |
| 722 | "description": "STD 1 policy type status", |
| 723 | "type": "object", |
| 724 | "properties": { |
| 725 | "enforceStatus": { |
| 726 | "type": "string" |
| 727 | }, |
| 728 | "enforceReason": { |
| 729 | "type": "string" |
| 730 | }, |
| 731 | "additionalProperties": false, |
| 732 | "required": [ |
| 733 | "enforceStatus" |
| 734 | ] |
| 735 | } |
| 736 | } |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 737 | }' |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 738 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 739 | **Result**: |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 740 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 741 | 200: :: |
| 742 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 743 | Policy type STD_PolicyModelUnconstrained_0.2.0 is OK |
| 744 | |
| 745 | 201: :: |
| 746 | |
| 747 | Policy type STD_PolicyModelUnconstrained_0.2.0 is OK |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 748 | |
| 749 | DELETE |
| 750 | ++++++ |
| 751 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 752 | Delete a policy type. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 753 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 754 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 755 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 756 | /policytype?id={policy-type-id} |
| 757 | |
| 758 | **Parameters:** |
| 759 | |
| 760 | None. |
| 761 | |
| 762 | **Responses:** |
| 763 | |
| 764 | 204 |
| 765 | |
| 766 | |
| 767 | **Examples:** |
| 768 | |
| 769 | **Call**: :: |
| 770 | |
| 771 | curl -X DELETE "http://localhost:8085/policytype?id=STD_PolicyModelUnconstrained_0.2.0" |
| 772 | |
| 773 | **Result**: |
| 774 | |
| 775 | 204 |
| 776 | |
| 777 | |
| 778 | |
| 779 | /policytypes |
| 780 | ~~~~~~~~~~~~ |
| 781 | |
| 782 | GET |
| 783 | +++ |
| 784 | |
| 785 | Get a list of policy types. |
| 786 | |
| 787 | **URL path:** |
| 788 | |
| 789 | /policytypes |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 790 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 791 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 792 | |
| 793 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 794 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 795 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 796 | |
| 797 | 200: |
| 798 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 799 | A list of policy types. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 800 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 801 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 802 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 803 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 804 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 805 | curl -X GET "http://localhost:8085/policytypes" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 806 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 807 | **Result**: |
| 808 | |
| 809 | 200: :: |
| 810 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 811 | ["STD_PolicyModelUnconstrained_0.2.0"] |
| 812 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 813 | |
| 814 | /{policyId}/{enforceStatus} |
| 815 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 816 | |
| 817 | PUT |
| 818 | +++ |
| 819 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 820 | Set a status to a policy instance with an enforceStatus parameter only. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 821 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 822 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 823 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 824 | /status?policyid={policyId}&status={status}&reason={reason} |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 825 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 826 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 827 | |
| 828 | None. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 829 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 830 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 831 | |
| 832 | 200: |
| 833 | |
| 834 | Status updated for policy: <policyId> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 835 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 836 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 837 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 838 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 839 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 840 | curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=ENFORCED" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 841 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 842 | **Result**: |
| 843 | |
| 844 | 200: :: |
| 845 | |
| 846 | Status updated for policy: Policy1 |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 847 | |
| 848 | /{policyId}/{enforceStatus}/{enforceReason} |
| 849 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 850 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 851 | /sendstatus |
| 852 | ~~~~~~~~~~~ |
| 853 | |
| 854 | POST |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 855 | ++++ |
| 856 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 857 | Send status for policy. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 858 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 859 | **URL path:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 860 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 861 | /sendstatus?policyid=<policy-id> |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 862 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 863 | **Parameters:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 864 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 865 | policyid: (*Required*) |
| 866 | |
| 867 | The ID of the policy to send status for. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 868 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 869 | **Responses:** |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 870 | |
| 871 | 200: |
| 872 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 873 | Is a JSON with the response of the actual post request to the callback server, whatever that is. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 874 | |
elinuxhenrik | c67ef9d | 2020-04-20 17:05:00 +0200 | [diff] [blame] | 875 | **Examples:** |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 876 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 877 | **Call**: :: |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 878 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 879 | curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2" |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 880 | |
elinuxhenrik | 83a40db | 2020-04-23 07:47:44 +0200 | [diff] [blame] | 881 | **Result**: |
| 882 | |
BjornMagnussonXA | ddf5854 | 2021-10-06 11:05:01 +0200 | [diff] [blame] | 883 | 200 |