Merge "sonar security issue fix- Make sure that command line arguments are used safel...
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>
Tue, 12 May 2020 14:58:57 +0000 (14:58 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 12 May 2020 14:58:57 +0000 (14:58 +0000)
27 files changed:
deployment/docker/src/main/docker/Dockerfile
deployment/http/web/index.html
products/onap-dublin/features/integration/src/main/resources/script/vnf-tosca-lcm.py
products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-artifact-schema-dublin.yaml
products/onap-dublin/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-add-artifact-schema-dublin.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/catalog/vfc-catalog-get-ns-descriptors-schema-moco.json [new file with mode: 0644]
products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/catalog/vfc-catalog-get-ns-descriptors-schema-sample.yaml [new file with mode: 0644]
products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-get-jobid-schema-moco.json [new file with mode: 0644]
products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-get-jobid-schema-sample.yaml [new file with mode: 0644]
products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-query-multinslcmopoccs-schema-moco.json [new file with mode: 0644]
products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-query-multinslcmopoccs-schema-sample.yaml [new file with mode: 0644]
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/catalog/vfc-catalog-get-ns-descriptors-schema.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-get-jobid.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-get-schema.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-query-multinslcmopoccs.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-sol005-create-schema.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-sol005-delete-schema.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-sol005-get-schema.yaml
products/onap-dublin/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-sol005-instantiate-schema.yaml
products/onap-elalto/auth/src/main/resources/open-cli-schema/basic-login-onap-policy-elalto.yaml
products/onap-elalto/features/policy/src/main/resources/open-cli-schema/policy/policy-create-schema-elalto.yaml [new file with mode: 0644]
products/onap-elalto/features/policy/src/main/resources/open-cli-schema/policy/policy-list-outdated-schema-elalto.yaml
products/onap-elalto/features/policy/src/main/resources/open-cli-schema/policy/policy-list-schema-elalto.yaml
products/onap-elalto/features/sdc/src/main/resources/open-cli-schema/service-model/service-model-add-artifact-schema-elalto.yaml
products/onap-elalto/features/sdc/src/main/resources/open-cli-schema/vf/vf-model-add-artifact-schema-elalto.yaml
products/onap-elalto/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-get-jobid.yaml [new file with mode: 0644]
products/onap-elalto/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-get-schema.yaml

index 6d5a8bc..2061c7d 100644 (file)
@@ -60,10 +60,10 @@ RUN sudo apt-get install -y lighttpd git curl pandoc vim && \
     sudo cp $OPEN_CLI_HOME/http/web/ocomp.pem /etc/lighttpd/ocomp.pem
     #openssl req -x509 -nodes -days 9999 -newkey rsa:2048 -keyout ~/.ocomp.key -out ~/.ocomp.crt -subj "/C=IN/ST=KA/L=BLR/O=CLI/CN=onap"
 EXPOSE 443
-EXPOSE 9090
+EXPOSE 9443
 EXPOSE 50051
-ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then sudo service lighttpd start; gotty -t --port 9090 --permit-write --reconnect oclip; \
+ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then sudo service lighttpd start; gotty -t --port 9443 --permit-write --reconnect oclip; \
            elif [ "$OPEN_CLI_MODE" = "ocs-web" ]; then echo "****** OCLIP Web Command Server ******"; sudo service lighttpd start; \
            elif [ "$OPEN_CLI_MODE" = "ocs-grpc" ]; then echo "****** OCLIP gRPC Command Server ******"; oclip-grpc; \
-           elif [ "$OPEN_CLI_MODE" = "occ" ]; then echo "****** OCLIP Web Command Console (OCC) ******"; gotty -t  --port 9090 --permit-write --reconnect oclip; \
+           elif [ "$OPEN_CLI_MODE" = "occ" ]; then echo "****** OCLIP Web Command Console (OCC) ******"; gotty -t  --port 9443 --permit-write --reconnect oclip; \
            else echo "****** OCLIP Command Shell******"; oclip -v && /bin/bash; fi
index 0b9d6b6..cebc79f 100644 (file)
@@ -21,7 +21,7 @@
 <meta charset="utf-8"><title>OCLIP...industry first open platform for cli</title><style></style>
 <script>
 function redirectToConsole(){
-   window.location.href="https://"+  window.location.hostname + ":9090";
+   window.location.href="https://"+  window.location.hostname + ":9443";
 }
 
 function redirectToConsoleOOM(){
index d04d54a..af9cb9b 100644 (file)
@@ -30,6 +30,7 @@ import platform
 import datetime
 import string
 import random
+import time
 
 from argparse import RawTextHelpFormatter
 
@@ -248,8 +249,8 @@ class ONAP:
             output = self.ocomp.run(command='vf-model-create',
                                     params={'name': '{} Vnf'.format(self.conf['vnf']['name']),
                                             'vendor-name': self.conf['vnf']['vendor-name'],
-                                            'vsp-id': self.vsp_id,
-                                            'vsp-version': self.vsp_version, # TODO: SDC fails to add VSP, check it
+                                            'vsp-id': self.vsp_id,
+                                            'vsp-version': self.vsp_version, # TODO: SDC fails to add VSP, check it
                                             'description': self.tag})
 
             vf_id = output['id']
@@ -259,7 +260,7 @@ class ONAP:
                                     params={'vf-id': vf_id,
                                             'remarks': self.tag,
                                             'artifact': self.conf['vnf']['vnf-csar'],
-                                            'artifact-name': 'tosca csar'})
+                                            'artifact-name': 'vnf.csar'})
 
             output = self.ocomp.run(command='vf-model-certify',
                                         params={'vf-id': vf_id,
@@ -293,7 +294,8 @@ class ONAP:
                                     params={'service-id': ns_id,
                                             'remarks': self.tag,
                                             'artifact': self.conf['vnf']['ns-csar'],
-                                            'artifact-name': 'tosca csar'})
+                                            'artifact-group-type': 'DEPLOYMENT',
+                                            'artifact-name': 'ns.csar'})
             #set property vnfmdriver
             for input in self.vf_inputs:
                 if input.endswith('.nf_type'):
@@ -367,7 +369,7 @@ class ONAP:
                                             'complex-name': self.location_id,
                                             'identity-url': self.conf['cloud']['identity-url'],
                                             'cloud-owner': cloud_id,
-                                            'cloud-type': 'OpenStack',
+                                            'cloud-type': 'openstack',
                                             'owner-type': 'ocomp',
                                             'cloud-region-version': self.conf['cloud']['version'],
                                             'cloud-zone': 'az1',
