efiacor | 0fa0198 | 2019-04-08 14:52:08 +0000 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License.
|
| 2 | .. http://creativecommons.org/licenses/by/4.0
|
| 3 |
|
| 4 | .. _data_router_api_guide:
|
| 5 |
|
| 6 | .. toctree::
|
| 7 | :maxdepth: 2
|
| 8 |
|
| 9 | Offered APIs
|
| 10 | ============
|
| 11 |
|
| 12 | **The API Provisioning Model**
|
| 13 |
|
| 14 | The DMaaP Data Router (DR) provisioning API defines two resource types - the feed and the subscription, each with JSON
|
| 15 | representations. The API models the provisioning data as a collection of feeds that are known to the DR
|
| 16 | (the feeds collection), with each feed containing a collection of the subscriptions to the feed.
|
| 17 | The standard HTTP operations (POST, GET, PUT, and DELETE), used in conjunction with these resource
|
| 18 | representations, allow an API user to create, get information about, modify, and delete feeds and
|
| 19 | subscriptions.
|
| 20 |
|
| 21 | **HTTP Service APIs**
|
| 22 |
|
| 23 | DMaaP Data Router utilizes an HTTPS REST API to service all transactions. HTTPS and REST standards are followed so
|
| 24 | clients as varied as CURL, Java applications and even Web Browsers will work to interact with the Data Router.
|
| 25 |
|
| 26 | **General HTTP Requirements**
|
| 27 |
|
| 28 | A DMaaP Data Router transactions consists of 4 distinct segments, HTTP URL, HTTP Header, HTTP Body (POST/PUT)
|
| 29 | and HTTP Response. The general considerations for each segment are as follows and are required for each
|
| 30 | of the specific transactions described in this section.
|
| 31 |
|
| 32 | **HTTP URL**
|
| 33 |
|
| 34 | http[s]://{serverBaseURL}/{resourcePath}
|
| 35 |
|
| 36 | * The serverBaseURL points to DMaaP Data Router host:port that will service the request.
|
| 37 | * The resourcePath specifies the service that the client is attempting to reach.
|
| 38 |
|
| 39 |
|
| 40 | **HTTP Header**
|
| 41 |
|
| 42 | Specifies HTTP Headers, such as Content-Type, that define the parameters of the HTTP Transaction
|
| 43 |
|
| 44 | **HTTP Body**
|
| 45 |
|
| 46 | The HTTP Body contains the feed content when creating a feed.
|
| 47 |
|
| 48 | **HTTP Authorization**
|
| 49 |
|
| 50 | The user-id:password pair:
|
| 51 |
|
| 52 | * If AAF enabled: A valid AAF AppId to be authenticated and authorized by the AAF CADI framework.
|
| 53 | * If Non AAF : When publishing or retracting a file, a valid `EID Object`_ with publish permissions.
|
| 54 |
|
| 55 | Create a Feed
|
| 56 | -------------
|
| 57 |
|
| 58 | **Description**: Creates a unique feed URL to service the publisher/subscriber model.
|
| 59 |
|
| 60 | .. code-block:: bash
|
| 61 |
|
| 62 | POST /
|
| 63 |
|
| 64 | **Request Parameters:**
|
| 65 |
|
| 66 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 67 | | Field | Description | Param Type | Data Type | MaxLen | Set By | Updatable? | Required | Valid/Example Values |
|
| 68 | +======================+================================+============+==================+========+========+============+==========+===============================+
|
| 69 | | name | Feed name | Body | String | <=20 | Client | N | Y | |
|
| 70 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 71 | | version | Feed version | Body | String | <=20 | Client | N | Y | v1.0.0 |
|
| 72 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 73 | | description | Feed description | Body | String | <=256 | Client | Y | N | |
|
| 74 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 75 | | business description | Business description | Body | String | <=256 | Client | Y | N | |
|
| 76 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 77 | | authorization | Information for authorizing | Body |`Auth Object`_ | | Client | Y | Y | |
|
| 78 | | | publishing requests | | | | | | | |
|
| 79 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 80 | | suspend | Set to true if the feed is in | Body | Boolean | | Client | Y | N | * true |
|
| 81 | | | the suspended state | | | | | | | * false (default) |
|
| 82 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 83 | | group-id | Auth group for feed management | Body | Integer | | Client | Y | N | 0 (default) |
|
| 84 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 85 | | aaf_instance | The instance passed to aaf | Body | String | <=256 | Client | N | N | legacy (default) |
|
| 86 | | | during permission checks | | | | | | | |
|
| 87 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 88 | | Content-Type | To specify type of message | Header | String | | Client | N | Y | application/vnd.dmaap-dr.feed |
|
| 89 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 90 | | publisher | Publisher identity as passed | Header | String | <=8 | DR | N | Y | username |
|
| 91 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | | | | |
|
| 92 | | | creation time | | | | | | | |
|
| 93 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 94 | | Authorization | The user / AppId to be | Header | String | | Client | N | Y if AAF | dcae@dcae.onap.org:{password} |
|
| 95 | | | authorized by the AAF CADI | | | | | | enabled | |
|
| 96 | | | framework | | | | | | | |
|
| 97 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 98 | | X-EXCLUDE-AAF | To determine if the feed to | Header | Boolean | | Client | N | Y if AAF | * true (for legacy feed) |
|
| 99 | | | create is legacy or AAF | | | | | | enabled | * false (for AAF feed) |
|
| 100 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 101 | | Links | URLs related to this feed | Body |`Feed Links Obj`_ | | DR | N | N | |
|
| 102 | +----------------------+--------------------------------+------------+------------------+--------+--------+------------+----------+-------------------------------+
|
| 103 |
|
| 104 | **Response Codes**
|
| 105 |
|
| 106 | * Success:
|
| 107 | 200
|
| 108 |
|
| 109 | * Error:
|
| 110 | See `Response Codes`_
|
| 111 |
|
| 112 | **Consumes**
|
| 113 | application/json
|
| 114 |
|
| 115 | **Produces**
|
| 116 | application/json
|
| 117 |
|
| 118 |
|
| 119 | **Sample Request**
|
| 120 |
|
| 121 | .. code-block:: bash
|
| 122 |
|
| 123 | curl -k -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @createFeed.json https://{host}:{port}
|
| 124 |
|
| 125 | **Sample Body**
|
| 126 |
|
| 127 | .. code-block:: json
|
| 128 |
|
| 129 | {
|
| 130 | "name": "ONAP Data Feed",
|
| 131 | "version": "v1.0",
|
| 132 | "authorization": {
|
| 133 | "classification": "unclassified",
|
| 134 | "endpoint_addrs": [
|
| 135 | ],
|
| 136 | "endpoint_ids": [
|
| 137 | {
|
| 138 | "id": "dradmin",
|
| 139 | "password": "dradmin"
|
| 140 | }
|
| 141 | ]
|
| 142 | }
|
| 143 | }
|
| 144 |
|
| 145 | **Sample Response**
|
| 146 |
|
| 147 | .. code-block:: json
|
| 148 |
|
| 149 | {
|
| 150 | "suspend": false,
|
| 151 | "groupid": 0,
|
| 152 | "description": "",
|
| 153 | "version": "v1.0",
|
| 154 | "authorization": {
|
| 155 | "endpoint_addrs": [
|
| 156 | ],
|
| 157 | "classification": "unclassified",
|
| 158 | "endpoint_ids": [
|
| 159 | {
|
| 160 | "password": "dradmin",
|
| 161 | "id": "dradmin"
|
| 162 | },
|
| 163 | {
|
| 164 | "password": "demo123456!",
|
| 165 | "id": "onap"
|
| 166 | }
|
| 167 | ]
|
| 168 | },
|
| 169 | "name": "ONAP Data Feed",
|
| 170 | "business_description": "",
|
| 171 | "aaf_instance": "legacy",
|
| 172 | "publisher": "dradmin",
|
| 173 | "links": {
|
| 174 | "subscribe": "https://dmaap-dr-prov/subscribe/1",
|
| 175 | "log": "https://dmaap-dr-prov/feedlog/1",
|
| 176 | "publish": "https://dmaap-dr-prov/publish/1",
|
| 177 | "self": "https://dmaap-dr-prov/feed/1"
|
| 178 | }
|
| 179 | }
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 | Update a Feed
|
| 184 | -------------
|
| 185 |
|
| 186 | **Description**: Update a feed with new parameters.
|
| 187 |
|
| 188 | .. code-block:: bash
|
| 189 |
|
| 190 | PUT /feed/{feedId}
|
| 191 |
|
| 192 |
|
| 193 | **Request Parameters:**
|
| 194 |
|
| 195 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 196 | | Field | Description | Param Type | Data Type | MaxLen | Required |
|
| 197 | +========================+=================================+=============+===============+============+=============+
|
| 198 | | name | Feed name | Body | String | <=20 | Y |
|
| 199 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 200 | | description | Feed description | Body | String | <=256 | N |
|
| 201 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 202 | | business description | Business description | Body | String | <=256 | N |
|
| 203 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 204 | | authorization | Information for authorizing | Body |`Auth Object`_ | | Y |
|
| 205 | | | publishing requests | | | | |
|
| 206 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 207 | | suspend | Set to true if the feed is in | Body | Boolean | | N |
|
| 208 | | | the suspended state | | | | |
|
| 209 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 210 | | group-id | Auth group for feed management | Body | Integer | | N |
|
| 211 | | | | | | | |
|
| 212 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 213 | | Content-type | To specify type of message | Header | String | | Y |
|
| 214 | | | (feed,subscriber,publisher) | | | | |
|
| 215 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 216 | | publisher | Publisher identity as passed | Header | String | <=8 | Y |
|
| 217 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | |
|
| 218 | | | creation time | | | | |
|
| 219 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 220 | | Authorization | The user / AppId to be | Header | String | | Y if AAF |
|
| 221 | | | authorized by the AAF CADI | | | | enabled |
|
| 222 | | | framework | | | | |
|
| 223 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 224 |
|
| 225 | **Response Codes**
|
| 226 |
|
| 227 | * Success:
|
| 228 | 200
|
| 229 |
|
| 230 | * Error:
|
| 231 | See `Response Codes`_
|
| 232 |
|
| 233 | **Consumes**
|
| 234 | application/json
|
| 235 |
|
| 236 | **Produces**
|
| 237 | application/json
|
| 238 |
|
| 239 |
|
| 240 | **Sample Request**
|
| 241 |
|
| 242 | .. code-block:: bash
|
| 243 |
|
| 244 | curl -k -X PUT -H "Content-Type: application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" --data-ascii @updateFeed.json --location-trusted https://{host}:{port}/feed/{feedId}
|
| 245 |
|
| 246 | **Sample Body**
|
| 247 |
|
| 248 | .. code-block:: json
|
| 249 |
|
| 250 | {
|
| 251 | "name": "ONAP Data Feed",
|
| 252 | "business_description": "Updated ONAP Feed",
|
| 253 | "groupid": 33,
|
| 254 | "description": "Updated ONAP Feed",
|
| 255 | "authorization": {
|
| 256 | "endpoint_addrs": [
|
| 257 | "10.1.2.3"
|
| 258 | ],
|
| 259 | "classification": "unclassified",
|
| 260 | "endpoint_ids": [
|
| 261 | {
|
| 262 | "password": "dradmin",
|
| 263 | "id": "dradmin"
|
| 264 | },
|
| 265 | {
|
| 266 | "password": "demo123456!",
|
| 267 | "id": "onap"
|
| 268 | }
|
| 269 | ]
|
| 270 | }
|
| 271 | }
|
| 272 |
|
| 273 | **Sample Response**
|
| 274 |
|
| 275 | .. code-block:: json
|
| 276 |
|
| 277 | {
|
| 278 | "suspend": false,
|
| 279 | "groupid": 33,
|
| 280 | "description": "Updated ONAP Feed",
|
| 281 | "authorization": {
|
| 282 | "endpoint_addrs": [
|
| 283 | "10.1.2.3"
|
| 284 | ],
|
| 285 | "classification": "unclassified",
|
| 286 | "endpoint_ids": [
|
| 287 | {
|
| 288 | "password": "dradmin",
|
| 289 | "id": "dradmin"
|
| 290 | },
|
| 291 | {
|
| 292 | "password": "demo123456!",
|
| 293 | "id": "onap"
|
| 294 | }
|
| 295 | ]
|
| 296 | },
|
| 297 | "name": "ONAP Data Feed1",
|
| 298 | "business_description": "Updated ONAP Feed",
|
| 299 | "aaf_instance": "legacy",
|
| 300 | "publisher": "dradmin",
|
| 301 | "links": {
|
| 302 | "subscribe": "https://dmaap-dr-prov/subscribe/1",
|
| 303 | "log": "https://dmaap-dr-prov/feedlog/1",
|
| 304 | "publish": "https://dmaap-dr-prov/publish/1",
|
| 305 | "self": "https://dmaap-dr-prov/feed/1"
|
| 306 | }
|
| 307 | }
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 | Get a Feed
|
| 312 | ----------
|
| 313 |
|
| 314 | **Description**: Retrieves a representation of the specified feed.
|
| 315 |
|
| 316 | .. code-block:: bash
|
| 317 |
|
| 318 | GET /feed/{feedId}
|
| 319 |
|
| 320 |
|
| 321 | **Request Parameters:**
|
| 322 |
|
| 323 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 324 | | Field | Description | Param Type | Data Type | MaxLen | Required |
|
| 325 | +========================+=================================+=============+===============+============+=============+
|
| 326 | | publisher | Publisher identity as passed | Header | String | <=8 | Y |
|
| 327 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | |
|
| 328 | | | creation time | | | | |
|
| 329 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 330 | | Authorization | The user / AppId to be | Header | String | | Y if AAF |
|
| 331 | | | authorized by the AAF CADI | | | | enabled |
|
| 332 | | | framework | | | | |
|
| 333 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 334 |
|
| 335 | **Response Codes**
|
| 336 |
|
| 337 | * Success:
|
| 338 | 200
|
| 339 |
|
| 340 | * Error:
|
| 341 | See `Response Codes`_
|
| 342 |
|
| 343 | **Produces**
|
| 344 | application/json
|
| 345 |
|
| 346 | **Sample Request**
|
| 347 |
|
| 348 | .. code-block:: bash
|
| 349 |
|
| 350 | curl -k -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}
|
| 351 |
|
| 352 | **Sample Response**
|
| 353 |
|
| 354 | .. code-block:: json
|
| 355 |
|
| 356 | {
|
| 357 | "suspend": false,
|
| 358 | "groupid": 33,
|
| 359 | "description": "Updated ONAP Feed",
|
| 360 | "version": "v1.0",
|
| 361 | "authorization": {
|
| 362 | "endpoint_addrs": [
|
| 363 | "10.1.2.3",
|
| 364 | "173.2.33.4"
|
| 365 | ],
|
| 366 | "classification": "unclassified",
|
| 367 | "endpoint_ids": [
|
| 368 | {
|
| 369 | "password": "dradmin",
|
| 370 | "id": "dradmin"
|
| 371 | },
|
| 372 | {
|
| 373 | "password": "demo123456!",
|
| 374 | "id": "onap"
|
| 375 | }
|
| 376 | ]
|
| 377 | },
|
| 378 | "name": "ONAP Data Feed",
|
| 379 | "business_description": "Updated ONAP Feed",
|
| 380 | "aaf_instance": "legacy",
|
| 381 | "publisher": "dradmin",
|
| 382 | "links": {
|
| 383 | "subscribe": "https://dmaap-dr-prov/subscribe/1",
|
| 384 | "log": "https://dmaap-dr-prov/feedlog/1",
|
| 385 | "publish": "https://dmaap-dr-prov/publish/1",
|
| 386 | "self": "https://dmaap-dr-prov/feed/1"
|
| 387 | }
|
| 388 | }
|
| 389 |
|
| 390 |
|
| 391 | Delete a Feed
|
| 392 | -------------
|
| 393 |
|
| 394 | **Description**: Deletes a specified feed
|
| 395 |
|
| 396 | .. code-block:: bash
|
| 397 |
|
| 398 | DELETE /feed/{feedId}
|
| 399 |
|
| 400 |
|
| 401 | **Request Parameters:**
|
| 402 |
|
| 403 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 404 | | Field | Description | Param Type | Data Type | MaxLen | Required |
|
| 405 | +========================+=================================+=============+===============+============+=============+
|
| 406 | | publisher | Publisher identity as passed | Header | String | <=8 | Y |
|
| 407 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | |
|
| 408 | | | creation time | | | | |
|
| 409 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 410 | | Authorization | The user / AppId to be | Header | String | | Y if AAF |
|
| 411 | | | authorized by the AAF CADI | | | | enabled |
|
| 412 | | | framework | | | | |
|
| 413 | +------------------------+---------------------------------+-------------+---------------+------------+-------------+
|
| 414 |
|
| 415 | **Response Codes**
|
| 416 |
|
| 417 | * Success:
|
| 418 | 204
|
| 419 |
|
| 420 | * Error:
|
| 421 | See `Response Codes`_
|
| 422 |
|
| 423 | **Sample Request**
|
| 424 |
|
| 425 | .. code-block:: bash
|
| 426 |
|
| 427 | curl -k -X DELETE -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}
|
| 428 |
|
| 429 |
|
| 430 | Subscribe to Feed
|
| 431 | -----------------
|
| 432 |
|
| 433 | **Description**: Subscribes to a created feed to receive files published to that feed.
|
| 434 |
|
| 435 | .. code-block:: bash
|
| 436 |
|
| 437 | POST /subscribe/{feedId}
|
| 438 |
|
| 439 |
|
| 440 | **Request Parameters:**
|
| 441 |
|
| 442 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 443 | | Field | Description | Param Type | Data Type | MaxLen | Set By | Updatable? | Required | Valid/Example Values |
|
| 444 | +=================+=================================+===============+=================+========+========+============+==========+======================================+
|
| 445 | | feedId | ID for the feed you are | Path | String | | Client | N | Y | 1 |
|
| 446 | | | subscribing to | | | | | | | |
|
| 447 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 448 | | delivery | Address and credentials for | Body | `Del Object`_ | | Client | Y | Y | |
|
| 449 | | | delivery | | | | | | | |
|
| 450 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 451 | | follow_redirect | Set to true if feed redirection | Body | Boolean | | Client | Y | N | * true |
|
| 452 | | | is expected | | | | | | | * false (default) |
|
| 453 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 454 | | metadata_only | Set to true if subscription is | Body | Boolean | | Client | Y | Y | * true |
|
| 455 | | | to receive per-file metadata | | | | | | | * false |
|
| 456 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 457 | | suspend | Set to true if the subscription | Body | Boolean | | Client | Y | N | * true |
|
| 458 | | | is in the suspended state | | | | | | | * false (default) |
|
| 459 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 460 | | decompress | Set to true if the data is to | Body | Boolean | | Client | Y | N | * true |
|
| 461 | | | be decompressed for subscriber | | | | | | | * false (default) |
|
| 462 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 463 | | group-id | Auth group for sub management | Body | Integer | | Client | Y | Y | 22 |
|
| 464 | | | | | | | | | | |
|
| 465 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 466 | | aaf_instance | The instance passed to aaf | Body | String | <=256 | Client | N | N | * legacy (default) |
|
| 467 | | | during permission checks | | | | | | | |
|
| 468 | | | | | | | | | | |
|
| 469 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 470 | | Content-type | To specify type of message | Header | String | | Client | N | Y | application/vnd.dmaap-dr.subscription|
|
| 471 | | | (feed,subscriber,publisher) | | | | | | | |
|
| 472 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 473 | | subscriber | Subscriber identity as passed | Header | String | <=8 | DR | N | Y | username |
|
| 474 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | | | | |
|
| 475 | | | creation time | | | | | | | |
|
| 476 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 477 | | Authorization | The user / AppId to be | Header | String | | Client | N | Y if AAF | dcae@dcae.onap.org:{password} |
|
| 478 | | | authorized by the AAF CADI | | | | | | enabled | |
|
| 479 | | | framework | | | | | | | |
|
| 480 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 481 | | X-EXCLUDE-AAF | To determine if the feed to | Header | Boolean | | Client | N | Y if AAF | * true (for legacy feed) |
|
| 482 | | | create is legacy or AAF | | | | | | enabled | * false (for AAF feed) |
|
| 483 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 484 | | Links | URLs related to this | Body |`Sub Links Obj`_ | | DR | N | N | |
|
| 485 | | | subscription | | | | | | | |
|
| 486 | +-----------------+---------------------------------+---------------+-----------------+--------+--------+------------+----------+--------------------------------------+
|
| 487 |
|
| 488 | **Response Codes**
|
| 489 |
|
| 490 | * Success:
|
| 491 | 201
|
| 492 |
|
| 493 | * Error:
|
| 494 | See `Response Codes`_
|
| 495 |
|
| 496 | **Consumes**
|
| 497 | application/json
|
| 498 |
|
| 499 | **Produces**
|
| 500 | application/json
|
| 501 |
|
| 502 |
|
| 503 | **Sample Request**
|
| 504 |
|
| 505 | .. code-block:: bash
|
| 506 |
|
| 507 | curl -k -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @addSubscriber.json https://{host}:{port}/subscribe/{feedId}
|
| 508 |
|
| 509 | **Sample Body**
|
| 510 |
|
| 511 | .. code-block:: json
|
| 512 |
|
| 513 | {
|
| 514 | "delivery": {
|
| 515 | "url": "http://dmaap-dr-subscriber:7070/",
|
| 516 | "user": "LOGIN",
|
| 517 | "password": "PASSWORD",
|
| 518 | "use100": true
|
| 519 | },
|
| 520 | "metadataOnly": false,
|
| 521 | "groupid": 22,
|
| 522 | "follow_redirect": true,
|
| 523 | "suspend": false,
|
| 524 | "decompress": true
|
| 525 | }
|
| 526 |
|
| 527 | **Sample Response**
|
| 528 |
|
| 529 | .. code-block:: json
|
| 530 |
|
| 531 | {
|
| 532 | "suspend": false,
|
| 533 | "delivery": {
|
| 534 | "use100": true,
|
| 535 | "password": "PASSWORD",
|
| 536 | "user": "LOGIN",
|
| 537 | "url": "http://dmaap-dr-subscriber:7070/"
|
| 538 | },
|
| 539 | "subscriber": "onap",
|
| 540 | "groupid": 1,
|
| 541 | "metadataOnly": false,
|
| 542 | "follow_redirect": true,
|
| 543 | "decompress": true,
|
| 544 | "aaf_instance": "legacy",
|
| 545 | "links": {
|
| 546 | "feed": "https://dmaap-dr-prov/feed/1",
|
| 547 | "log": "https://dmaap-dr-prov/sublog/1",
|
| 548 | "self": "https://dmaap-dr-prov/subs/1"
|
| 549 | },
|
| 550 | "created_date": 1553707279509
|
| 551 | }
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 | Update subscription
|
| 556 | -------------------
|
| 557 |
|
| 558 | **Description**: Update a subscription to a feed.
|
| 559 |
|
| 560 | .. code-block:: bash
|
| 561 |
|
| 562 | PUT /subs/{subId}
|
| 563 |
|
| 564 |
|
| 565 | **Request Parameters:**
|
| 566 |
|
| 567 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 568 | | Field | Description | Param Type | Data Type | MaxLen | Required |
|
| 569 | +=================+=================================+==============+===============+========+=============+
|
| 570 | | subId | ID for the subscription you are | Path | String | | Y |
|
| 571 | | | updating | | | | |
|
| 572 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 573 | | delivery | Address and credentials for | Body | `Del Object`_ | | Y |
|
| 574 | | | delivery | | | | |
|
| 575 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 576 | | follow_redirect | Set to true if feed redirection | Body | Boolean | | N |
|
| 577 | | | is expected | | | | |
|
| 578 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 579 | | metadata_only | Set to true if subscription is | Body | Boolean | | Y |
|
| 580 | | | to receive per-file metadata | | | | |
|
| 581 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 582 | | suspend | Set to true if the subscription | Body | Boolean | | N |
|
| 583 | | | is in the suspended state | | | | |
|
| 584 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 585 | | decompress | Set to true if the data is to | Body | Boolean | | N |
|
| 586 | | | be decompressed for subscriber | | | | |
|
| 587 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 588 | | group-id | Auth group for sub management | Body | Integer | | Y |
|
| 589 | | | | | | | |
|
| 590 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 591 | | Content-type | To specify type of message | Header | String | | Y |
|
| 592 | | | (feed,subscriber,publisher) | | | | |
|
| 593 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 594 | | subscriber | Subscriber identity as passed | Header | String | <=8 | Y |
|
| 595 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | |
|
| 596 | | | creation time | | | | |
|
| 597 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 598 | | Authorization | The user / AppId to be | Header | String | | Y if AAF |
|
| 599 | | | authorized by the AAF CADI | | | | enabled |
|
| 600 | | | framework | | | | |
|
| 601 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 602 | | X-EXCLUDE-AAF | To determine if the feed to | Header | Boolean | | Y if AAF |
|
| 603 | | | create is legacy or AAF | | | | enabled |
|
| 604 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 605 |
|
| 606 | **Response Codes**
|
| 607 |
|
| 608 | * Success:
|
| 609 | 200
|
| 610 |
|
| 611 | * Error:
|
| 612 | See `Response Codes`_
|
| 613 |
|
| 614 | **Consumes**
|
| 615 | application/json
|
| 616 |
|
| 617 | **Produces**
|
| 618 | application/json
|
| 619 |
|
| 620 | **Sample Request**
|
| 621 |
|
| 622 | .. code-block:: bash
|
| 623 |
|
| 624 | curl -k -X PUT -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @updateSubscriber.json https://{host}:{port}/subs/{subId}
|
| 625 |
|
| 626 | **Sample Body**
|
| 627 |
|
| 628 | .. code-block:: json
|
| 629 |
|
| 630 | {
|
| 631 | "delivery": {
|
| 632 | "url": "http://dmaap-dr-subscriber:7070/",
|
| 633 | "user": "NEW_LOGIN",
|
| 634 | "password": "NEW_PASSWORD",
|
| 635 | "use100": false
|
| 636 | },
|
| 637 | "metadataOnly": true,
|
| 638 | "groupid": 67,
|
| 639 | "follow_redirect": false,
|
| 640 | "decompress": false
|
| 641 | }
|
| 642 |
|
| 643 |
|
| 644 | **Sample Response**
|
| 645 |
|
| 646 | .. code-block:: json
|
| 647 |
|
| 648 | {
|
| 649 | "suspend": false,
|
| 650 | "delivery": {
|
| 651 | "use100": false,
|
| 652 | "password": "NEW_PASSWORD",
|
| 653 | "user": "NEW_LOGIN",
|
| 654 | "url": "http://dmaap-dr-subscriber:7070/"
|
| 655 | },
|
| 656 | "subscriber": "onap",
|
| 657 | "groupid": 67,
|
| 658 | "metadataOnly": true,
|
| 659 | "follow_redirect": false,
|
| 660 | "decompress": false,
|
| 661 | "aaf_instance": "legacy",
|
| 662 | "links": {
|
| 663 | "feed": "https://dmaap-dr-prov/feed/1",
|
| 664 | "log": "https://dmaap-dr-prov/sublog/1",
|
| 665 | "self": "https://dmaap-dr-prov/subs/1"
|
| 666 | },
|
| 667 | "created_date": 1553714446614
|
| 668 | }
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 | Get a Subscription
|
| 673 | ------------------
|
| 674 |
|
| 675 | **Description**: Retrieves a representation of the specified subscription.
|
| 676 |
|
| 677 | .. code-block:: bash
|
| 678 |
|
| 679 | GET /subs/{subId}
|
| 680 |
|
| 681 |
|
| 682 | **Request Parameters:**
|
| 683 |
|
| 684 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 685 | | Field | Description | Param Type | Data Type | MaxLen | Required |
|
| 686 | +=================+=================================+==============+===============+========+=============+
|
| 687 | | subscriber | Subscriber identity as passed | Header | String | <=8 | Y |
|
| 688 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | |
|
| 689 | | | creation time | | | | |
|
| 690 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 691 | | Authorization | The user / AppId to be | Header | String | | Y if AAF |
|
| 692 | | | authorized by the AAF CADI | | | | enabled |
|
| 693 | | | framework | | | | |
|
| 694 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 695 |
|
| 696 | **Response Codes**
|
| 697 |
|
| 698 | * Success:
|
| 699 | 200
|
| 700 |
|
| 701 | * Error:
|
| 702 | See `Response Codes`_
|
| 703 |
|
| 704 | **Produces**
|
| 705 | application/json
|
| 706 |
|
| 707 | **Sample Request**
|
| 708 |
|
| 709 | .. code-block:: bash
|
| 710 |
|
| 711 | curl -k -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}
|
| 712 |
|
| 713 | **Sample Response**
|
| 714 |
|
| 715 | .. code-block:: json
|
| 716 |
|
| 717 | {
|
| 718 | "suspend": false,
|
| 719 | "delivery": {
|
| 720 | "use100": false,
|
| 721 | "password": "NEW_PASSWORD",
|
| 722 | "user": "NEW_LOGIN",
|
| 723 | "url": "http://dmaap-dr-subscriber:7070/"
|
| 724 | },
|
| 725 | "subscriber": "onap",
|
| 726 | "groupid": 67,
|
| 727 | "metadataOnly": true,
|
| 728 | "privilegedSubscriber": false,
|
| 729 | "follow_redirect": false,
|
| 730 | "decompress": false,
|
| 731 | "aaf_instance": "legacy",
|
| 732 | "links": {
|
| 733 | "feed": "https://dmaap-dr-prov/feed/2",
|
| 734 | "log": "https://dmaap-dr-prov/sublog/6",
|
| 735 | "self": "https://dmaap-dr-prov/subs/6"
|
| 736 | }
|
| 737 | }
|
| 738 |
|
| 739 |
|
| 740 |
|
| 741 | Delete a subscription
|
| 742 | ---------------------
|
| 743 |
|
| 744 | **Description**: Deletes a specified subscription
|
| 745 |
|
| 746 | .. code-block:: bash
|
| 747 |
|
| 748 | DELETE /subs/{subId}
|
| 749 |
|
| 750 |
|
| 751 | **Request Parameters:**
|
| 752 |
|
| 753 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 754 | | Field | Description | Param Type | Data Type | MaxLen | Required |
|
| 755 | +=================+=================================+==============+===============+========+=============+
|
| 756 | | subscriber | Subscriber identity as passed | Header | String | <=8 | Y |
|
| 757 | | | in X-DMAAP-DR-ON-BEHALF-OF at | | | | |
|
| 758 | | | creation time | | | | |
|
| 759 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 760 | | Authorization | The user / AppId to be | Header | String | | Y if AAF |
|
| 761 | | | authorized by the AAF CADI | | | | enabled |
|
| 762 | | | framework | | | | |
|
| 763 | +-----------------+---------------------------------+--------------+---------------+--------+-------------+
|
| 764 |
|
| 765 | **Response Codes**
|
| 766 |
|
| 767 | * Success:
|
| 768 | 204
|
| 769 |
|
| 770 | * Error:
|
| 771 | See `Response Codes`_
|
| 772 |
|
| 773 | **Sample Request**
|
| 774 |
|
| 775 | .. code-block:: bash
|
| 776 |
|
| 777 | curl -k -X DELETE -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}
|
| 778 |
|
| 779 |
|
| 780 | Publish to Feed
|
| 781 | ---------------
|
| 782 |
|
| 783 | **Description**: Publish data to a given feed
|
| 784 |
|
| 785 | .. code-block:: bash
|
| 786 |
|
| 787 | PUT /publish/{feedId}/{fileId}
|
| 788 |
|
| 789 |
|
| 790 | **Request parameters**
|
| 791 |
|
| 792 | +------------------------+---------------------------------+------------------+------------+--------------+-------------+-------------------------------------------+
|
| 793 | | Name | Description | Param Type | Data Type | MaxLen | Required | Valid/Example Values |
|
| 794 | +========================+=================================+==================+============+==============+=============+===========================================+
|
| 795 | | feedId | ID of the feed you are | Path | String | | Y | |
|
| 796 | | | publishing to | | | | | |
|
| 797 | +------------------------+---------------------------------+------------------+------------+--------------+-------------+-------------------------------------------+
|
| 798 | | fileId | Name of the file when it is | Path | String | | Y | |
|
| 799 | | | published to subscribers | | | | | |
|
| 800 | +------------------------+---------------------------------+------------------+------------+--------------+-------------+-------------------------------------------+
|
| 801 | | Content-type | To specify type of message | Header | String | | Y | application/octet-stream |
|
| 802 | | | format | | | | | |
|
| 803 | +------------------------+---------------------------------+------------------+------------+--------------+-------------+-------------------------------------------+
|
| 804 | | X-DMAAP-DR-META | Metadata for the file. Accepts | Header | String | <=4096 | N | '{“compressionType”: ”gzip”, |
|
| 805 | | | only non nested json objects | | | | | ”id”: 1234, |
|
| 806 | | | of the following type: | | | | | “transferred”: true, |
|
| 807 | | | | | | | | “size”: null }’ |
|
| 808 | | | * Numbers | | | | | |
|
| 809 | | | * Strings | | | | | |
|
| 810 | | | * Lowercase boolean | | | | | |
|
| 811 | | | * null | | | | | |
|
| 812 | +------------------------+---------------------------------+------------------+------------+--------------+-------------+-------------------------------------------+
|
| 813 | | Authorization | An `EID Object`_ with publish | Header | String | | Y | * (legacy Feed) dradmin:dradmin |
|
| 814 | | | permissions. | | | | | * (AAF Feed) dcae@dcae.onap.org:{password}|
|
| 815 | | | If AAF CADI is enabled, use a | | | | | |
|
| 816 | | | valid AAF user/AppId instead. | | | | | |
|
| 817 | +------------------------+---------------------------------+------------------+------------+--------------+-------------+-------------------------------------------+
|
| 818 |
|
| 819 | **Response Codes**
|
| 820 |
|
| 821 | * Success:
|
| 822 | 204
|
| 823 |
|
| 824 | * Error:
|
| 825 | See `Response Codes`_
|
| 826 |
|
| 827 | **Sample Request**
|
| 828 |
|
| 829 | .. code-block:: bash
|
| 830 |
|
| 831 | curl -k -X PUT --user {user}:{password} -H "Content-Type:application/octet-stream" -H "X-DMAAP-DR-META:{\"filetype\":\"txt\"}" --data-binary @sampleFile.txt --post301 --location-trusted https://{host}:{port}/publish/{feedId}/{fileId}
|
| 832 |
|
| 833 |
|
| 834 |
|
| 835 | Delete/Retract a Published file
|
| 836 | -------------------------------
|
| 837 |
|
| 838 | **Description**: Deletes/retracts a specified published file
|
| 839 |
|
| 840 | .. code-block:: bash
|
| 841 |
|
| 842 | DELETE /publish/{feedId}/{fileId}
|
| 843 |
|
| 844 |
|
| 845 | **Request Parameters:**
|
| 846 |
|
| 847 | +-----------------+---------------------------------+--------------+---------------+------------+-------------------------------------------+
|
| 848 | | Field | Description | Param Type | Data Type | Required | Valid/Example Values |
|
| 849 | +=================+=================================+==============+===============+============+===========================================+
|
| 850 | | Authorization | An `EID Object`_ with publish | Header | String | Y | * (legacy Feed) dradmin:dradmin |
|
| 851 | | | permissions. | | | | * (AAF Feed) dcae@dcae.onap.org:{password}|
|
| 852 | | | If AAF CADI is enabled, use a | | | | |
|
| 853 | | | valid AAF user/AppId instead. | | | | |
|
| 854 | +-----------------+---------------------------------+--------------+---------------+------------+-------------------------------------------+
|
| 855 | | feedId | ID of the feed that was | Path | String | Y | |
|
| 856 | | | publishing to | | | | |
|
| 857 | +-----------------+---------------------------------+--------------+---------------+------------+-------------------------------------------+
|
| 858 | | fileId | Name of the file when it was | Path | String | Y | |
|
| 859 | | | published to subscribers | | | | |
|
| 860 | +-----------------+---------------------------------+--------------+---------------+------------+-------------------------------------------+
|
| 861 |
|
| 862 | **Response Codes**
|
| 863 |
|
| 864 | * Success:
|
| 865 | 204
|
| 866 |
|
| 867 | * Error:
|
| 868 | See `Response Codes`_
|
| 869 |
|
| 870 |
|
| 871 | **Sample Request**
|
| 872 |
|
| 873 | .. code-block:: bash
|
| 874 |
|
| 875 | curl -k -X DELETE --user {user}:{password} --location-trusted https://{host}:{port}/publish/{feedId}/{fileId}
|
| 876 |
|
| 877 |
|
| 878 |
|
| 879 | Feed logging
|
| 880 | ------------
|
| 881 |
|
| 882 | **Description**: View logging information for specified feeds, which can be narrowed down with further parameters
|
| 883 |
|
| 884 | .. code-block:: bash
|
| 885 |
|
| 886 | GET /feedlog/{feedId}?{queryParam}
|
| 887 |
|
| 888 |
|
| 889 | **Request parameters**
|
| 890 |
|
| 891 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 892 | | Name | Description | Param Type | Data Type | Required | Valid/Example Values |
|
| 893 | +========================+=================================+==================+============+=============+======================================+
|
| 894 | | feedId | Id of the feed you want | Path | String | Y | 1 |
|
| 895 | | | logs for | | | | |
|
| 896 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 897 | | type | Select records of the | Path | String | N | * pub: Publish attempt |
|
| 898 | | | specified type | | | | * del: Delivery attempt |
|
| 899 | | | | | | | * exp: Delivery expiry |
|
| 900 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 901 | | publishId | Select records with specified | Path | String | N | |
|
| 902 | | | publish id, carried in the | | | | |
|
| 903 | | | X-DMAAP-DR-PUBLISH-ID header | | | | |
|
| 904 | | | from original publish request | | | | |
|
| 905 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 906 | | start | Select records created at or | Path | String | N | A date-time expressed in the format |
|
| 907 | | | after specified date | | | | specified by RFC 3339 |
|
| 908 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 909 | | end | Select records created at or | Path | String | N | A date-time expressed in the format |
|
| 910 | | | before specified date | | | | specified by RFC 3339 |
|
| 911 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 912 | | statusCode | Select records with the | Path | String | N | An HTTP Integer status code or one |
|
| 913 | | | specified statusCode field | | | | of the following special values: |
|
| 914 | | | | | | | |
|
| 915 | | | | | | | * Success: Any code between 200-299 |
|
| 916 | | | | | | | * Redirect: Any code between 300-399 |
|
| 917 | | | | | | | * Failure: Any code > 399 |
|
| 918 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 919 | | expiryReason | Select records with the | Path | String | N | |
|
| 920 | | | specified expiry reason | | | | |
|
| 921 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 922 | | filename | Select published records with | Path | String | N | |
|
| 923 | | | the specified filename | | | | |
|
| 924 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 925 |
|
| 926 | **Response Parameters**
|
| 927 |
|
| 928 | +------------------------+----------------------------------------------+
|
| 929 | | Name | Description |
|
| 930 | +========================+==============================================+
|
| 931 | | type | Record type: |
|
| 932 | | | |
|
| 933 | | | * pub: publication attempt |
|
| 934 | | | * del: delivery attempt |
|
| 935 | | | * exp: delivery expiry |
|
| 936 | +------------------------+----------------------------------------------+
|
| 937 | | date | The UTC date and time at which the record |
|
| 938 | | | was generated, with millisecond resolution |
|
| 939 | | | in the format specified by RFC 3339 |
|
| 940 | +------------------------+----------------------------------------------+
|
| 941 | | publishId | The unique identifier assigned by the DR |
|
| 942 | | | at the time of the initial publication |
|
| 943 | | | request (carried in the X-DMAAP-DR-PUBLISH-ID|
|
| 944 | | | header in the response to the original |
|
| 945 | | | publish request) |
|
| 946 | +------------------------+----------------------------------------------+
|
| 947 | | requestURI | The Request-URI associated with the |
|
| 948 | | | request |
|
| 949 | +------------------------+----------------------------------------------+
|
| 950 | | method | The HTTP method (PUT or DELETE) for the |
|
| 951 | | | request |
|
| 952 | +------------------------+----------------------------------------------+
|
| 953 | | contentType | The media type of the payload of the |
|
| 954 | | | request |
|
| 955 | +------------------------+----------------------------------------------+
|
| 956 | | contentLength | The size (in bytes) of the payload of |
|
| 957 | | | the request |
|
| 958 | +------------------------+----------------------------------------------+
|
| 959 | | sourceIp | The IP address from which the request |
|
| 960 | | | originated |
|
| 961 | +------------------------+----------------------------------------------+
|
| 962 | | endpointId | The identity used to submit a publish |
|
| 963 | | | request to the DR |
|
| 964 | +------------------------+----------------------------------------------+
|
| 965 | | deliveryId | The identity used to submit a delivery |
|
| 966 | | | request to a subscriber endpoint |
|
| 967 | +------------------------+----------------------------------------------+
|
| 968 | | statusCode | The HTTP status code in the response to |
|
| 969 | | | the request. A value of -1 indicates that |
|
| 970 | | | the DR was not able to obtain an HTTP |
|
| 971 | | | status code |
|
| 972 | +------------------------+----------------------------------------------+
|
| 973 | | expiryReason | The reason that delivery attempts were |
|
| 974 | | | discontinued: |
|
| 975 | | | |
|
| 976 | | | * notRetryable: The last delivery attempt |
|
| 977 | | | encountered an error condition for which |
|
| 978 | | | the DR does not make retries. |
|
| 979 | | | * retriesExhausted: The DR reached its |
|
| 980 | | | limit for making further retry attempts |
|
| 981 | +------------------------+----------------------------------------------+
|
| 982 | | attempts | Total number of attempts made before |
|
| 983 | | | delivery attempts were discontinued |
|
| 984 | +------------------------+----------------------------------------------+
|
| 985 | | filename | File name associated with a publish record |
|
| 986 | +------------------------+----------------------------------------------+
|
| 987 |
|
| 988 | **Response Codes**
|
| 989 |
|
| 990 | * Success:
|
| 991 | 200
|
| 992 |
|
| 993 | * Error:
|
| 994 | See `Response Codes`_
|
| 995 |
|
| 996 | **Produces**
|
| 997 | application/json
|
| 998 |
|
| 999 |
|
| 1000 | **Sample Request**
|
| 1001 |
|
| 1002 | .. code-block:: bash
|
| 1003 |
|
| 1004 | curl -k https://{host}:{port}/feedlog/{feedId}?statusCode=204``
|
| 1005 |
|
| 1006 | **Sample Response**
|
| 1007 |
|
| 1008 | .. code-block:: json
|
| 1009 |
|
| 1010 | [
|
| 1011 | {
|
| 1012 | "statusCode": 204,
|
| 1013 | "publishId": "1553715307322.dmaap-dr-node",
|
| 1014 | "requestURI": "https://dmaap-dr-node/publish/1/hello",
|
| 1015 | "sourceIP": "172.19.0.1",
|
| 1016 | "method": "PUT",
|
| 1017 | "contentType": "application/octet-stream",
|
| 1018 | "endpointId": "dradmin",
|
| 1019 | "type": "pub",
|
| 1020 | "date": "2019-03-27T19:35:07.324Z",
|
| 1021 | "contentLength": 14,
|
| 1022 | "fileName": "hello"
|
| 1023 | },
|
| 1024 | {
|
| 1025 | "statusCode": 204,
|
| 1026 | "publishId": "1553715312071.dmaap-dr-node",
|
| 1027 | "requestURI": "https://dmaap-dr-node/publish/2/hello",
|
| 1028 | "sourceIP": "172.19.0.1",
|
| 1029 | "method": "PUT",
|
| 1030 | "contentType": "application/octet-stream",
|
| 1031 | "endpointId": "onap",
|
| 1032 | "type": "pub",
|
| 1033 | "date": "2019-03-27T19:35:12.072Z",
|
| 1034 | "contentLength": 14,
|
| 1035 | "fileName": "hello2"
|
| 1036 | }
|
| 1037 | ]
|
| 1038 |
|
| 1039 |
|
| 1040 | Subscription logging
|
| 1041 | --------------------
|
| 1042 |
|
| 1043 | **Description**: View logging information for specified subscriptions, which can be narrowed down with further parameters
|
| 1044 |
|
| 1045 | .. code-block:: bash
|
| 1046 |
|
| 1047 | GET /sublog/{subId}?{queryParam}
|
| 1048 |
|
| 1049 |
|
| 1050 | **Request parameters**
|
| 1051 |
|
| 1052 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1053 | | Name | Description | Param Type | Data Type | Required | Valid/Example Values |
|
| 1054 | +========================+=================================+==================+============+=============+======================================+
|
| 1055 | | subId | Id of the subscription you want | Path | String | Y | 1 |
|
| 1056 | | | logs for | | | | |
|
| 1057 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1058 | | type | Select records of the | Path | String | N | * pub: Publish attempt |
|
| 1059 | | | specified type | | | | * del: Delivery attempt |
|
| 1060 | | | | | | | * exp: Delivery expiry |
|
| 1061 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1062 | | publishId | Select records with specified | Path | String | N | |
|
| 1063 | | | publish id, carried in the | | | | |
|
| 1064 | | | X-DMAAP-DR-PUBLISH-ID header | | | | |
|
| 1065 | | | from original publish request | | | | |
|
| 1066 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1067 | | start | Select records created at or | Path | String | N | A date-time expressed in the format |
|
| 1068 | | | after specified date | | | | specified by RFC 3339 |
|
| 1069 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1070 | | end | Select records created at or | Path | String | N | A date-time expressed in the format |
|
| 1071 | | | before specified date | | | | specified by RFC 3339 |
|
| 1072 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1073 | | statusCode | Select records with the | Path | String | N | An Http Integer status code or one |
|
| 1074 | | | specified statusCode field | | | | of the following special values: |
|
| 1075 | | | | | | | |
|
| 1076 | | | | | | | * Success: Any code between 200-299 |
|
| 1077 | | | | | | | * Redirect: Any code between 300-399 |
|
| 1078 | | | | | | | * Failure: Any code > 399 |
|
| 1079 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1080 | | expiryReason | Select records with the | Path | String | N | |
|
| 1081 | | | specified expiry reason | | | | |
|
| 1082 | +------------------------+---------------------------------+------------------+------------+-------------+--------------------------------------+
|
| 1083 |
|
| 1084 | Response Parameters
|
| 1085 | -------------------
|
| 1086 |
|
| 1087 | +------------------------+---------------------------------------------+
|
| 1088 | | Name | Description |
|
| 1089 | +========================+=============================================+
|
| 1090 | | type | Record type: |
|
| 1091 | | | |
|
| 1092 | | | * pub: publication attempt |
|
| 1093 | | | * del: delivery attempt |
|
| 1094 | | | * exp: delivery expiry |
|
| 1095 | +------------------------+---------------------------------------------+
|
| 1096 | | date | The UTC date and time at which the record |
|
| 1097 | | | was generated, with millisecond resolution |
|
| 1098 | | | in the format specified by RFC 3339 |
|
| 1099 | +------------------------+---------------------------------------------+
|
| 1100 | | publishId | The unique identifier assigned by the DR |
|
| 1101 | | | at the time of the initial publication |
|
| 1102 | | | request(carried in the X-DMAAP-DR-PUBLISH-ID|
|
| 1103 | | | header in the response to the original |
|
| 1104 | | | publish request) to a feed log URL or |
|
| 1105 | | | subscription log URL known to the system |
|
| 1106 | +------------------------+---------------------------------------------+
|
| 1107 | | requestURI | The Request-URI associated with the |
|
| 1108 | | | request |
|
| 1109 | +------------------------+---------------------------------------------+
|
| 1110 | | method | The HTTP method (PUT or DELETE) for the |
|
| 1111 | | | request |
|
| 1112 | +------------------------+---------------------------------------------+
|
| 1113 | | contentType | The media type of the payload of the |
|
| 1114 | | | request |
|
| 1115 | +------------------------+---------------------------------------------+
|
| 1116 | | contentLength | The size (in bytes) of the payload of |
|
| 1117 | | | the request |
|
| 1118 | +------------------------+---------------------------------------------+
|
| 1119 | | sourceIp | The IP address from which the request |
|
| 1120 | | | originated |
|
| 1121 | +------------------------+---------------------------------------------+
|
| 1122 | | endpointId | The identity used to submit a publish |
|
| 1123 | | | request to the DR |
|
| 1124 | +------------------------+---------------------------------------------+
|
| 1125 | | deliveryId | The identity used to submit a delivery |
|
| 1126 | | | request to a subscriber endpoint |
|
| 1127 | +------------------------+---------------------------------------------+
|
| 1128 | | statusCode | The HTTP status code in the response to |
|
| 1129 | | | the request. A value of -1 indicates that |
|
| 1130 | | | the DR was not able to obtain an HTTP |
|
| 1131 | | | status code |
|
| 1132 | +------------------------+---------------------------------------------+
|
| 1133 | | expiryReason | The reason that delivery attempts were |
|
| 1134 | | | discontinued: |
|
| 1135 | | | |
|
| 1136 | | | * notRetryable: The last delivery attempt |
|
| 1137 | | | encountered an error condition for which |
|
| 1138 | | | the DR does not make retries. |
|
| 1139 | | | * retriesExhausted: The DR reached its |
|
| 1140 | | | limit for making further retry attempts |
|
| 1141 | +------------------------+---------------------------------------------+
|
| 1142 | | attempts | Total number of attempts made before |
|
| 1143 | | | delivery attempts were discontinued |
|
| 1144 | +------------------------+---------------------------------------------+
|
| 1145 |
|
| 1146 | **Response Codes**
|
| 1147 |
|
| 1148 | * Success:
|
| 1149 | 200
|
| 1150 |
|
| 1151 | * Error:
|
| 1152 | See `Response Codes`_
|
| 1153 |
|
| 1154 | **Produces**
|
| 1155 | application/json
|
| 1156 |
|
| 1157 | **Sample Request**
|
| 1158 |
|
| 1159 | .. code-block:: bash
|
| 1160 |
|
| 1161 | curl -k https://{host}:{port}/sublog/{subId}?statusCode=204
|
| 1162 |
|
| 1163 | **Sample Response**
|
| 1164 |
|
| 1165 | .. code-block:: json
|
| 1166 |
|
| 1167 | [
|
| 1168 | {
|
| 1169 | "statusCode": 204,
|
| 1170 | "publishId": "1553715307322.dmaap-dr-node",
|
| 1171 | "requestURI": "https://dmaap-dr-node/publish/1/hello",
|
| 1172 | "sourceIP": "172.19.0.1",
|
| 1173 | "method": "PUT",
|
| 1174 | "contentType": "application/octet-stream",
|
| 1175 | "endpointId": "dradmin",
|
| 1176 | "type": "pub",
|
| 1177 | "date": "2019-03-27T19:35:07.324Z",
|
| 1178 | "contentLength": 14,
|
| 1179 | "fileName": "hello"
|
| 1180 | },
|
| 1181 | {
|
| 1182 | "statusCode": 204,
|
| 1183 | "publishId": "1553715312071.dmaap-dr-node",
|
| 1184 | "requestURI": "https://dmaap-dr-node/publish/2/hello",
|
| 1185 | "sourceIP": "172.19.0.1",
|
| 1186 | "method": "PUT",
|
| 1187 | "contentType": "application/octet-stream",
|
| 1188 | "endpointId": "onap",
|
| 1189 | "type": "pub",
|
| 1190 | "date": "2019-03-27T19:35:12.072Z",
|
| 1191 | "contentLength": 14,
|
| 1192 | "fileName": "hello2"
|
| 1193 | }
|
| 1194 | ]
|
| 1195 |
|
| 1196 |
|
| 1197 | **Feed Authorization Object**
|
| 1198 |
|
| 1199 | .. _`Auth Object`:
|
| 1200 |
|
| 1201 | +----------------+-----------------+--------------------------------+------------------------------+
|
| 1202 | | Field | Type | Description | Restrictions |
|
| 1203 | +================+=================+================================+==============================+
|
| 1204 | | classification | string | An indicator of the feed’s | Length <=32 |
|
| 1205 | | | | data security classification | |
|
| 1206 | +----------------+-----------------+--------------------------------+------------------------------+
|
| 1207 | | endpoint_ids |`EID Object`_ [] | Array of objects defining the | At least 1 id in the array |
|
| 1208 | | | | identities that are allowed | |
|
| 1209 | | | | to publish to this feed | |
|
| 1210 | +----------------+-----------------+--------------------------------+------------------------------+
|
| 1211 | | endpoint_addrs | string[] | Array of IP addresses or IP | Each string must be a valid |
|
| 1212 | | | | subnetwork addresses that | textual representation of |
|
| 1213 | | | | are allowed to publish to this | IPv4 or IPv6 host address or |
|
| 1214 | | | | feed; an empty array indicates | subnetwork address. |
|
| 1215 | | | | that publish requests are | |
|
| 1216 | | | | permitted from any IP address | |
|
| 1217 | +----------------+-----------------+--------------------------------+------------------------------+
|
| 1218 |
|
| 1219 |
|
| 1220 | **Endpoint Identity Object**
|
| 1221 |
|
| 1222 | .. _`EID Object`:
|
| 1223 |
|
| 1224 | +----------+--------+--------------------------+--------------+
|
| 1225 | | Field | Type | Description | Restrictions |
|
| 1226 | +==========+========+==========================+==============+
|
| 1227 | | id | string | Publishing endpoint | Length <= 20 |
|
| 1228 | | | | identifier | |
|
| 1229 | +----------+--------+--------------------------+--------------+
|
| 1230 | | password | string | Password associated with | Length <= 32 |
|
| 1231 | | | | id | |
|
| 1232 | +----------+--------+--------------------------+--------------+
|
| 1233 |
|
| 1234 |
|
| 1235 | **Feed Links Object**
|
| 1236 |
|
| 1237 | .. _`Feed Links Obj`:
|
| 1238 |
|
| 1239 | +-----------+---------------------------------------------------+----------------+
|
| 1240 | | Field | Description | Symbolic Name |
|
| 1241 | +===========+===================================================+================+
|
| 1242 | | self | URL pointing to this feed, used for updating and | <feedURL> |
|
| 1243 | | | deleting the feed. | |
|
| 1244 | +-----------+---------------------------------------------------+----------------+
|
| 1245 | | publish | URL for publishing requests for this feed | <publishURL> |
|
| 1246 | +-----------+---------------------------------------------------+----------------+
|
| 1247 | | subscribe | URL for subscribing to this feed | <subscribeURL> |
|
| 1248 | +-----------+---------------------------------------------------+----------------+
|
| 1249 | | log | URL for accessing log information about this feed | <feedLogURL> |
|
| 1250 | +-----------+---------------------------------------------------+----------------+
|
| 1251 |
|
| 1252 |
|
| 1253 | **Delivery Object**
|
| 1254 |
|
| 1255 | .. _`Del Object`:
|
| 1256 |
|
| 1257 | +----------+---------+-----------------------------------------------+-------------------------------------+
|
| 1258 | | Field | Type | Description | Restrictions |
|
| 1259 | +==========+=========+===============================================+=====================================+
|
| 1260 | | url | string | URL to which deliveries for this subscription | length <= 256 |
|
| 1261 | | | | should be directed Valid HTTPS URL | |
|
| 1262 | +----------+---------+-----------------------------------------------+-------------------------------------+
|
| 1263 | | user | string | User ID to be passed in the Authorization | Length <= 20 |
|
| 1264 | | | | header when deliveries are made | |
|
| 1265 | +----------+---------+-----------------------------------------------+-------------------------------------+
|
| 1266 | | password | string | Password to be passed in the Authorization | Length <= 32 |
|
| 1267 | | | | header when deliveries are made | |
|
| 1268 | +----------+---------+-----------------------------------------------+-------------------------------------+
|
| 1269 | | use100 | boolean | Flag indicating whether the DR should use | Must be: true to use 100-continue |
|
| 1270 | | | | the HTTP 100-continue feature | |
|
| 1271 | | | | | false to disable using 100-continue |
|
| 1272 | +----------+---------+-----------------------------------------------+-------------------------------------+
|
| 1273 |
|
| 1274 |
|
| 1275 | **Sub Links Object**
|
| 1276 |
|
| 1277 | .. _`Sub Links Obj`:
|
| 1278 |
|
| 1279 | +-----------+---------------------------------------------------+-------------------+
|
| 1280 | | Field | Description | Symbolic Name |
|
| 1281 | +===========+===================================================+===================+
|
| 1282 | | self | URL pointing to this subscription, used for | <subscriptionURL> |
|
| 1283 | | | updating and deleting the subscription. | |
|
| 1284 | +-----------+---------------------------------------------------+-------------------+
|
| 1285 | | feed | URL of the feed to which this subscription | <feedURL> |
|
| 1286 | | | applies; the same URL as the <feedURL> in the | |
|
| 1287 | | | representation of the feed | |
|
| 1288 | +-----------+---------------------------------------------------+-------------------+
|
| 1289 | | log | URL for accessing log information about this | <subLogURL> |
|
| 1290 | | | subscription | |
|
| 1291 | +-----------+---------------------------------------------------+-------------------+
|
| 1292 |
|
| 1293 |
|
| 1294 | **Response/Error Codes**
|
| 1295 |
|
| 1296 | .. _`Response Codes`:
|
| 1297 |
|
| 1298 | +------------------------+-------------------------------------------+
|
| 1299 | | Response statusCode | Response Description |
|
| 1300 | +========================+===========================================+
|
| 1301 | | 200 to 299 | Success Response |
|
| 1302 | +------------------------+-------------------------------------------+
|
| 1303 | | 400 | Bad request - The request is defective in |
|
| 1304 | | | some way. Possible causes: |
|
| 1305 | | | |
|
| 1306 | | | * JSON object in request body does not |
|
| 1307 | | | conform to the spec. |
|
| 1308 | | | * Invalid parameter value in query string |
|
| 1309 | +------------------------+-------------------------------------------+
|
| 1310 | | 401 | Indicates that the request was missing the|
|
| 1311 | | | Authorization header or, if the header |
|
| 1312 | | | was presented, the credentials were not |
|
| 1313 | | | acceptable |
|
| 1314 | +------------------------+-------------------------------------------+
|
| 1315 | | 403 | Forbidden - The request failed |
|
| 1316 | | | authorization. |
|
| 1317 | | | Possible causes: |
|
| 1318 | | | |
|
| 1319 | | | * Request originated from an unauthorized |
|
| 1320 | | | IP address |
|
| 1321 | | | * Client certificate subject is not on |
|
| 1322 | | | the API’s authorized list. |
|
| 1323 | | | * X-DMAAP-DR-ON-BEHALF-OF identity is not |
|
| 1324 | | | authorized to perform |
|
| 1325 | +------------------------+-------------------------------------------+
|
| 1326 | | 404 | Not Found - The Request-URI does not point|
|
| 1327 | | | to a resource that is known to the API. |
|
| 1328 | +------------------------+-------------------------------------------+
|
| 1329 | | 405 | Method Not Allowed - The HTTP method in |
|
| 1330 | | | the request is not supported for the |
|
| 1331 | | | resource addressed by the Request-URI. |
|
| 1332 | +------------------------+-------------------------------------------+
|
| 1333 | | 406 | Not Acceptable - The request has an Accept|
|
| 1334 | | | header indicating that the requester will |
|
| 1335 | | | not accept a response with |
|
| 1336 | | | application/vnd.dmaap-dr.log-list content.|
|
| 1337 | +------------------------+-------------------------------------------+
|
| 1338 | | 415 | Unsupported Media Type - The media type in|
|
| 1339 | | | the requests Content-Type header is not |
|
| 1340 | | | appropriate for the request. |
|
| 1341 | +------------------------+-------------------------------------------+
|
| 1342 | | 500 | Internal Server Error - The DR API server |
|
| 1343 | | | encountered an internal error and could |
|
| 1344 | | | not complete the request. |
|
| 1345 | +------------------------+-------------------------------------------+
|
| 1346 | | 503 | Service Unavailable - The DR API service |
|
| 1347 | | | is currently unavailable |
|
| 1348 | +------------------------+-------------------------------------------+
|
| 1349 | | -1 | Failed Delivery |
|
| 1350 | +------------------------+-------------------------------------------+ |