From 864eafac295bb9cc4c0b4315aa7c262eb214ccc6 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 4 Oct 2017 18:25:24 +0530 Subject: Remove default_parameter section and use is_includ Issue-Id: CLI-66 Change-Id: I24a3bc4d133d4d69fd6522091f20f88edd6c2f19 Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/resources/default_input_parameters.yaml | 28 -------------------- .../resources/default_input_parameters_http.yaml | 30 ++++++++++++++++++++++ framework/src/main/resources/log4j.properties | 4 +-- .../resources/open-cli-schema/basic-login.yaml | 13 ++++------ .../resources/open-cli-schema/basic-logout.yaml | 13 ++++------ .../main/resources/open-cli-schema/catalog.yaml | 19 ++++++-------- .../resources/open-cli-schema/schema-refresh.yaml | 18 +++++++------ .../resources/open-cli-schema/schema-validate.yaml | 19 ++++++-------- framework/src/main/resources/open-cli.properties | 25 +++++++----------- 9 files changed, 77 insertions(+), 92 deletions(-) create mode 100644 framework/src/main/resources/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 index 7f06e2bd..a8d35eee 100644 --- a/framework/src/main/resources/default_input_parameters.yaml +++ b/framework/src/main/resources/default_input_parameters.yaml @@ -1,27 +1,5 @@ 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: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: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:HOST_URL} - name: help type: string description: print help message @@ -57,10 +35,4 @@ parameters: description: whether to print title or not short_option: t long_option: no-title - default_value: false - - 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/default_input_parameters_http.yaml b/framework/src/main/resources/default_input_parameters_http.yaml new file mode 100644 index 00000000..529053d0 --- /dev/null +++ b/framework/src/main/resources/default_input_parameters_http.yaml @@ -0,0 +1,30 @@ +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: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: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: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/log4j.properties b/framework/src/main/resources/log4j.properties index 1b352b5b..f117ef6e 100644 --- a/framework/src/main/resources/log4j.properties +++ b/framework/src/main/resources/log4j.properties @@ -2,8 +2,8 @@ log4j.rootLogger=ERROR, file # Redirect log messages to a log file, support file rolling. log4j.appender.file=org.apache.log4j.RollingFileAppender -log4j.appender.file.File=${ONAP_CLI_HOME}/logs/onap-cli.log +log4j.appender.file.File=${OPEN_CLI_HOME}/logs/oclip.log log4j.appender.file.MaxFileSize=5MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n \ No newline at end of file +log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n diff --git a/framework/src/main/resources/open-cli-schema/basic-login.yaml b/framework/src/main/resources/open-cli-schema/basic-login.yaml index a7f3b6ed..dab9652e 100644 --- a/framework/src/main/resources/open-cli-schema/basic-login.yaml +++ b/framework/src/main/resources/open-cli-schema/basic-login.yaml @@ -4,14 +4,11 @@ name: basic-login description: basic login auth command -version: cli-1.0 - -type: auth - -service: - name: open-cli - version: 1.0.0 - mode: direct +info: + product: open-cli + service: basic-auth + type: auth + author: Kanagaraj Manickam mkr1481@gmail.com results: direction: portrait diff --git a/framework/src/main/resources/open-cli-schema/basic-logout.yaml b/framework/src/main/resources/open-cli-schema/basic-logout.yaml index 80255dd5..088fe7df 100644 --- a/framework/src/main/resources/open-cli-schema/basic-logout.yaml +++ b/framework/src/main/resources/open-cli-schema/basic-logout.yaml @@ -4,11 +4,8 @@ name: basic-logout description: basic logout auth command -version: cli-1.0 - -type: auth - -service: - name: open-cli - version: 1.0.0 - mode: direct \ No newline at end of file +info: + product: open-cli + service: basic-auth + type: auth + author: Kanagaraj Manickam mkr1481@gmail.com diff --git a/framework/src/main/resources/open-cli-schema/catalog.yaml b/framework/src/main/resources/open-cli-schema/catalog.yaml index 160ff1d4..4fafec4c 100644 --- a/framework/src/main/resources/open-cli-schema/catalog.yaml +++ b/framework/src/main/resources/open-cli-schema/catalog.yaml @@ -2,18 +2,14 @@ open_cli_schema_version: 1.0 name: catalog -description: cli catalog command to find the base path for service. +description: cli catalog command to find the base path for service. -version: cli-1.0 +info: + product: open-cli + service: catalog + type: catalog + author: Kanagaraj Manickam mkr1481@gmail.com -type: catalog - -service: - auth: none - name: open-cli - version: 1.0.0 - mode: direct - parameters: - name: catalog-service-name type: string @@ -27,6 +23,7 @@ parameters: short_option: i long_option: catalog-service-version is_optional: false + results: direction: portrait attributes: @@ -39,4 +36,4 @@ results: 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 + default_value: / \ No newline at end of file diff --git a/framework/src/main/resources/open-cli-schema/schema-refresh.yaml b/framework/src/main/resources/open-cli-schema/schema-refresh.yaml index 5f1cb50e..136bc1cd 100644 --- a/framework/src/main/resources/open-cli-schema/schema-refresh.yaml +++ b/framework/src/main/resources/open-cli-schema/schema-refresh.yaml @@ -1,11 +1,13 @@ open_cli_schema_version: 1.0 name: schema-refresh -description: Onap command to refresh schemas stored in OPEN_cli_schema folders. -version: cli-1.0 -service: - auth: none - name: open-cli - version: 1.0.0 +description: Onap command to refresh schemas stored in open_cli_schema folders. + +info: + product: open-cli + service: schema + type: auth + author: Kanagaraj Manickam mkr1481@gmail.com + results: direction: landscape attributes: @@ -17,7 +19,7 @@ results: description: Command name scope: short type: string - - name: product-version + - name: product description: Command product version scope: short type: string @@ -25,7 +27,7 @@ results: description: Schema name scope: short type: string - - name: version + - name: ocs-version description: Schema version scope: short type: string \ 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 8c777666..e5b22bbf 100644 --- a/framework/src/main/resources/open-cli-schema/schema-validate.yaml +++ b/framework/src/main/resources/open-cli-schema/schema-validate.yaml @@ -1,17 +1,13 @@ open_cli_schema_version: 1.0 name: schema-validate description: Onap command to validate schema -version: cli-1.0 -service: - auth: none - name: open-cli - version: 1.0.0 -default_parameters: - exclude: - - host-username - - host-password - - host-url - - no-auth + +info: + product: open-cli + service: schema + type: auth + author: Kanagaraj Manickam mkr1481@gmail.com + parameters: - name: schema-location type: url @@ -25,6 +21,7 @@ parameters: short_option: i long_option: internal-schema is_optional: false + results: direction: landscape attributes: diff --git a/framework/src/main/resources/open-cli.properties b/framework/src/main/resources/open-cli.properties index 6ee08900..84a4736e 100644 --- a/framework/src/main/resources/open-cli.properties +++ b/framework/src/main/resources/open-cli.properties @@ -1,38 +1,31 @@ cli.ignore_auth=false cli.http.api_key_use_cookies=true cli.discover_always=false - -cli.service_name=open-cli -cli.product.version=cli-1.0 +cli.product_name=open-cli cli.version=1.0 -# service section -cli.exclude_params_internal_cmd=host-username,host-password,host-url,no-auth -cli.no_auth_disable_include_params_external_cmd=host-username,host-password,host-url,no-auth -cli.no_auth_enable_exclude_params_external_cmd=host-username,host-password,no-auth -cli.no_auth_enable_include_params_external_cmd=host-url - #schema validation -cli.schema.top_level_params_list=open_cli_schema_version,name,version,description,service,parameters,results,http,type,info +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.service_params_list=name,version,auth,mode -cli.schema.service_params_mandatory_list=name,version +cli.schema.info_params_list=product,service,type,author +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 +cli.schema.input_params_list=name,description,type,short_option,long_option, is_optional,default_value,is_secured,is_include cli.schema.input_params_mandatory_list=name,description,type cli.schema.result_params_list=name,description,scope,type,is_secured, default_value cli.schema.result_params_mandatory_list=name, description, type, scope -cli.schema.http_sections=request,success_codes,result_map,sample_response +#http +cli.schema.http_sections=request,service,success_codes,result_map,sample_response cli.schema.http_mandatory_sections=request, success_codes cli.schema.http_request_params=uri,method,body,headers,queries,multipart_entity_name cli.schema.http_request_mandatory_params=uri,method -cli.schema.info_params_list=product,service,type,author -cli.schema.info_params_mandatory_list=product,service +cli.schema.service_params_list=name,version,auth,mode +cli.schema.service_params_mandatory_list=auth,mode cli.schema.http_methods=post,get,delete,put,head -- cgit 1.2.3-korg