elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. http://creativecommons.org/licenses/by/4.0 |
elinuxhenrik | 0a4c38b | 2020-04-14 10:59:36 +0200 | [diff] [blame] | 3 | .. Copyright (C) 2020 Nordix |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 4 | |
| 5 | .. |nbsp| unicode:: 0xA0 |
| 6 | :trim: |
| 7 | |
| 8 | .. |nbh| unicode:: 0x2011 |
| 9 | :trim: |
| 10 | |
| 11 | .. _policy-agent-api: |
| 12 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 13 | ################################ |
| 14 | A1 Policy Management Service API |
| 15 | ################################ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 16 | |
| 17 | |
| 18 | ******************************************* |
| 19 | A1 Policy Management Service - Introduction |
| 20 | ******************************************* |
| 21 | |
| 22 | The A1 Policy Management Service ("Policy Agent") is an SMO/NONRTRIC service above the NONRTRIC A1 Adaptor/Controller |
| 23 | that provides: |
| 24 | |
| 25 | * Unified REST & DMAAP APIs for managing A1 Policies in all Near |nbh| RT |nbsp| RICs |
| 26 | * Synchronized view of registered "services" (e.g. R-APP, GUI, etc) |
| 27 | * Synchronized view of policy instances for each "service" |
| 28 | * Synchronized view of policy instances in all Near |nbh| RT |nbsp| RICs |
| 29 | * Synchronized view of policy types in all Near |nbh| RT |nbsp| RICs |
| 30 | * Policy Query API (e.g. per Near |nbh| RT |nbsp| RIC, per "service", per policy type) |
| 31 | * An initial interface for unified Near |nbh| RT |nbsp| RIC ID to Near |nbh| RT |nbsp| RIC address mapping. |
| 32 | (Note: may also later act as adaptor to A&AI, CMDBs etc. to "find" Near |nbh| RT |nbsp| RICs - TBC) |
| 33 | * An Initial "O1 ManagedElement" mapping database & interface to find appropriate Near |nbh| RT |nbsp| RIC for RAN elements. |
| 34 | (Note: may also later act as adaptor to A&AI, RuntimeDB, other CMDBs etc. - TBC) |
| 35 | * Monitors all Near |nbh| RT |nbsp| RICs and recovers from inconsistencies (Note: e.g. Near |nbh| RT |nbsp| RIC restarts) |
| 36 | * Support for different Southbound connectors on a per Near |nbh| RT |nbsp| RIC basis. (Note: e.g. different A1 |
| 37 | versions, different Near |nbh| RT |nbsp| RIC versions, different A1 adapters, different or proprietary A1 |
| 38 | controllers/EMSs) |
| 39 | |
| 40 | *************************************** |
| 41 | A1 Policy Management Service - REST NBI |
| 42 | *************************************** |
| 43 | |
| 44 | This is the north bound API of the A1 Policy Management Service ("Policy Agent"). This API allows *services* to interact |
| 45 | with the Policy Agent using REST. |
| 46 | |
| 47 | By registering with the Policy Agent, the Policy Agent takes responsibility for synchronizing the policies created by |
| 48 | the service in the Near |nbh| RT |nbsp| RICs. This means that if a Near |nbh| RT |nbsp| RIC restarts, the Policy Agent |
| 49 | will try to recreate all the policies residing in the Near |nbh| RT |nbsp| RIC once it is started again. If this is not |
| 50 | possible, it will remove all policies belonging to the Near |nbh| RT |nbsp| RIC. |
| 51 | |
| 52 | The Policy Agent also keeps an updated view of the policy types available, and which Near |nbh| RT |nbsp| RICs that |
| 53 | support which types. Also, the Policy Agent can tell if a Managed Element is managed by a certain |
| 54 | Near |nbh| RT |nbsp| RIC. |
| 55 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 56 | The Policy Agent NBI has five distinct parts, described in the sections below: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 57 | |
| 58 | * Service Management |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 59 | * Policy Types |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 60 | * Policy Management |
| 61 | * Near-RT RIC Repository |
| 62 | * Health Check |
| 63 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 64 | ****************** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 65 | Service Management |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 66 | ****************** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 67 | |
| 68 | A service can register itself in the Policy Agent. |
| 69 | |
| 70 | By providing a callback URL the service can get notifications from the Policy Agent. |
| 71 | |
| 72 | A service can also register a "*Keep Alive Interval*", in seconds. By doing this the service promises to call the |
| 73 | Policy Agent's "*Keep Alive*" method, or else create or delete policies, more often than the "*Keep Alive Interval*" |
| 74 | measured in seconds. If the service, for some reason, is not able to do this, the Policy Agent will consider that the |
| 75 | service has died or vanished and will then delete all its policies, both in the internal repository and in the |
| 76 | Near |nbh| RT |nbsp| RICs where they were earlier created. **Note!** |nbsp| If the service does not provide a value for |
| 77 | "*Keep Alive Interval*", then the service maintains full responsibility to delete all of its policies when they are no |
| 78 | longer needed. |
| 79 | |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 80 | /service |
| 81 | ~~~~~~~~ |
| 82 | |
| 83 | PUT |
| 84 | +++ |
| 85 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 86 | Register a service. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 87 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 88 | Definition |
| 89 | """""""""" |
| 90 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 91 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 92 | |
| 93 | /service |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 94 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 95 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 96 | |
| 97 | None. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 98 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 99 | **Body:** (*Required*) |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 100 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 101 | A JSON object (ServiceRegistrationInfo): :: |
| 102 | |
| 103 | { |
| 104 | "callbackUrl": "string", (An empty string means the service will never get any callbacks.) |
| 105 | "keepAliveIntervalSeconds": 0, (0 means the service will always be considered alive.) |
| 106 | "serviceName": "string" (Required, must be unique.) |
| 107 | } |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 108 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 109 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 110 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 111 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 112 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 113 | Service updated. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 114 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 115 | 201: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 116 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 117 | Service created. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 118 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 119 | 400: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 120 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 121 | The ServiceRegistrationInfo is not accepted. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 122 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 123 | Examples |
| 124 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 125 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 126 | **Call**: :: |
| 127 | |
| 128 | curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d '{ |
| 129 | "callbackUrl": "URL", |
| 130 | "keepAliveIntervalSeconds": 0, |
| 131 | "serviceName": "existing" |
| 132 | }' |
| 133 | |
| 134 | **Result**: |
| 135 | |
| 136 | 201: :: |
| 137 | |
| 138 | OK |
| 139 | |
| 140 | **Call**: :: |
| 141 | |
| 142 | curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{}" |
| 143 | |
| 144 | **Result**: |
| 145 | |
| 146 | 400: :: |
| 147 | |
| 148 | Missing mandatory parameter 'serviceName' |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 149 | |
| 150 | /services |
| 151 | ~~~~~~~~~ |
| 152 | |
| 153 | GET |
| 154 | +++ |
| 155 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 156 | Query service information. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 157 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 158 | Definition |
| 159 | """""""""" |
| 160 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 161 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 162 | |
| 163 | /services?name=<service-name> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 164 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 165 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 166 | |
| 167 | name: (*Optional*) |
| 168 | |
| 169 | The name of the service. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 170 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 171 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 172 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 173 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 174 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 175 | Array of JSON objects (ServiceStatus). :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 176 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 177 | { |
| 178 | "callbackUrl": "string", (Callback URL) |
| 179 | "keepAliveIntervalSeconds": 0, (Policy keep alive interval) |
| 180 | "serviceName": "string", (Identity of the service) |
| 181 | "timeSinceLastActivitySeconds": 0 (Time since last invocation by the service) |
| 182 | } |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 183 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 184 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 185 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 186 | Service is not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 187 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 188 | Examples |
| 189 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 190 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 191 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 192 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 193 | curl -X GET "http://localhost:8081/services?name=existing" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 194 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 195 | **Result**: |
| 196 | |
| 197 | 200: :: |
| 198 | |
| 199 | [ |
| 200 | { |
| 201 | "serviceName":"existing", |
| 202 | "keepAliveIntervalSeconds":0, |
| 203 | "timeSinceLastActivitySeconds":7224, |
| 204 | "callbackUrl":"URL" |
| 205 | } |
| 206 | ] |
| 207 | |
| 208 | **Call**: :: |
| 209 | |
| 210 | curl -X GET "http://localhost:8081/services?name=nonexistent" |
| 211 | |
| 212 | Result: |
| 213 | |
| 214 | 404: :: |
| 215 | |
| 216 | Service not found |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 217 | |
| 218 | DELETE |
| 219 | ++++++ |
| 220 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 221 | Delete a service. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 222 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 223 | Definition |
| 224 | """""""""" |
| 225 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 226 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 227 | |
| 228 | /services?name=<service-name> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 229 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 230 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 231 | |
| 232 | name: (*Required*) |
| 233 | |
| 234 | The name of the service. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 235 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 236 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 237 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 238 | 204: |
| 239 | OK |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 240 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 241 | 404: |
| 242 | Service not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 243 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 244 | Examples |
| 245 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 246 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 247 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 248 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 249 | curl -X DELETE "http://localhost:8081/services?name=existing" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 250 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 251 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 252 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 253 | 204: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 254 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 255 | OK |
| 256 | |
| 257 | **Call**: :: |
| 258 | |
| 259 | curl -X DELETE "http://localhost:8081/services?name=nonexistent" |
| 260 | |
| 261 | Result: |
| 262 | |
| 263 | 404: :: |
| 264 | |
| 265 | Could not find service: nonexistent |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 266 | |
| 267 | /services/keepalive |
| 268 | ~~~~~~~~~~~~~~~~~~~ |
| 269 | |
elinuxhenrik | 3d0aa33 | 2020-04-08 08:15:59 +0200 | [diff] [blame] | 270 | PUT |
| 271 | +++ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 272 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 273 | Heart beat from a service. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 274 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 275 | Definition |
| 276 | """""""""" |
| 277 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 278 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 279 | |
| 280 | /services/keepalive?name=<service-name> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 281 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 282 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 283 | |
| 284 | name: (*Required*) |
| 285 | |
| 286 | The name of the service. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 287 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 288 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 289 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 290 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 291 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 292 | OK |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 293 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 294 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 295 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 296 | Service is not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 297 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 298 | Examples |
| 299 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 300 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 301 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 302 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 303 | curl -X PUT "http://localhost:8081/services/keepalive?name=existing" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 304 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 305 | **Result**: |
| 306 | |
| 307 | 200: :: |
| 308 | |
| 309 | OK |
| 310 | |
| 311 | **Call**: :: |
| 312 | |
| 313 | curl -X PUT "http://localhost:8081/services/keepalive?name=nonexistent" |
| 314 | |
| 315 | **Result**: |
| 316 | |
| 317 | 404: :: |
| 318 | |
| 319 | Could not find service: nonexistent |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 320 | |
| 321 | .. _policy-management: |
| 322 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 323 | ************ |
| 324 | Policy Types |
| 325 | ************ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 326 | |
| 327 | Policies are based on types. The set of available policy types is determined by the set of policy types supported by |
| 328 | Near |nbh| RT |nbsp| RICs. At startup, the Policy Agent queries all Near |nbh| RT |nbsp| RICs for their supported types |
| 329 | and stores them in its internal repository. It then checks this at regular intervals to keep the repository of types up |
| 330 | to date. Policy types cannot be created, updated or deleted using this interface since this must be done via the |
| 331 | Near |nbh| RT |nbsp| RICs. |
| 332 | |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 333 | A policy type defines a name and a JSON schema that constrains the content of a policy of that type. |
| 334 | |
| 335 | /policy_types |
| 336 | ~~~~~~~~~~~~~ |
| 337 | |
| 338 | GET |
| 339 | +++ |
| 340 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 341 | Query policy type names. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 342 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 343 | Definition |
| 344 | """""""""" |
| 345 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 346 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 347 | |
| 348 | /policy_types?ric=<name-of-ric> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 349 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 350 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 351 | |
| 352 | ric: (*Optional*) |
| 353 | |
| 354 | The name of the Near |nbh| RT |nbsp| RIC to get types for. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 355 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 356 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 357 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 358 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 359 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 360 | Array of policy type names. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 361 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 362 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 363 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 364 | Near |nbh| RT |nbsp| RIC is not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 365 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 366 | Examples |
| 367 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 368 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 369 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 370 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 371 | curl -X GET "http://localhost:8081/policy_types" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 372 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 373 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 374 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 375 | 200: :: |
| 376 | |
| 377 | [ |
| 378 | "STD_PolicyModelUnconstrained_0.2.0", |
| 379 | "Example_QoETarget_1.0.0", |
| 380 | "ERIC_QoSNudging_0.2.0" |
| 381 | ] |
| 382 | |
| 383 | **Call**: :: |
| 384 | |
| 385 | curl -X GET "http://localhost:8081/policy_types?ric=nonexistent" |
| 386 | |
| 387 | **Result**: |
| 388 | |
| 389 | 404: :: |
| 390 | |
| 391 | org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 392 | |
| 393 | /policy_schema |
| 394 | ~~~~~~~~~~~~~~ |
| 395 | |
| 396 | GET |
| 397 | +++ |
| 398 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 399 | Returns one policy type schema definition. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 400 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 401 | Definition |
| 402 | """""""""" |
| 403 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 404 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 405 | |
| 406 | /policy_schema?id=<name-of-type> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 407 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 408 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 409 | |
| 410 | id: (*Required*) |
| 411 | |
| 412 | The ID of the policy type to get the definition for. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 413 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 414 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 415 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 416 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 417 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 418 | Policy schema as JSON schema. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 419 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 420 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 421 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 422 | Policy type is not found. |
| 423 | |
| 424 | Examples |
| 425 | """""""" |
| 426 | |
| 427 | **Call**: :: |
| 428 | |
| 429 | curl -X GET "http://localhost:8081/policy_schema?id=STD_PolicyModelUnconstrained_0.2.0" |
| 430 | |
| 431 | **Result**: |
| 432 | |
| 433 | 200: :: |
| 434 | |
| 435 | { |
| 436 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 437 | "title": "STD_PolicyModelUnconstrained_0.2.0", |
| 438 | "description": "Standard model of a policy with unconstrained scope id combinations", |
| 439 | "type": "object", |
| 440 | "properties": { |
| 441 | "scope": { |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 442 | "type": "object", |
| 443 | "properties": { |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 444 | "ueId": {"type": "string"}, |
| 445 | "groupId": {"type": "string"} |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 446 | }, |
| 447 | "minProperties": 1, |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 448 | "additionalProperties": false |
| 449 | }, |
| 450 | "qosObjectives": { |
| 451 | "type": "object", |
| 452 | "properties": { |
| 453 | "gfbr": {"type": "number"}, |
| 454 | "mfbr": {"type": "number"} |
| 455 | }, |
| 456 | "additionalProperties": false |
| 457 | }, |
| 458 | "resources": { |
| 459 | "type": "array", |
| 460 | "items": { |
| 461 | "type": "object", |
| 462 | "properties": { |
| 463 | "cellIdList": { |
| 464 | "type": "array", |
| 465 | "minItems": 1, |
| 466 | "uniqueItems": true, |
| 467 | "items": { |
| 468 | "type": "string" |
| 469 | } |
| 470 | }, |
| 471 | "additionalProperties": false, |
| 472 | "required": ["cellIdList"] |
| 473 | } |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 474 | } |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 475 | }, |
| 476 | "minProperties": 1, |
| 477 | "additionalProperties": false, |
| 478 | "required": ["scope"] |
| 479 | } |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 480 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 481 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 482 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 483 | curl -X GET "http://localhost:8081/policy_schema?id=nonexistent" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 484 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 485 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 486 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 487 | 404: :: |
| 488 | |
| 489 | org.oransc.policyagent.exceptions.ServiceException: Could not find type: nonexistent |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 490 | |
| 491 | /policy_schemas |
| 492 | ~~~~~~~~~~~~~~~ |
| 493 | |
| 494 | GET |
| 495 | +++ |
| 496 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 497 | Returns policy type schema definitions. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 498 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 499 | Definition |
| 500 | """""""""" |
| 501 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 502 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 503 | |
| 504 | /policy_schemas?ric=<name-of-ric> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 505 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 506 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 507 | |
| 508 | ric: (*Optional*) |
| 509 | |
| 510 | The name of the Near |nbh| RT |nbsp| RIC to get the definitions for. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 511 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 512 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 513 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 514 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 515 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 516 | An array of policy schemas as JSON schemas. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 517 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 518 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 519 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 520 | Near |nbh| RT |nbsp| RIC is not found. |
| 521 | |
| 522 | Examples |
| 523 | """""""" |
| 524 | |
| 525 | **Call**: :: |
| 526 | |
| 527 | curl -X GET "http://localhost:8081/policy_schemas" |
| 528 | |
| 529 | **Result**: |
| 530 | |
| 531 | 200: :: |
| 532 | |
| 533 | [ |
| 534 | { |
| 535 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 536 | "title": "STD_PolicyModelUnconstrained_0.2.0", |
| 537 | "description": "Standard model of a policy with unconstrained scope id combinations", |
| 538 | "type": "object", |
| 539 | "properties": { |
| 540 | "scope": { |
| 541 | "type": "object", |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 542 | . |
| 543 | . |
| 544 | . |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 545 | } |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 546 | "additionalProperties": false, |
| 547 | "required": ["scope"] |
| 548 | }, |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 549 | . |
| 550 | . |
| 551 | . |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 552 | { |
| 553 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 554 | "title": "Example_QoETarget_1.0.0", |
| 555 | "description": "Example QoE Target policy type", |
| 556 | "type": "object", |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 557 | "properties": { |
| 558 | "scope": { |
| 559 | "type": "object", |
| 560 | . |
| 561 | . |
| 562 | . |
| 563 | } |
| 564 | "additionalProperties": false, |
| 565 | "required": ["scope"] |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | ] |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 570 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 571 | **Call**: :: |
elinuxhenrik | 53e4604 | 2020-04-21 15:14:04 +0200 | [diff] [blame] | 572 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 573 | curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 574 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 575 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 576 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 577 | 404: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 578 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 579 | org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent |
| 580 | |
| 581 | ***************** |
| 582 | Policy Management |
| 583 | ***************** |
| 584 | |
| 585 | Policies can be queried, created, updated, and deleted. A policy is always created in a specific |
| 586 | Near |nbh| RT |nbsp| RIC. |
| 587 | |
| 588 | When a policy is created, the Policy Agent stores information about it in its internal repository. At regular intervals, |
| 589 | it then checks with all Near |nbh| RT |nbsp| RICs that this repository is synchronized. If, for some reason, there is an |
| 590 | inconsistency, the Policy Agent will start a synchronization job and try to reflect the status of the |
| 591 | Near |nbh| RT |nbsp| RIC. If this fails, the Policy Agent will delete all policies for the specific |
| 592 | Near |nbh| RT |nbsp| RIC in the internal repository and set its state to *UNKNOWN*. This means that no interaction with |
| 593 | the Near |nbh| RT |nbsp| RIC is possible until the Policy Agent has been able to contact it again and re-synchronize its |
| 594 | state in the repository. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 595 | |
| 596 | A policy is defined by its type schema. |
| 597 | |
| 598 | Once a service has created a policy, it is the service's responsibility to maintain its life cycle. Since policies are |
| 599 | transient, they will not survive a restart of a Near |nbh| RT |nbsp| RIC. But this is handled by the Policy Agent. When |
| 600 | a Near |nbh| RT |nbsp| RIC has been restarted, the Policy Agent will try to recreate the policies in the |
| 601 | Near |nbh| RT |nbsp| RIC that are stored in its local repository. This means that the service always must delete any |
| 602 | policy it has created. There are only two exceptions, see below: |
| 603 | |
| 604 | - The service has registered a "*Keep Alive Interval*", then its policies will be deleted if it fails to notify the |
| 605 | Policy Agent in due time. |
| 606 | - The Policy Agent completely fails to synchronize with a Near |nbh| RT |nbsp| RIC. |
| 607 | |
| 608 | /policies |
| 609 | ~~~~~~~~~ |
| 610 | |
| 611 | GET |
| 612 | +++ |
| 613 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 614 | Query policies. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 615 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 616 | Definition |
| 617 | """""""""" |
| 618 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 619 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 620 | |
| 621 | /policies?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-type> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 622 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 623 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 624 | |
| 625 | ric: (*Optional*) |
| 626 | |
| 627 | The name of the Near |nbh| RT |nbsp| RIC to get policies for. |
| 628 | |
| 629 | service: (*Optional*) |
| 630 | |
| 631 | The name of the service to get policies for. |
| 632 | |
| 633 | type: (*Optional*) |
| 634 | |
| 635 | The name of the policy type to get policies for. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 636 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 637 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 638 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 639 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 640 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 641 | Array of JSON objects (PolicyInfo). :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 642 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 643 | { |
| 644 | "id": "string", (Identity of the policy) |
| 645 | "json": "object", (The configuration of the policy) |
| 646 | "lastModified": "string", (Timestamp, last modification time) |
| 647 | "ric": "string", (Identity of the target Near |nbh| RT |nbsp| RIC) |
| 648 | "service": "string", (The name of the service owning the policy) |
| 649 | "type": "string" (Name of the policy type) |
| 650 | } |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 651 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 652 | 404: |
| 653 | Near |nbh| RT |nbsp| RIC or policy type not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 654 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 655 | Examples |
| 656 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 657 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 658 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 659 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 660 | curl -X GET "http://localhost:8081/policies?ric=existing" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 661 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 662 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 663 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 664 | 200: :: |
| 665 | |
| 666 | [ |
| 667 | { |
| 668 | "id": "Policy 1", |
| 669 | "json": { |
| 670 | "scope": { |
| 671 | "ueId": "UE 1", |
| 672 | "groupId": "Group 1" |
| 673 | }, |
| 674 | "qosObjectives": { |
| 675 | "gfbr": 1, |
| 676 | "mfbr": 2 |
| 677 | }, |
| 678 | "cellId": "Cell 1" |
| 679 | }, |
| 680 | "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT", |
| 681 | "ric": "existing", |
| 682 | "service": "Service 1", |
| 683 | "type": "STD_PolicyModelUnconstrained_0.2.0" |
| 684 | }, |
| 685 | { |
| 686 | "id": "Policy 2", |
| 687 | "json": { |
| 688 | . |
| 689 | . |
| 690 | . |
| 691 | }, |
| 692 | "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT", |
| 693 | "ric": "existing", |
| 694 | "service": "Service 2", |
| 695 | "type": "Example_QoETarget_1.0.0" |
| 696 | } |
| 697 | ] |
| 698 | |
| 699 | **Call**: :: |
| 700 | |
| 701 | curl -X GET "http://localhost:8081/policies?type=nonexistent" |
| 702 | |
| 703 | **Result**: |
| 704 | |
| 705 | 404: :: |
| 706 | |
| 707 | Policy type not found |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 708 | |
| 709 | /policy |
| 710 | ~~~~~~~ |
| 711 | |
| 712 | GET |
| 713 | +++ |
| 714 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 715 | Returns a policy configuration. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 716 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 717 | Definition |
| 718 | """""""""" |
| 719 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 720 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 721 | |
| 722 | /policy?id=<policy-id> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 723 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 724 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 725 | |
| 726 | id: (*Required*) |
| 727 | |
| 728 | The ID of the policy instance. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 729 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 730 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 731 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 732 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 733 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 734 | JSON object containing policy information. :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 735 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 736 | { |
| 737 | "id": "string", (ID of policy) |
| 738 | "json": "object", (JSON with policy data speified by the type) |
| 739 | "ownerServiceName": "string", (Name of the service that created the policy) |
| 740 | "ric": "string", (Name of the Near |nbh| RT |nbsp| RIC where the policy resides) |
| 741 | "type": "string", (Name of the policy type of the policy) |
| 742 | "lastModified" (Timestamp, last modification time) |
| 743 | } |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 744 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 745 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 746 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 747 | Policy is not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 748 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 749 | Examples |
| 750 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 751 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 752 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 753 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 754 | curl -X GET "http://localhost:8081/policy?id=Policy 1" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 755 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 756 | **Result**: |
| 757 | |
| 758 | 200: :: |
| 759 | |
| 760 | { |
| 761 | "id": "Policy 1", |
| 762 | "json", { |
| 763 | "scope": { |
| 764 | "ueId": "UE1 ", |
| 765 | "cellId": "Cell 1" |
| 766 | }, |
| 767 | "qosObjectives": { |
| 768 | "gfbr": 319.5, |
| 769 | "mfbr": 782.75, |
| 770 | "priorityLevel": 268.5, |
| 771 | "pdb": 44.0 |
| 772 | }, |
| 773 | "qoeObjectives": { |
| 774 | "qoeScore": 329.0, |
| 775 | "initialBuffering": 27.75, |
| 776 | "reBuffFreq": 539.0, |
| 777 | "stallRatio": 343.0 |
| 778 | }, |
| 779 | "resources": [] |
| 780 | }, |
| 781 | "ownerServiceName": "Service 1", |
| 782 | "ric": "ric1", |
| 783 | "type": "STD_PolicyModelUnconstrained_0.2.0", |
| 784 | "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT" |
| 785 | } |
| 786 | |
| 787 | **Call**: :: |
| 788 | |
| 789 | curl -X GET "http://localhost:8081/policy?id=nonexistent" |
| 790 | |
| 791 | **Result**: |
| 792 | |
| 793 | 404: :: |
| 794 | |
| 795 | Policy is not found |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 796 | |
| 797 | PUT |
| 798 | +++ |
| 799 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 800 | Create/Update a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a |
| 801 | "*Keep Alive Interval*" registered. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 802 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 803 | Definition |
| 804 | """""""""" |
| 805 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 806 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 807 | |
| 808 | /policy?id=<policy-id>&ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 809 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 810 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 811 | |
| 812 | id: (*Required*) |
| 813 | |
| 814 | The ID of the policy instance. |
| 815 | |
| 816 | ric: (*Required*) |
| 817 | |
| 818 | The name of the Near |nbh| RT |nbsp| RIC where the policy will be created. |
| 819 | |
| 820 | service: (*Required*) |
| 821 | |
| 822 | The name of the service creating the policy. |
| 823 | |
| 824 | type: (*Optional*) |
| 825 | |
| 826 | The name of the policy type. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 827 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 828 | **Body:** (*Required*) |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 829 | |
| 830 | A JSON object containing the data specified by the type. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 831 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 832 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 833 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 834 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 835 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 836 | Policy updated. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 837 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 838 | 201: |
| 839 | |
| 840 | Policy created. |
| 841 | |
| 842 | 404: |
| 843 | |
| 844 | Near |nbh| RT |nbsp| RIC or policy type is not found. |
| 845 | |
| 846 | 423: |
| 847 | |
| 848 | Near |nbh| RT |nbsp| RIC is not operational. |
| 849 | |
| 850 | Examples |
| 851 | """""""" |
| 852 | |
| 853 | **Call**: :: |
| 854 | |
| 855 | curl -X PUT "http://localhost:8081/policy?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0" |
| 856 | -H "Content-Type: application/json" |
| 857 | -d '{ |
| 858 | "scope": { |
| 859 | "ueId": "UE 1", |
| 860 | "cellId": "Cell 1" |
| 861 | }, |
| 862 | "qosObjectives": { |
| 863 | "gfbr": 319.5, |
| 864 | "mfbr": 782.75, |
| 865 | "priorityLevel": 268.5, |
| 866 | "pdb": 44.0 |
| 867 | }, |
| 868 | "qoeObjectives": { |
| 869 | "qoeScore": 329.0, |
| 870 | "initialBuffering": 27.75, |
| 871 | "reBuffFreq": 539.0, |
| 872 | "stallRatio": 343.0 |
| 873 | }, |
| 874 | "resources": [] |
| 875 | }' |
| 876 | |
| 877 | **Result**: |
| 878 | |
| 879 | 200 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 880 | |
| 881 | DELETE |
| 882 | ++++++ |
| 883 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 884 | Deletes a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a |
| 885 | "*Keep Alive Interval*" registered. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 886 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 887 | Definition |
| 888 | """""""""" |
| 889 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 890 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 891 | |
| 892 | /policy?id=<policy-id> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 893 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 894 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 895 | |
| 896 | id: (*Required*) |
| 897 | |
| 898 | The ID of the policy instance. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 899 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 900 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 901 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 902 | 204: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 903 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 904 | Policy deleted. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 905 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 906 | 404: |
| 907 | |
| 908 | Policy is not found. |
| 909 | |
| 910 | 423: |
| 911 | |
| 912 | Near |nbh| RT |nbsp| RIC is not operational. |
| 913 | |
| 914 | Examples |
| 915 | """""""" |
| 916 | |
| 917 | **Call**: :: |
| 918 | |
| 919 | curl -X DELETE "http://localhost:8081/policy?id=Policy 1" |
| 920 | |
| 921 | **Result**: |
| 922 | |
| 923 | 204 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 924 | |
| 925 | /policy_ids |
| 926 | ~~~~~~~~~~~ |
| 927 | |
| 928 | GET |
| 929 | +++ |
| 930 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 931 | Query policy type IDs. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 932 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 933 | Definition |
| 934 | """""""""" |
| 935 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 936 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 937 | |
| 938 | /policy_ids?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 939 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 940 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 941 | |
| 942 | ric: (*Optional*) |
| 943 | |
| 944 | The name of the Near |nbh| RT |nbsp| RIC to get policies for. |
| 945 | |
| 946 | service: (*Optional*) |
| 947 | |
| 948 | The name of the service to get policies for. |
| 949 | |
| 950 | type: (*Optional*) |
| 951 | |
| 952 | The name of the policy type to get policies for. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 953 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 954 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 955 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 956 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 957 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 958 | Array of policy type names. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 959 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 960 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 961 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 962 | RIC or policy type not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 963 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 964 | Examples |
| 965 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 966 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 967 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 968 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 969 | curl -X GET "http://localhost:8081/policy_ids" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 970 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 971 | **Result**: |
| 972 | |
| 973 | 200: :: |
| 974 | |
| 975 | [ |
| 976 | "Policy 1", |
| 977 | "Policy 2", |
| 978 | "Policy 3" |
| 979 | ] |
| 980 | |
| 981 | **Call**: :: |
| 982 | |
| 983 | curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent" |
| 984 | |
| 985 | **Result**: |
| 986 | |
| 987 | 404: :: |
| 988 | |
| 989 | Ric not found |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 990 | |
| 991 | /policy_status |
| 992 | ~~~~~~~~~~~~~~ |
| 993 | |
| 994 | GET |
| 995 | +++ |
| 996 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 997 | Returns the status of a policy. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 998 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 999 | Definition |
| 1000 | """""""""" |
| 1001 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1002 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1003 | |
| 1004 | /policy_status?id=<policy-id> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1005 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1006 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1007 | |
| 1008 | id: (*Required*) |
| 1009 | |
| 1010 | The ID of the policy. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1011 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1012 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1013 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1014 | 200: |
| 1015 | |
| 1016 | JSON object with policy status. |
| 1017 | |
| 1018 | 404: |
| 1019 | |
| 1020 | Policy not found. |
| 1021 | |
| 1022 | ********************** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1023 | Near-RT RIC Repository |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1024 | ********************** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1025 | |
| 1026 | The Policy Agent keeps an updated view of the Near |nbh| RT |nbsp| RICs that are available in the system. A service can |
| 1027 | find out which Near |nbh| RT |nbsp| RIC that manages a specific element in the network or which |
| 1028 | Near |nbh| RT |nbsp| RICs that support a specific policy type. |
| 1029 | |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1030 | /ric |
| 1031 | ~~~~ |
| 1032 | |
| 1033 | GET |
| 1034 | +++ |
| 1035 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1036 | Returns the name of a Near |nbh| RT |nbsp| RIC managing a specific Mananged Element. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1037 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1038 | Definition |
| 1039 | """""""""" |
| 1040 | |
| 1041 | **URL path:** |
| 1042 | |
| 1043 | /ric?managedElementId=<id-of-managed-element> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1044 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1045 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1046 | |
| 1047 | managedElementId: (*Required*) |
| 1048 | |
| 1049 | The ID of the Managed Element. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1050 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1051 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1052 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1053 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1054 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1055 | Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1056 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1057 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1058 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1059 | No Near |nbh| RT |nbsp| RIC manages the given Managed Element. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1060 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1061 | Examples |
| 1062 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1063 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1064 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1065 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1066 | curl -X GET "http://localhost:8081/ric?managedElementId=Node 1" |
| 1067 | |
| 1068 | **Result**: |
| 1069 | |
| 1070 | 200: :: |
| 1071 | |
| 1072 | Ric 1 |
| 1073 | |
| 1074 | **Call**: :: |
| 1075 | |
| 1076 | curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged" |
| 1077 | |
| 1078 | **Result**: |
| 1079 | |
| 1080 | 404 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1081 | |
| 1082 | /rics |
| 1083 | ~~~~~ |
| 1084 | |
| 1085 | GET |
| 1086 | +++ |
| 1087 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1088 | Query Near |nbh| RT |nbsp| RIC information. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1089 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1090 | Definition |
| 1091 | """""""""" |
| 1092 | |
| 1093 | **URL path:** |
| 1094 | |
| 1095 | /rics?policyType=<name-of-policy-type> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1096 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1097 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1098 | |
| 1099 | policyType: (*Optional*) |
| 1100 | |
| 1101 | The name of the policy type. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1102 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1103 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1104 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1105 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1106 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1107 | Array of JSON objects containing Near |nbh| RT |nbsp| RIC information. :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1108 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1109 | [ |
| 1110 | { |
| 1111 | "managedElementIds": [ |
| 1112 | "string" |
| 1113 | ], |
| 1114 | "policyTypes": [ |
| 1115 | "string" |
| 1116 | ], |
| 1117 | "ricName": "string", |
| 1118 | "state": "string" |
| 1119 | } |
| 1120 | ] |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1121 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1122 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1123 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1124 | Policy type is not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1125 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1126 | Examples |
| 1127 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1128 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1129 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1130 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1131 | curl -X GET "http://localhost:8081/rics?policyType=STD_PolicyModelUnconstrained_0.2.0" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1132 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1133 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1134 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1135 | 200: :: |
| 1136 | |
| 1137 | [ |
| 1138 | { |
| 1139 | "managedElementIds": [ |
| 1140 | "ME 1", |
| 1141 | "ME 2" |
| 1142 | ], |
| 1143 | "policyTypes": [ |
| 1144 | "STD_PolicyModelUnconstrained_0.2.0", |
| 1145 | "Example_QoETarget_1.0.0", |
| 1146 | "ERIC_QoSNudging_0.2.0" |
| 1147 | ], |
| 1148 | "ricName": "Ric 1", |
| 1149 | "state": "AVAILABLE" |
| 1150 | }, |
| 1151 | . |
| 1152 | . |
| 1153 | . |
| 1154 | { |
| 1155 | "managedElementIds": [ |
| 1156 | "ME 3" |
| 1157 | ], |
| 1158 | "policyTypes": [ |
| 1159 | "STD_PolicyModelUnconstrained_0.2.0" |
| 1160 | ], |
| 1161 | "ricName": "Ric X", |
| 1162 | "state": "UNAVAILABLE" |
| 1163 | } |
| 1164 | ] |
| 1165 | |
| 1166 | **Call**: :: |
| 1167 | |
| 1168 | curl -X GET "http://localhost:8081/rics?policyType=nonexistent" |
| 1169 | |
| 1170 | **Result**: |
| 1171 | |
| 1172 | 404: :: |
| 1173 | |
| 1174 | Policy type not found |
| 1175 | |
| 1176 | ************ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1177 | Health Check |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1178 | ************ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1179 | |
| 1180 | The status of the Policy Agent. |
| 1181 | |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1182 | /status |
| 1183 | ~~~~~~~ |
| 1184 | |
| 1185 | GET |
| 1186 | +++ |
| 1187 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1188 | Returns the status of the Policy Agent. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1189 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1190 | Definition |
| 1191 | """""""""" |
| 1192 | |
| 1193 | **URL path:** |
| 1194 | |
| 1195 | /status |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1196 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1197 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1198 | |
| 1199 | None. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1200 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1201 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1202 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1203 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1204 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1205 | Service is living. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1206 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1207 | Examples |
| 1208 | """""""" |
| 1209 | |
| 1210 | **Call**: :: |
| 1211 | |
| 1212 | curl -X GET "http://localhost:8081/status" |
| 1213 | |
| 1214 | **Result**: |
| 1215 | |
| 1216 | 200 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1217 | |
| 1218 | **************** |
| 1219 | A1 through DMaaP |
| 1220 | **************** |
| 1221 | |
| 1222 | The Policy Agent also provides the possibility to use DMaap to handle policies according to the A1 specification. The |
| 1223 | Policy Agent polls the DMaaP Message Router regularly and processes any messages targeted to it. The response is then |
| 1224 | published back to the DMaaP Message Router with the result of the call. |
| 1225 | |
| 1226 | Send Message |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1227 | ~~~~~~~~~~~~ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1228 | |
| 1229 | The message to send is a JSON like the one below. The "*url*" is one of the URLs described under |
| 1230 | :ref:`policy-management`. The "*target*" must always be "*policy-agent*" for the message to be processed by the Policy |
| 1231 | Agent. The "*operation*" can be one of the following: "*GET | PUT | POST | DELETE*". :: |
| 1232 | |
| 1233 | { |
| 1234 | "type": "string", |
| 1235 | "correlationId": "string", |
| 1236 | "target": "string", |
| 1237 | "timestamp": "timestamp", |
| 1238 | "apiVersion": "string", |
| 1239 | "originatorId": "string", |
| 1240 | "requestId": "string", |
| 1241 | "operation": "string", |
| 1242 | "url": "string" |
| 1243 | } |
| 1244 | |
| 1245 | Example |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1246 | +++++++ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1247 | |
| 1248 | To get all policy types for a specific Near |nbh| RT |nbsp| RIC the following message should be sent to DMaaP Message |
| 1249 | Router: :: |
| 1250 | |
| 1251 | { |
| 1252 | "type":"request", |
| 1253 | "correlationId":"c09ac7d1-de62-0016-2000-e63701125557-201", |
| 1254 | "target":"policy-agent", |
| 1255 | "timestamp":"2019-05-14T11:44:51.36Z", |
| 1256 | "apiVersion":"1.0", |
| 1257 | "originatorId":"849e6c6b420", |
| 1258 | "requestId":"23343221", |
| 1259 | "operation":"GET", |
| 1260 | "url":"/policy_schemas?ric=ric_ric-simulator_1" |
| 1261 | } |
| 1262 | |
| 1263 | Receive Message |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1264 | ~~~~~~~~~~~~~~~ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1265 | |
| 1266 | The message the Policy Agent sends back to the DMaaP Message Router is a JSON like the one below. The "*requestId*" |
| 1267 | "*correlationId*", and "*originatorId*" are the same as in the message sent to DMaaP MR. :: |
| 1268 | |
| 1269 | { |
| 1270 | "requestId": "string", |
| 1271 | "correlationId": "string", |
| 1272 | "originatorId": "string", |
| 1273 | "type": "string", |
| 1274 | "message": "string", |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1275 | "type": "string", |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1276 | "timestamp": "string", |
| 1277 | "status": "string" |
| 1278 | } |
| 1279 | |
| 1280 | Example |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1281 | +++++++ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1282 | |
| 1283 | The response containing all policy types for a specific Near |nbh| RT |nbsp| RIC sent to the DMaaP Message Router from |
| 1284 | the Policy Agent: :: |
| 1285 | |
| 1286 | { |
| 1287 | \"requestId\":\"23343221\", |
| 1288 | \"correlationId\":\"c09ac7d1-de62-0016-2000-e63701125557-201\", |
| 1289 | \"originatorId\":\"849e6c6b420\", |
| 1290 | \"type\":\"response\", |
| 1291 | \"message\":\"[ |
| 1292 | { |
| 1293 | \\\"$schema\\\":\\\"http://json-schema.org/draft-07/schema#\\\", |
| 1294 | \\\"description\\\":\\\"QoS policy type\\\", |
| 1295 | \\\"title\\\":\\\"STD_QoSNudging_0.2.0\\\", |
| 1296 | \\\"type\\\":\\\"object\\\", |
| 1297 | \\\"properties\\\":{\\\"scope\\\":{\\\"additionalProperties\\\":true, |
| 1298 | \\\"type\\\":\\\"object\\\", |
| 1299 | \\\"properties\\\":{\\\"qosId\\\":{\\\"type\\\":\\\"string\\\"}, |
| 1300 | \\\"ueId\\\":{\\\"type\\\":\\\"string\\\"}}, |
| 1301 | \\\"required\\\":[\\\"ueId\\\", |
| 1302 | \\\"qosId\\\"]}, |
| 1303 | \\\"statement\\\":{\\\"additionalProperties\\\":false, |
| 1304 | \\\"type\\\":\\\"object\\\", |
| 1305 | \\\"properties\\\":{\\\"priorityLevel\\\":{\\\"type\\\":\\\"number\\\"}}, |
| 1306 | \\\"required\\\":[\\\"priorityLevel\\\"]}} |
| 1307 | } |
| 1308 | ]\", |
| 1309 | \"timestamp\":\"2019-05-14T11:44:51.36Z\", |
| 1310 | \"status\":\"200 OK\" |
| 1311 | } |