Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. The URI prefix is /dmi instead of /ncmp.
  2. For non-passthrough datastores, the resource path will be converted from cpsPath to RESTConfPath
  3. The body for each request will contain additional information and any data provided on the NCMP interface (write operations) will be embedded in a larger JSON structure as described in example below.

  4. Since all requests will have a message body, in some cases the HTTP method will be different to allow passing data. Thus PUT is used instead of GET and DELETE.

Excerpt

Request Format for Data Access

Code Block
languagexml
titlerequest body
{
  “operation”: “<operation>”,         // Valid operations are: “create”, “read”, “update” and “delete”.
                                      // For update, replace and patch is distinguished by the HTTP method (PUT or PATCH).
  "dataType": "<dataType>",

    “data”: {                           // Embedded data as a String.
    <data>                            // required for create and update operations. Optional filter-data for read-operations
  },

  “cmHandleProperties”: {           // Additional properties for CM handle previously added by DMI plugin and stored in NCMP.
    <properties>
  }
}




Expand
titleAPI details

Below table shows the proposed interface, actual implementation might deviate from this but can be accessed from


UsecaseREST MethodURI
1Add a data resource for a cmHandlePOST

{dmiRoot}/dmi/v1/ch/<cmhandle>/data/ds/ncmp-datastore:running/{parentDataResourceIdentifier}

{
<new-yang-data-resource>
}

Content-Type: application/json

"data" payload : yang-data+json

2Delete a data resource for a cmHandlePUT{dmiRoot}/dmi/v1/ch/<cmHandle>/data/ds/ncmp-datastore:running/{resourceIdentifier}
3Patch a data resource for a cmHandlePATCH

{dmiRoot}/dmi/v1/ch/<cmHandle>/data/ds/ncmp-datastore:running/{resourceIdentifier}

{
<yang-data-for-merging>
}

Content-Type: application/json

"data" payload : yang-data+json

4Patch multiple child resources for a single cmHandlePATCH

{dmiRoot}/dmi/v1/ch/<cmHandle>/data/ds/<dsName>/{resourceIdentifier}


Content-Type: application/json

"data" payload : yang-patch+json

5Execute a yang action on a cmhandle instancePOST

{dmiRoot}/dmi/v1/ch/<cmHandle>/data/ds/ncmp-datastore:operational/{resourceIdentifier}/{action}


input: {
         "param1Name" :"param1Value”,
          "param2Name" : "param2Value”

}


Note : If the "action" statement has no "input" section, the request message MUST NOT include a message-body

6Execute an rpc operationPOST

{dmiRoot}/dmi/v1/operations/ch/<cmHandle>/ds/ncmp-datastore:operational/ {module-name}:{action}

{ input: {
            "param1Name" : "param1Value”,
             "param2Name" : "param2Value”
} }

Note: If there is no "input" section, the request MUST NOT include a message-body

7Read a filtered set of data under a data resource for a cmHandlePUT

{dmiroot}/dmi/v1/ch/<cmHandle>/data/ds/ncmp-datastore:operational/{resourceIdentifier}?fields={fields-expression}

OptionDescription
fieldsRequest a subset of the target
resource contents


8Read data resources with specified fields under a given data resource for a given cmHandlePUT

{dmiRoot}/dmi/v1/ch/<cmHandle>/data/ds/ncmp-datastore:operational/{resourceIdentifier}?fields={fields-expression}


OptionDescription
fieldsRequest a subset of the target
resource contents


9Get data resource with 'fileds' for a cmhandle with a given scope conditionPUT{dmiRoot}/dmi/v1/ch/{cmHandle}/data/ds/ncmp-datastore:operational/{resourcepath}?fields={fields}&scope={scope}
10Read descendant nodes to a given depth for a given cmHandlePUT

{dmiRoot}/dmi/v1/ch/{cmHandle}/data/ds/ncmp-datastore:operational/{resourceIdentifier}?depth={level}


OptionDescription
depthRequest limited sub-tree depth in
the reply content
If '1' then only immediate resource
is retrieved
If '2' then resource plus next level
resources are retrieved


11Replace data for a CMHandlePUT

{dmiRoot}/dmi/v1/ch/<cmHandle>/data/ds/ncmp-datastore:running/{resourceIdentifier}

{data : {

            .... the complete tree config to be replaced

      }}


...