Checkin service model in SDC 15/21815/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Thu, 2 Nov 2017 08:48:38 +0000 (14:18 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Thu, 2 Nov 2017 08:48:38 +0000 (14:18 +0530)
CLI-57

Change-Id: Ic84c6b5194594c9c4869dd1aac9ee17de39502a6
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
plugins/sdc/src/main/resources/onap-cli-schema/service-model/service-model-checkin-schema-1.1.yaml [new file with mode: 0644]
plugins/sdc/src/test/resources/onap-cli-sample/service-model/service-model-checkin-schema-1.1-moco.json [new file with mode: 0644]
plugins/sdc/src/test/resources/onap-cli-sample/service-model/service-model-checkin-schema-1.1-sample.yaml [new file with mode: 0644]

diff --git a/plugins/sdc/src/main/resources/onap-cli-schema/service-model/service-model-checkin-schema-1.1.yaml b/plugins/sdc/src/main/resources/onap-cli-schema/service-model/service-model-checkin-schema-1.1.yaml
new file mode 100644 (file)
index 0000000..d5900fe
--- /dev/null
@@ -0,0 +1,26 @@
+open_cli_schema_version: 1.0
+name: service-model-checkin
+description: Checkin Service model in SDC
+version: onap-1.1
+service:
+  name: sdc
+  version: v1.0
+  auth: basic
+  mode: direct
+
+parameters:
+  - name: service-model-id
+    description: Service model ID
+    type: string
+    long_option: service-model-id
+    short_option: b
+    is_optional: true
+
+http:
+  request:
+    uri: /sdc2/rest/v1/catalog/services/${service-model-id}/lifecycleState/checkin
+    method: POST
+    body: '{"userRemarks": "Checked in via CLI"}'
+  success_codes:
+    - 200
+
diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/service-model/service-model-checkin-schema-1.1-moco.json b/plugins/sdc/src/test/resources/onap-cli-sample/service-model/service-model-checkin-schema-1.1-moco.json
new file mode 100644 (file)
index 0000000..b6979a5
--- /dev/null
@@ -0,0 +1,48 @@
+[ {
+  "request" : {
+    "method" : "post",
+    "uri" : "/sdc2/rest/v1/catalog/services/7b427dbf-685b-4ba9-8838-a9b3b3c8e584/lifecycleState/checkin",
+    "headers" : {
+      "Authorization" : "Basic Y3MwMDA4OmRlbW8xMjM0NTYh",
+      "X-FromAppId" : "onap-cli",
+      "Accept" : "application/json",
+      "USER_ID" : "cs0008",
+      "X-TransactionId" : "req-7fce4b26-bae7-455f-b3d6-ebb01cca72b7",
+      "Content-Type" : "application/json"
+    },
+    "json" : {
+      "userRemarks" : "Checked in via CLI"
+    }
+  },
+  "response" : {
+    "status" : 200,
+    "json" : {
+      "uniqueId" : "7b427dbf-685b-4ba9-8838-a9b3b3c8e584",
+      "name" : "kanag-cli-VLB",
+      "version" : "0.1",
+      "isHighestVersion" : true,
+      "creationDate" : 1509606274213,
+      "lastUpdateDate" : 1509606402636,
+      "description" : "VLB created from CLI",
+      "lifecycleState" : "NOT_CERTIFIED_CHECKIN",
+      "tags" : [ "CLI", "kanag-cli-VLB" ],
+      "icon" : "defaulticon",
+      "normalizedName" : "kanagclivlb",
+      "systemName" : "KanagCliVlb",
+      "contactId" : "cs0008",
+      "projectCode" : "kanag-123456",
+      "invariantUUID" : "c4425f23-fc9a-4cbf-a3b7-12e69054806b",
+      "componentType" : "SERVICE",
+      "creatorUserId" : "cs0008",
+      "creatorFullName" : "Carlos Santana",
+      "lastUpdaterUserId" : "cs0008",
+      "lastUpdaterFullName" : "Carlos Santana",
+      "distributionStatus" : "DISTRIBUTION_NOT_APPROVED",
+      "ecompGeneratedNaming" : true,
+      "namingPolicy" : "",
+      "serviceType" : "",
+      "serviceRole" : "",
+      "uuid" : "660c524c-176b-43b1-a85b-1ef18011ca85"
+    }
+  }
+} ]
\ No newline at end of file
diff --git a/plugins/sdc/src/test/resources/onap-cli-sample/service-model/service-model-checkin-schema-1.1-sample.yaml b/plugins/sdc/src/test/resources/onap-cli-sample/service-model/service-model-checkin-schema-1.1-sample.yaml
new file mode 100644 (file)
index 0000000..f9991df
--- /dev/null
@@ -0,0 +1,9 @@
+onap_cli_sample_version: 1.0
+name: service-model-checkin
+version: onap-1.1
+samples:
+  sample1:
+    name: service-model-checkin
+    input: --service-model-id 7b427dbf-685b-4ba9-8838-a9b3b3c8e584
+    moco: service-model-checkin-schema-1.1-moco.json
+    ouput:
\ No newline at end of file