switch from CLI to REST for consistency and because the CLI hates question marks 24/5524/1
authorJeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Wed, 4 Oct 2017 23:45:37 +0000 (19:45 -0400)
committerJeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Wed, 4 Oct 2017 23:47:22 +0000 (19:47 -0400)
Signed-off-by: Jeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Change-Id: Icd0a4b5e7bc0e83b5c9017c065f5da36747fb444

BUG 348

installers/install_osm.sh

index 896eaef..9d10308 100755 (executable)
@@ -229,10 +229,24 @@ function configure(){
       --data '{"rw-ro-account:account": [ { "openmano": { "host": "'$RO_CONTAINER_IP'", "port": "9090", "tenant-id": "'$RO_TENANT_ID'"}, "name": "osmopenmano", "ro-account-type": "openmano" }]}')
     [[ $result =~ .*success.* ]] || FATAL "Failed resource-orchestrator configuration: $result"
 
-    lxc exec SO-ub -- /usr/rift/rift-shell -- rwcli --username admin --passwd admin  <<EOF
-config 
-openidc-provider-config rw-ui-client redirect-uri https://$DEFAULT_IP:8443/callback post-logout-redirect-uri https://$DEFAULT_IP:8443/
-EOF
+    result=$(curl -k --request PATCH \
+      --url https://$SO_CONTAINER_IP:8008/v2/api/config/openidc-provider-config/rw-ui-client/redirect-uri \
+      --header 'accept: application/vnd.yang.data+json' \
+      --header 'authorization: Basic YWRtaW46YWRtaW4=' \
+      --header 'cache-control: no-cache'   \
+      --header 'content-type: application/vnd.yang.data+json' \
+      --data '{"redirect-uri": "https://'$DEFAULT_IP':8443/callback" }')
+    [[ $result =~ .*success.* ]] || FATAL "Failed redirect-uri configuration: $result"
+
+    result=$(curl -k --request PATCH \
+      --url https://$SO_CONTAINER_IP:8008/v2/api/config/openidc-provider-config/rw-ui-client/post-logout-redirect-uri \
+      --header 'accept: application/vnd.yang.data+json' \
+      --header 'authorization: Basic YWRtaW46YWRtaW4=' \
+      --header 'cache-control: no-cache'   \
+      --header 'content-type: application/vnd.yang.data+json' \
+      --data '{"post-logout-redirect-uri": "https://'$DEFAULT_IP':8443/?api_server=https://'$DEFAULT_IP'" }')
+    [[ $result =~ .*success.* ]] || FATAL "Failed post-logout-redirect-uri configuration: $result"
+
     lxc exec SO-ub -- tee /etc/network/interfaces.d/60-rift.cfg <<EOF
 auto lo:1
 iface lo:1 inet static