From a4cd2403a5a171d6ab6aa6b1b0b1aae83345121b Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Tue, 29 Aug 2017 18:15:10 +0530 Subject: Add versioning for command By allowing to add version to the YAML, helps to create same command for multiple versions of product say onap 1.0, 1.1 CLI-37 Change-Id: Ic3982ea912045ff4f422fcf093cbd98ecd99716d Signed-off-by: Kanagaraj Manickam k00365106 --- .../resources/onap-cli-schema/schema-refresh.yaml | 27 +++++++++++++++ .../resources/onap-cli-schema/schema-validate.yaml | 38 ++++++++++++++++++++++ framework/src/main/resources/onap.properties | 6 ++-- framework/src/main/resources/schema-refresh.yaml | 26 --------------- framework/src/main/resources/schema-validate.yaml | 37 --------------------- 5 files changed, 69 insertions(+), 65 deletions(-) create mode 100644 framework/src/main/resources/onap-cli-schema/schema-refresh.yaml create mode 100644 framework/src/main/resources/onap-cli-schema/schema-validate.yaml delete mode 100644 framework/src/main/resources/schema-refresh.yaml delete mode 100644 framework/src/main/resources/schema-validate.yaml (limited to 'framework/src/main/resources') diff --git a/framework/src/main/resources/onap-cli-schema/schema-refresh.yaml b/framework/src/main/resources/onap-cli-schema/schema-refresh.yaml new file mode 100644 index 00000000..56492502 --- /dev/null +++ b/framework/src/main/resources/onap-cli-schema/schema-refresh.yaml @@ -0,0 +1,27 @@ +onap_cmd_schema_version: 1.0 +name: schema-refresh +description: Onap command to refresh schemas stored in onap_cli_schema folders. +version: 0.0 +service: + auth: none + name: onap-cli + version: 1.0.0 +results: + direction: landscape + attributes: + - name: sl-no + description: Serial Number + scope: short + type: string + - name: command + description: Command name + scope: short + type: string + - name: schema + description: Schema name + scope: short + type: string + - name: version + description: Schema version + scope: short + type: string \ No newline at end of file diff --git a/framework/src/main/resources/onap-cli-schema/schema-validate.yaml b/framework/src/main/resources/onap-cli-schema/schema-validate.yaml new file mode 100644 index 00000000..a4c1fd29 --- /dev/null +++ b/framework/src/main/resources/onap-cli-schema/schema-validate.yaml @@ -0,0 +1,38 @@ +onap_cmd_schema_version: 1.0 +name: schema-validate +description: Onap command to validate schema +version: 0.0 +service: + auth: none + name: onap-cli + version: 1.0.0 +default_parameters: + exclude: + - onap-username + - onap-password + - host-url + - no-auth +parameters: + - name: schema-location + type: url + description: Schema file location + short_option: l + long_option: schema-location + is_optional: false + - name: internal-schema + type: bool + description: Validate existing schema file + short_option: i + long_option: internal-schema + is_optional: false +results: + direction: landscape + attributes: + - name: sl-no + description: Serial Number of error + scope: short + type: string + - name: error + description: Schema validation error + scope: short + type: string \ No newline at end of file diff --git a/framework/src/main/resources/onap.properties b/framework/src/main/resources/onap.properties index 9d59f1e2..9e6b34bd 100644 --- a/framework/src/main/resources/onap.properties +++ b/framework/src/main/resources/onap.properties @@ -12,7 +12,6 @@ cli.no_auth_disable_include_params_external_cmd=onap-username,onap-password,host cli.no_auth_enable_exclude_params_external_cmd=onap-username,onap-password,no-auth cli.no_auth_enable_include_params_external_cmd=host-url -cli.service.auth=aaf cli.http.basic.common_headers=x-auth-token,x-transaction-id,x-app-id cli.http.basic.common_headers.x-auth-token=Authorization cli.http.basic.common_headers.x-transaction-id=X-TransactionId @@ -29,7 +28,7 @@ cli.http.basic.common_headers.sdc.user-id.value=${onap-username} #cli.service.auth=aaf #schema validation -cli.schema.top_level_params_list=onap_cmd_schema_version,name,description,service,parameters,results,http +cli.schema.top_level_params_list=onap_cmd_schema_version,name,version,description,service,parameters,results,http cli.schema.top_level_mandatory_list=onap_cmd_schema_version cli.schema.service_params_list=name,version,auth,mode @@ -52,3 +51,6 @@ cli.schema.http_methods=post,get,delete,put,head cli.schema.boolean_values=true,false cli.schema.auth_values=none,basic cli.schema.mode_values=direct,catalog + +#product version +cli.product.version=cli-1.0 diff --git a/framework/src/main/resources/schema-refresh.yaml b/framework/src/main/resources/schema-refresh.yaml deleted file mode 100644 index 59f2496c..00000000 --- a/framework/src/main/resources/schema-refresh.yaml +++ /dev/null @@ -1,26 +0,0 @@ -onap_cmd_schema_version: 1.0 -name: schema-refresh -description: Onap command to refresh schemas stored in onap_cli_schema folders. -service: - auth: none - name: onap-cli - version: 1.0.0 -results: - direction: landscape - attributes: - - name: sl-no - description: Serial Number - scope: short - type: string - - name: command - description: Command name - scope: short - type: string - - name: schema - description: Schema name - scope: short - type: string - - name: version - description: Schema version - scope: short - type: string \ No newline at end of file diff --git a/framework/src/main/resources/schema-validate.yaml b/framework/src/main/resources/schema-validate.yaml deleted file mode 100644 index 76945793..00000000 --- a/framework/src/main/resources/schema-validate.yaml +++ /dev/null @@ -1,37 +0,0 @@ -onap_cmd_schema_version: 1.0 -name: schema-validate -description: Onap command to validate schema -service: - auth: none - name: onap-cli - version: 1.0.0 -default_parameters: - exclude: - - onap-username - - onap-password - - host-url - - no-auth -parameters: - - name: schema-location - type: url - description: Schema file location - short_option: l - long_option: schema-location - is_optional: false - - name: internal-schema - type: bool - description: Validate existing schema file - short_option: i - long_option: internal-schema - is_optional: false -results: - direction: landscape - attributes: - - name: sl-no - description: Serial Number of error - scope: short - type: string - - name: error - description: Schema validation error - scope: short - type: string \ No newline at end of file -- cgit 1.2.3-korg