From 3ac0d20b08dd8c31ff85ad3ca5c53df11b6d96e4 Mon Sep 17 00:00:00 2001 From: ottero Date: Sun, 17 Mar 2019 19:38:32 +0000 Subject: Adding custom headers capability to REST client For YANG PATCH requests to ODL to work, they need to have a Content- type header of application/yang.patch+json and should not have Accept as application/json Current REST client inserts a default header to the requests with this content: Content-Type: application/json Accept: application/json The solution was to add the possibility of sending custom headers alon- gside the other parameters. Change-Id: I2cf0cd2ef7b87f4f5a246d427dffafe266cb33f7 Issue-ID: CCSDK-926 Signed-off-by: ottero --- .../Templates/config-assign-pnf-mapping.json | 3 -- .../config-assign-restconf-configlet-template.vtl | 56 ++++++++++++++-------- .../config-deploy-restconf-mount-template.vtl | 14 ++++++ .../Templates/configure-pnf-mapping.json | 3 -- .../configure-restconf-mount-template.vtl | 14 ------ .../configure-restconf-unmount-template.vtl | 1 - 6 files changed, 51 insertions(+), 40 deletions(-) delete mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-deploy-restconf-mount-template.vtl delete mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json delete mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl delete mode 100644 components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl (limited to 'components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates') diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json deleted file mode 100644 index 41b42e677..000000000 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-pnf-mapping.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - -] diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl index e3d7a6716..3812380ea 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-assign-restconf-configlet-template.vtl @@ -1,19 +1,37 @@ - -example-patch -Example patch - - edit1 - create - /car-entry - - - 0 - - - - - edit2 - delete - /car-entry/0 - - +{ + "ietf-restconf:yang-patch":{ + "patch-id":"patch-1", + "edit":[ + { + "edit-id":"edit1", + "operation":"merge", + "target":"/", + "value":{ + "netconflist":{ + "netconf":[ + { + "netconf-id":"40", + "netconf-param":"4040" + } + ] + } + } + }, + { + "edit-id":"edit2", + "operation":"merge", + "target":"/", + "value":{ + "netconflist":{ + "netconf":[ + { + "netconf-id":"50", + "netconf-param":"98765" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-deploy-restconf-mount-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-deploy-restconf-mount-template.vtl new file mode 100644 index 000000000..935177658 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/config-deploy-restconf-mount-template.vtl @@ -0,0 +1,14 @@ + + $entity.pnf-id + + ODL-private-key + netconf + + $entity.pnf-name + 6513 + false + + TLS + + 5 + diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json deleted file mode 100644 index 41b42e677..000000000 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-pnf-mapping.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - -] diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl deleted file mode 100644 index a899aa45c..000000000 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-mount-template.vtl +++ /dev/null @@ -1,14 +0,0 @@ - - $pnf-id - - ODL-private-key - netconf - - $pnf-ip - 6513 - false - - TLS - - 5 - diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl deleted file mode 100644 index a0990367e..000000000 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_restconf/Templates/configure-restconf-unmount-template.vtl +++ /dev/null @@ -1 +0,0 @@ -TBD -- cgit 1.2.3-korg