@@ -396,6 +398,9 @@ class ONAP:
                                             'cloud-region': self.conf['cloud']['region'],
                                             'cloud-owner': self.cloud_id})
 
+        self.ocomp.run(command='multicloud-register-cloud',
+                       params={'cloud-region': self.conf['cloud']['region'], 'cloud-owner': self.cloud_id})
+
         subscribe = False
         if not self.service_type_id and not self.service_type_version:
             service_type_id = '{}-{}'.format(self.conf['subscription']['service-type'], self.conf['ONAP']['uid'])
@@ -413,7 +418,7 @@ class ONAP:
                     break
 
         if not self.customer_id and not self.customer_version:
-            customer_id = '{}-{}'.format(self.conf['subscription']['customer-name'], self.ocomp.conf['ONAP']['random'])
+            customer_id = '{}-{}'.format(self.conf['subscription']['customer-name'], self.conf['ONAP']['uid'])
             self.ocomp.run(command='customer-create',
                                 params={'customer-name': customer_id,
                                         'subscriber-name': customer_id})
@@ -428,23 +433,16 @@ class ONAP:
                     break
 
         if not self.tenant_id and not self.tenant_version:
-            tenant_id = str(uuid.uuid4())
-            self.ocomp.run(command='tenant-create',
-                                params={'tenant-name': self.conf['cloud']['tenant'],
-                                        'tenant-id': tenant_id,
-                                        'cloud':self.cloud_id,
-                                        'region': self.conf['cloud']['region']})
-            self.tenant_id = tenant_id
-            subscribe = True
-
             output = self.ocomp.run(command='tenant-list', params={
                 'cloud': self.cloud_id,
                 'region': self.conf['cloud']['region']
                 })
 
             for tenant in output:
-                if tenant['tenant-id'] == self.tenant_id:
+                if tenant['tenant-name'] == self.conf['cloud']['tenant']:
+                    self.tenant_id = tenant['tenant-id']
                     self.tenant_version = tenant['resource-version']
+                    subscribe = True
                     break
 
         if subscribe:
