Data Operations Endpoint
Introduction
For all data operations on CM Handle(s), we have a post endpoint:
/ncmp/v1/data?topic={client-topic-name} forward request to it’s dmi plugin service.
When asynchronous (with topic) operations are executed, a request id (UUID) will be returned.
Note. The client topic is validated to ensure it adheres to Kafka’s topic naming conventions. Additionally, if a client specifies a topic that does not exist, the request might be delayed. To enable a fail-fast mechanism, the max.block.ms parameter can be adjusted to define the maximum duration the request is allowed to block. The parameter is 60000ms by default but can be set to a lower value.
spring.kafka.producer.properties.max.block.ms: <value_in_ms>
Request Body
This endpoint executes data operation for given array of operations:
Operation attributes
Mandatory
Description
operation
Yes
Only read operation is allowed.
operationId
Yes
Unique operation id for each operation.
datastore
Yes
Supports only ncmp-datastore:passthrough-operational and ncmp-datastore:passthrough-running.
options
No
It is mandatory to wrap key(s)=value(s) in parenthesis’()’. The format of options parameter depend on the associated DMI Plugin implementation.
resourceIdentifier
No
The format of resource identifier depend on the associated DMI Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but it can really be anything.
targetIds
Yes
List of CM Handle references
The status codes used in the events resulting from these operations are defined here:
Request Body example from client app to NCMP endpoint:
curl --location 'http: //{ncmp-host-name}:{ncmp-port}/ncmp/v1/data?topic=my-topic-name' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
--data '{
"operations": [
{
"operation": "read",
"operationId": "operational-12",
"datastore": "ncmp-datastore:passthrough-operational",
"options": "some option",
"resourceIdentifier": "parent/child",
"targetIds": [
"836bb62201f34a7aa056a47bd95a81ed",
"202acb75b4a54e43bb1ff8c0c17a8e08"
]
},
{
"operation": "read",
"operationId": "running-14",
"datastore": "ncmp-datastore:passthrough-running",
"targetIds": [
"ec2e9495679a43c58659c07d87025e72",
"0df4d39af6514d99b816758148389cfd"
]
}
]
}'
DMI service batch endpoint
DMI Service 1 (POST): http://{dmi-host-name}:{dmi-port}/dmi/v1/data?topic=my-topic-name&requestId=4753fc1f-7de2-449a-b306-a6204b5370b3
[
{
"operationType": "read",
"operationId": "running-14",
"datastore": "ncmp-datastore:passthrough-running",
"cmHandles": [
{
"id": "ec2e9495679a43c58659c07d87025e72",
"cmHandleProperties": {
"id": "123",
"attributes":{"userLabel":"test"}
}
},
{
"id": "0df4d39af6514d99b816758148389cfd",
"cmHandleProperties": {
"id": "123",
"attributes":{"userLabel":"test"}
}
}
]
}
]
DMI Service 2 (POST) : http://{dmi-host-name}:{dmi-port}/dmi/v1/data?topic=my-topic-name&requestId=4753fc1f-7de2-449a-b306-a6204b5370b3
[
{
"operationType": "read",
"operationId": "operational-12",
"datastore": "ncmp-datastore:passthrough-operational",
"options": "some option",
"resourceIdentifier": "parent/child",
"cmHandles": [
{
"id": "836bb62201f34a7aa056a47bd95a81ed",
"cmHandleProperties": {
"id": "123",
"attributes":{"userLabel":"test"}
}
},
{
"id": "202acb75b4a54e43bb1ff8c0c17a8e08",
"cmHandleProperties": {
"id": "123",
"attributes":{"userLabel":"test"}
}
}
]
}
]
Above examples are for illustration purposes only. Please refer to link below for latest schema.