Migrate type long into digit 65/12465/2
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Thu, 14 Sep 2017 15:12:01 +0000 (20:42 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Thu, 14 Sep 2017 15:28:48 +0000 (20:58 +0530)
CLI-3

Change-Id: I5706963146d9575a9094aa7c24b85e1a0d8e7f80
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
25 files changed:
framework/src/main/java/org/onap/cli/fw/input/ParameterType.java
framework/src/test/java/org/onap/cli/fw/input/ParameterTypeTest.java
framework/src/test/java/org/onap/cli/fw/output/OnapCommandResultAttributeScopeTest.java
framework/src/test/resources/onap-cli-schema/sample-test1-schema-http.yaml
framework/src/test/resources/onap-test-schema.yaml
framework/src/test/resources/sample-test-invalid-schema-duplicate-longoption.yaml
framework/src/test/resources/sample-test-invalid-schema-duplicate-name.yaml
framework/src/test/resources/sample-test-invalid-schema-duplicate-shortoption.yaml
framework/src/test/resources/sample-test-invalid-schema.yaml
framework/src/test/resources/sample-test-schema-http.yaml
framework/src/test/resources/sample-test-schema.yaml
framework/src/test/resources/schema-validate-basic.yaml
framework/src/test/resources/schema-validate-http.yaml
framework/src/test/resources/schema-validate-invalidschematype.yaml
main/src/test/resources/onap-cli-schema/sample-create-schema.yaml
main/src/test/resources/sample-test-schema.yaml
plugins/aai/src/main/resources/onap-cli-schema/esr/ems/ems-delete-schema-1.1.yaml
plugins/aai/src/main/resources/onap-cli-schema/esr/sdnc/sdnc-create-schema-1.1.yaml
plugins/aai/src/main/resources/onap-cli-schema/esr/sdnc/sdnc-delete-schema-1.1.yaml
plugins/aai/src/main/resources/onap-cli-schema/esr/sdnc/sdnc-list-schema-1.1.yaml
plugins/aai/src/main/resources/onap-cli-schema/esr/vim/vim-delete-schema-1.1.yaml
plugins/msb/src/main/resources/onap-cli-schema/microservice-create-schema.yaml
plugins/msb/src/main/resources/onap-cli-schema/microservice-list-schema.yaml
plugins/msb/src/main/resources/onap-cli-schema/microservice-show-schema.yaml
plugins/msb/src/test/resources/service-list-schema.yaml

index 2625883..791d7e4 100644 (file)
@@ -30,7 +30,7 @@ public enum ParameterType {
     /**
      * YAML file.
      */
-    YAML, STRING, TEXT, LONG,
+    YAML, STRING, TEXT, DIGIT,
     /**
      * URL location.
      */
@@ -52,8 +52,8 @@ public enum ParameterType {
             return YAML;
         } else if (STRING.name().equalsIgnoreCase(name)) {
             return STRING;
-        } else if (LONG.name().equalsIgnoreCase(name)) {
-            return LONG;
+        } else if (DIGIT.name().equalsIgnoreCase(name)) {
+            return DIGIT;
         } else if (URL.name().equalsIgnoreCase(name)) {
             return URL;
         } else if (BOOL.name().equalsIgnoreCase(name)) {
index eef49ad..0a5ad00 100644 (file)
@@ -30,7 +30,7 @@ public class ParameterTypeTest {
             assertTrue(ParameterType.JSON.equals(ParameterType.get("json"))
                     && ParameterType.YAML.equals(ParameterType.get("yaml"))
                     && ParameterType.STRING.equals(ParameterType.get("string"))
-                    && ParameterType.LONG.equals(ParameterType.get("long"))
+                    && ParameterType.DIGIT.equals(ParameterType.get("digit"))
                     && ParameterType.URL.equals(ParameterType.get("url"))
                     && ParameterType.BOOL.equals(ParameterType.get("bool"))
                     && ParameterType.MAP.equals(ParameterType.get("map"))
index ac1a6d3..d74f83a 100644 (file)
@@ -31,11 +31,11 @@ public class OnapCommandResultAttributeScopeTest {
         att.setName("name");
         att.setScope(OnapCommandResultAttributeScope.LONG);
         att.setSecured(true);
-        att.setType(ParameterType.LONG);
+        att.setType(ParameterType.DIGIT);
         att.setValues(Collections.emptyList());
         assertTrue("description".equals(att.getDescription()) && "name".equals(att.getName())
                 && OnapCommandResultAttributeScope.LONG.equals(att.getScope())
-                && ParameterType.LONG.equals(att.getType()) && att.getValues().isEmpty());
+                && ParameterType.DIGIT.equals(att.getType()) && att.getValues().isEmpty());
     }
 
 }
index 55e9326..21f863b 100644 (file)
@@ -41,7 +41,7 @@ parameters:
     short_option: j
     is_optional: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index ef86348..814a138 100644 (file)
@@ -42,7 +42,7 @@ parameters:
     short_option: j
     is_optional: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index c7b018d..04ec6f2 100644 (file)
@@ -41,7 +41,7 @@ parameters:
     short_option: j
     is_optional: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index f46a975..c94a238 100644 (file)
@@ -48,7 +48,7 @@ parameters:
     short_option: j
     is_optional: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index 4eb07be..d97e585 100644 (file)
@@ -42,7 +42,7 @@ parameters:
     short_option: j
     is_optional: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index 036a207..fbe8708 100644 (file)
@@ -41,7 +41,7 @@ parameters:
     short_option: j
     is_optional: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index c6e0450..8791879 100644 (file)
@@ -26,7 +26,7 @@ parameters:
     is_optional: false
   - name: status
     description: Onap service status
-    type: long
+    type: digit
     short_option: z
     long_option: service-status
     is_optional: true
@@ -59,7 +59,7 @@ results:
     - name: status
       description: Onap service status
       scope: short
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
index 48ef2d6..0387e48 100644 (file)
@@ -43,7 +43,7 @@ parameters:
     is_optional: false
     is_secured: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index f788031..7cab57b 100644 (file)
@@ -24,7 +24,7 @@ parameters:
     is_optional: false1
   - name: status
     description: Onap service status
-    type: long
+    type: digit
     short_option: z
     long_option: service-version
     is_optional: true
@@ -57,7 +57,7 @@ results:
     - name: status
       description: Onap service status
       scope: short1
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
index c813b76..2f56ec4 100644 (file)
@@ -24,7 +24,7 @@ parameters:
     is_optional: false1
   - name: status
     description: Onap service status
-    type: long
+    type: digit
     short_option: z
     long_option: service-version
     is_optional: true
@@ -57,7 +57,7 @@ results:
     - name: status
       description: Onap service status
       scope: short1
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
index 469f28e..17f4abe 100644 (file)
@@ -22,7 +22,7 @@ parameters:
     is_optional: false1
   - name: status
     description: Onap service status
-    type: long
+    type: digit
     short_option: z
     long_option: service-version
     is_optional: true
@@ -55,7 +55,7 @@ results:
     - name: status
       description: Onap service status
       scope: short1
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
index 561fa22..ff24c0a 100644 (file)
@@ -41,7 +41,7 @@ results:
     - name: status
       description: Onap service status
       scope: short
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
index 286135c..a4fd856 100644 (file)
@@ -41,7 +41,7 @@ parameters:
     short_option: j
     is_optional: false
   - name: long-param
-    type: long
+    type: digit
     description: Onap long param
     short_option: l
     long_option: long-opt
index 45ffd35..c703c65 100644 (file)
@@ -21,7 +21,7 @@ parameters:
     is_optional: false
   - name: resource-version
     description: Onap vim resource version
-    type: uuid
+    type: string
     short_option: y
     long_option: resource-version
     is_optional: true
index 83afd01..fe0d22a 100644 (file)
@@ -88,7 +88,7 @@ parameters:
 
 http:
   request:
-    uri: /aai/v11/external-system/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{sdnc-id}
+    uri: /aai/v11/external-system/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/${sdnc-id}
     method: PUT
     body: '{"thirdparty-sdnc-id":"${sdnc-id}","location":"${location}","product-name":"${product-name}","esr-system-info-list":{"esr-system-info":[{"esr-system-info-id":"${sdnc-id}","system-name":"${name}","type":"${type}","vendor":"${vendor}","version":"${sdnc-version}","service-url":"","user-name":"${username}","password":"${password}","system-type":"sdnc","protocal":"${protocal}","ssl-cacert":"","ssl-insecure":"","ip-address":"${ip-address}","port":"${port}","cloud-domain":"","default-tenant":""}]}}'
   success_codes:
index 3cee472..eec0ca6 100644 (file)
@@ -15,14 +15,14 @@ service:
 parameters:
   - name: sdnc-id
     description: Onap VNFM unique id
-    type: uuid
+    type: string
     short_option: x
     long_option:  sdnc-id
     is_optional: false
 
 http:
   request:
-    uri: /aai/v11/external-system/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{sdnc-id}
+    uri: /aai/v11/external-system/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/${sdnc-id}
     method: DELETE
 
   success_codes:
index aa56b71..f84c480 100644 (file)
@@ -19,46 +19,6 @@ results:
       description: Onap sdnc id
       scope: short
       type: string
-    - name: location
-      description: Onap sdnc id
-      scope: short
-      type: string
-    - name: name
-      description: Onap sdnc name
-      scope: short
-      type: string
-    - name: type
-      description: Onap sdnc type
-      scope: short
-      type: string
-    - name: vendor
-      description: Onap sdnc vendor
-      scope: short
-      type: string
-    - name: version
-      description: Onap sdnc version
-      scope: short
-      type: string
-    - name: ip-address
-      description: Onap sdnc ip-address
-      scope: short
-      type: string
-    - name: port
-      description: Onap sdnc port
-      scope: short
-      type: string
-    - name: protocal
-      description: Onap sdnc protocal
-      scope: short
-      type: string
-    - name: username
-      description: Onap sdnc username
-      scope: long
-      type: string
-    - name: product-name
-      description: Onap sdnc product-name
-      scope: short
-      type: string
     - name: resource-version
       description: Onap sdnc resource version
       scope: short
@@ -71,18 +31,8 @@ http:
   success_codes:
     - 200
   result_map:
-    sdnc-id: $b{$.esr-sdnc.[*].sdnc-id
-    location: $b{$.esr-sdnc.[*].location
-    name: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].system-name
-    type: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].type
-    vendor: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].vendor
-    version: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].version
-    ip-address: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].ip-address
-    port: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].port
-    protocal: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].protocal
-    username: $b{$.esr-sdnc.[*].esr-system-info-list.esr-system-info.[0].user-name
-    product-name: $b{$.esr-sdnc.[*].product-name
-    resource-version: $b{$.esr-sdnc.[*].resource-version
+    sdnc-id: $b{$.esr-sdnc.[*].sdnc-id}
+    resource-version: $b{$.esr-sdnc.[*].resource-version}
 
   sample_response:
     body: '{"esr-sdnc":[{"sdnc-id":"example-sdnc-id-val-36878","location":"location","product-name":"example-remotepath-val-80493","esr-system-info-list":{"esr-system-info":[{"esr-system-info-id":"example-esr-system-info-id-val-44791","system-name":"example-system-name-val-48687","type":"example-type-val-95885","vendor":"example-vendor-val-41061","version":"example-version-val-38559","service-url":"example-service-url-val-2663","user-name":"example-user-name-val-26126","password":"example-password-val-33838","system-type":"sdnc","protocal":"","ssl-cacert":"","ssl-insecure":false,"ip-address":"","port":"","cloud-domain":"","default-tenant":""}]}}]}'
index 55d1604..ee74ead 100644 (file)
@@ -33,7 +33,7 @@ parameters:
     is_optional: false
   - name: resource-version
     description: Onap vim resource version
-    type: uuid
+    type: string
     short_option: b
     long_option: resource-version
     is_optional: true
index 1d0053f..dd3aead 100644 (file)
@@ -53,7 +53,7 @@ results:
     - name: status
       description: Onap service status
       scope: short
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
@@ -83,4 +83,3 @@ http:
 
   sample_response:
     body: '{"serviceName":"test","version":"v1","url":"/api/test/v1","protocol":"REST","visualRange":"1","lb_policy":"hash","nodes":[{"ip":"127.0.0.1","port":"8012","ttl":0,"nodeId":"test_127.0.0.1_8012","expiration":"2017-02-10T05:33:25Z","created_at":"2017-02-10T05:33:25Z","updated_at":"2017-02-10T05:33:25Z"}],"status":"1"}'
-
index 981d619..b9bc306 100644 (file)
@@ -24,7 +24,7 @@ results:
     - name: status
       description: Onap service status
       scope: short
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
index 919af2d..437e567 100644 (file)
@@ -37,7 +37,7 @@ results:
     - name: status
       description: Onap service status
       scope: short
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long
index 3c97d30..d6ec32f 100644 (file)
@@ -23,7 +23,7 @@ results:
     - name: status
       description: Onap service status
       scope: short
-      type: long
+      type: digit
     - name: nodes
       description: Onap service running nodes
       scope: long