@@ -471,7 +469,7 @@ class ONAP:
 
             esr_vnfm_id = str(uuid.uuid4())
             self.ocomp.run(command='vnfm-create',
-                                    params={'vim-id': self.cloud_id,
+                                    params={'vim-id': self.cloud_id + "_" + self.conf['cloud']['region'],
                                             'vnfm-id': esr_vnfm_id,
                                             'name': 'OCOMP {}'.format(vnfmdriver),
                                             'type': vnfmdriver,
@@ -495,7 +493,19 @@ class ONAP:
 
     def create_vnf(self):
         self.ocomp.run(command='vfc-catalog-onboard-vnf',
-                                params={'vnf-csar-uuid': self.vf_uuid})
+                       params={'vnf-csar-uuid': self.vf_uuid})
+
+        vnf_flag = False
+        for i in range(60):
+            output = self.ocomp.run(command='vfc-catalog-get-vnf')
+            for csar in output:
+                if csar.get("csar-id") == self.vf_uuid:
+                    vnf_flag = True
+                    break
+            if vnf_flag:
+                break
+            else:
+                time.sleep(1)
 
         self.ocomp.run(command='vfc-catalog-onboard-ns',
                                 params={'ns-csar-uuid': self.ns_uuid})
@@ -508,20 +518,36 @@ class ONAP:
 
         self.ns_instance_id = output['ns-instance-id']
 
-        vnfmdriver = self.conf['vnf']['vnfm-driver']
-        self.ocomp.run(command='vfc-nslcm-instantiate',
+        output = self.ocomp.run(command='vfc-nslcm-instantiate',
                                 params={'ns-instance-id': self.ns_instance_id,
-                                        'location': self.cloud_id,
+                                        'location': self.cloud_id + "_" + self.conf['cloud']['region'],
                                         'sdn-controller-id': self.esr_vnfm_id})
 
+        jobid = output['job-id']
+        self.waitProcessFinished(jobid)
+
     def vnf_status_check(self):
         self.vnf_status = 'active'
         self.ns_instance_status = 'active'
 
+    def waitProcessFinished(self, job_id):
+        for i in range(150):
+            output = self.ocomp.run(command='vfc-nslcm-get-jobid',
+                                    params={'ns-job-id': job_id})
+            progress_rep = int(output["job-progress"])
+            if 100 != progress_rep:
+                if 255 == progress_rep:
+                    break
+                time.sleep(1)
+            else:
+                break
+
     def cleanup(self):
         if self.ns_instance_id:
-            self.ocomp.run(command='vfc-nslcm-terminate',
+            output = self.ocomp.run(command='vfc-nslcm-terminate',
                               params={'ns-instance-id': self.ns_instance_id})
+            jobid = output['job-id']
+            self.waitProcessFinished(jobid)
             self.ocomp.run(command='vfc-nslcm-delete',
                               params={'ns-instance-id': self.ns_instance_id})
             self.ns_instance_id = None
@@ -580,24 +606,23 @@ class ONAP:
                                       'resource-version': self.tenant_version})
             self.tenant_id = self.tenant_version = None
 
-        if self.cloud_id and self.location_id:
-            self.ocomp.run(command='complex-disassociate',
-                              params={'cloud-owner': self.cloud_id,
-                                      'cloud-region': self.conf['cloud']['region'],
-                                      'complex-name': self.location_id})
-
-        if self.cloud_id and self.cloud_version:
-            output = self.ocomp.run(command='cloud-list')
-
-            for c in output:
-                if c['cloud'] == self.cloud_id and c['region'] == self.conf['cloud']['region']:
-                    self.cloud_version = c['resource-version']
+        if self.cloud_id:
+            self.ocomp.run(command='multicloud-cloud-delete',
+                           params={'cloud-owner': self.cloud_id,
+                                   'cloud-region': self.conf['cloud']['region']})
+
+            for i in range(30):
+                cloud_flag = False
+                output = self.ocomp.run(command='cloud-list')
+                for cloud in output:
+                    if cloud.get('cloud') == self.cloud_id:
+                        cloud_flag = True
+                        break
+                if not cloud_flag:
                     break
+                else:
+                    time.sleep(1)
 
-            self.ocomp.run(command='cloud-delete',
-                              params={'cloud-name': self.cloud_id,
-                                      'region-name': self.conf['cloud']['region'],
-                                      'resource-version': self.cloud_version})
             self.cloud_id = self.cloud_version = None
 
         if self.location_id and self.location_version:
@@ -696,13 +721,15 @@ if __name__ == '__main__':
         if vnf_csar:
             conf['vnf']['vnf-csar'] = vnf_csar
         if ns_csar:
-            conf['vnf']['ns-csar'] = vnf_csar
+            conf['vnf']['ns-csar'] = ns_csar
         if vnf_name:
             conf['vnf']['name'] = vnf_name
         conf['vnf']['name'] = '{}{}'.format(conf['vnf']['name'], conf['ONAP']['uid'])
         if vendor_name:
             conf['vnf']['vendor-name'] = vendor_name
         conf['vnf']['vendor-name'] = '{}-{}'.format(conf['vnf']['vendor-name'], conf['ONAP']['uid'])
+        if vnfm_driver:
+            conf['vnf']['vnfm-driver'] = vnfm_driver
 
     if args.result:
         result_file = args.result
index 5eb0c8c..454a730 100644 (file)
@@ -48,6 +48,13 @@ parameters:
     long_option: artifact-name
     short_option: b
     is_optional: false
+  - name: artifact-label
+    description: Artifact Label
+    type: string
+    long_option: artifact-label
+    short_option: l
+    default_value: artifactLabel
+    is_optional: true
   - name: user-id
     description: Designer user id
     type: string
@@ -67,6 +74,6 @@ http:
     headers:
       Content-MD5: $s{md5:__body__}
       USER_ID: ${user-id}
-    body: '{"payloadData":"${artifact}","artifactDisplayName":"${artifact-name}","artifactType":"OTHER","description":"${remarks}","artifactName":"${artifact-name}", "artifactLabel":"${artifact-name}","artifactGroupType":"DEPLOYMENT", artifactChecksum="$s{md5:artifact}"}'
+    body: '{"payloadData":"${artifact}","artifactDisplayName":"${artifact-name}","artifactType":"OTHER","description":"${remarks}","artifactName":"${artifact-name}", "artifactLabel":"${artifact-label}","artifactGroupType":"DEPLOYMENT", artifactChecksum="$s{md5:artifact}"}'
   success_codes:
     - 200
diff --git a/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/catalog/vfc-catalog-get-ns-descriptors-schema-moco.json b/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/catalog/vfc-catalog-get-ns-descriptors-schema-moco.json
new file mode 100644 (file)
index 0000000..8dc819e
--- /dev/null
@@ -0,0 +1,37 @@
+[ {
+  "request" : {
+    "method" : "get",
+    "uri" : "/api/nsd/v1/ns_descriptors/2295cab6-4b4a-403f-8eb9-4dd83ca049d0",
+    "headers" : {
+      "Accept" : "application/json",
+      "Content-Type" : "application/json"
+    },
+    "json" : { }
+  },
+  "response" : {
+    "status" : 200,
+    "json" : {
+      "id": "2295cab6-4b4a-403f-8eb9-4dd83ca049d0",
+      "nsdId": "2295cab6-4b4a-403f-8eb9-4dd83ca049d0",
+      "nsdName": "vCPE-tes1",
+      "nsdVersion": "",
+      "nsdDesigner": "",
+      "nsdInvariantId": "83fbd4c0-a2f3-4b35-8ba4-dfec47c6a99b",
+      "vnfPkgIds": [
+        "0a628ee7-465d-4916-b772-b72b541d8320",
+        "af099c7a-a975-40f5-bf9f-ac67de1b11a9",
+        "5bcdb6a8-6c4b-4032-b56d-d3030ee1ec05",
+        "1347001a-38ca-480a-a77b-d34873b6d0be",
+        "0ec7a346-26f2-414b-bcfd-4dfd63846c4d"
+      ],
+      "pnfdInfoIds": [],
+      "nestedNsdInfoIds": [],
+      "nsdOnboardingState": "ONBOARDED",
+      "onboardingFailureDetails": null,
+      "nsdOperationalState": "ENABLED",
+      "nsdUsageState": "NOT_IN_USE",
+      "userDefinedData": {},
+      "_links": null
+    }
+  }
+} ]
\ No newline at end of file
diff --git a/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/catalog/vfc-catalog-get-ns-descriptors-schema-sample.yaml b/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/catalog/vfc-catalog-get-ns-descriptors-schema-sample.yaml
new file mode 100644 (file)
index 0000000..6a10c25
--- /dev/null
@@ -0,0 +1,22 @@
+open_cli_sample_version: 1.0
+name: vfc-nslcm-get-ns-descriptors
+version: onap-dublin
+samples:
+  sample1:
+    name: vfc-nslcm-get-ns-descriptors
+    input: -m http://10.12.5.155:30280 -c 2295cab6-4b4a-403f-8eb9-4dd83ca049d0
+    moco: vfc-catalog-get-ns-descriptors-schema-moco.json
+    output: |
+      +--------------------------------------+--------------------------------------+------------+----------------------+--------------------------------------+------------------+
+      |id                                    |nsd-info-id                           |nsd-name    |nsd-onboarding-state  |vnf-package-ids                       |pnf-package-ids   |
+      +--------------------------------------+--------------------------------------+------------+----------------------+--------------------------------------+------------------+
+      |2295cab6-4b4a-403f-8eb9-4dd83ca049d0  |2295cab6-4b4a-403f-8eb9-4dd83ca049d0  |vCPE-tes1   |ONBOARDED             |0a628ee7-465d-4916-b772-b72b541d8320  |                  |
+      +--------------------------------------+--------------------------------------+------------+----------------------+--------------------------------------+------------------+
+      |                                      |                                      |            |                      |af099c7a-a975-40f5-bf9f-ac67de1b11a9  |                  |
+      +--------------------------------------+--------------------------------------+------------+----------------------+--------------------------------------+------------------+
+      |                                      |                                      |            |                      |5bcdb6a8-6c4b-4032-b56d-d3030ee1ec05  |                  |
+      +--------------------------------------+--------------------------------------+------------+----------------------+--------------------------------------+------------------+
+      |                                      |                                      |            |                      |1347001a-38ca-480a-a77b-d34873b6d0be  |                  |
+      +--------------------------------------+--------------------------------------+------------+----------------------+--------------------------------------+------------------+
+      |                                      |                                      |            |                      |0ec7a346-26f2-414b-bcfd-4dfd63846c4d  |                  |
+      +--------------------------------------+--------------------------------------+------------+----------------------+--------------------------------------+------------------+
diff --git a/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-get-jobid-schema-moco.json b/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-get-jobid-schema-moco.json
new file mode 100644 (file)
index 0000000..772367a
--- /dev/null
@@ -0,0 +1,75 @@
+
+[ {
+  "request" : {
+    "method" : "get",
+    "uri" : "/api/nslcm/v1/jobs/NS-NS_INST-330366c3-3a42-4739-9d46-6f468cf7e6ec-a85c262c-8099-11ea-80f5-0227d810af52",
+    "headers" : {
+      "Accept" : "application/json",
+      "Content-Type" : "application/json"
+    }
+  },
+  "response" : {
+    "status" : 200,
+    "json" : {
+      "jobId": "NS-NS_INST-330366c3-3a42-4739-9d46-6f468cf7e6ec-a85c262c-8099-11ea-80f5-0227d810af52",
+      "responseDescriptor": {
+        "status": "finished",
+        "progress": 100,
+        "statusDescription": "Create NS successfully.",
+        "errorCode": "0",
+        "responseId": 8,
+        "responseHistoryList": [
+          {
+            "status": "processing",
+            "progress": 90,
+            "statusDescription": "Start to post deal",
+            "errorCode": "0",
+            "responseId": 7
+          },
+          {
+            "status": "processing",
+            "progress": 70,
+            "statusDescription": "Start to create SFC",
+            "errorCode": "0",
+            "responseId": 6
+          },
+          {
+            "status": "processing",
+            "progress": 50,
+            "statusDescription": "Start to create PNF",
+            "errorCode": "0",
+            "responseId": 5
+          },
+          {
+            "status": "processing",
+            "progress": 30,
+            "statusDescription": "Start to create VNF",
+            "errorCode": "0",
+            "responseId": 4
+          },
+          {
+            "status": "processing",
+            "progress": 10,
+            "statusDescription": "Start to create VL",
+            "errorCode": "0",
+            "responseId": 3
+          },
+          {
+            "status": "processing",
+            "progress": 10,
+            "statusDescription": "NS inst(330366c3-3a42-4739-9d46-6f468cf7e6ec) buildin workflow started.",
+            "errorCode": "0",
+            "responseId": 2
+          },
+          {
+            "status": "processing",
+            "progress": 5,
+            "statusDescription": "Start query nsd(be194bc4-eb04-467c-a4ee-67e43ecbb7ad)",
+            "errorCode": "0",
+            "responseId": 1
+          }
+        ]
+      }
+    }
+  }
+} ]
diff --git a/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-get-jobid-schema-sample.yaml b/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-get-jobid-schema-sample.yaml
new file mode 100644 (file)
index 0000000..895ca2d
--- /dev/null
@@ -0,0 +1,19 @@
+open_cli_sample_version: 1.0
+name: vfc-nslcm-get-jobid
+version: onap-dublin
+samples:
+  sample1:
+    name: vfc-nslcm-get-jobid
+    input: -m http://10.12.5.155:30280 -i NS-NS_INST-330366c3-3a42-4739-9d46-6f468cf7e6ec-a85c262c-8099-11ea-80f5-0227d810af52
+    moco: vfc-nslcm-get-jobid-schema-moco.json
+    output: |
+      +--------------+----------------------------------------------------+
+      |property      |value                                               |
+      +--------------+----------------------------------------------------+
+      |ns-job-id     |NS-NS_INST-330366c3-3a42-4739-9d46-6f468cf7e6ec-a8  |
+      |              |5c262c-8099-11ea-80f5-0227d810af52                  |
+      +--------------+----------------------------------------------------+
+      |job-status    |finished                                            |
+      +--------------+----------------------------------------------------+
+      |job-progress  |100                                                 |
+      +--------------+----------------------------------------------------+
diff --git a/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-query-multinslcmopoccs-schema-moco.json b/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-query-multinslcmopoccs-schema-moco.json
new file mode 100644 (file)
index 0000000..e8afc2e
--- /dev/null
@@ -0,0 +1,224 @@
+
+[ {
+  "request" : {
+    "method" : "get",
+    "uri" : "/api/nslcm/v1/ns_lcm_op_occs",
+    "headers" : {
+      "Accept" : "application/json",
+      "Content-Type" : "application/json"
+    }
+  },
+  "response" : {
+    "status" : 200,
+    "json" : [
+      {
+        "id": "1aa6afe6-035a-47f0-a14d-7b63e00424f4",
+        "operationState": "COMPLETED",
+        "stateEnteredTime": "2020-04-20 09:59:59",
+        "startTime": "2020-04-20 09:58:08",
+        "nsInstanceId": "18c8be1a-6776-47b4-bbfc-bb8cd4a61152",
+        "operation": "INSTANTIATE",
+        "isAutomaticInvocation": "False",
+        "operationParams": {
+          "additionalParamForNs": {
+            "sdncontroller": "e8bd9e9e-70f4-4893-b75c-9cd3fe161eab",
+            "location": "OCOMP-hiofn_RegionOne"
+          }
+        },
+        "isCancelPending": "False",
+        "cancelMode": null,
+        "error": null,
+        "resourceChanges": null,
+        "_links": {
+          "self": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/1aa6afe6-035a-47f0-a14d-7b63e00424f4"
+          },
+          "nsInstance": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_instances/18c8be1a-6776-47b4-bbfc-bb8cd4a61152"
+          },
+          "retry": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/1aa6afe6-035a-47f0-a14d-7b63e00424f4/retry"
+          },
+          "rollback": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/1aa6afe6-035a-47f0-a14d-7b63e00424f4/rollback"
+          },
+          "continue": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/1aa6afe6-035a-47f0-a14d-7b63e00424f4/continue"
+          },
+          "fail": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/1aa6afe6-035a-47f0-a14d-7b63e00424f4/fail"
+          },
+          "cancel": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/1aa6afe6-035a-47f0-a14d-7b63e00424f4/cancel"
+          }
+        }
+      },
+      {
+        "id": "7bb94926-cf28-487e-a40d-1cdc90d14abe",
+        "operationState": "COMPLETED",
+        "stateEnteredTime": "2020-04-20 10:36:12",
+        "startTime": "2020-04-20 10:35:03",
+        "nsInstanceId": "1a68a79b-e1b6-47d3-9655-b8e4afb5f4f7",
+        "operation": "INSTANTIATE",
+        "isAutomaticInvocation": "False",
+        "operationParams": {
+          "additionalParamForNs": {
+            "sdncontroller": "58e5c86b-7f07-487d-a507-b123a245e37d",
+            "location": "OCOMP-rsnbf_RegionOne"
+          }
+        },
+        "isCancelPending": "False",
+        "cancelMode": null,
+        "error": null,
+        "resourceChanges": null,
+        "_links": {
+          "self": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/7bb94926-cf28-487e-a40d-1cdc90d14abe"
+          },
+          "nsInstance": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_instances/1a68a79b-e1b6-47d3-9655-b8e4afb5f4f7"
+          },
+          "retry": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/7bb94926-cf28-487e-a40d-1cdc90d14abe/retry"
+          },
+          "rollback": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/7bb94926-cf28-487e-a40d-1cdc90d14abe/rollback"
+          },
+          "continue": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/7bb94926-cf28-487e-a40d-1cdc90d14abe/continue"
+          },
+          "fail": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/7bb94926-cf28-487e-a40d-1cdc90d14abe/fail"
+          },
+          "cancel": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/7bb94926-cf28-487e-a40d-1cdc90d14abe/cancel"
+          }
+        }
+      },
+      {
+        "id": "816cf68f-56f2-423b-8fb4-aae5b96f3908",
+        "operationState": "COMPLETED",
+        "stateEnteredTime": "2020-04-20 10:50:23",
+        "startTime": "2020-04-20 10:48:51",
+        "nsInstanceId": "b7609865-9212-4ab0-a390-c192ffce751c",
+        "operation": "INSTANTIATE",
+        "isAutomaticInvocation": "False",
+        "operationParams": {
+          "additionalParamForNs": {
+            "sdncontroller": "ac2906fe-8304-4db6-9678-1ff392884d75",
+            "location": "OCOMP-tmlfq_RegionOne"
+          }
+        },
+        "isCancelPending": "False",
+        "cancelMode": null,
+        "error": null,
+        "resourceChanges": null,
+        "_links": {
+          "self": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/816cf68f-56f2-423b-8fb4-aae5b96f3908"
+          },
+          "nsInstance": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_instances/b7609865-9212-4ab0-a390-c192ffce751c"
+          },
+          "retry": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/816cf68f-56f2-423b-8fb4-aae5b96f3908/retry"
+          },
+          "rollback": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/816cf68f-56f2-423b-8fb4-aae5b96f3908/rollback"
+          },
+          "continue": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/816cf68f-56f2-423b-8fb4-aae5b96f3908/continue"
+          },
+          "fail": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/816cf68f-56f2-423b-8fb4-aae5b96f3908/fail"
+          },
+          "cancel": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/816cf68f-56f2-423b-8fb4-aae5b96f3908/cancel"
+          }
+        }
+      },
+      {
+        "id": "cc2180c2-52c0-41fa-8ae1-a3b54142cc95",
+        "operationState": "COMPLETED",
+        "stateEnteredTime": "2020-04-20 11:08:15",
+        "startTime": "2020-04-20 11:06:53",
+        "nsInstanceId": "deccc3a8-3f90-4801-b43a-8eccbadce8f2",
+        "operation": "INSTANTIATE",
+        "isAutomaticInvocation": "False",
+        "operationParams": {
+          "additionalParamForNs": {
+            "sdncontroller": "56c16600-4aae-4680-ba1b-6acfc8f8b27f",
+            "location": "OCOMP-pvjzk_RegionOne"
+          }
+        },
+        "isCancelPending": "False",
+        "cancelMode": null,
+        "error": null,
+        "resourceChanges": null,
+        "_links": {
+          "self": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/cc2180c2-52c0-41fa-8ae1-a3b54142cc95"
+          },
+          "nsInstance": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_instances/deccc3a8-3f90-4801-b43a-8eccbadce8f2"
+          },
+          "retry": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/cc2180c2-52c0-41fa-8ae1-a3b54142cc95/retry"
+          },
+          "rollback": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/cc2180c2-52c0-41fa-8ae1-a3b54142cc95/rollback"
+          },
+          "continue": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/cc2180c2-52c0-41fa-8ae1-a3b54142cc95/continue"
+          },
+          "fail": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/cc2180c2-52c0-41fa-8ae1-a3b54142cc95/fail"
+          },
+          "cancel": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/cc2180c2-52c0-41fa-8ae1-a3b54142cc95/cancel"
+          }
+        }
+      },
+      {
+        "id": "f3a5e32e-22e9-4f23-b881-59c0360af22f",
+        "operationState": "COMPLETED",
+        "stateEnteredTime": "2020-04-20 10:41:05",
+        "startTime": "2020-04-20 10:39:59",
+        "nsInstanceId": "1a68a79b-e1b6-47d3-9655-b8e4afb5f4f7",
+        "operation": "TERMINATE",
+        "isAutomaticInvocation": "False",
+        "operationParams": {
+          "gracefulTerminationTimeout": 60000,
+          "terminationType": "FORCEFUL"
+        },
+        "isCancelPending": "False",
+        "cancelMode": null,
+        "error": null,
+        "resourceChanges": null,
+        "_links": {
+          "self": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/f3a5e32e-22e9-4f23-b881-59c0360af22f"
+          },
+          "nsInstance": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_instances/1a68a79b-e1b6-47d3-9655-b8e4afb5f4f7"
+          },
+          "retry": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/f3a5e32e-22e9-4f23-b881-59c0360af22f/retry"
+          },
+          "rollback": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/f3a5e32e-22e9-4f23-b881-59c0360af22f/rollback"
+          },
+          "continue": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/f3a5e32e-22e9-4f23-b881-59c0360af22f/continue"
+          },
+          "fail": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/f3a5e32e-22e9-4f23-b881-59c0360af22f/fail"
+          },
+          "cancel": {
+            "href": "http://msb-iag:80/api/nslcm/v1/ns_lcm_op_occs/f3a5e32e-22e9-4f23-b881-59c0360af22f/cancel"
+          }
+        }
+      }
+    ]
+  }
+} ]
diff --git a/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-query-multinslcmopoccs-schema-sample.yaml b/products/onap-dublin/features/vfc/src/main/resources/open-cli-sample/nslcm/vfc-nslcm-query-multinslcmopoccs-schema-sample.yaml
new file mode 100644 (file)
index 0000000..1a11465
--- /dev/null
@@ -0,0 +1,22 @@
+open_cli_sample_version: 1.0
+name: vfc-nslcm-query-multinslcmopoccs
+version: onap-dublin
+samples:
+  sample1:
+    name: vfc-nslcm-query-multinslcmopoccs
+    input: -m http://10.12.5.155:30280
+    moco: vfc-nslcm-query-multinslcmopoccs-schema-moco.json
+    output: |
+      +--------------------------------------+--------------------+--------------------------------------+--------------------+----------------------+
+      |nslcm-opocc-id                        |ns-operation-state  |ns-instance-id                        |lcm-operation-type  |state-entered-time    |
+      +--------------------------------------+--------------------+--------------------------------------+--------------------+----------------------+
+      |1aa6afe6-035a-47f0-a14d-7b63e00424f4  |COMPLETED           |18c8be1a-6776-47b4-bbfc-bb8cd4a61152  |INSTANTIATE         |2020-04-20 09:59:59   |
+      +--------------------------------------+--------------------+--------------------------------------+--------------------+----------------------+
+      |7bb94926-cf28-487e-a40d-1cdc90d14abe  |COMPLETED           |1a68a79b-e1b6-47d3-9655-b8e4afb5f4f7  |INSTANTIATE         |2020-04-20 10:36:12   |
+      +--------------------------------------+--------------------+--------------------------------------+--------------------+----------------------+
+      |816cf68f-56f2-423b-8fb4-aae5b96f3908  |COMPLETED           |b7609865-9212-4ab0-a390-c192ffce751c  |INSTANTIATE         |2020-04-20 10:50:23   |
+      +--------------------------------------+--------------------+--------------------------------------+--------------------+----------------------+
+      |cc2180c2-52c0-41fa-8ae1-a3b54142cc95  |COMPLETED           |deccc3a8-3f90-4801-b43a-8eccbadce8f2  |INSTANTIATE         |2020-04-20 11:08:15   |
+      +--------------------------------------+--------------------+--------------------------------------+--------------------+----------------------+
+      |f3a5e32e-22e9-4f23-b881-59c0360af22f  |COMPLETED           |1a68a79b-e1b6-47d3-9655-b8e4afb5f4f7  |TERMINATE           |2020-04-20 10:41:05   |
+      +--------------------------------------+--------------------+--------------------------------------+--------------------+----------------------+
index e0036a8..dbb14e4 100644 (file)
@@ -32,6 +32,10 @@ parameters:
 results:
   direction: landscape
   attributes:
