blob: 52f977a99a3ab5da6350ddd646295f5f5e6daa61 [file] [log] [blame]
Rishi.Chail5272dca2021-02-23 12:14:24 +00001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
ToineSiebelink74eed2c2023-08-31 17:38:52 +01003.. Copyright (C) 2021-2023 Nordix Foundation
Rishi.Chail5272dca2021-02-23 12:14:24 +00004
5.. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
Ruslan Kashapov55dc6542021-03-02 16:48:41 +02006.. _design:
Rishi.Chail5272dca2021-02-23 12:14:24 +00007
8
Ruslan Kashapov55dc6542021-03-02 16:48:41 +02009CPS Design
10##########
11
12.. toctree::
13 :maxdepth: 1
14
15Offered APIs
16============
Rishi.Chail5272dca2021-02-23 12:14:24 +000017
niamhcorec1904c12021-10-11 16:38:53 +010018CPS supports the public APIs listed in the following sections.
19
20CPS-Core
21--------
22
23CPS-Core functionality.
Rishi.Chail85aebca2021-02-24 15:10:58 +000024
shivasubedi44beaa32021-09-13 15:16:30 +010025:download:`CPS Rest OpenApi Specification <api/swagger/cps/openapi.yaml>`
26
niamhcorec1904c12021-10-11 16:38:53 +010027CPS-NCMP
28--------
29
30XNF data access and module information.
31
shivasubedi44beaa32021-09-13 15:16:30 +010032:download:`CPS NCMP RestOpenApi Specification <api/swagger/ncmp/openapi.yaml>`
Rishi.Chail5272dca2021-02-23 12:14:24 +000033
niamhcorec1904c12021-10-11 16:38:53 +010034CPS-NCMP-Inventory
35------------------
36
37DMI-Plugin Inventory.
38
39:download:`CPS NCMP RestOpenApi Inventory Specification <api/swagger/ncmp/openapi-inventory.yaml>`
40
lukegleesone1308ac2021-09-30 13:36:37 +010041View Offered APIs
42-----------------
Rishi.Chail5272dca2021-02-23 12:14:24 +000043
Rishi.Chail85aebca2021-02-24 15:10:58 +000044The standard for API definition in the RESTful API world is the OpenAPI Specification (OAS).
Rishi.Chail4359d282021-03-03 16:36:26 +000045The OAS 3, which is based on the original "Swagger Specification", is being widely used in API developments.
Rishi.Chail5272dca2021-02-23 12:14:24 +000046
Ruslan Kashapov55dc6542021-03-02 16:48:41 +020047Specification can be accessed using following URI:
Rishi.Chail5272dca2021-02-23 12:14:24 +000048
49.. code-block:: bash
50
lukegleesone1308ac2021-09-30 13:36:37 +010051 http://<hostname>:<port>/v3/api-docs?group=cps-docket
52
niamhcorec1904c12021-10-11 16:38:53 +010053Additionally, the Swagger User Interface can be found at the following URI. The component may be changed between CPS-Core, CPS-NCMP
54and CPS-NCMP-Inventory using the drop down table in the top right:
lukegleesone1308ac2021-09-30 13:36:37 +010055
56.. code-block:: bash
57
58 http://<hostname>:<port>/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/
59
60Consumed APIs
niamhcorec1904c12021-10-11 16:38:53 +010061=============
lukegleesone1308ac2021-09-30 13:36:37 +010062
ToineSiebelink8593bae2024-07-01 17:50:54 +010063DMI-Plugin
64----------
lukegleesone1308ac2021-09-30 13:36:37 +010065
ToineSiebelink8593bae2024-07-01 17:50:54 +010066DMI-Plugin is a REST based interface which is used to provide integration
67and allow the DMI registry API's have access to the corresponding NCMP API's within CPS Core.
68More 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
70Policy-Executor
71---------------
72
73.. toctree::
74 :maxdepth: 1
75
76 policy-executor.rst
ToineSiebelink98c07872021-04-20 17:33:09 +010077
78CPS Path
79========
80
81Several CPS APIs use the cps-path (or cpsPath in Java API) parameter.
82The CPS Path is described in detail in :doc:`cps-path`.
lukegleesonde294742022-07-25 11:00:11 +010083
Arpit Singh4d42d682024-02-06 16:54:50 +053084CPS Delta
85=========
86
87CPS Delta feature provides the ability to find the delta/difference between two JSON configurations.
88The CPS Delta feature is described in detail in :doc:`cps-delta-feature`.
89
lukegleesonde294742022-07-25 11:00:11 +010090NCMP CM Handle Querying
91=======================
92
93The CM Handle searches endpoints can be used to query for CM Handles or CM Handle IDs.
emacleeb176de22022-08-31 15:53:10 +010094This endpoint is described in detail in :doc:`ncmp-cmhandle-querying`.
seanbeirnef5a3a212023-03-06 09:12:49 +000095
96NCMP Inventory CM Handle Querying
97=================================
98
99The CM Handle searches ncmp inventory endpoints can be used to query for CM Handles or CM Handle IDs.
100This endpoint is described in detail in :doc:`ncmp-inventory-querying`.
sourabh_sourabh02ce57c2023-10-09 12:18:19 +0100101
102Common NCMP Response Codes
103==========================
104
105NCMP 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
ToineSiebelink74eed2c2023-08-31 17:38:52 +0100111
112Contract Testing (stubs)
113========================
114
115The CPS team is committed to supporting consumers of our APIs through contract testing.
116Obviously we test our own contracts on a continuous basis as part of the build and delivery process.
117CPS uses a contract-first approach. That means we write our OpenAPi contracts first and then generate the interface code from that.
118This means our interface implementation simply cannot deviate from the OpenApi contracts we deliver.
119
120Another advantage is that we can also generate 'stubs'. Stubs are a basic implementation of the same interface for testing purposes.
121These 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.
122This 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
124Stubs for contract testing typically always return the same response which is sufficient for the strict definition of a contract test.
125However 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.
126CPS has implemented what we call 'extended stubs' that allow clients to provide alternate responses.implementation
127
128The available stubs and how to use them are described in :doc:'cps-stubs'.
129
130
131