efiacor | 248a9f1 | 2022-10-25 11:46:34 +0100 | [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 | .. Copyright (C) 2022 Nordix Foundation |
| 4 | |
| 5 | Architecture |
| 6 | ============ |
| 7 | |
| 8 | .. |
| 9 | * This section is used to describe a software component from a high level |
| 10 | view of capability, common usage scenarios, and interactions with other |
| 11 | components required in the usage scenarios. |
| 12 | |
| 13 | * The architecture section is typically: provided in a platform-component |
| 14 | and sdk collections; and referenced from developer and user guides. |
| 15 | |
| 16 | * This note must be removed after content has been added. |
| 17 | |
| 18 | |
| 19 | Capabilities |
| 20 | ------------ |
| 21 | |
| 22 | The SDC Distribution client is a library that applications can use to simplify the handling of |
| 23 | distribution related notifications from/to SDC and to download artifacts from SDC based on those notification. |
| 24 | |
| 25 | .. note:: |
| 26 | |
| 27 | As of version 2.0.0, the client uses kafka as it's message bus to publish/subscribe to/from the |
| 28 | relevant SDC distribution topics. |
| 29 | |
| 30 | All previous releases of the client use DMaaP Message Router as it's message bus. |
| 31 | |
| 32 | Usage Scenarios |
| 33 | --------------- |
| 34 | - **Get Distribution Notification event** |
| 35 | |
| 36 | The client polls the relevant NOTIFICATION topic for distribution events sent from SDC. |
| 37 | |
| 38 | - **Get Deployment Artifact from SDC** |
| 39 | |
| 40 | Once a new notification event is received, the client will download the relevant artifacts that it |
| 41 | has defined as part of it configuration. |
| 42 | |
| 43 | - **Send Distribution Status event** |
| 44 | |
| 45 | As part of the processing of the downloaded artifacts, the client will publish it's progress to SDC |
| 46 | via the relevant STATUS topic. |
| 47 | Once the download has ben successfully completed, the client must publish it's final response |
| 48 | COMPONENT_DONE_OK to the STATUS topic. |
| 49 | |
| 50 | |
| 51 | Interactions |
| 52 | ------------ |
| 53 | |
| 54 | Kafka |
| 55 | ^^^^^ |
| 56 | The client uses kafka as it's messaging bus to publish and subscribe to the relevant SDC topics. |
| 57 | |
| 58 | .. _SDCE-6 Swagger api: https://docs.onap.org/projects/onap-sdc/en/latest/_downloads/4eca2a3848d70e58566570a5ef889efb/swagger-sdce-6.json |
| 59 | .. _SDCE-7 Swagger api: https://docs.onap.org/projects/onap-sdc/en/latest/_downloads/542e76906472dae2e00adfad5fc7d879/swagger-sdce-7.json |
| 60 | |
| 61 | SDC |
| 62 | ^^^ |
| 63 | **The client interacts with the following SDC apis on initialization:** |
| 64 | |
| 65 | - ``/sdc/v1/artifactTypes`` |
| 66 | |
| 67 | Get the current artifact types from SDC to validate against the clients configured list. |
| 68 | |
| 69 | See `SDCE-6 Swagger api`_ for more details |
| 70 | |
| 71 | - ``/sdc/v1/distributionKafkaData`` |
| 72 | |
| 73 | Get the kafka distribution config from SDC to be used during publish and subscribe |
| 74 | |
| 75 | See `SDCE-6 Swagger api`_ for more details |
| 76 | |
| 77 | .. image:: ../images/sdc_client_init.png |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | **The client interacts with the following SDC apis during distribution:** |
| 83 | |
| 84 | - ``/sdc/v1/catalog/services/{serviceName}/{serviceVersion}/resourceInstances/{resourceInstanceName}/artifacts/{artifactName}`` |
| 85 | |
| 86 | Get the artifact for a particular resource instance defined in the artifactUrl of the notification event |
| 87 | |
| 88 | See `SDCE-7 Swagger api`_ for more details |
| 89 | |
| 90 | - ``/sdc/v1/catalog/services/{serviceName}/{serviceVersion}/artifacts/{artifactName}`` |
| 91 | |
| 92 | Get the artifact defined in the artifactUrl of the notification event |
| 93 | |
| 94 | See `SDCE-7 Swagger api`_ for more details |
| 95 | |
| 96 | |
| 97 | .. image:: ../images/sdc_distrib_flow.png |