blob: 80eb5f1523f11f0936a79f0d9a8565148e3e088e [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
63CPS Core uses API's from the following ONAP components
64
65* DMI-Plugin: REST based interface which is used to provide integration
66 and allow the DMI registry API's have access to the corresponding NCMP API's within CPS Core.
lukegleesonf027cfb2021-11-08 15:53:12 +000067 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>`.
ToineSiebelink98c07872021-04-20 17:33:09 +010068
69CPS Path
70========
71
72Several CPS APIs use the cps-path (or cpsPath in Java API) parameter.
73The CPS Path is described in detail in :doc:`cps-path`.
lukegleesonde294742022-07-25 11:00:11 +010074
75NCMP CM Handle Querying
76=======================
77
78The CM Handle searches endpoints can be used to query for CM Handles or CM Handle IDs.
emacleeb176de22022-08-31 15:53:10 +010079This endpoint is described in detail in :doc:`ncmp-cmhandle-querying`.
seanbeirnef5a3a212023-03-06 09:12:49 +000080
81NCMP Inventory CM Handle Querying
82=================================
83
84The CM Handle searches ncmp inventory endpoints can be used to query for CM Handles or CM Handle IDs.
85This endpoint is described in detail in :doc:`ncmp-inventory-querying`.
sourabh_sourabh02ce57c2023-10-09 12:18:19 +010086
87Common NCMP Response Codes
88==========================
89
90NCMP uses common responses codes in REST responses and events. Also the DMI plugin interface uses these codes which are defined here:
91
92.. toctree::
93 :maxdepth: 1
94
95 cps-ncmp-message-status-codes.rst
ToineSiebelink74eed2c2023-08-31 17:38:52 +010096
97Contract Testing (stubs)
98========================
99
100The CPS team is committed to supporting consumers of our APIs through contract testing.
101Obviously we test our own contracts on a continuous basis as part of the build and delivery process.
102CPS uses a contract-first approach. That means we write our OpenAPi contracts first and then generate the interface code from that.
103This means our interface implementation simply cannot deviate from the OpenApi contracts we deliver.
104
105Another advantage is that we can also generate 'stubs'. Stubs are a basic implementation of the same interface for testing purposes.
106These 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.
107This 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.
108
109Stubs for contract testing typically always return the same response which is sufficient for the strict definition of a contract test.
110However 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.
111CPS has implemented what we call 'extended stubs' that allow clients to provide alternate responses.implementation
112
113The available stubs and how to use them are described in :doc:'cps-stubs'.
114
115
116