Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +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 |
ToineSiebelink | 74eed2c | 2023-08-31 17:38:52 +0100 | [diff] [blame] | 3 | .. Copyright (C) 2021-2023 Nordix Foundation |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 4 | |
| 5 | .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING |
Ruslan Kashapov | 55dc654 | 2021-03-02 16:48:41 +0200 | [diff] [blame] | 6 | .. _design: |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 7 | |
| 8 | |
Ruslan Kashapov | 55dc654 | 2021-03-02 16:48:41 +0200 | [diff] [blame] | 9 | CPS Design |
| 10 | ########## |
| 11 | |
| 12 | .. toctree:: |
| 13 | :maxdepth: 1 |
| 14 | |
| 15 | Offered APIs |
| 16 | ============ |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 17 | |
niamhcore | c1904c1 | 2021-10-11 16:38:53 +0100 | [diff] [blame] | 18 | CPS supports the public APIs listed in the following sections. |
| 19 | |
| 20 | CPS-Core |
| 21 | -------- |
| 22 | |
| 23 | CPS-Core functionality. |
Rishi.Chail | 85aebca | 2021-02-24 15:10:58 +0000 | [diff] [blame] | 24 | |
shivasubedi | 44beaa3 | 2021-09-13 15:16:30 +0100 | [diff] [blame] | 25 | :download:`CPS Rest OpenApi Specification <api/swagger/cps/openapi.yaml>` |
| 26 | |
niamhcore | c1904c1 | 2021-10-11 16:38:53 +0100 | [diff] [blame] | 27 | CPS-NCMP |
| 28 | -------- |
| 29 | |
| 30 | XNF data access and module information. |
| 31 | |
shivasubedi | 44beaa3 | 2021-09-13 15:16:30 +0100 | [diff] [blame] | 32 | :download:`CPS NCMP RestOpenApi Specification <api/swagger/ncmp/openapi.yaml>` |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 33 | |
niamhcore | c1904c1 | 2021-10-11 16:38:53 +0100 | [diff] [blame] | 34 | CPS-NCMP-Inventory |
| 35 | ------------------ |
| 36 | |
| 37 | DMI-Plugin Inventory. |
| 38 | |
| 39 | :download:`CPS NCMP RestOpenApi Inventory Specification <api/swagger/ncmp/openapi-inventory.yaml>` |
| 40 | |
lukegleeson | e1308ac | 2021-09-30 13:36:37 +0100 | [diff] [blame] | 41 | View Offered APIs |
| 42 | ----------------- |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 43 | |
Rishi.Chail | 85aebca | 2021-02-24 15:10:58 +0000 | [diff] [blame] | 44 | The standard for API definition in the RESTful API world is the OpenAPI Specification (OAS). |
Rishi.Chail | 4359d28 | 2021-03-03 16:36:26 +0000 | [diff] [blame] | 45 | The OAS 3, which is based on the original "Swagger Specification", is being widely used in API developments. |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 46 | |
Ruslan Kashapov | 55dc654 | 2021-03-02 16:48:41 +0200 | [diff] [blame] | 47 | Specification can be accessed using following URI: |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 48 | |
| 49 | .. code-block:: bash |
| 50 | |
lukegleeson | e1308ac | 2021-09-30 13:36:37 +0100 | [diff] [blame] | 51 | http://<hostname>:<port>/v3/api-docs?group=cps-docket |
| 52 | |
niamhcore | c1904c1 | 2021-10-11 16:38:53 +0100 | [diff] [blame] | 53 | Additionally, the Swagger User Interface can be found at the following URI. The component may be changed between CPS-Core, CPS-NCMP |
| 54 | and CPS-NCMP-Inventory using the drop down table in the top right: |
lukegleeson | e1308ac | 2021-09-30 13:36:37 +0100 | [diff] [blame] | 55 | |
| 56 | .. code-block:: bash |
| 57 | |
| 58 | http://<hostname>:<port>/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/ |
| 59 | |
| 60 | Consumed APIs |
niamhcore | c1904c1 | 2021-10-11 16:38:53 +0100 | [diff] [blame] | 61 | ============= |
lukegleeson | e1308ac | 2021-09-30 13:36:37 +0100 | [diff] [blame] | 62 | |
ToineSiebelink | 8593bae | 2024-07-01 17:50:54 +0100 | [diff] [blame] | 63 | DMI-Plugin |
| 64 | ---------- |
lukegleeson | e1308ac | 2021-09-30 13:36:37 +0100 | [diff] [blame] | 65 | |
ToineSiebelink | 8593bae | 2024-07-01 17:50:54 +0100 | [diff] [blame] | 66 | DMI-Plugin is a REST based interface which is used to provide integration |
| 67 | and allow the DMI registry API's have access to the corresponding NCMP API's within CPS Core. |
| 68 | More information on the DMI-Plugins offered APIs can be found on the :ref:`DMI-Plugin's Design Page <onap-cps-ncmp-dmi-plugin:design>`. |
| 69 | |
| 70 | Policy-Executor |
| 71 | --------------- |
| 72 | |
| 73 | .. toctree:: |
| 74 | :maxdepth: 1 |
| 75 | |
| 76 | policy-executor.rst |
ToineSiebelink | 98c0787 | 2021-04-20 17:33:09 +0100 | [diff] [blame] | 77 | |
| 78 | CPS Path |
| 79 | ======== |
| 80 | |
| 81 | Several CPS APIs use the cps-path (or cpsPath in Java API) parameter. |
| 82 | The CPS Path is described in detail in :doc:`cps-path`. |
lukegleeson | de29474 | 2022-07-25 11:00:11 +0100 | [diff] [blame] | 83 | |
Arpit Singh | 4d42d68 | 2024-02-06 16:54:50 +0530 | [diff] [blame] | 84 | CPS Delta |
| 85 | ========= |
| 86 | |
| 87 | CPS Delta feature provides the ability to find the delta/difference between two JSON configurations. |
| 88 | The CPS Delta feature is described in detail in :doc:`cps-delta-feature`. |
| 89 | |
lukegleeson | de29474 | 2022-07-25 11:00:11 +0100 | [diff] [blame] | 90 | NCMP CM Handle Querying |
| 91 | ======================= |
| 92 | |
| 93 | The CM Handle searches endpoints can be used to query for CM Handles or CM Handle IDs. |
emaclee | b176de2 | 2022-08-31 15:53:10 +0100 | [diff] [blame] | 94 | This endpoint is described in detail in :doc:`ncmp-cmhandle-querying`. |
seanbeirne | f5a3a21 | 2023-03-06 09:12:49 +0000 | [diff] [blame] | 95 | |
| 96 | NCMP Inventory CM Handle Querying |
| 97 | ================================= |
| 98 | |
| 99 | The CM Handle searches ncmp inventory endpoints can be used to query for CM Handles or CM Handle IDs. |
| 100 | This endpoint is described in detail in :doc:`ncmp-inventory-querying`. |
sourabh_sourabh | 02ce57c | 2023-10-09 12:18:19 +0100 | [diff] [blame] | 101 | |
| 102 | Common NCMP Response Codes |
| 103 | ========================== |
| 104 | |
| 105 | NCMP uses common responses codes in REST responses and events. Also the DMI plugin interface uses these codes which are defined here: |
| 106 | |
| 107 | .. toctree:: |
| 108 | :maxdepth: 1 |
| 109 | |
| 110 | cps-ncmp-message-status-codes.rst |
ToineSiebelink | 74eed2c | 2023-08-31 17:38:52 +0100 | [diff] [blame] | 111 | |
| 112 | Contract Testing (stubs) |
| 113 | ======================== |
| 114 | |
| 115 | The CPS team is committed to supporting consumers of our APIs through contract testing. |
| 116 | Obviously we test our own contracts on a continuous basis as part of the build and delivery process. |
| 117 | CPS uses a contract-first approach. That means we write our OpenAPi contracts first and then generate the interface code from that. |
| 118 | This means our interface implementation simply cannot deviate from the OpenApi contracts we deliver. |
| 119 | |
| 120 | Another advantage is that we can also generate 'stubs'. Stubs are a basic implementation of the same interface for testing purposes. |
| 121 | These stubs can be used by clients for unit testing but also for more higher level integration-like testing where the real service is replaced by a stub. |
| 122 | This can be useful for faster feedback loops where deployment of a full stack is difficult and not strictly needed for the purpose of the tests. |
| 123 | |
| 124 | Stubs for contract testing typically always return the same response which is sufficient for the strict definition of a contract test. |
| 125 | However it is often useful to allow more variation in the responses so different clients or the same client can test different scenarios without having to mock the service. |
| 126 | CPS has implemented what we call 'extended stubs' that allow clients to provide alternate responses.implementation |
| 127 | |
| 128 | The available stubs and how to use them are described in :doc:'cps-stubs'. |
| 129 | |
| 130 | |
| 131 | |