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 | |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 22 | The A1 Policy Management Service ("Policy Agent") is an SMO/NONRTRIC service above the NONRTRIC A1 Adapter/Controller |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 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. |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 32 | (Note: may also later act as adapter to A&AI, CMDBs etc. to "find" Near |nbh| RT |nbsp| RICs - TBC) |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 33 | * An Initial "O1 ManagedElement" mapping database & interface to find appropriate Near |nbh| RT |nbsp| RIC for RAN elements. |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 34 | (Note: may also later act as adapter to A&AI, RuntimeDB, other CMDBs etc. - TBC) |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 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 | |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 588 | A policy is defined by its policy type schema. |
| 589 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 590 | When a policy is created, the Policy Agent stores information about it in its internal repository. At regular intervals, |
| 591 | it then checks with all Near |nbh| RT |nbsp| RICs that this repository is synchronized. If, for some reason, there is an |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 592 | inconsistency, the Policy Agent will start a synchronization job and try to inconsistency, the Policy Agent will start a |
| 593 | synchronization job and try to reset the Near |nbh| RT |nbsp| RIC to its last-known-good status. If this fails, the |
| 594 | Policy Agent will clear all policies for the specific Near |nbh| RT |nbsp| RIC in the internal repository and set its |
| 595 | state to *UNKNOWN*. This means that no interaction with the Near |nbh| RT |nbsp| RIC is possible until the Policy Agent |
| 596 | has been able to contact it again and re-synchronize its state in the repository. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 597 | |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 598 | Once a service has created a policy, it is the service's responsibility to maintain its life cycle. When a Near |nbh| RT |
| 599 | |nbsp| RIC has been restarted, the Policy Agent will try to recreate policies in the Near |nbh| RT |nbsp| RIC according |
| 600 | to the policies maintained in its local repository. |
| 601 | This means that the service must delete any policies it has created. |
| 602 | A policy may be created as a "transient policy", whereby if this policy "disappears" at any stage it will not be |
| 603 | re-synchronized to the Near |nbh| RT |nbsp| RIC. |
| 604 | For example, this is useful if the policy should not survive a restart of the Near |nbh| RT |nbsp| RIC. |
| 605 | A non-transient policy will continue to be maintained in the Near |nbh| RT |nbsp| RIC until it is explicitly deleted |
| 606 | (or the service that created it fails to update its Keep Alive status). |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 607 | |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 608 | There are some exceptions where policy instances are not re-synchronized after a Near |nbh| RT |nbsp| RIC restart or |
| 609 | when some inconsistency is identified: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 610 | |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 611 | - The service has registered a "*Keep Alive Interval*", but the service then fails to update its Keep Alive status. |
| 612 | - The Policy Agent completely fails to synchronize with a Near |nbh| RT |nbsp| RIC, as described above. |
| 613 | - Policies that are marked as transient policies. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 614 | |
| 615 | /policies |
| 616 | ~~~~~~~~~ |
| 617 | |
| 618 | GET |
| 619 | +++ |
| 620 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 621 | Query policies. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 622 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 623 | Definition |
| 624 | """""""""" |
| 625 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 626 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 627 | |
| 628 | /policies?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-type> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 629 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 630 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 631 | |
| 632 | ric: (*Optional*) |
| 633 | |
| 634 | The name of the Near |nbh| RT |nbsp| RIC to get policies for. |
| 635 | |
| 636 | service: (*Optional*) |
| 637 | |
| 638 | The name of the service to get policies for. |
| 639 | |
| 640 | type: (*Optional*) |
| 641 | |
| 642 | The name of the policy type to get policies for. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 643 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 644 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 645 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 646 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 647 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 648 | Array of JSON objects (PolicyInfo). :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 649 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 650 | { |
| 651 | "id": "string", (Identity of the policy) |
| 652 | "json": "object", (The configuration of the policy) |
| 653 | "lastModified": "string", (Timestamp, last modification time) |
| 654 | "ric": "string", (Identity of the target Near |nbh| RT |nbsp| RIC) |
| 655 | "service": "string", (The name of the service owning the policy) |
| 656 | "type": "string" (Name of the policy type) |
| 657 | } |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 658 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 659 | 404: |
| 660 | Near |nbh| RT |nbsp| RIC or policy type not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 661 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 662 | Examples |
| 663 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 664 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 665 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 666 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 667 | curl -X GET "http://localhost:8081/policies?ric=existing" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 668 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 669 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 670 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 671 | 200: :: |
| 672 | |
| 673 | [ |
| 674 | { |
| 675 | "id": "Policy 1", |
| 676 | "json": { |
| 677 | "scope": { |
| 678 | "ueId": "UE 1", |
| 679 | "groupId": "Group 1" |
| 680 | }, |
| 681 | "qosObjectives": { |
| 682 | "gfbr": 1, |
| 683 | "mfbr": 2 |
| 684 | }, |
| 685 | "cellId": "Cell 1" |
| 686 | }, |
| 687 | "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT", |
| 688 | "ric": "existing", |
| 689 | "service": "Service 1", |
| 690 | "type": "STD_PolicyModelUnconstrained_0.2.0" |
| 691 | }, |
| 692 | { |
| 693 | "id": "Policy 2", |
| 694 | "json": { |
| 695 | . |
| 696 | . |
| 697 | . |
| 698 | }, |
| 699 | "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT", |
| 700 | "ric": "existing", |
| 701 | "service": "Service 2", |
| 702 | "type": "Example_QoETarget_1.0.0" |
| 703 | } |
| 704 | ] |
| 705 | |
| 706 | **Call**: :: |
| 707 | |
| 708 | curl -X GET "http://localhost:8081/policies?type=nonexistent" |
| 709 | |
| 710 | **Result**: |
| 711 | |
| 712 | 404: :: |
| 713 | |
| 714 | Policy type not found |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 715 | |
| 716 | /policy |
| 717 | ~~~~~~~ |
| 718 | |
| 719 | GET |
| 720 | +++ |
| 721 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 722 | Returns a policy configuration. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 723 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 724 | Definition |
| 725 | """""""""" |
| 726 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 727 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 728 | |
| 729 | /policy?id=<policy-id> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 730 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 731 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 732 | |
| 733 | id: (*Required*) |
| 734 | |
| 735 | The ID of the policy instance. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 736 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 737 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 738 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 739 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 740 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 741 | JSON object containing policy information. :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 742 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 743 | { |
| 744 | "id": "string", (ID of policy) |
| 745 | "json": "object", (JSON with policy data speified by the type) |
| 746 | "ownerServiceName": "string", (Name of the service that created the policy) |
| 747 | "ric": "string", (Name of the Near |nbh| RT |nbsp| RIC where the policy resides) |
| 748 | "type": "string", (Name of the policy type of the policy) |
| 749 | "lastModified" (Timestamp, last modification time) |
| 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 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 753 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 754 | Policy is not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 755 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 756 | Examples |
| 757 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 758 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 759 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 760 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 761 | curl -X GET "http://localhost:8081/policy?id=Policy 1" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 762 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 763 | **Result**: |
| 764 | |
| 765 | 200: :: |
| 766 | |
| 767 | { |
| 768 | "id": "Policy 1", |
| 769 | "json", { |
| 770 | "scope": { |
| 771 | "ueId": "UE1 ", |
| 772 | "cellId": "Cell 1" |
| 773 | }, |
| 774 | "qosObjectives": { |
| 775 | "gfbr": 319.5, |
| 776 | "mfbr": 782.75, |
| 777 | "priorityLevel": 268.5, |
| 778 | "pdb": 44.0 |
| 779 | }, |
| 780 | "qoeObjectives": { |
| 781 | "qoeScore": 329.0, |
| 782 | "initialBuffering": 27.75, |
| 783 | "reBuffFreq": 539.0, |
| 784 | "stallRatio": 343.0 |
| 785 | }, |
| 786 | "resources": [] |
| 787 | }, |
| 788 | "ownerServiceName": "Service 1", |
| 789 | "ric": "ric1", |
| 790 | "type": "STD_PolicyModelUnconstrained_0.2.0", |
| 791 | "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT" |
| 792 | } |
| 793 | |
| 794 | **Call**: :: |
| 795 | |
| 796 | curl -X GET "http://localhost:8081/policy?id=nonexistent" |
| 797 | |
| 798 | **Result**: |
| 799 | |
| 800 | 404: :: |
| 801 | |
| 802 | Policy is not found |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 803 | |
| 804 | PUT |
| 805 | +++ |
| 806 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 807 | Create/Update a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a |
| 808 | "*Keep Alive Interval*" registered. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 809 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 810 | Definition |
| 811 | """""""""" |
| 812 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 813 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 814 | |
| 815 | /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] | 816 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 817 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 818 | |
| 819 | id: (*Required*) |
| 820 | |
| 821 | The ID of the policy instance. |
| 822 | |
| 823 | ric: (*Required*) |
| 824 | |
| 825 | The name of the Near |nbh| RT |nbsp| RIC where the policy will be created. |
| 826 | |
| 827 | service: (*Required*) |
| 828 | |
| 829 | The name of the service creating the policy. |
| 830 | |
maximesson | d7b9167 | 2020-05-14 16:09:57 +0200 | [diff] [blame^] | 831 | transient: (*Optional*) |
| 832 | |
| 833 | If the policy is transient or not (boolean defaulted to false). |
| 834 | A policy is transient if it will be forgotten when the service needs to reconnect to the Near |nbh| RT |nbsp| RIC. |
| 835 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 836 | type: (*Optional*) |
| 837 | |
| 838 | The name of the policy type. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 839 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 840 | **Body:** (*Required*) |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 841 | |
| 842 | A JSON object containing the data specified by the type. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 843 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 844 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 845 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 846 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 847 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 848 | Policy updated. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 849 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 850 | 201: |
| 851 | |
| 852 | Policy created. |
| 853 | |
| 854 | 404: |
| 855 | |
| 856 | Near |nbh| RT |nbsp| RIC or policy type is not found. |
| 857 | |
| 858 | 423: |
| 859 | |
| 860 | Near |nbh| RT |nbsp| RIC is not operational. |
| 861 | |
| 862 | Examples |
| 863 | """""""" |
| 864 | |
| 865 | **Call**: :: |
| 866 | |
| 867 | curl -X PUT "http://localhost:8081/policy?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0" |
| 868 | -H "Content-Type: application/json" |
| 869 | -d '{ |
| 870 | "scope": { |
| 871 | "ueId": "UE 1", |
| 872 | "cellId": "Cell 1" |
| 873 | }, |
| 874 | "qosObjectives": { |
| 875 | "gfbr": 319.5, |
| 876 | "mfbr": 782.75, |
| 877 | "priorityLevel": 268.5, |
| 878 | "pdb": 44.0 |
| 879 | }, |
| 880 | "qoeObjectives": { |
| 881 | "qoeScore": 329.0, |
| 882 | "initialBuffering": 27.75, |
| 883 | "reBuffFreq": 539.0, |
| 884 | "stallRatio": 343.0 |
| 885 | }, |
| 886 | "resources": [] |
| 887 | }' |
| 888 | |
| 889 | **Result**: |
| 890 | |
| 891 | 200 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 892 | |
| 893 | DELETE |
| 894 | ++++++ |
| 895 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 896 | Deletes a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a |
| 897 | "*Keep Alive Interval*" registered. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 898 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 899 | Definition |
| 900 | """""""""" |
| 901 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 902 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 903 | |
| 904 | /policy?id=<policy-id> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 905 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 906 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 907 | |
| 908 | id: (*Required*) |
| 909 | |
| 910 | The ID of the policy instance. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 911 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 912 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 913 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 914 | 204: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 915 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 916 | Policy deleted. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 917 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 918 | 404: |
| 919 | |
| 920 | Policy is not found. |
| 921 | |
| 922 | 423: |
| 923 | |
| 924 | Near |nbh| RT |nbsp| RIC is not operational. |
| 925 | |
| 926 | Examples |
| 927 | """""""" |
| 928 | |
| 929 | **Call**: :: |
| 930 | |
| 931 | curl -X DELETE "http://localhost:8081/policy?id=Policy 1" |
| 932 | |
| 933 | **Result**: |
| 934 | |
| 935 | 204 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 936 | |
| 937 | /policy_ids |
| 938 | ~~~~~~~~~~~ |
| 939 | |
| 940 | GET |
| 941 | +++ |
| 942 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 943 | Query policy type IDs. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 944 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 945 | Definition |
| 946 | """""""""" |
| 947 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 948 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 949 | |
| 950 | /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] | 951 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 952 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 953 | |
| 954 | ric: (*Optional*) |
| 955 | |
| 956 | The name of the Near |nbh| RT |nbsp| RIC to get policies for. |
| 957 | |
| 958 | service: (*Optional*) |
| 959 | |
| 960 | The name of the service to get policies for. |
| 961 | |
| 962 | type: (*Optional*) |
| 963 | |
| 964 | The name of the policy type to get policies for. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 965 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 966 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 967 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 968 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 969 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 970 | Array of policy type names. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 971 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 972 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 973 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 974 | RIC or policy type not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 975 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 976 | Examples |
| 977 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 978 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 979 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 980 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 981 | curl -X GET "http://localhost:8081/policy_ids" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 982 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 983 | **Result**: |
| 984 | |
| 985 | 200: :: |
| 986 | |
| 987 | [ |
| 988 | "Policy 1", |
| 989 | "Policy 2", |
| 990 | "Policy 3" |
| 991 | ] |
| 992 | |
| 993 | **Call**: :: |
| 994 | |
| 995 | curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent" |
| 996 | |
| 997 | **Result**: |
| 998 | |
| 999 | 404: :: |
| 1000 | |
| 1001 | Ric not found |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1002 | |
| 1003 | /policy_status |
| 1004 | ~~~~~~~~~~~~~~ |
| 1005 | |
| 1006 | GET |
| 1007 | +++ |
| 1008 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1009 | Returns the status of a policy. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1010 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1011 | Definition |
| 1012 | """""""""" |
| 1013 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1014 | **URL path:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1015 | |
| 1016 | /policy_status?id=<policy-id> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1017 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1018 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1019 | |
| 1020 | id: (*Required*) |
| 1021 | |
| 1022 | The ID of the policy. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1023 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1024 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1025 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1026 | 200: |
| 1027 | |
| 1028 | JSON object with policy status. |
| 1029 | |
| 1030 | 404: |
| 1031 | |
| 1032 | Policy not found. |
| 1033 | |
| 1034 | ********************** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1035 | Near-RT RIC Repository |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1036 | ********************** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1037 | |
| 1038 | The Policy Agent keeps an updated view of the Near |nbh| RT |nbsp| RICs that are available in the system. A service can |
| 1039 | find out which Near |nbh| RT |nbsp| RIC that manages a specific element in the network or which |
| 1040 | Near |nbh| RT |nbsp| RICs that support a specific policy type. |
| 1041 | |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1042 | /ric |
| 1043 | ~~~~ |
| 1044 | |
| 1045 | GET |
| 1046 | +++ |
| 1047 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1048 | 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] | 1049 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1050 | Definition |
| 1051 | """""""""" |
| 1052 | |
| 1053 | **URL path:** |
| 1054 | |
| 1055 | /ric?managedElementId=<id-of-managed-element> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1056 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1057 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1058 | |
| 1059 | managedElementId: (*Required*) |
| 1060 | |
| 1061 | The ID of the Managed Element. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1062 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1063 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1064 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1065 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1066 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1067 | Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1068 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1069 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1070 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1071 | No Near |nbh| RT |nbsp| RIC manages the given Managed Element. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1072 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1073 | Examples |
| 1074 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1075 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1076 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1077 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1078 | curl -X GET "http://localhost:8081/ric?managedElementId=Node 1" |
| 1079 | |
| 1080 | **Result**: |
| 1081 | |
| 1082 | 200: :: |
| 1083 | |
| 1084 | Ric 1 |
| 1085 | |
| 1086 | **Call**: :: |
| 1087 | |
| 1088 | curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged" |
| 1089 | |
| 1090 | **Result**: |
| 1091 | |
| 1092 | 404 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1093 | |
| 1094 | /rics |
| 1095 | ~~~~~ |
| 1096 | |
| 1097 | GET |
| 1098 | +++ |
| 1099 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1100 | Query Near |nbh| RT |nbsp| RIC information. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1101 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1102 | Definition |
| 1103 | """""""""" |
| 1104 | |
| 1105 | **URL path:** |
| 1106 | |
| 1107 | /rics?policyType=<name-of-policy-type> |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1108 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1109 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1110 | |
| 1111 | policyType: (*Optional*) |
| 1112 | |
| 1113 | The name of the policy type. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1114 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1115 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1116 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1117 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1118 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1119 | Array of JSON objects containing Near |nbh| RT |nbsp| RIC information. :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1120 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1121 | [ |
| 1122 | { |
| 1123 | "managedElementIds": [ |
| 1124 | "string" |
| 1125 | ], |
| 1126 | "policyTypes": [ |
| 1127 | "string" |
| 1128 | ], |
| 1129 | "ricName": "string", |
| 1130 | "state": "string" |
| 1131 | } |
| 1132 | ] |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1133 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1134 | 404: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1135 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1136 | Policy type is not found. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1137 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1138 | Examples |
| 1139 | """""""" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1140 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1141 | **Call**: :: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1142 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1143 | curl -X GET "http://localhost:8081/rics?policyType=STD_PolicyModelUnconstrained_0.2.0" |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1144 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1145 | **Result**: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1146 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1147 | 200: :: |
| 1148 | |
| 1149 | [ |
| 1150 | { |
| 1151 | "managedElementIds": [ |
| 1152 | "ME 1", |
| 1153 | "ME 2" |
| 1154 | ], |
| 1155 | "policyTypes": [ |
| 1156 | "STD_PolicyModelUnconstrained_0.2.0", |
| 1157 | "Example_QoETarget_1.0.0", |
| 1158 | "ERIC_QoSNudging_0.2.0" |
| 1159 | ], |
| 1160 | "ricName": "Ric 1", |
| 1161 | "state": "AVAILABLE" |
| 1162 | }, |
| 1163 | . |
| 1164 | . |
| 1165 | . |
| 1166 | { |
| 1167 | "managedElementIds": [ |
| 1168 | "ME 3" |
| 1169 | ], |
| 1170 | "policyTypes": [ |
| 1171 | "STD_PolicyModelUnconstrained_0.2.0" |
| 1172 | ], |
| 1173 | "ricName": "Ric X", |
| 1174 | "state": "UNAVAILABLE" |
| 1175 | } |
| 1176 | ] |
| 1177 | |
| 1178 | **Call**: :: |
| 1179 | |
| 1180 | curl -X GET "http://localhost:8081/rics?policyType=nonexistent" |
| 1181 | |
| 1182 | **Result**: |
| 1183 | |
| 1184 | 404: :: |
| 1185 | |
| 1186 | Policy type not found |
| 1187 | |
| 1188 | ************ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1189 | Health Check |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1190 | ************ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1191 | |
| 1192 | The status of the Policy Agent. |
| 1193 | |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1194 | /status |
| 1195 | ~~~~~~~ |
| 1196 | |
| 1197 | GET |
| 1198 | +++ |
| 1199 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1200 | Returns the status of the Policy Agent. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1201 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1202 | Definition |
| 1203 | """""""""" |
| 1204 | |
| 1205 | **URL path:** |
| 1206 | |
| 1207 | /status |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1208 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1209 | **Parameters:** |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1210 | |
| 1211 | None. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1212 | |
elinuxhenrik | fea065a | 2020-04-20 16:46:26 +0200 | [diff] [blame] | 1213 | **Responses:** |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1214 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1215 | 200: |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1216 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1217 | Service is living. |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1218 | |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1219 | Examples |
| 1220 | """""""" |
| 1221 | |
| 1222 | **Call**: :: |
| 1223 | |
| 1224 | curl -X GET "http://localhost:8081/status" |
| 1225 | |
| 1226 | **Result**: |
| 1227 | |
| 1228 | 200 |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1229 | |
| 1230 | **************** |
| 1231 | A1 through DMaaP |
| 1232 | **************** |
| 1233 | |
| 1234 | The Policy Agent also provides the possibility to use DMaap to handle policies according to the A1 specification. The |
| 1235 | Policy Agent polls the DMaaP Message Router regularly and processes any messages targeted to it. The response is then |
| 1236 | published back to the DMaaP Message Router with the result of the call. |
| 1237 | |
| 1238 | Send Message |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1239 | ~~~~~~~~~~~~ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1240 | |
| 1241 | The message to send is a JSON like the one below. The "*url*" is one of the URLs described under |
| 1242 | :ref:`policy-management`. The "*target*" must always be "*policy-agent*" for the message to be processed by the Policy |
| 1243 | Agent. The "*operation*" can be one of the following: "*GET | PUT | POST | DELETE*". :: |
| 1244 | |
| 1245 | { |
| 1246 | "type": "string", |
| 1247 | "correlationId": "string", |
| 1248 | "target": "string", |
| 1249 | "timestamp": "timestamp", |
| 1250 | "apiVersion": "string", |
| 1251 | "originatorId": "string", |
| 1252 | "requestId": "string", |
| 1253 | "operation": "string", |
| 1254 | "url": "string" |
| 1255 | } |
| 1256 | |
| 1257 | Example |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1258 | +++++++ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1259 | |
| 1260 | To get all policy types for a specific Near |nbh| RT |nbsp| RIC the following message should be sent to DMaaP Message |
| 1261 | Router: :: |
| 1262 | |
| 1263 | { |
| 1264 | "type":"request", |
| 1265 | "correlationId":"c09ac7d1-de62-0016-2000-e63701125557-201", |
| 1266 | "target":"policy-agent", |
| 1267 | "timestamp":"2019-05-14T11:44:51.36Z", |
| 1268 | "apiVersion":"1.0", |
| 1269 | "originatorId":"849e6c6b420", |
| 1270 | "requestId":"23343221", |
| 1271 | "operation":"GET", |
| 1272 | "url":"/policy_schemas?ric=ric_ric-simulator_1" |
| 1273 | } |
| 1274 | |
| 1275 | Receive Message |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1276 | ~~~~~~~~~~~~~~~ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1277 | |
| 1278 | The message the Policy Agent sends back to the DMaaP Message Router is a JSON like the one below. The "*requestId*" |
| 1279 | "*correlationId*", and "*originatorId*" are the same as in the message sent to DMaaP MR. :: |
| 1280 | |
| 1281 | { |
| 1282 | "requestId": "string", |
| 1283 | "correlationId": "string", |
| 1284 | "originatorId": "string", |
| 1285 | "type": "string", |
| 1286 | "message": "string", |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1287 | "type": "string", |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1288 | "timestamp": "string", |
| 1289 | "status": "string" |
| 1290 | } |
| 1291 | |
| 1292 | Example |
elinuxhenrik | d64e33d | 2020-04-22 18:05:07 +0200 | [diff] [blame] | 1293 | +++++++ |
elinuxhenrik | e0fab9a | 2020-03-31 17:59:49 +0200 | [diff] [blame] | 1294 | |
| 1295 | The response containing all policy types for a specific Near |nbh| RT |nbsp| RIC sent to the DMaaP Message Router from |
| 1296 | the Policy Agent: :: |
| 1297 | |
| 1298 | { |
| 1299 | \"requestId\":\"23343221\", |
| 1300 | \"correlationId\":\"c09ac7d1-de62-0016-2000-e63701125557-201\", |
| 1301 | \"originatorId\":\"849e6c6b420\", |
| 1302 | \"type\":\"response\", |
| 1303 | \"message\":\"[ |
| 1304 | { |
| 1305 | \\\"$schema\\\":\\\"http://json-schema.org/draft-07/schema#\\\", |
| 1306 | \\\"description\\\":\\\"QoS policy type\\\", |
| 1307 | \\\"title\\\":\\\"STD_QoSNudging_0.2.0\\\", |
| 1308 | \\\"type\\\":\\\"object\\\", |
| 1309 | \\\"properties\\\":{\\\"scope\\\":{\\\"additionalProperties\\\":true, |
| 1310 | \\\"type\\\":\\\"object\\\", |
| 1311 | \\\"properties\\\":{\\\"qosId\\\":{\\\"type\\\":\\\"string\\\"}, |
| 1312 | \\\"ueId\\\":{\\\"type\\\":\\\"string\\\"}}, |
| 1313 | \\\"required\\\":[\\\"ueId\\\", |
| 1314 | \\\"qosId\\\"]}, |
| 1315 | \\\"statement\\\":{\\\"additionalProperties\\\":false, |
| 1316 | \\\"type\\\":\\\"object\\\", |
| 1317 | \\\"properties\\\":{\\\"priorityLevel\\\":{\\\"type\\\":\\\"number\\\"}}, |
| 1318 | \\\"required\\\":[\\\"priorityLevel\\\"]}} |
| 1319 | } |
| 1320 | ]\", |
| 1321 | \"timestamp\":\"2019-05-14T11:44:51.36Z\", |
| 1322 | \"status\":\"200 OK\" |
| 1323 | } |