- CPS-391Getting issue details... STATUS
Guiding Principles
- NCMP REST Interface will follow/be inspired by RESTConf interface for easy acceptance of and transition to this interface
- Will follow ONAP's RESTful API Design Specification
- The interface will include the concept of data-stores inspired by Network Management Datastore Architecture (NMDA) and as used in RESTConf
- The application should be able to easily switch between 'pass-through' and other datastores (also identical rest endpoint and responses)
References
Follow principles/patterns of RESTCONF RFC-8040 https://datatracker.ietf.org/doc/html/rfc8040
Follow principles/patterns of yang-patch RFC-8072 https://datatracker.ietf.org/doc/html/rfc8040
Follow principles/patterns of RESTCONF NMDA RFC-8527 https://datatracker.ietf.org/doc/html/rfc8527
Open Issues & Decisions
RESTCONF/NETCONF relationship
NCMP URI
NCMP URI format to follow below pattern
<OP>/ncmp/<v{v-number}>/ch/<cm-handle>/<data|operations|{ncmp-action}>/ds/{datastore}/[rp:]{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 |
ch/<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. this could be data, operations or ncmp-action (e.g. 'sync-data') | Mandatory |
ds/{datastore} | optional datastore | Optional |
<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. | 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 'intent' 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 :
Datastore Mapping in ONAP DMI Plugin impl.
# | Incoming DS value (NCMP & DMI Rest interfaces) | Outgoing (non-NMDA RestConf controller) | Notes |
---|---|---|---|
1 | /ds /ncmp-datastores:operational |
| CT + CF, RO |
2 | /ds/ncmp-datastores:running |
| CT, RW |
3 | /ds/ncmp-datastores:passthrough-operational |
| CT + CF, RO |
4 | /ds/ncmp-datastores:passthrough-running |
| CT, RW |
5 | /ds/ <anything-else> | N/A | Not supported |
Expected Resource-Path format Fields (filter) Included DataNodes Not Specified N/A Not supported NCMP does not parse Resolve DMI plugin Forward request to plugin The DMI plugin may error if the RP or accept header are not supported. Resolve DMI plugin Forward request to plugin Read from cache output: application/yang-data+json Read from cache output: application/json to be determined in spike, see issue #28 Resolve DMI plugin Convert cpsPath to RESTConfPath Forward request to plugin | Read from DMI plugin Output application/yang-data+json config + Resolve DMI plugin Convert cpsPath to RESTConfPath Forward request to plugin | Read from DMI plugin Output application/yang-data+json Works Items for above. Expected Resource-Path format NCMP does not parse Resolve DMI plugin Forward request to plugin The DMI plugin may error if the RP or content type are not supported. NCMP does not parse Resolve DMI plugin Forward request to plugin The DMI plugin may error if the RP or content type are not supported. NCMP does not parse Resolve DMI plugin Forward request to plugin The DMI plugin may error if the RP or content type are not supported. NCMP does not parse Resolve DMI plugin Forward request to plugin The DMI plugin may error if the RP or content type are not supported. Resolve DMI plugin Convert cpsPath to RESTConfPath Forward request to plugin Output received response (success or failure) Resolve DMI plugin Convert cpsPath to RESTConfPath Forward request to plugin Output received response (success or failure) Resolve DMI plugin Convert cpsPath to RESTConfPath Forward request to plugin Output received response (success or failure) application/yang-data+json (*plain patch) Resolve DMI plugin Convert cpsPath to RESTConfPath Forward request to plugin Output received response (success or failure) Resolve DMI plugin Convert cpsPath to RESTConfPath Forward request to plugin Output received response (success or failure)Datastore, Paths and Format Combinations for Read Operations
State Input Behavior Data Notes # Data-Sync Datastore parameter Accept-Header Data Source
(config)1 On Not Specified cpsPath application/yang-data+json N/A Not supported N/A N/A 2 On Not Specified cpsPath application/json N/A Not supported N/A N/A 3 Off cpsPath application/yang-data+json N/A N/A 4 Off Not Specified cpsPath N/A N/A Not supported N/A N/A there are NO DataNode objects in CPS to output as JSON) 5 Off Not Specified other then cpsPath N/A N/A Not supported N/A N/A Not supported Since NCMP can only convert cpsPaths 6 On | Off ncmp/passthrough-operational NCMP does not parse depends on DMI-Plugin
(supported in ONAP)DMI-Plugin config +
non-config7 On | Off ncmp/passthrough-running NCMP does not parse NCMP does not parse depends on DMI-Plugin
(supported in ONAP)DMI-Plugin config-only 8 On ncmp/operational cpsPath application/yang-data+json Not supported in Istanbul releases CPS-Core config +
non-configNCMP/CPS-Core needs to remove DataNode wrapping 9 On ncmp/operational cpsPath application/json Not supported in Istanbul releases CPS-Core config +
non-config10 Off ncmp/operational cpsPath application/yang-data+json DMI-Plugin
non-config11 On | Off ncmp/running cpsPath application/yang-data+json to be determined in spike, see issue #28 DMI-Plugin config-only Read Example
# Description Component Enables 1 Forward request from NCMP to CPS-Core NCMP 8,9 2 Forward request from NCMP to DMI-Plugin NCMP 6,7 3 Convert json (dataNode) to yang-data+json CPS-Core/NCMP 8 4 Convert cpsPath to RESTConf Path NCMP 10,11 5 Enhance &fields parameter where needed NCMP 10,11+fields option 6 NOT Supported N/A 1,2,3,4,5 Datastore, Paths and Format Combinations for Write Operations
State Input Behavior Notes # Data-Sync Operation Datastore parameter Content-Type 1 On | Off Create ncmp/passthrough-running NCMP does not parse (needs to be valid JSON) 2 On | Off Update ncmp/passthrough-running NCMP does not parse (needs to be valid JSON) 3 On | Off Delete ncmp/passthrough-running N/A 4 On | Off Patch ncmp/passthrough-running NCMP does not parse (needs to be valid JSON) 5 On | Off Create ncmp/running cpsPath application/yang-data+json 6 On | Off Update ncmp/running cpsPath application/yang-data+json 7 On | Off Delete ncmp/running cpsPath N/A 8 On | Off Patch ncmp/running cpsPath 9 On | Off Patch ncmp/running cpsPath application/yang-patch+json Write Example