blob: 94d5ee9c0a57a14b7d9c6776f23fe3c1c549545b [file] [log] [blame]
sourabh_sourabh9a76aa32023-07-25 10:58:52 +01001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright (C) 2023 Nordix Foundation
4
5.. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
6.. _cmHandleDataOperation:
7
8
david.mcweeneydeee6ff2024-01-04 12:29:33 +00009Data Operations Endpoint
10########################
sourabh_sourabh9a76aa32023-07-25 10:58:52 +010011
12.. toctree::
13 :maxdepth: 1
14
15Introduction
16============
17
david.mcweeneydeee6ff2024-01-04 12:29:33 +000018For all data operations on cm handle(s), we have a post endpoint:
sourabh_sourabh9a76aa32023-07-25 10:58:52 +010019
20- /ncmp/v1/data?topic={client-topic-name} forward request to it's dmi plugin service.
21
david.mcweeneydeee6ff2024-01-04 12:29:33 +000022- When asynchronous (with topic) operations are executed, a request id (UUID) will be returned.
sourabh_sourabh9a76aa32023-07-25 10:58:52 +010023
24Request Body
25============
26
27This endpoint executes data operation for given array of operations:
28
29 +--------------------------+-------------+-------------------------------------------------------------------------+
30 | Operation attributes | Mandatory | Description |
31 +==========================+=============+=========================================================================+
32 | operation | Yes | Only read operation is allowed. |
33 +--------------------------+-------------+-------------------------------------------------------------------------+
34 | operationId | Yes | Unique operation id for each operation. |
35 +--------------------------+-------------+-------------------------------------------------------------------------+
36 | datastore | Yes | Supports only ncmp-datastore:passthrough-operational and |
37 | | | ncmp-datastore:passthrough-running. |
38 +--------------------------+-------------+-------------------------------------------------------------------------+
39 | options | No | It is mandatory to wrap key(s)=value(s) in parenthesis'()'. The format |
40 | | | of options parameter depend on the associated DMI Plugin implementation.|
41 +--------------------------+-------------+-------------------------------------------------------------------------+
42 | resourceIdentifier | No | The format of resource identifier depend on the associated DMI Plugin |
43 | | | implementation. For ONAP DMI Plugin it will be RESTConf paths but it can|
44 | | | really be anything. |
45 +--------------------------+-------------+-------------------------------------------------------------------------+
46 | targetIds | Yes | List of cm handle ids. |
47 +--------------------------+-------------+-------------------------------------------------------------------------+
48
49The status codes used in the events resulting from these operations are defined here:
50
51.. toctree::
52 :maxdepth: 1
53
54 cps-ncmp-message-status-codes.rst
55
56Request Body example from client app to NCMP endpoint:
57
58.. code-block:: bash
59
60 curl --location 'http: //{ncmp-host-name}:{ncmp-port}/ncmp/v1/data?topic=my-topic-name' \
61 --header 'Content-Type: application/json' \
62 --header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
63 --data '{
64 "operations": [
65 {
66 "operation": "read",
67 "operationId": "operational-12",
68 "datastore": "ncmp-datastore:passthrough-operational",
69 "options": "some option",
70 "resourceIdentifier": "parent/child",
71 "targetIds": [
72 "836bb62201f34a7aa056a47bd95a81ed",
73 "202acb75b4a54e43bb1ff8c0c17a8e08"
74 ]
75 },
76 {
77 "operation": "read",
78 "operationId": "running-14",
79 "datastore": "ncmp-datastore:passthrough-running",
80 "targetIds": [
81 "ec2e9495679a43c58659c07d87025e72",
82 "0df4d39af6514d99b816758148389cfd"
83 ]
84 }
85 ]
86 }'
87
88
89DMI service batch endpoint
90--------------------------
91
92DMI Service 1 (POST): `http://{dmi-host-name}:{dmi-port}/dmi/v1/data?topic=my-topic-name&requestId=4753fc1f-7de2-449a-b306-a6204b5370b3`
93
94.. code-block:: json
95
96 [
97 {
98 "operationType": "read",
99 "operationId": "running-14",
100 "datastore": "ncmp-datastore:passthrough-running",
101 "cmHandles": [
102 {
103 "id": "ec2e9495679a43c58659c07d87025e72",
104 "cmHandleProperties": {
105 "neType": "RadioNode"
106 }
107 },
108 {
109 "id": "0df4d39af6514d99b816758148389cfd",
110 "cmHandleProperties": {
111 "neType": "RadioNode"
112 }
113 }
114 ]
115 }
116 ]
117
118DMI Service 2 (POST) : `http://{dmi-host-name}:{dmi-port}/dmi/v1/data?topic=my-topic-name&requestId=4753fc1f-7de2-449a-b306-a6204b5370b3`
119
120.. code-block:: json
121
122 [
123 {
124 "operationType": "read",
125 "operationId": "operational-12",
126 "datastore": "ncmp-datastore:passthrough-operational",
127 "options": "some option",
128 "resourceIdentifier": "parent/child",
129 "cmHandles": [
130 {
131 "id": "836bb62201f34a7aa056a47bd95a81ed",
132 "cmHandleProperties": {
133 "neType": "RadioNode"
134 }
135 },
136 {
137 "id": "202acb75b4a54e43bb1ff8c0c17a8e08",
138 "cmHandleProperties": {
139 "neType": "RadioNode"
140 }
141 }
142 ]
143 }
144 ]
145
david.mcweeneydeee6ff2024-01-04 12:29:33 +0000146Above examples are for illustration purposes only. Please refer to link below for latest schema.
sourabh_sourabh9a76aa32023-07-25 10:58:52 +0100147
148:download:`Data operation event schema <schemas/data-operation-event-schema-1.0.0.json>`