+    - name: id
+      description: ns package id
+      scope: short
+      type: string
     - name: nsd-info-id
       description: nsd-info-id
       scope: short
@@ -40,25 +44,25 @@ results:
       description: nsd-name
       scope: short
       type: string
-    - name: nsd-description
-      description: nsd-description
+    - name: nsd-onboarding-state
+      description: nsd-onboarding-state
       scope: short
       type: string
-    - name: ns-package-id
-      description: ns-package-id
+    - name: vnf-package-ids
+      description: vnf-package-ids
       scope: short
-      type: string
-    - name: sdc-csar-id
-      description: sdc-csar-id
+      type: array
+    - name: pnf-package-ids
+      description: pnf-package-ids
       scope: short
-      type: string
+      type: array
 
 http:
   service:
     auth: none
     mode: direct
   request:
-    uri: api/nsd/v1/ns_descriptors/${nsd-info-id}
+    uri: /api/nsd/v1/ns_descriptors/${nsd-info-id}
     method: GET
     context:
       remove_empty_node: true
@@ -69,8 +73,9 @@ http:
   success_codes:
     - 200
   result_map:
+    id: $b{$.id}
     nsd-info-id: $b{$.nsdId}
     nsd-name: $b{$.nsdName}
-    nsd-description: $b{$.nsdDescription}
-    ns-package-id: $b{$.nsPackageId}
-    sdc-csar-id: $b{$.sdcCsarId }
+    nsd-onboarding-state: $b{$.nsdOnboardingState}
+    vnf-package-ids: $b{$.vnfPkgIds}
+    pnf-package-ids: $b{$.pnfdInfoIds}
index a35c508..d15cd5c 100644 (file)
@@ -18,19 +18,29 @@ info:
   service: vfc
   author: ONAP VFC Team (yangyanyj@chinamobile.com)
 
