...
RESTCONF/NETCONF relationship
NCMP URI
NCMP URI format to follow below pattern
<OP> <OP>/ncmp /<v{v-number}>/ cmcmhandle/<cm-handle handle>/<cmhandle> /<data|operations|{ncmp-action}>/ds/{datastore} /<resource-path>?<query>
URI | Mandatory or Optional | |
---|---|---|
<OP> | the HTTP method | Mandatory |
ncmp / |
the ncmp root resource | Mandatory | |
<v{v-number}> | version of the ncmp interface <path> is the target resource URI <query> is the query parameter list | Mandatory |
cm-handle /<cm-handle> |
unique (string) identifier of a yang tree instance. | Optional | |
<data|operations|{ncmp-action}> | request category - yang data, rpc operation or a (non-modelled) ncmp api action | Mandatory |
ds/{datastore} | optional datastore | Optional |
<resource-path> |
...
<OP> : the HTTP method
<ncmp> : the ncmp root resource
<v{v-number}> : version of the ncmp interface <path> is the target resource URI <query> is the query
parameter list
<request-category> : yang data, rpc operation or a (non-modelled) ncmp api action
<datastore> : optional datastore
<cmhandle> : unique (string) identifier of a yang tree instance.
<resource-path> : the path expression identifying the resource that is being accessed by the operation. If this field is not present, then the target resource is the API itself.
<query> : the set of parameters associated with the RESTCONF message; see Section 3.4 of [RFC3986]. RESTCONF parameters have the
familiar form of "name=value" pairs. Most query parameters are optional to implement by the server and optional to use by the client. Each optional query parameter is identified by a URI
Datastores
New datastores are defined for ncmp to access the CPS 'intended' or 'operational' datastore.
Alternatively, the request can be sent directly to the 'device' itself (bypassing CPS datastores) using one of the 'passthrough-*' datastores options as below
The new ncmp datastores required for ONAP Release I include :
...
the path expression identifying the resource that is being accessed by the operation. If this field is not present, then the target resource is the API itself. | Optional | |
<query> | the set of parameters associated with the RESTCONF message; see Section 3.4 of [RFC3986]. RESTCONF parameters have the familiar form of "name=value" pairs. Most query parameters are optional to implement by the server and optional to use by the client. Each optional query parameter is identified by a URI | Optional |
Datastores
New datastores are defined for ncmp to access the CPS 'intended' or 'operational' datastore.
Alternatively, the request can be sent directly to the 'device' itself (bypassing CPS datastores) using one of the 'passthrough-*' datastores options as below
The new ncmp datastores required for ONAP Release I include :
ncmp-datastores:running (RW) | Read/Write to the CPS "intended" store (with validation). Then do subsequent write on DMI interface with ds ietf-datastores:running. |
ncmp-datastores:operational (RO) | Read from the CPS "operational" store. |
ncmp-datastores:passthrough-running (RW) | Read/Write to/from the live devices ietf-datastores:running (no local ncmp validation) |
Future datastores to be supported by NCMP include :
ncmp-datastores:passthrough-intented (RO) | Read from the live devices ietf-datastores:intended ncmp-datastores:passthrough-operational (RO) : Read from the live devices ietf-datastores:operational |
ncmp-datastores:passthrough-candidate (RW) | Read from the live devices ietf-datastores:candidate |
If datastore (ds/{datastore}) is omitted from URI AND the model/moduleSet is not available in NCMP, the datastore is defaulted to ncmp-datastores: passthrough-running
If datastore (ds/{datastore}) is omitted from URI AND the model/moduleSet exists, the datastore defaults to ncmp-datastores:running
Yang data resource actions and RPC operations are run directly on the 'device' meaning ncmp-datastores:passthrough-running is used for these request
REST API
Req/usecase | REST Method | URI / Payload | Header Parameters | Request/Response Example | Status | |||
---|---|---|---|---|---|---|---|---|
1 | NCMP-CM-001-2 Read a data resource directly from source (passthrough) for a cmHandle - async | GET | {ncmp-root}/ncmp/v1/cm-handle//ds /ncmp-datastores:passthrough-running/{data-resource-identifier}?fields={fields}&topic= {topicId} Note 'topic' and 'fields' are only supported in passthrough mode at this time (ONAP Release I). If not pass through then an exception is thrown from NCMP at this time. | Accept: application/json | Scenario : Read the bookstore for cmhandle "335ff" as passthrough Event Response:
| Under Review | ||
2 | NCMP-CM-001-2 Read a data resource directly from source (passthrough) for a cmHandle. Only return specific field(s). Synchronous call | GET | {ncmp-root}/ncmp/v1/cm-handle//ds /ncmp-datastores:passthrough-running/{dataresource-identifier}?fields={fields} | Accept: application/json | Scenario : Read the EUtranCellFDD.(administrativeState, operationalState, tac, earfcndl, cellId, physicalLayerCellId) for cmhandle "335ff" as passthrough Method : GET URI : {ncmp-root}/ncmp/v1/cm-handle/335ff/ds/ncmp-datastores: passthrough-running//EUtranCellFDD?fields=administrativeState; operationalState;tac;earfcndl;cellId;physicalLayerCellId Header : Accept: application/json | Under Review | ||
3 | ALTERNATIVE OUTPUT TO ABOVE SCENARIO NCMP-CM-001-2 Read a data resource directly from source (passthrough) for a cmHandle. Only return specific field(s). Synchronous call | GET | WIP | Accept: application/json | Under Review | |||
4 | NCMP-CM-001-2 Read a data resource with some leaf value condition directly from the source (passthrough) for a cmHandle. Only return specific field(s). Synchronous call | GET | {ncmp-root}/ncmp/v1/cm-handle//ds /ncmp-datastores:passthrough-running/{data-resource-identifier}?fields={fields} &topic={topicId} | Accept: application/json | Scenario : Read the LocalSctpEndpoint.(interfaceUsed==X2,sctpEndpointRef) for cmhandle "335ff" as passthrough
| Under Review | ||
5 |
Future datastores to be supported by NCMP include :
...
If datastore (ds/{datastore}) is omitted from URI AND the model/moduleSet is not available in NCMP, the datastore is defaulted to ncmp-datastores: passthrough-running
If datastore (ds/{datastore}) is omitted from URI AND the model/moduleSet exists, the datastore is defaulted to ncmp-datastores:running
Yang data resource actions and RPC operations are run directly on the 'device' meaning ncmp-datastores:passthrough-running is used for these request
Req/usecase | REST Method | URI / Payload | Header Parameters | Request/Response Example | Status | 1 | NCMP-CM-001-1 Get model (module set) for CMHandle | GET | {ncmp-root}/ncmp/v1/model/<handleId> {ncmp-root}/ncmp/v1/model/cmhandle/<cm-handle> | Accept: application/ yang- data+json | Scenario : Get the model data for CMHandle with id "335ff" Response :
| Under Review | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26 | NCMP-CM-001-4 Create a data resource for a cmhandle | POST | {ncmp-root}/ncmp/v1/cm-handle/<cmhandle>/ds/ncmp-datastores:passthrough-running/{parent-data-resource-identifier}
| Accept: application/ yang- data+json | Scenario : Create a data resource of the bookstore model for the given cmhandle. Method : POST RI : {ncmp-root}/ncmp/v1/cm-handle/34l5k32/bookstore Header : Accept: application/yang-data+json Body:
| Under Review | ||||||||
37 | NCMP-CM-001-5 Delete a data resource for a cmHandle | DELETE | {ncmp-root}/ncmp/v1//ds/ncmp-datastores:passthrough-running/{data-resource-identifier} OR with datastores defaults {ncmp-root}/ncmp/v1/cmhandle// {parent-data-resource-identifier} | Accept: application/ yang- data+json | Scenario : Delete categories=SciFi do we follow xpath syntax? {adapter-root}??? | Under Review | ||||||||
48 | NCMP-CM-001-3 Update a data resource for a cmHandle | PATCH | {ncmp-root}/ncmp/v1/data//ds/ncmp-datastores:passthrough-running/{data-resource-identifier} { OR with datastores defaults {ncmp-root}/ncmp/v1/cmhandle// {parent-data-resource-identifier} { | Accept: application/ yang- data+json | Scenario : Add a book to categories SciFi if it doesn't already exist Header : Body :
| Under Review | ||||||||
59 | NCMP-CM-001-8 Multiple edits under a target data | PATCH | {ncmp-root}/ncmp/v1/cm-handle//ds /ncmp-datastores:passthrough-running/{data-resource-identifier} { yang-patch payload } OR using datastores defaults {ncmp-root}/ncmp/v1/cm-handle//{data-resource-identifier} { yang-patch payload } | Content-Type: application/yang-patch+json | Scenario: Make multiple updates under the bookstore/categories data resource Method : PATCH URI : {ncmp-root}/ncmp/v1/cm-handle/32rf234/bookstore/categories Header : Body:
Response : | Under Review | ||||||||
6 | 7 | 8 | 9 | 10 | ||||||||||
11 | ||||||||||||||
12 | ||||||||||||||
13 | ||||||||||||||
14 | ||||||||||||||
15 | ||||||||||||||
16 | ||||||||||||||
17 | ||||||||||||||
18 | ||||||||||||||
19 | ||||||||||||||
20 | ||||||||||||||
21 |