aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-06 14:33:42 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-06 14:37:11 +0530
commit1b45d1a610274ebd99b3bf361f5ec41aff338da9 (patch)
tree66217f4e074ddac8724dc29e551899bc920c7700 /plugins
parent60e988d324475b22fb273b0e1cba7a1481fa0082 (diff)
Fix subscription-list command
Now it reports tenant, region and cloud CLI-14 Change-Id: I6d2bd1459d5a942603ac7c6e8b02ac06fe5b7625 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/aai/src/main/resources/onap-cli-schema/subscription/subscription-list-schema-1.1.yaml16
-rw-r--r--plugins/aai/src/test/resources/onap-cli-sample/cloud-region/cloud-list-sample-1.0.yaml27
2 files changed, 43 insertions, 0 deletions
diff --git a/plugins/aai/src/main/resources/onap-cli-schema/subscription/subscription-list-schema-1.1.yaml b/plugins/aai/src/main/resources/onap-cli-schema/subscription/subscription-list-schema-1.1.yaml
index 0908fc9a..adfd1026 100644
--- a/plugins/aai/src/main/resources/onap-cli-schema/subscription/subscription-list-schema-1.1.yaml
+++ b/plugins/aai/src/main/resources/onap-cli-schema/subscription/subscription-list-schema-1.1.yaml
@@ -27,6 +27,18 @@ results:
description: Onap subscription resource version
scope: short
type: string
+ - name: tenant
+ description: Onap tenant name
+ scope: long
+ type: string
+ - name: region
+ description: Onap region name
+ scope: long
+ type: string
+ - name: cloud
+ description: Onap cloud name
+ scope: long
+ type: string
http:
request:
uri: /aai/v11/business/customers/customer/${customer-name}/service-subscriptions
@@ -36,6 +48,10 @@ http:
result_map:
service-type: $b{$.service-subscription.[*].service-type}
resource-version: $b{$.service-subscription.[*].resource-version}
+ tenant: $b{service-subscription.[*].relationship-list.relationship.[*].relationship-data.[?(@.relationship-key == 'tenant.tenant-id')].relationship-value}
+ region: $b{service-subscription.[*].relationship-list.relationship.[*].relationship-data.[?(@.relationship-key == 'cloud-region.cloud-region-id')].relationship-value}
+ cloud: $b{service-subscription.[*].relationship-list.relationship.[*].relationship-data.[?(@.relationship-key == 'cloud-region.cloud-owner')].relationship-value}
+
sample_response:
body: '{"service-subscription":[{"service-type":"vTest","resource-version":"1504091375183","relationship-list":{"relationship":[{"related-to":"tenant","related-link":"/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/26ab7af6-96cc-4c4e-814a-e533af4ef9f6","relationship-data":[{"relationship-key":"cloud-region.cloud-owner","relationship-value":"att-aic"},{"relationship-key":"cloud-region.cloud-region-id","relationship-value":"AAIAIC25"},{"relationship-key":"tenant.tenant-id","relationship-value":"26ab7af6-96cc-4c4e-814a-e533af4ef9f6"}],"related-to-property":[{"property-key":"tenant.tenant-name","property-value":"test"}]}]}}]}'
diff --git a/plugins/aai/src/test/resources/onap-cli-sample/cloud-region/cloud-list-sample-1.0.yaml b/plugins/aai/src/test/resources/onap-cli-sample/cloud-region/cloud-list-sample-1.0.yaml
new file mode 100644
index 00000000..9b267481
--- /dev/null
+++ b/plugins/aai/src/test/resources/onap-cli-sample/cloud-region/cloud-list-sample-1.0.yaml
@@ -0,0 +1,27 @@
+onap_cli_sample_version: 1.0
+
+name: cloud-list
+version: onap-1.0
+samples:
+ sample1:
+ name: List the configured clouds in onap
+ input: -h https://locahost:8443 -u AAI -p AAI
+ output: |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ |cloud |region |tenant |tenant-id |customer |service |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ |Rackspace |RegionOne |onap |e69e6d64b44347509c3fc512391f34a6 |Demonstration |vFW |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ | | | | |Demonstration123 |vFW |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ | | | | |u2 |vFW |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ | | | | |DemoCust_7151e36a-1a57-4993-b513-54134f2b8f19 |vFW |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ | | | | |Demonstration |vLB |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ | | | | |Linan |vFW |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+ | | | | |Linan |vLB |
+ +------------+------------+--------+----------------------------------+------------------------------------------------+----------+
+