+parameters:
+  - name: ns-job-id
+    description: ns job id
+    type: string
+    short_option: i
+    long_option: ns-job-id
+    is_optional: false
+
 results:
   direction: portrait
   attributes:
     - name: ns-job-id
-      description: ns-job-id
+      description: ns job id
       scope: short
       type: string
-    - name: ns-name
-      description: ns-name
+
+    - name: job-status
+      description: job status
       scope: short
       type: string
-    - name: description
-      description: description
+
+    - name: job-progress
+      description: job progress
       scope: short
       type: string
 
@@ -39,7 +49,7 @@ http:
     auth: none
     mode: direct
   request:
-    uri: /api/nsd/v1/ns_descriptors
+    uri: /api/nslcm/v1/jobs/${ns-job-id}
     method: GET
     context:
       remove_empty_node: true
@@ -49,7 +59,8 @@ http:
       Accept: application/json
   success_codes:
     - 200
+
   result_map:
-    ns-job-id: $b{$.ns-job-id}
-    ns-name: $b{$.nsName}
-    description: $b{$.description}
+    ns-job-id: $b{$.jobId}
+    job-status: $b{$.responseDescriptor.status}
+    job-progress: $b{$.responseDescriptor.progress}
\ No newline at end of file
index 984a1dc..b17a45f 100644 (file)
@@ -22,7 +22,7 @@ info:
   author: ONAP HPA Integration Team (haibin.huang@intel.com)
 
 results:
