Versions Compared

Key

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

...

  1. Get all dataspaces

    URL

    GET  http://IP:PORT/cps/api/v1v2/admin/dataspaces

    Response body


    Code Block
    {“dataspace-names”: [“data-space1”,” data-space2”,” data-space3”] }

    Response body(ref. get anchors)

    Code Block
    [
        {
            "dataspaceName": "testDataspace-1"
        },
        {
            "dataspaceName": "testDataspace-2"
        },
        {
            "dataspaceName": "testDataspace-3"
        }
    ]



  2. Get single dataspace

    URL

    GET   http://IP:PORT/cps/api/v2/v1admin/dataspaces/<dataspace-name>

    Response body


    Code Block
    {
        “dataspaceName”:”data-space1”
    }



  3. Get all schema sets for a dataspaces

    URL

    GET   http://IP:PORT/cps/api/v1v2/admin/dataspaces/<dataspace-name>/schema-sets

    Response body (Reference get all dataspaces)


    Code Block
    {“schema-set-names”“schemaSetNames”: [“schemaset-1”,” schemaset-1”,” schemaset-1”] }

    Response body (Reference get schema-set)

    Code Block
    [
    {
        "dataspaceName": "testDataspace",
        "moduleReferences": [
            {
                "name": null,
                "namespace": "http://example.com/example-2",
                "revision": "2021-01-28"
            }
        ],
        "name": "example-1-yang"
    },
    {
        "dataspaceName": "testDataspace",
        "moduleReferences": [
            {
                "name": null,
                "namespace": "http://example.com/example-2",
                "revision": "2021-01-28"
            }
        ],
        "name": "example-2-yang"
    }
    ]

    Response body(Reference :get anchors)

    Code Block
    [
        {
            "dataspaceName": "testDataspace",
            "schemaSetName": "testSchema"
        },
        {
            "dataspaceName": "testDataspace",
            "schemaSetName": "testSchema"
        },
        {
            "dataspaceName": "testDataspace",
            "schemaSetName": "testSchema"
        }
    ]



List of existing API's that can be updated

...

  1. Create multiple root nodes in parallel (ref. Jira- CPS-341)

    URL : POST http:// IP:PORT/cps/api/v1/dataspaces/<dataspace-name>/anchors/<anchor-name>/nodes?xpath=/

    Existing request payload

    New request payload (ref JSON file in CPS-341)


    Code Block
    {
      "first-container": {
        "a-leaf": "a-value",
        "b-leaf": "b-value"
       }
    }




    Code Block
    {
      "first-container": {
        "a-leaf": "a-value",
        "b-leaf": "b-value"
      },
      "second-container": {
        "x-leaf": "x-value",
        "y-leaf": "y-value"
      },
      "last-container": {
        "x-leaf": "x-value",
        "y-leaf": "y-value"
      }
    }



    Note: For get multiple nodes we will use same API for get singular node to return. Can we have new end point for getting all root nodes ‘/nodes’.

  2. Create Dataspace should return JSON not have response body

    URL : POST http://IP:PORT/cps/api/v1v2/dataspaces?dataspace-name=testDataspace

    {    “dataspaceName”: “testDataspace” }

    No response body

    Current response body

    testDataspace

    Current response type

    Text/plain

    New response body


    Code Block

    New response type

    Application/jsonNo response type


  3. Create schema-set should return JSON not have response body

    URL : POST http://IP:PORT/cps/api/v1v2/dataspaces/<dataspace-name>/schema-sets

    Current response body

    schema-set1

    Current response type

    Text/plain

    New response body

    Code Block
    {
        "dataspaceName": "testDataspace",
        "moduleReferences": [
            {
                "name": null,
                "namespace": "http://example.com/example-2",
                "revision": "2021-01-28"
            }
        ],
        "name": "example-2-yang"
    }


    No response body

    New response type

    No response type

    New response type

    Application/json


  4. Create an anchor should return JSON not have response body

    URL : POST http://IP:PORT/cps/api/v1v2/dataspaces/<dataspace-name>/anchors?schema-set-name=<schema-set-name>&anchor-name=<anchor_name>

    Current response body

    anchor-test1

    Current response type

    Text/plain

    New response body

    Code Block
    {
         "name": "testAnchor",
        "dataspaceName": "testDataspace",
        "schemaSetName": "example-2-yang"
    }

    New response type

    Application/json

    Create Node should return JSON response

    URL:  POST http://IP:PORT/cps/api/v1/dataspaces/<dataspace-name>/anchors/<anchor-name>/nodes?xpath=/

    No response body


    New response type

    No response type

    Current response body

    No Content

    Current response type

    New response body

    Code Block
    {
         "nodeName": "sampleNode",
         "anchorName": "testAnchor",
          "dataspaceName": "testDataspace"
    }

    New response type

    Application/json


  5. Create Node: if leaf list has only one leaf, then don’t force to use [] in request payload?

    Current error message:

    Only error code 500 Internal Server Error is returned.

    The logs are as follows

    Code Block
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Node (org:onap:ccsdk:sample?revision=2020-09-15)authors is not a simple type

    here authors is name of leaf-list in schema/yang resource

      

    Code Block
    leaf-list authors {
                    type string;
                }

    Sample error message:

    Code Block
    Node (org:onap:ccsdk:sample?revision=2020-09-15)authors in schema is a leaf-list. Data received is of type list (or leaf).

    Note: We need to handle above error and add a leaf list if there is only one leaf in leaf-list without forcing []. Include list as it accepts data without [], so do we need the error or change leaf-list to accept without []

...