Fix VIM commands and samples 79/12179/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Wed, 13 Sep 2017 11:27:14 +0000 (16:57 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Wed, 13 Sep 2017 11:37:12 +0000 (17:07 +0530)
AAI has fixed the ESR to create the VIM
properly and VIM commands are updated
to reflect that change.

CLI-5
Change-Id: Ic768846129f218979d87737fc47cab272e6c83b8
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
plugins/aai/src/main/resources/onap-cli-schema/esr/vim/vim-delete-schema-1.1.yaml
plugins/aai/src/main/resources/onap-cli-schema/esr/vim/vim-list-schema-1.1.yaml
plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-create-sample-1.1.yaml [new file with mode: 0644]
plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-delete-sample-1.1.yaml [new file with mode: 0644]
plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-list-sample-1.1.yaml [new file with mode: 0644]

index 7fd2d98..55d1604 100644 (file)
@@ -31,14 +31,20 @@ parameters:
     short_option: z
     long_option:  vim-id
     is_optional: false
+  - name: resource-version
+    description: Onap vim resource version
+    type: uuid
+    short_option: b
+    long_option: resource-version
+    is_optional: true
 
 http:
   request:
-    uri: /aai/v11/cloud-infrastructure/cloud-regions/cloud-region/${cloud-name}/${region-name}/esr-system-info-list/esr-system-info/${vim-id}
+    uri: /aai/v11/cloud-infrastructure/cloud-regions/cloud-region/${cloud-name}/${region-name}/esr-system-info-list/esr-system-info/${vim-id}?resource-version=${resource-version}
     method: DELETE
 
   success_codes:
-    - 201
+    - 204
     - 404
 
   sample_response:
index de133db..2af3474 100644 (file)
@@ -39,7 +39,7 @@ results:
       type: string
     - name: type
       description: Onap vim type
-      scope: short
+      scope: long
       type: string
     - name: vendor
       description: Onap vim vendor
@@ -47,11 +47,11 @@ results:
       type: string
     - name: version
       description: Onap vim version
-      scope: short
+      scope: long
       type: string
     - name: url
       description: Onap vim url
-      scope: short
+      scope: long
       type: string
     - name: username
       description: Onap vim username
@@ -77,18 +77,16 @@ http:
   success_codes:
     - 200
   result_map:
-    vim-id: $b{$.esr-system-info.[*].esr-system-info-id
-    name: $b{$.esr-system-info.[*].system-name
-    type: $b{$.esr-system-info.[*].type
-    vendor: $b{$.esr-system-info.[*].vendor
-    version: $b{$.esr-system-info.[*].version
-    url: $b{$.esr-system-info.[*].service-url
-    username: $b{$.esr-system-info.[*].user-name
-    cloud-domain: $b{$.esr-system-info.[*].cloud-domain
-    default-tenant: $b{$.esr-system-info.[*].default-tenant
-    resource-version: $b{$.esr-system-info.[*].resource-version
+    vim-id: $b{$.esr-system-info.[*].esr-system-info-id}
+    name: $b{$.esr-system-info.[*].system-name}
+    type: $b{$.esr-system-info.[*].type}
+    vendor: $b{$.esr-system-info.[*].vendor}
+    version: $b{$.esr-system-info.[*].version}
+    url: $b{$.esr-system-info.[*].service-url}
+    username: $b{$.esr-system-info.[*].user-name}
+    cloud-domain: $b{$.esr-system-info.[*].cloud-domain}
+    default-tenant: $b{$.esr-system-info.[*].default-tenant}
+    resource-version: $b{$.esr-system-info.[*].resource-version}
 
   sample_response:
     body: '{esr-system-info":[{"esr-system-info-id":"example-esr-system-info-id-val-62966","system-name":"example-system-name-val-76894","type":"example-type-val-32301","vendor":"example-vendor-val-38139","version":"example-version-val-42345","service-url":"example-service-url-val-33729","user-name":"example-user-name-val-32122","password":"example-password-val-56539","system-type":"example-system-type-val-80707","protocal":"example-protocal-val-30105","ssl-cacert":"example-ssl-cacert-val-52110","ssl-insecure":true,"ip-address":"example-ip-address-val-10140","port":"example-port-val-26369","cloud-domain":"example-cloud-domain-val-22303","default-tenant":"example-default-tenant-val-26326"}]}'
-
-
diff --git a/plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-create-sample-1.1.yaml b/plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-create-sample-1.1.yaml
new file mode 100644 (file)
index 0000000..3193f6e
--- /dev/null
@@ -0,0 +1,8 @@
+onap_cli_sample_version: 1.0
+
+name: vim-register
+version: onap-1.1
+samples:
+    sample1:
+        name: Create a vim under given cloud region
+        input: -x cloud-1 -y region-1 -z f962fa1e-d439-4b02-a122-cc38fd0da07b -b vim-1 -c OpenStack -e HW -q 1.0 -g http://locahost -i user -j password -n default -o tenant-1 -d
diff --git a/plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-delete-sample-1.1.yaml b/plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-delete-sample-1.1.yaml
new file mode 100644 (file)
index 0000000..5a1998f
--- /dev/null
@@ -0,0 +1,8 @@
+onap_cli_sample_version: 1.0
+
+name: vim-unregister
+version: onap-1.1
+samples:
+    sample1:
+        name: Delete the vim under given cloud region
+        input: -x cloud-1 -y region-1 -z f962fa1e-d439-4b02-a122-cc38fd0da07b -b 1505295671538
diff --git a/plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-list-sample-1.1.yaml b/plugins/aai/src/test/resources/onap-cli-sample/esr/vim/vim-list-sample-1.1.yaml
new file mode 100644 (file)
index 0000000..d0e6d43
--- /dev/null
@@ -0,0 +1,24 @@
+onap_cli_sample_version: 1.0
+
+name: vim-list
+version: onap-1.1
+samples:
+    sample1:
+        name: List all vim under given cloud region
+        input: -x cloud-1 -y region-1
+        output: |
+            +--------------------------------------+--------+--------+----------------+------------------+
+            |vim-id                                |name    |vendor  |default-tenant  |resource-version  |
+            +--------------------------------------+--------+--------+----------------+------------------+
+            |f962fa1e-d439-4b02-a122-cc38fd0da07b  |vim-1   |HW      |tenant-1        |1505295671538     |
+            +--------------------------------------+--------+--------+----------------+------------------+
+    sample2:
+        name: List all vim under given cloud region with complete details
+        input: -x cloud-1 -y region-1 --long
+        output: |
+            +--------------------------------------+--------+------------+--------+----------+------------------+----------+--------------+----------------+------------------+
+            |vim-id                                |name    |type        |vendor  |version   |url               |username  |cloud-domain  |default-tenant  |resource-version  |
+            +--------------------------------------+--------+------------+--------+----------+------------------+----------+--------------+----------------+------------------+
+            |f962fa1e-d439-4b02-a122-cc38fd0da07b  |vim-1   |OpenStack   |HW      |1.0       |http://locahost   |user      |default       |tenant-1        |1505295671538     |
+            +--------------------------------------+--------+------------+--------+----------+------------------+----------+--------------+----------------+------------------+
+