-  direction: portrait
+  direction: landscape
   attributes:
     - name: ns-instance-id
       description: ns-instance-id
@@ -57,7 +57,7 @@ http:
   success_codes:
     - 200
   result_map:
-    ns-instance-id: $b{$.nsInstanceId}
-    ns-name: $b{$.nsName}
-    description: $b{$.description}
-    nsd-id: $b{$.nsdId}
+    ns-instance-id: $b{$.[*].nsInstanceId}
+    ns-name: $b{$.[*].nsName}
+    description: $b{$.[*].description}
+    nsd-id: $b{$.[*].nsdId}
\ No newline at end of file
index 3634a71..ccf3ed6 100644 (file)
@@ -19,14 +19,14 @@ info:
   author: ONAP VFC Team (yangyanyj@chinamobile.com)
 
 results:
-  direction: portrait
+  direction: landscape
   attributes:
     - name: nslcm-opocc-id
       description: nslcm-opocc-id
       scope: short
       type: string
-    - name: operation-state
-      description: operation-state
+    - name: ns-operation-state
+      description: ns-operation-state
       scope: short
       type: string
     - name: ns-instance-id
@@ -37,8 +37,8 @@ results:
       description: lcm-operation-type
       scope: short
       type: string
-    - name: status-entered-time
-      description: status-entered-time
+    - name: state-entered-time
+      description: state-entered-time
       scope: short
       type: string
 
@@ -47,19 +47,18 @@ http:
     auth: none
     mode: direct
   request:
-    uri: api/nslcm/v1/ns_lcm_op_occs
+    uri: /api/nslcm/v1/ns_lcm_op_occs
     method: GET
-    context:
-      remove_empty_node: true
-    body: '{}'
     headers:
       Content-Type: application/json
       Accept: application/json
