Versions Compared

Key

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

...

Assuming the following data is in the DB

Code Block
titleData Example
collapsetrue
[
    {
        "int:interface-A": {
            "interface": [
                {
                    "name": "Interface-A-2",
                    "address": "1.1.1.70",
                    "enabled": false,
                    "subnet-mask": "0.0.0.0"
                },
                {
                    "name": "Interface-A",
                    "address": "10.10.10.18",
                    "enabled": false,
                    "subnet-mask": "255.255.0.0"
                }
            ]
        }
    }
]

Updating multiple items in a list data node

Code Block
titlePatch Operation
collapsetrue
curl --location --request PATCH 'http://localhost:8080/cps/api/v1/dataspaces/testDataspace/anchors/MultipleDataTree/nodes?xpath=%2Finterface-A&observed-timestamp=2021-03-21T00%3A10%3A34.030-0100' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
--header 'Cookie: JSESSIONID=node01oja2kuolgg6dtfvnzzqf4bwk0.node0' \
--data '{
        
            "interface": [
                
                {
                    "name": "Interface-A-2",
                    "address": "1.1.1.1",		//value to be updated
                    "enabled": true,			//value to be updated
                    "subnet-mask": "0.0.0.0"
                },
                {
                    "name": "Interface-A",
                    "address": "10.10.10.10",	//value to be updated
                    "enabled": true,			//value to be updated
                    "subnet-mask": "0.0.0.0"
                }
            ]
        
    }'

Response received after CPS 1526

Code Block
titleResponse
{
    "status": "400 BAD_REQUEST",
    "message": "Operation is not supported for multiple data nodes",
    "details": "Number of data nodes present: 2"
}

...