Versions Compared

Key

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

...

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).

  “data-type”: “<mime-type>”,         // Indicates format for the embedded data.
                                      // Shall use MIME type syntax, e g “application/yang-data+json”.
                                      // Shall only be present for create and update operations.

  “data”: {                           // Embedded data. Must be valid JSON object.
    <data>                            // Shall only be present for create and update operations.
  },

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


Request Body : {     "additionalProperties" : { [ "subsystemId" : "system-001" ] } }

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 request format for data access above.

  • 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.


  • Expand
    titleAPI details

    *The examples in the below table refer back to the NCMP interface. The same differences apply to the data callsThe DMI APIs for data access are similar to corresponding NCMP APIs. The following list is a summary of the main differences:

    1. The  URI prefix /dmi instead of /ncmp
    2. For non-passthrough datastores, the resource path will be converted from cpsPath to RESTConfPath
    3. The The request body for each request wil include the 'additional properties' as stored for each cm-handle (hence the need for PUT over GET method)  e.g. 

    Code Block
    languagexml
    titleRequest Body

    UsecaseREST MethodURI
    1Add a data resource for a cmHandlePOST

    {dmi-root}/dmi/v1/ch/<cmhandle>/data/ds/ncmp-datastore:running/{parent-data-resource-identifier}

    {
    <new-yang-data-resource>
    }

    Content-Type: application/json

    "data" payload : yang-data+json

    2Delete a data resource for a cmHandlePUT{dmi-root}/dmi/v1/ch/<cm-handle>/data/ds/ncmp-datastore:running/{resource-identifier}
    3Patch a data resource for a cmHandlePATCH

    {dmi-root}/dmi/v1/ch/<cm-handle>/data/ds/ncmp-datastore:running/{resource-identifier}

    {
    <yang-data-for-merging>
    }

    Content-Type: application/json

    "data" payload : yang-data+json

    4Patch multiple child resources for a single cmHandlePATCH

    {dmi-root}/dmi/v1/ch/<cm-handle>/data/ds/ncmp-datastore:running/{resource-identifier}


    Content-Type: application/json

    "data" payload : yang-patch+json

    5Execute a yang action on a cmhandle instancePOST

    {dmi-root}/dmi/v1/ch/<cm-handle>/data/ds/ncmp-datastore:operational/{resource-identifier}/{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

    {dmi-root}/dmi/v1/operations/ch/<cm-handle>/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/<cm-handle>/data/ds/ncmp-datastore:operational/{resource-identifier}?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

    {dmi-root}/dmi/v1/ch/<cm-handle>/data/ds/ncmp-datastore:operational/{resource-identifier}?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{dmi-root}/dmi/v1/ch/{cm-handle}/data/ds/ncmp-datastore:operational/{resourcepath}?fields={fields}&scope={scope}
    10Read descendant nodes to a given depth for a given cmHandlePUT

    {dmi-root}/dmi/v1/ch/{cm-handle}/data/ds/ncmp-datastore:operational/{resource-identifier}?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

    {dmi-root}/dmi/v1/ch/<cm-handle>/data/ds/ncmp-datastore:running/{resource-identifier}

    {data : {

                .... the complete tree config to be replaced

          }}


    ...