+
   success_codes:
     - 200
+
   result_map:
-    nslcm-opocc-id: $b{$.nslcmOpoccId}
-    ns-operation-state: $b{$.operationState}
-    ns-instance-id: $b{$.nsInstanceId}
-    lcm-operation-type-id: $b{$.lcmOperationType}
-    status-entered-time: $b{$.statusEnteredTime}
+    nslcm-opocc-id: $b{$.[*].id}
+    ns-operation-state: $b{$.[*].operationState}
+    ns-instance-id: $b{$.[*].nsInstanceId}
+    lcm-operation-type: $b{$.[*].operation}
+    state-entered-time: $b{$.[*].stateEnteredTime}
index fde5fc1..f913d7b 100644 (file)
@@ -28,8 +28,8 @@ parameters:
     short_option: c
     long_option: ns-csar-uuid
     is_optional: false
-  - name: ns-csar-name
-    description: ns's name of csar
+  - name: ns-name
+    description: ns's name of create
     type: string
     short_option: n
     long_option: ns-csar-name
@@ -60,20 +60,20 @@ http:
     auth: none
     mode: direct
   request:
-    uri: api/nslcm/v1/ns_instances
+    uri: /api/nslcm/v1/ns_instances
     method: POST
     context:
       remove_empty_node: true
     body: '{
              "nsdId": "${ns-csar-uuid}",
-             "nsName": "${ns-csar-name}",
+             "nsName": "${ns-name}",
              "nsDescription": "description"
            }'
     headers:
       Content-Type: application/json
       Accept: application/json
-      HTTP_GLOBALCUSTOMERID: '${customer-name}'
-      HTTP_SERVICETYPE: '${service-type}'
+      GLOBALCUSTOMERID: '${customer-name}'
+      SERVICETYPE: '${service-type}'
 
   success_codes:
     - 201
index 1d131cd..7ede716 100644 (file)
@@ -33,7 +33,7 @@ http:
     auth: none
     mode: direct
   request:
-    uri: api/nslcm/v1/ns_instances/${ns-instance-id}
+    uri: /api/nslcm/v1/ns_instances/${ns-instance-id}
     method: DELETE
     context:
       remove_empty_node: true
index 00cb8f5..bb83ed8 100644 (file)
@@ -22,7 +22,7 @@ info:
   author: ONAP VFC Team (yangyanyj@chinamobile.com)
 
 results:
-  direction: portrait
+  direction: landscape
   attributes:
     - name: ns-instance-id
       description: ns-instance-id
@@ -46,7 +46,7 @@ http:
     auth: none
     mode: direct
   request:
-    uri: api/nslcm/v1/ns_instances
+    uri: /api/nslcm/v1/ns_instances
     method: GET
     context:
       remove_empty_node: true
@@ -57,7 +57,7 @@ http:
   success_codes:
     - 200
   result_map:
-    ns-instance-id: $b{$.nsInstanceId}
-    ns-name: $b{$.nsName}
-    description: $b{$.description}
-    nsd-id: $b{$.nsdId}
+    ns-instance-id: $b{$.[*].id}
+    ns-name: $b{$.[*].nsInstanceName}
+    description: $b{$.[*].nsInstanceDescription}
+    nsd-id: $b{$.[*].nsdId}
index d673818..43eb775 100644 (file)
@@ -54,7 +54,7 @@ http:
     auth: none
     mode: direct
   request:
-    uri: api/nslcm/v1/ns_instances/${ns-instance-id}/instantiate
+    uri: /api/nslcm/v1/ns_instances/${ns-instance-id}/instantiate
     method: POST
     context:
       remove_empty_node: true
index 0916c20..e539c60 100644 (file)
@@ -33,13 +33,3 @@ results:
       description: Authorization
       scope: short
       type: string
-    - name: Environment
-      description: Environment
-      scope: short
-      type: string
-      default_value: TEST
-    - name: ClientAuth
-      description: Client Auth
-      scope: short
-      type: string
-      default_value: cHl0aG9uOnRlc3Q=
diff --git a/products/onap-elalto/features/policy/src/main/resources/open-cli-schema/policy/policy-create-schema-elalto.yaml b/products/onap-elalto/features/policy/src/main/resources/open-cli-schema/policy/policy-create-schema-elalto.yaml
new file mode 100644 (file)
index 0000000..b03ccba
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright © Intel Corporation 2019
+#
+# 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: policy-create
+description: Create a policy thru policy-api
+
+info:
+  product: onap-elalto
+  service: policy
+  author: ONAP CLI Team onap-discuss@lists.onap.org
+
+parameters:
+  - name: policy-name
+    description: Onap policy Name
+    type: string
+    short_option: x
+    long_option: policy-name
+    is_optional: false
+  - name: policy-body
+    description: Policy body
+    type: json
+    long_option: policy-body
+    short_option: b
+    is_optional: false
+  - name: policy-type
+    description: Onap policy type
+    type: string
+    short_option: T
+    long_option: policy-type
+    is_optional: false
+  - name: policy-version 
+    description: Onap policy Version
+    type: string
+    short_option: S
+    long_option: policy-version
+    is_optional: false
+
+http:
+  service:
+    name: policy
+    version: v1.0
+    auth: basic
+    mode: direct
+  request:
+    uri: /policy/api/v1/policytypes/${policy-type}/versions/${policy-version}/policies
+    method: POST
+    context:
+      remove_empty_node: true
+    body: '{"tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+            "topology_template": {
+            "policies": [{
+              "${policy-name}": "${policy-body}"}]}}'
+    headers:
+      Content-Type: application/json
+      Accept: application/json
+
+  success_codes:
+    - 200
+    - 201
index 4d607f3..0b847b0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2019 Intel Corporation.
+# Copyright 2019 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.
 # limitations under the License.
 
 open_cli_schema_version: 1.0
-name: policy-list-outdated
-description: List policies
+name: policy-list
+description: Retrieve all version details of a policy created for a particular policy type version
 
 info:
   product: onap-elalto
   service: policy
-  author: ONAP HPA Team onap-discuss@lists.onap.org
+  author: ONAP CLI Team onap-discuss@lists.onap.org
 
 parameters:
-  - name: policy-name
-    description: ONAP policy name
+  - name: policy-type-id
+    description: Policy type ID
     type: string
-    long_option: policy-name
+    long_option: policy-type-id
     short_option: x
     is_optional: false
