From 8aa599260569b9f063fb85680c95116b00609c31 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Sat, 14 Oct 2017 01:04:20 +0530 Subject: Make schema-validate independent of schema profile Now schema-validate is able to validate schema of any given type supported. Issue-Id: CLI-66 Change-Id: I47ac5e81e9b12dd575e0a4cdc7e8e8bad0f87474 Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/resources/default_input_parameters.yaml | 38 ------------------- .../resources/default_input_parameters_http.yaml | 30 --------------- .../resources/open-cli-schema/basic-login.yaml | 19 ---------- .../resources/open-cli-schema/basic-logout.yaml | 19 ---------- .../main/resources/open-cli-schema/catalog.yaml | 44 ---------------------- .../open-cli-schema/default_input_parameters.yaml | 44 ++++++++++++++++++++++ .../open-cli-schema/http/basic-login.yaml | 19 ++++++++++ .../open-cli-schema/http/basic-logout.yaml | 19 ++++++++++ .../resources/open-cli-schema/http/catalog.yaml | 44 ++++++++++++++++++++++ .../http/default_input_parameters_http.yaml | 36 ++++++++++++++++++ .../resources/open-cli-schema/schema-validate.yaml | 7 ++++ framework/src/main/resources/open-cli.properties | 2 +- framework/src/main/resources/version.info | 4 +- 13 files changed, 172 insertions(+), 153 deletions(-) delete mode 100644 framework/src/main/resources/default_input_parameters.yaml delete mode 100644 framework/src/main/resources/default_input_parameters_http.yaml delete mode 100644 framework/src/main/resources/open-cli-schema/basic-login.yaml delete mode 100644 framework/src/main/resources/open-cli-schema/basic-logout.yaml delete mode 100644 framework/src/main/resources/open-cli-schema/catalog.yaml create mode 100644 framework/src/main/resources/open-cli-schema/default_input_parameters.yaml create mode 100644 framework/src/main/resources/open-cli-schema/http/basic-login.yaml create mode 100644 framework/src/main/resources/open-cli-schema/http/basic-logout.yaml create mode 100644 framework/src/main/resources/open-cli-schema/http/catalog.yaml create mode 100644 framework/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml (limited to 'framework/src/main/resources') diff --git a/framework/src/main/resources/default_input_parameters.yaml b/framework/src/main/resources/default_input_parameters.yaml deleted file mode 100644 index a8d35eee..00000000 --- a/framework/src/main/resources/default_input_parameters.yaml +++ /dev/null @@ -1,38 +0,0 @@ -open_cli_schema_version: 1.0 -parameters: - - name: help - type: string - description: print help message - short_option: h - long_option: help - default_value: false - - name: version - type: string - description: print service version - short_option: v - long_option: version - default_value: false - - name: debug - type: bool - description: Enable debug output - short_option: d - long_option: debug - default_value: false - - name: format - type: string - description: Output formats, supported formats such as table, csv, json, yaml - short_option: f - long_option: format - default_value: table - - name: long - type: bool - description: whether to print all attributes or only short attributes - short_option: s - long_option: long - default_value: false - - name: no-title - type: bool - description: whether to print title or not - short_option: t - long_option: no-title - default_value: false \ No newline at end of file diff --git a/framework/src/main/resources/default_input_parameters_http.yaml b/framework/src/main/resources/default_input_parameters_http.yaml deleted file mode 100644 index 81656ea0..00000000 --- a/framework/src/main/resources/default_input_parameters_http.yaml +++ /dev/null @@ -1,30 +0,0 @@ -open_cli_schema_version: 1.0 -parameters: - - name: host-username - type: string - description: Host user name - short_option: u - long_option: host-username - default_value: $s{env:OPEN_CLI_HOST_USERNAME} - is_optional: false - - name: host-password - type: string - description: Host user password - short_option: p - long_option: host-password - default_value: $s{env:OPEN_CLI_HOST_PASSWORD} - is_secured: true - is_optional: false - - name: host-url - type: url - description: host url in http(s) - short_option: m - long_option: host-url - is_optional: false - default_value: $s{env:OPEN_CLI_HOST_URL} - - name: no-auth - type: bool - description: whether to authenticate user or not - short_option: a - long_option: no-auth - default_value: false \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/basic-login.yaml b/framework/src/main/resources/open-cli-schema/basic-login.yaml deleted file mode 100644 index dab9652e..00000000 --- a/framework/src/main/resources/open-cli-schema/basic-login.yaml +++ /dev/null @@ -1,19 +0,0 @@ -open_cli_schema_version: 1.0 - -name: basic-login - -description: basic login auth command - -info: - product: open-cli - service: basic-auth - type: auth - author: Kanagaraj Manickam mkr1481@gmail.com - -results: - direction: portrait - attributes: - - name: Authorization - description: Authorization - scope: short - type: string diff --git a/framework/src/main/resources/open-cli-schema/basic-logout.yaml b/framework/src/main/resources/open-cli-schema/basic-logout.yaml deleted file mode 100644 index ef60006c..00000000 --- a/framework/src/main/resources/open-cli-schema/basic-logout.yaml +++ /dev/null @@ -1,19 +0,0 @@ -open_cli_schema_version: 1.0 - -name: basic-logout - -description: basic logout auth command - -info: - product: open-cli - service: basic-auth - type: auth - author: Kanagaraj Manickam mkr1481@gmail.com - -parameters: - - name: host-username - is_include: false - - name: host-password - is_include: false - - name: no-auth - is_include: false \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/catalog.yaml b/framework/src/main/resources/open-cli-schema/catalog.yaml deleted file mode 100644 index d3ee9992..00000000 --- a/framework/src/main/resources/open-cli-schema/catalog.yaml +++ /dev/null @@ -1,44 +0,0 @@ -open_cli_schema_version: 1.0 - -name: catalog - -description: cli catalog command to find the base path for service. - -info: - product: open-cli - service: catalog - type: catalog - author: Kanagaraj Manickam mkr1481@gmail.com - -parameters: - - name: catalog-service-name - type: string - description: service name registered in catalog service - short_option: l - long_option: catalog-service-name - is_optional: false - - name: catalog-service-version - type: string - description: service version registered in catalog service - short_option: i - long_option: catalog-service-version - is_optional: false - - name: host-username - is_include: false - - name: host-password - is_include: false - - name: no-auth - is_include: false -results: - direction: portrait - attributes: - - name: catalog-service-host-url - description: Service connection url - scope: short - type: string - default_value: ${host-url} - - name: catalog-service-base-path - description: service base path, to append with host-url for connecting the service. - scope: short - type: string - default_value: / \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/default_input_parameters.yaml b/framework/src/main/resources/open-cli-schema/default_input_parameters.yaml new file mode 100644 index 00000000..e8e08f46 --- /dev/null +++ b/framework/src/main/resources/open-cli-schema/default_input_parameters.yaml @@ -0,0 +1,44 @@ +open_cli_schema_version: 1.0 + +info: + product: open-cli + service: default-param + ignore: true + +parameters: + - name: help + type: string + description: print help message + short_option: h + long_option: help + default_value: false + - name: version + type: string + description: print service version + short_option: v + long_option: version + default_value: false + - name: debug + type: bool + description: Enable debug output + short_option: d + long_option: debug + default_value: false + - name: format + type: string + description: Output formats, supported formats such as table, csv, json, yaml + short_option: f + long_option: format + default_value: table + - name: long + type: bool + description: whether to print all attributes or only short attributes + short_option: s + long_option: long + default_value: false + - name: no-title + type: bool + description: whether to print title or not + short_option: t + long_option: no-title + default_value: false \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/http/basic-login.yaml b/framework/src/main/resources/open-cli-schema/http/basic-login.yaml new file mode 100644 index 00000000..dab9652e --- /dev/null +++ b/framework/src/main/resources/open-cli-schema/http/basic-login.yaml @@ -0,0 +1,19 @@ +open_cli_schema_version: 1.0 + +name: basic-login + +description: basic login auth command + +info: + product: open-cli + service: basic-auth + type: auth + author: Kanagaraj Manickam mkr1481@gmail.com + +results: + direction: portrait + attributes: + - name: Authorization + description: Authorization + scope: short + type: string diff --git a/framework/src/main/resources/open-cli-schema/http/basic-logout.yaml b/framework/src/main/resources/open-cli-schema/http/basic-logout.yaml new file mode 100644 index 00000000..ef60006c --- /dev/null +++ b/framework/src/main/resources/open-cli-schema/http/basic-logout.yaml @@ -0,0 +1,19 @@ +open_cli_schema_version: 1.0 + +name: basic-logout + +description: basic logout auth command + +info: + product: open-cli + service: basic-auth + type: auth + author: Kanagaraj Manickam mkr1481@gmail.com + +parameters: + - name: host-username + is_include: false + - name: host-password + is_include: false + - name: no-auth + is_include: false \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/http/catalog.yaml b/framework/src/main/resources/open-cli-schema/http/catalog.yaml new file mode 100644 index 00000000..d3ee9992 --- /dev/null +++ b/framework/src/main/resources/open-cli-schema/http/catalog.yaml @@ -0,0 +1,44 @@ +open_cli_schema_version: 1.0 + +name: catalog + +description: cli catalog command to find the base path for service. + +info: + product: open-cli + service: catalog + type: catalog + author: Kanagaraj Manickam mkr1481@gmail.com + +parameters: + - name: catalog-service-name + type: string + description: service name registered in catalog service + short_option: l + long_option: catalog-service-name + is_optional: false + - name: catalog-service-version + type: string + description: service version registered in catalog service + short_option: i + long_option: catalog-service-version + is_optional: false + - name: host-username + is_include: false + - name: host-password + is_include: false + - name: no-auth + is_include: false +results: + direction: portrait + attributes: + - name: catalog-service-host-url + description: Service connection url + scope: short + type: string + default_value: ${host-url} + - name: catalog-service-base-path + description: service base path, to append with host-url for connecting the service. + scope: short + type: string + default_value: / \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml b/framework/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml new file mode 100644 index 00000000..d7fbe03c --- /dev/null +++ b/framework/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml @@ -0,0 +1,36 @@ +open_cli_schema_version: 1.0 + +info: + product: open-cli + service: default-param + ignore: true + +parameters: + - name: host-username + type: string + description: Host user name + short_option: u + long_option: host-username + default_value: $s{env:OPEN_CLI_HOST_USERNAME} + is_optional: false + - name: host-password + type: string + description: Host user password + short_option: p + long_option: host-password + default_value: $s{env:OPEN_CLI_HOST_PASSWORD} + is_secured: true + is_optional: false + - name: host-url + type: url + description: host url in http(s) + short_option: m + long_option: host-url + is_optional: false + default_value: $s{env:OPEN_CLI_HOST_URL} + - name: no-auth + type: bool + description: whether to authenticate user or not + short_option: a + long_option: no-auth + default_value: false \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/schema-validate.yaml b/framework/src/main/resources/open-cli-schema/schema-validate.yaml index 65acfb0e..c17b3a08 100644 --- a/framework/src/main/resources/open-cli-schema/schema-validate.yaml +++ b/framework/src/main/resources/open-cli-schema/schema-validate.yaml @@ -21,6 +21,13 @@ parameters: short_option: i long_option: internal-schema is_optional: false + - name: ocs-version + type: string + description: OCS version + short_option: b + long_option: ocs-version + is_optional: true + default_value: 1.0 results: direction: landscape diff --git a/framework/src/main/resources/open-cli.properties b/framework/src/main/resources/open-cli.properties index 757b0259..813e46dd 100644 --- a/framework/src/main/resources/open-cli.properties +++ b/framework/src/main/resources/open-cli.properties @@ -8,7 +8,7 @@ cli.version=1.0 cli.schema.top_level_params_list=open_cli_schema_version,name,description,parameters,results,http,info cli.schema.top_level_mandatory_list=open_cli_schema_version -cli.schema.info_params_list=product,service,type,author +cli.schema.info_params_list=product,service,type,author,ignore cli.schema.info_params_mandatory_list=product,service cli.schema.input_params_list=name,description,type,short_option,long_option, is_optional,default_value,is_secured,is_include diff --git a/framework/src/main/resources/version.info b/framework/src/main/resources/version.info index fc959d19..edfa61d6 100644 --- a/framework/src/main/resources/version.info +++ b/framework/src/main/resources/version.info @@ -3,5 +3,5 @@ Available products: __AVAILABLE_PRODUCT_VERSIONS__ Enabled product : __ENABLED_PRODUCT_VERSIONS__ To enable a product, use one of following methods: -1. In scripting mode, Set environment variable OPEN_CLI_PRODUCT_IN_USE -2. In interactive mode, set the directive 'use ' +1. In scripting mode, set environment variable OPEN_CLI_PRODUCT_IN_USE +2. In interactive mode, use the directive 'use ' -- cgit 1.2.3-korg