From 6d8ee6d341b0e5f3ff3cbf2d06fa27d0b6cb7cad Mon Sep 17 00:00:00 2001 From: demx8as6 Date: Thu, 19 Mar 2020 13:27:00 +0100 Subject: [PATCH] Provide curl bash scripts for Software Management For development purposes it is beneficial to show interfacing with O1 controler on the northbound side. IssueID: OAM-75 Change-Id: Icd8f1cf6768d190c99d177427955407c67b15ceb Signed-off-by: demx8as6 --- .../software-management/o-ran-ru-swm-config | 52 ++++++++++++++++++++ .../o-ran-ru-swm-get-software-inventory.sh | 25 ++++++++++ .../software-management/x-ran-ru-swm-config | 56 ++++++++++++++++++++++ .../x-ran-ru-swm-software-activate.json | 5 ++ .../x-ran-ru-swm-software-download.json | 8 ++++ .../x-ran-ru-swm-software-install.json | 6 +++ .../scripts/software-management/x-ran-ru-swm.sh | 34 +++++++++++++ 7 files changed, 186 insertions(+) create mode 100644 solution/dev/smo/scripts/software-management/o-ran-ru-swm-config create mode 100755 solution/dev/smo/scripts/software-management/o-ran-ru-swm-get-software-inventory.sh create mode 100644 solution/dev/smo/scripts/software-management/x-ran-ru-swm-config create mode 100644 solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-activate.json create mode 100644 solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-download.json create mode 100644 solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-install.json create mode 100755 solution/dev/smo/scripts/software-management/x-ran-ru-swm.sh diff --git a/solution/dev/smo/scripts/software-management/o-ran-ru-swm-config b/solution/dev/smo/scripts/software-management/o-ran-ru-swm-config new file mode 100644 index 0000000..36d8cdd --- /dev/null +++ b/solution/dev/smo/scripts/software-management/o-ran-ru-swm-config @@ -0,0 +1,52 @@ +################################################################################ +# +# Copyright 2020 highstreet technologies GmbH and others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +################################################################################ +# Configuration for Sotware management interface tests + +# settings +# protocol: http | http +protocol=https + +# host: http | https +host=sdn-r-dev.open5g-test.com + +# port: The SDN-R port number exposed by SDN-R docker +port=443 + +# restconf: a static url path of SDN-R (currently not RFC8040) +restconf=restconf/config/network-topology:network-topology/topology/topology-netconf/node + +# nodeId: The device (or NetConf server) identifier to be addressed +nodeId=o-ran-RadioUnit-fronthaul-1 + +# static: a static part of the url path required by ODL +static=yang-ext:mount + +# objectId: The Object identifier as defined by YANG +objectId=o-ran-software-management:software-inventory + +# appUser, appPassword: App crendencials for authentiation +appUser=admin +appPassword=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + +# Inherit or static curl/header parameters + url=$protocol://$host/$restconf/$nodeId/$static/$objectId + auth="-u $appUser:$appPassword" + authority="-H 'authority: "$host"'" +contentType="-H 'Content-Type:application/json'" + accept="-H 'Accept:application/json'" diff --git a/solution/dev/smo/scripts/software-management/o-ran-ru-swm-get-software-inventory.sh b/solution/dev/smo/scripts/software-management/o-ran-ru-swm-get-software-inventory.sh new file mode 100755 index 0000000..5a37c00 --- /dev/null +++ b/solution/dev/smo/scripts/software-management/o-ran-ru-swm-get-software-inventory.sh @@ -0,0 +1,25 @@ +#!/bin/bash +################################################################################ +# +# Copyright 2020 highstreet technologies GmbH and others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +################################################################################ +# Script to request interfaces from ONAP SDN-R + +# import settings +. o-ran-ru-swm-config; + +# send HTTP-GET +curl $url $auth $authority $accept $contentType --compressed | python -m json.tool diff --git a/solution/dev/smo/scripts/software-management/x-ran-ru-swm-config b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-config new file mode 100644 index 0000000..f683869 --- /dev/null +++ b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-config @@ -0,0 +1,56 @@ +################################################################################ +# +# Copyright 2020 highstreet technologies GmbH and others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +################################################################################ +# Configuration for Sotware management interface tests + +# settings +# protocol: http | http +protocol=https + +# host: http | https +host=sdn-r-dev.open5g-test.com + +# port: The SDN-R port number exposed by SDN-R docker +port=443 + +# restconf: a static url path of SDN-R (currently not RFC8040) +restconfConfig=restconf/config/network-topology:network-topology/topology/topology-netconf/node +restconfOperations=restconf/operations/network-topology:network-topology/topology/topology-netconf/node + +# nodeId: The device (or NetConf server) identifier to be addressed +nodeId=x-ran-RadioUnit-fronthaul-1 + +# static: a static part of the url path required by ODL +static=yang-ext:mount + +# objectId: The Object identifier as defined by YANG +inventoryId=xran-software-management:software-inventory +downloadId=xran-software-management:software-download +installId=xran-software-management:software-install +activateId=xran-software-management:software-activate + +# appUser, appPassword: App crendencials for authentiation +appUser=admin +appPassword=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + +# Inherit or static curl/header parameters +urlInventory=$protocol://$host/$restconfConfig/$nodeId/$static/$inventoryId + urlDownload=$protocol://$host/$restconfOperations/$nodeId/$static/$downloadId + urlInstall=$protocol://$host/$restconfOperations/$nodeId/$static/$installId + urlActivate=$protocol://$host/$restconfOperations/$nodeId/$static/$activateId + auth="-u $appUser:$appPassword" diff --git a/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-activate.json b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-activate.json new file mode 100644 index 0000000..344316c --- /dev/null +++ b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-activate.json @@ -0,0 +1,5 @@ +{ + "xran-software-management:input": { + "xran-software-management:slot-name": "LoLoozLzL" + } +} diff --git a/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-download.json b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-download.json new file mode 100644 index 0000000..5ed742e --- /dev/null +++ b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-download.json @@ -0,0 +1,8 @@ +{ + "xran-software-management:input": { + "xran-software-management:remote-file-path": "sftp://admin@sim.o-ran-sc.org:22/images/WHB-odu#123.ext", + "xran-software-management:password": { + "xran-software-management:password": "test" + } + } +} diff --git a/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-install.json b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-install.json new file mode 100644 index 0000000..69d41f7 --- /dev/null +++ b/solution/dev/smo/scripts/software-management/x-ran-ru-swm-software-install.json @@ -0,0 +1,6 @@ +{ + "xran-software-management:input": { + "xran-software-management:slot-name": "LoLoozLzL", + "xran-software-management:file-names": ["UCUCKUKBUyCyKCyKKK", "iiiiggsiisigigs"] + } +} diff --git a/solution/dev/smo/scripts/software-management/x-ran-ru-swm.sh b/solution/dev/smo/scripts/software-management/x-ran-ru-swm.sh new file mode 100755 index 0000000..d7b87a2 --- /dev/null +++ b/solution/dev/smo/scripts/software-management/x-ran-ru-swm.sh @@ -0,0 +1,34 @@ +#!/bin/bash +################################################################################ +# +# Copyright 2020 highstreet technologies GmbH and others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +################################################################################ +# Script to request interfaces from ONAP SDN-R + +# import settings +. x-ran-ru-swm-config; + +# send HTTP-GET Software Inventory +curl $auth -H "Content-Type: application/json" -H "Accept: application/json" $urlInventory --compressed | python -m json.tool + +# send HTTP-POST Software Download +curl $auth -H "Content-Type: application/json" -H "Accept: application/json" $urlDownload -d @x-ran-ru-swm-software-download.json --compressed | python -m json.tool + +# send HTTP-POST Software Install +curl $auth -H "Content-Type: application/json" -H "Accept: application/json" $urlInstall -d @x-ran-ru-swm-software-install.json --compressed | python -m json.tool + +# send HTTP-POST Software Activate +curl $auth -H "Content-Type: application/json" -H "Accept: application/json" $urlActivate -d @x-ran-ru-swm-software-activate.json --compressed | python -m json.tool -- 2.16.6