{
- "ietf-restconf:yang-patch":{
- "patch-id":"patch-1",
- "edit":[
+ "bookstore": {
+ "categories": [
{
- "edit-id":"edit1",
- "operation":"merge",
- "target":"/",
- "value":{
- "bookstore": {
- "categories": [
- {
- "code": "100",
- "books": [
- {
- "title": "A new book in a new category",
- "pub_year": "2019",
- "authors": [
- "Rahul"
- ],
- "lang": "English",
- "price": "2011"
- }
- ],
- "name": "Category100"
- }
- ]
+ "code": "100",
+ "books": [
+ {
+ "title": "A new book in a new category",
+ "pub_year": "2019",
+ "authors": [
+ "Rahul"
+ ],
+ "lang": "English",
+ "price": "2011"
}
- }
+ ],
+ "name": "Category100"
},
{
- "edit-id":"edit2",
- "operation":"merge",
- "target":"/",
- "value":{
- "bookstore": {
- "categories": [
- {
- "code": "02",
- "name": "Horror",
- "books": [
- {
- "title": "A New book in existing category",
- "lang": "English",
- "authors": [
- "Joe & Rahul"
- ],
- "pub_year": "2003",
- "price": "2000"
- }
- ]
- }
- ]
+ "code": "02",
+ "name": "Horror",
+ "books": [
+ {
+ "title": "A New book in existing category",
+ "lang": "English",
+ "authors": [
+ "Joe & Rahul"
+ ],
+ "pub_year": "2003",
+ "price": "2000"
}
- }
+ ]
}
]
}
Patch will add new category with new book and add a new book to an existing category
${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore
- ${headers}= Create Dictionary Content-Type=application/yang.patch+json
+ ${headers}= Create Dictionary Content-Type=application/json
${jsonData}= Get Binary File ${DATADIR_NCMP}${/}bookstorePatchExample.json
${response}= PATCH On Session CPS_URL ${uri} headers=${headers} data=${jsonData}
Should Be Equal As Strings ${response.status_code} 200
NODE_ID=${NODE_ID:-'ietfYang-PNFDemo'}
echo "Attempting to mount node with id '$NODE_ID' to SDNC using RestConf"
-curl --request PUT "http://$SDNC_HOST:$SDNC_PORT/restconf/config/network-topology:network-topology/topology/topology-netconf/node/$NODE_ID" \
+curl --request PUT "http://$SDNC_HOST:$SDNC_PORT/rests/data/network-topology:network-topology/topology=topology-netconf/node=$NODE_ID" \
--silent --location \
--header "$SDNC_AUTH_HEADER" \
--header 'Content-Type: application/json' \
}'
# Verify node has been mounted
-RESPONSE=$(curl --silent --location --request GET "http://$SDNC_HOST:$SDNC_PORT/restconf/config/network-topology:network-topology/topology/topology-netconf" --header "$SDNC_AUTH_HEADER")
+RESPONSE=$(curl --silent --location --request GET "http://$SDNC_HOST:$SDNC_PORT/rests/data/network-topology:network-topology/topology=topology-netconf?content=config" --header "$SDNC_AUTH_HEADER")
if echo "$RESPONSE" | grep -q "$NODE_ID"; then
echo "Node mounted successfully"
sdnc:
container_name: sdnc
- image: onap/sdnc-image:${SDNC_VERSION:-2.2.3}
+ image: onap/sdnc-image:${SDNC_VERSION:-3.0.2}
entrypoint: /opt/onap/sdnc/bin/startODL.sh
ports:
- 8181:8181
- ./config/sdnc/certs/certs.properties:/opt/opendaylight/certs/certs.properties
- ./config/sdnc/certs/keys0.zip:/opt/opendaylight/certs/keys0.zip
healthcheck:
- test: "wget -q -O - --header 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' http://localhost:8181/restconf/operational/network-topology:network-topology || exit 1"
+ test: "wget -q -O - --header 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' http://localhost:8181/rests/operations/SLI-API:healthcheck || exit 1"
interval: 10s
timeout: 10s
retries: 6