Casablanca: AAI customer-show 00/69700/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Fri, 28 Sep 2018 03:43:48 +0000 (09:13 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Fri, 28 Sep 2018 03:46:04 +0000 (09:16 +0530)
Issue-ID: CLI-122

Change-Id: Iab593d1d800849c5e4f9d78a80856fbe26caf6bb
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-list-schema-casablanca-moco.json
products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-list-schema-casablanca-sample.yaml
products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-show-schema-casablanca-moco.json [new file with mode: 0644]
products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-show-schema-casablanca-sample.yaml [new file with mode: 0644]
products/onap-casablanca/features/aai/src/main/resources/open-cli-schema/customer/customer-show-schema-casablanca.yaml [new file with mode: 0644]

index 671696f..be7ab31 100644 (file)
@@ -6,7 +6,7 @@
       "Authorization" : "Basic QUFJOkFBSQ==",\r
       "X-FromAppId" : "ONAP CLI",\r
       "Accept" : "application/json",\r
-      "X-TransactionId" : "req-c0c84e34-0ea1-4e2c-b91e-5e12838530bf",\r
+      "X-TransactionId" : "req-6e5c21be-a7a2-459d-8765-99f7663cdce9",\r
       "Content-Type" : "application/json"\r
     },\r
     "json" : null\r
         "subscriber-name" : "generic",\r
         "subscriber-type" : "BSS",\r
         "resource-version" : "1535628858377"\r
+      }, {\r
+        "global-customer-id" : "mrkanag",\r
+        "subscriber-name" : "mrkanag",\r
+        "subscriber-type" : "INFRA",\r
+        "resource-version" : "1538105836430"\r
       } ]\r
     }\r
   }\r
index a6d35a4..6652091 100644 (file)
@@ -4,6 +4,15 @@ version: onap-casablanca
 samples:
   sample1:
     name: customer-list
-    input: -d
+    input: 
     moco: customer-list-schema-casablanca-moco.json
     output: |
+      +------------+------------------+
+      |name        |resource-version  |
+      +------------+------------------+
+      |Customer1   |1535520279641     |
+      +------------+------------------+
+      |generic     |1535628858377     |
+      +------------+------------------+
+      |mrkanag     |1538105836430     |
+      +------------+------------------+
diff --git a/products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-show-schema-casablanca-moco.json b/products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-show-schema-casablanca-moco.json
new file mode 100644 (file)
index 0000000..0919a99
--- /dev/null
@@ -0,0 +1,23 @@
+[ {\r
+  "request" : {\r
+    "method" : "get",\r
+    "uri" : "/aai/v13/business/customers/customer/mrkanag",\r
+    "headers" : {\r
+      "Authorization" : "Basic QUFJOkFBSQ==",\r
+      "X-FromAppId" : "ONAP CLI",\r
+      "Accept" : "application/json",\r
+      "X-TransactionId" : "req-04a4060f-b2ac-4cb5-97fb-2ec535599434",\r
+      "Content-Type" : "application/json"\r
+    },\r
+    "json" : null\r
+  },\r
+  "response" : {\r
+    "status" : 200,\r
+    "json" : {\r
+      "global-customer-id" : "mrkanag",\r
+      "subscriber-name" : "mrkanag",\r
+      "subscriber-type" : "INFRA",\r
+      "resource-version" : "1538105836430"\r
+    }\r
+  }\r
+} ]
\ No newline at end of file
diff --git a/products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-show-schema-casablanca-sample.yaml b/products/onap-casablanca/features/aai/src/main/resources/open-cli-sample/customer/customer-show-schema-casablanca-sample.yaml
new file mode 100644 (file)
index 0000000..aa38612
--- /dev/null
@@ -0,0 +1,14 @@
+open_cli_sample_version: 1.0
+name: customer-show
+version: onap-casablanca
+samples:
+  sample1:
+    name: customer-show
+    input: --customer-name mrkanag --long
+    moco: customer-show-schema-casablanca-moco.json
+    output: |
+      +----------+------------------+------------------+------------------+
+      |name      |subscriber-name   |resource-version  |subscriber-type   |
+      +----------+------------------+------------------+------------------+
+      |mrkanag   |mrkanag           |1538105836430     |INFRA             |
+      +----------+------------------+------------------+------------------+
diff --git a/products/onap-casablanca/features/aai/src/main/resources/open-cli-schema/customer/customer-show-schema-casablanca.yaml b/products/onap-casablanca/features/aai/src/main/resources/open-cli-schema/customer/customer-show-schema-casablanca.yaml
new file mode 100644 (file)
index 0000000..65c512f
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright 2018 Huawei Technologies Co., Ltd.
+#
+# 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.
+
+open_cli_schema_version: 1.0
+name: customer-show
+description: Retrieves the given registered customer in Onap
+
+info:
+  product: onap-casablanca
+  service: aai
+  author: ONAP CLI Team onap-discuss@lists.onap.org
+
+parameters:
+  - name: customer-name
+    description: Onap customer name
+    type: string
+    short_option: x
+    long_option: customer-name
+    is_optional: false
+
+results:
+  direction: landscape
+  attributes:
+    - name: name
+      description: Onap customer name
+      scope: short
+      type: string
+    - name: subscriber-name
+      description: Onap subscriber name
+      scope: short
+      type: string
+    - name: resource-version
+      description: Onap subscriber resource version
+      scope: long
+      type: string
+    - name: subscriber-type
+      description: Onap subscriber type
+      scope: long
+      type: string
+http:
+  service:
+    auth: basic
+    mode: direct
+  request:
+    uri: /aai/v13/business/customers/customer/${customer-name}
+    method: GET
+  success_codes:
+    - 200
+  result_map:
+    name: $b{$.global-customer-id}
+    subscriber-name: $b{$.subscriber-name}
+    subscriber-type: $b{$.subscriber-type}
+    resource-version: $b{$.resource-version}
+  sample_response:
+    body: '{"global-customer-id":"Linan","subscriber-name":"Linan","subscriber-type":"INFRA","resource-version":"1501768482","service-subscriptions":{"service-subscription":[{"service-type":"vFW","resource-version":"1501768482","relationship-list":{"relationship":[{"related-to":"tenant","related-link":"https://192.168.17.12:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/Rackspace/RegionOne/tenants/tenant/e69e6d64b44347509c3fc512391f34a6/","relationship-data":[{"relationship-key":"cloud-region.cloud-owner","relationship-value":"Rackspace"},{"relationship-key":"cloud-region.cloud-region-id","relationship-value":"RegionOne"},{"relationship-key":"tenant.tenant-id","relationship-value":"e69e6d64b44347509c3fc512391f34a6"}],"related-to-property":[{"property-key":"tenant.tenant-name","property-value":"onap"}]}]}},{"service-type":"vLB","resource-version":"1501768482","relationship-list":{"relationship":[{"related-to":"tenant","related-link":"https://192.168.17.12:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/Rackspace/RegionOne/tenants/tenant/e69e6d64b44347509c3fc512391f34a6/","relationship-data":[{"relationship-key":"cloud-region.cloud-owner","relationship-value":"Rackspace"},{"relationship-key":"cloud-region.cloud-region-id","relationship-value":"RegionOne"},{"relationship-key":"tenant.tenant-id","relationship-value":"e69e6d64b44347509c3fc512391f34a6"}],"related-to-property":[{"property-key":"tenant.tenant-name","property-value":"onap"}]}]}}]}}'