CLI: service-create beijing 15/36515/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 19 Mar 2018 10:35:37 +0000 (16:05 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 19 Mar 2018 10:35:37 +0000 (16:05 +0530)
Change-Id: I68ab0985cb8db766c60e95dfffbe3658f509a8e3
Issue-ID: CLI-100
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-sample-beijing.yaml [new file with mode: 0644]
products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-schema-beijing-moco.json [new file with mode: 0644]
products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-schema-beijing-sample.yaml [new file with mode: 0644]
products/onap-beijing/features/so/src/main/resources/open-cli-schema/services/service-create-schema-beijing.yaml [new file with mode: 0644]

diff --git a/products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-sample-beijing.yaml b/products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-sample-beijing.yaml
new file mode 100644 (file)
index 0000000..ce0dd7f
--- /dev/null
@@ -0,0 +1,22 @@
+# 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_sample_version: 1.0
+
+name: service-create
+version: onap-beijing
+samples:
+    sample1:
+        name: Create a service instance
+        input: -h https://locahost:8080 -u InfraPortalClient -p password1$  -c customer -s subscriber -i instance -r
\ No newline at end of file
diff --git a/products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-schema-beijing-moco.json b/products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-schema-beijing-moco.json
new file mode 100644 (file)
index 0000000..2832108
--- /dev/null
@@ -0,0 +1,48 @@
+[ {
+  "request" : {
+    "method" : "post",
+    "uri" : "/ecomp/mso/infra/serviceInstances/v3",
+    "headers" : {
+      "Authorization" : "Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
+      "X-FromAppId" : "onap-cli",
+      "Accept" : "application/json",
+      "X-TransactionId" : "req-0dc01d80-f629-4ea9-b49f-0bc45b79bfaf",
+      "Content-Type" : "application/json"
+    },
+    "json" : {
+      "requestDetails" : {
+        "cloudConfiguration" : {
+          "lcpCloudRegionId" : "RegionOne",
+          "tenantId" : "onap"
+        },
+        "modelInfo" : {
+          "modelType" : "service",
+          "modelInvariantId" : "1de901ed-17af-4b03-bc1f-41659cfa27cb",
+          "modelNameVersionId" : "ace39141-09ec-4068-b06d-ac6b23bdc6e0",
+          "modelName" : "demoVLB",
+          "modelVersion" : "1.0"
+        },
+        "subscriberInfo" : {
+          "globalSubscriberId" : "Demonstration"
+        },
+        "requestInfo" : {
+          "instanceName" : "sample-service-onap-cli-13",
+          "source" : "VID",
+          "suppressRollback" : "false"
+        },
+        "requestParameters" : {
+          "subscriptionServiceType" : "vLB"
+        }
+      }
+    }
+  },
+  "response" : {
+    "status" : 202,
+    "json" : {
+      "requestReferences" : {
+        "instanceId" : "957949b4-f857-497c-81b0-832ce7bb9434",
+        "requestId" : "d59fc98a-b0fa-4de9-b426-6ef40dfd0812"
+      }
+    }
+  }
+} ]
\ No newline at end of file
diff --git a/products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-schema-beijing-sample.yaml b/products/onap-beijing/features/so/src/main/resources/open-cli-sample/services/service-create-schema-beijing-sample.yaml
new file mode 100644 (file)
index 0000000..4155261
--- /dev/null
@@ -0,0 +1,28 @@
+# 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_sample_version: 1.0
+name: service-create
+version: onap-beijing
+samples:
+  sample1:
+    name: service-create
+    input: --cloud-region RegionOne --tenant-id onap --model-invariant-id 1de901ed-17af-4b03-bc1f-41659cfa27cb --model-uuid ace39141-09ec-4068-b06d-ac6b23bdc6e0 --model-name demoVLB --model-version 1.0 -c Demonstration --instance-name sample-service-onap-cli-13 --service-type vLB
+    moco: service-create-schema-1.1-moco.json
+    output: |
+      +--------------+--------------------------------------+
+      |property      |value                                 |
+      +--------------+--------------------------------------+
+      |service-id    |957949b4-f857-497c-81b0-832ce7bb9434  |
+      +--------------+--------------------------------------+
diff --git a/products/onap-beijing/features/so/src/main/resources/open-cli-schema/services/service-create-schema-beijing.yaml b/products/onap-beijing/features/so/src/main/resources/open-cli-schema/services/service-create-schema-beijing.yaml
new file mode 100644 (file)
index 0000000..1db8b9d
--- /dev/null
@@ -0,0 +1,111 @@
+# 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: service-create
+description: Create a service instance using MSO
+
+info:
+  product: onap-beijing
+  service: so
+  author: ONAP CLI Team onap-discuss@lists.onap.org
+
+parameters:
+  - name: cloud-region
+    description: cloud region identifier
+    type: string
+    short_option: l
+    long_option: cloud-region
+    is_optional: false
+  - name: tenant-id
+    description: tenant id
+    type: string
+    short_option: b
+    long_option: tenant-id
+    is_optional: false
+  - name: model-invariant-id
+    description: model invariant id generated by ASDC.
+    type: string
+    short_option: e
+    long_option: model-invariant-id
+    is_optional: false
+  - name: model-uuid
+    description: model uuid generated by ASDC.
+    type: string
+    short_option: g
+    long_option: model-uuid
+    is_optional: false
+  - name: model-name
+    description: model name as provided in ASDC design time.
+    type: string
+    short_option: i
+    long_option: model-name
+    is_optional: false
+  - name: model-version
+    description: model-version
+    type: string
+    short_option: j
+    long_option: model-version
+    is_optional: false
+  - name: customer
+    description: unique id for customer
+    type: string
+    short_option: c
+    long_option: customer
+    is_optional: false
+  - name: instance-name
+    description: service instance name
+    type: string
+    short_option: k
+    long_option: instance-name
+    is_optional: false
+  - name: supress-rollback
+    description: rollback changes if instantiation fails.
+    type: bool
+    short_option: r
+    long_option: supress-rollback
+    is_optional: true
+  - name: service-type
+    description: subscription service type
+    type: string
+    short_option: w
+    long_option: service-type
+    is_optional: false
+
+results:
+  direction: portrait
+  attributes:
+    - name: service-id
+      description: instance id for the created service.
+      type: string
+      scope: short
+
+
+http:
+  service:
+    name: so
+    version: v3
+    auth: basic
+    mode: direct
+  request:
+    uri: /ecomp/mso/infra/serviceInstances/v3
+    method: POST
+    body: '{"requestDetails": {"cloudConfiguration" : {"lcpCloudRegionId": "${cloud-region}","tenantId": "${tenant-id}"},"modelInfo": {"modelType": "service","modelInvariantId": "${model-invariant-id}","modelNameVersionId": "${model-uuid}","modelName": "${model-name}","modelVersion": "${model-version}"},"subscriberInfo": {"globalSubscriberId": "${customer}"},"requestInfo": {"instanceName": "${instance-name}","source": "VID","suppressRollback": "${supress-rollback}"},"requestParameters": {"subscriptionServiceType": "${service-type}"}}}'
+
+  success_codes:
+    - 202
+  result_map:
+    service-id: $b{$.requestReferences.instanceId}
+  sample_response:
+    body: '{"requestReferences":{"instanceId":"${instance-id}","requestId":"375ba428-65e7-4f2b-afb9-74735ac6bfd0"}}'