-    default_value: .*
-  - name: config-attributes
-    description: Configuration Attributes
-    type: json
-    long_option: config-attributes
-    short_option: A
-    is_optional: true
-    default_value: {}
+  - name: version-id
+    description: Policy type version ID
+    type: string
+    long_option: version-id
+    short_option: y
+    is_optional: false
+  - name: policy-id
+    description: Policy ID
+    type: string
+    long_option: policy-id
+    short_option: z
+    is_optional: false
 
 results:
   direction: landscape
   attributes:
-    - name: name
-      description: Policy Name
-      scope: short
-      type: string
-    - name: type
-      description: Policy type
+    - name: Policy properties
+      description: Policy properties
       scope: short
-      type: string
-    - name: config
-      description: Policy configuration
-      scope: short
-      type: json
-    - name: version
-      description: Policy version
-      scope: long
-      type: string
-    - name: rules
-      description: Policy rules
-      scope: long
       type: json
+
 http:
   service:
     name: policy
@@ -67,22 +56,14 @@ http:
     auth: basic
     mode: direct
   request:
-    uri: /pdp/api/getConfig
-    method: POST
-    body: '{"configAttributes": "${config-attributes}", "policyName": "${policy-name}"}'
+    uri: /policy/api/v1/policytypes/${policy-type-id}/versions/${version-id}/policies/${policy-id}
+    method: GET
     headers:
       Accept: application/json
-      ClientAuth: cHl0aG9uOnRlc3Q=
       Environment: TEST
 
-
   success_codes:
     - 200
 
   result_map:
-    name: $b{$.[*].policyName}
-    type: $b{$.[*].policyType}
-    version: $b{$.[*].policyVersion}
-    config: $b{$.[*].config}
-    rules: $b{$.[*].matchingConditions}
-
+    Policy properties: $b{$.[*]}
index 0b847b0..c25a64a 100644 (file)
@@ -13,8 +13,8 @@
 # limitations under the License.
 
 open_cli_schema_version: 1.0
-name: policy-list
-description: Retrieve all version details of a policy created for a particular policy type version
+name: policy-list-with-config
+description: Retrieve policies according to configs 
 
 info:
   product: onap-elalto
@@ -22,24 +22,12 @@ info:
   author: ONAP CLI Team onap-discuss@lists.onap.org
 
 parameters:
-  - name: policy-type-id
-    description: Policy type ID
-    type: string
-    long_option: policy-type-id
+  - name: config-attributes
+    description: Policy retrieval config attributes
+    type: json
+    long_option: config-attributes
     short_option: x
     is_optional: false
-  - name: version-id
-    description: Policy type version ID
-    type: string
-    long_option: version-id
-    short_option: y
-    is_optional: false
-  - name: policy-id
-    description: Policy ID
-    type: string
-    long_option: policy-id
-    short_option: z
-    is_optional: false
 
 results:
   direction: landscape
@@ -56,11 +44,16 @@ http:
     auth: basic
     mode: direct
   request:
-    uri: /policy/api/v1/policytypes/${policy-type-id}/versions/${version-id}/policies/${policy-id}
-    method: GET
+    uri: /policy/pdpx/v1/decision
+    method: POST
+    body: '{"ONAPName": "OOF",
+            "ONAPComponent": "OOF_Component",
+            "ONAPInstance": "OOF_Component_Instance",
+            "action": "optimize",
+            "resources": "${config-attributes}"}'
     headers:
       Accept: application/json
-      Environment: TEST
+
 
   success_codes:
     - 200
index cbcc32f..b0f58ff 100644 (file)
@@ -48,6 +48,13 @@ parameters:
     long_option: artifact-name
     short_option: b
     is_optional: false
+  - name: artifact-label
+    description: Artifact Label
+    type: string
+    long_option: artifact-label
+    short_option: l
+    default_value: artifactLabel
+    is_optional: true
   - name: user-id
     description: Designer user id
     type: string
@@ -67,6 +74,6 @@ http:
     headers:
       Content-MD5: $s{md5:__body__}
       USER_ID: ${user-id}
-    body: '{"payloadData":"${artifact}","artifactDisplayName":"${artifact-name}","artifactType":"OTHER","description":"${remarks}","artifactName":"${artifact-name}", "artifactLabel":"${artifact-name}","artifactGroupType":"DEPLOYMENT", artifactChecksum="$s{md5:artifact}"}'
+    body: '{"payloadData":"${artifact}","artifactDisplayName":"${artifact-name}","artifactType":"OTHER","description":"${remarks}","artifactName":"${artifact-name}", "artifactLabel":"${artifact-label}","artifactGroupType":"DEPLOYMENT", artifactChecksum="$s{md5:artifact}"}'
   success_codes:
     - 200
diff --git a/products/onap-elalto/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-get-jobid.yaml b/products/onap-elalto/features/vfc/src/main/resources/open-cli-schema/nslcm/vfc-nslcm-get-jobid.yaml
new file mode 100644 (file)
index 0000000..bfb8fee
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright (c) 2019, CMCC 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: vfc-nslcm-get-jobid
+description: vfc nsclm get the jobid of  ns created job
+
+info:
+  product: onap-elalto
+  service: vfc
+  author: ONAP VFC Team (yangyanyj@chinamobile.com)
+
+parameters:
+  - name: ns-job-id
+    description: ns job id
+    type: string
+    short_option: i
+    long_option: ns-job-id
+    is_optional: false
+
+results:
+  direction: portrait
+  attributes:
+    - name: ns-job-id
+      description: ns job id
+      scope: short
+      type: string
+
+    - name: job-status
+      description: job status
+      scope: short
+      type: string
+
+    - name: job-progress
+      description: job progress
+      scope: short
+      type: string
+
+http:
+  service:
+    auth: none
+    mode: direct
+  request:
+    uri: /api/nslcm/v1/jobs/${ns-job-id}
+    method: GET
+    context:
+      remove_empty_node: true
+    body: '{}'
+    headers:
+      Content-Type: application/json
+      Accept: application/json
+  success_codes:
+    - 200
+
+  result_map:
+    ns-job-id: $b{$.jobId}
+    job-status: $b{$.responseDescriptor.status}
+    job-progress: $b{$.responseDescriptor.progress}
\ No newline at end of file
index dc46494..20846d6 100644 (file)
@@ -57,7 +57,7 @@ http:
   success_codes:
     - 200
   result_map:
-    ns-instance-id: $b{$.nsInstanceId}
-    ns-name: $b{$.nsName}
-    description: $b{$.description}
-    nsd-id: $b{$.nsdId}
+    ns-instance-id: $b{$.[*].nsInstanceId}
+    ns-name: $b{$.[*].nsName}
+    description: $b{$.[*].description}
+    nsd-id: $b{$.[*].nsdId}