diff options
Diffstat (limited to 'profiles')
5 files changed, 38 insertions, 27 deletions
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java b/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java index aa1368ec..3127b6b1 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java @@ -113,7 +113,8 @@ public class OnapCommandHttpAuthClient { } private String getServiceUrl(OnapHttpCommand cmd) throws OnapCommandException { - if (cmd.getService().isModeDirect()){ + if (cmd.getService().isModeDirect() || + Boolean.parseBoolean(cmd.getParametersMap().get(OnapCommandHttpConstants.DEFAULT_PARAMETER_NO_CATALOG).getValue().toString())){ return cmd.getParametersMap().get(OnapCommandHttpConstants.DEAFULT_PARAMETER_HOST_URL).getValue().toString(); } else { //Catalog mode OnapCommand catalog = OnapCommandRegistrar.getRegistrar().get("catalog", cmd.getInfo().getProduct()); diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java index 7b421523..cd10849b 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java @@ -24,11 +24,11 @@ public class OnapCommandHttpConstants { public static final String CONF = "open-cli-http.properties"; public static final String OPEN_IGNORE_AUTH = "cli.ignore_auth"; public static final String HTTP_API_KEY_USE_COOKIES = "cli.http.api_key_use_cookies"; - public static final String HTTP_SECTIONS = "cli.schema.http_sections"; - public static final String HTTP_MANDATORY_SECTIONS = "cli.schema.http_mandatory_sections"; - public static final String HTTP_REQUEST_PARAMS = "cli.schema.http_request_params"; - public static final String HTTP_REQUEST_MANDATORY_PARAMS = "cli.schema.http_request_mandatory_params"; - public static final String HTTP_METHODS = "cli.schema.http_methods"; + public static final String HTTP_SECTIONS = "cli.schema.http.sections"; + public static final String HTTP_MANDATORY_SECTIONS = "cli.schema.http.sections.mandatory"; + public static final String HTTP_REQUEST_PARAMS = "cli.schema.http.request.sections"; + public static final String HTTP_REQUEST_MANDATORY_PARAMS = "cli.schema.http.request.sections.mandatory"; + public static final String HTTP_METHODS = "cli.schema.http.request.method.values"; //http connection public static final String SSLCONTEST_TLS = "TLSV1.2"; public static final String APPLICATION_JSON = "application/json"; @@ -87,6 +87,8 @@ public class OnapCommandHttpConstants { public static final String MODE_VALUES = "cli.schema.mode_values"; public static final String SERVICE_PARAMS_LIST = "cli.schema.service_params_list"; public static final String SERVICE_PARAMS_MANDATORY_LIST = "cli.schema.service_params_mandatory_list"; + + public static final String DEFAULT_PARAMETER_NO_CATALOG = "no-catalog"; } diff --git a/profiles/http/src/main/resources/open-cli-http.properties b/profiles/http/src/main/resources/open-cli-http.properties index caeb4a95..db19d088 100644 --- a/profiles/http/src/main/resources/open-cli-http.properties +++ b/profiles/http/src/main/resources/open-cli-http.properties @@ -3,16 +3,16 @@ cli.http.api_key_use_cookies=true #schema validation #http -cli.schema.http_sections=request,service,success_codes,result_map,sample_response -cli.schema.http_mandatory_sections=request, success_codes +cli.schema.http.sections=request,service,success_codes,result_map,sample_response +cli.schema.http.sections.mandatory=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.http.request.sections=uri,method,body,headers,queries,multipart_entity_name +cli.schema.http.request.sections.mandatory=uri,method -cli.schema.service_params_list=name,version,auth,mode -cli.schema.service_params_mandatory_list=auth,mode +cli.schema.http.service.sections=name,version,auth,mode +cli.schema.http.service.sections.mandatory=auth,mode -cli.schema.http_methods=post,get,delete,put,head +cli.schema.http.request.method.values=post,get,delete,put,head -cli.schema.auth_values=none,basic -cli.schema.mode_values=direct,catalog +cli.schema.http.service.auth.values=none,basic +cli.schema.http.service.mode.values=direct,catalog diff --git a/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml b/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml index 69e82b3b..6721b207 100644 --- a/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml +++ b/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml @@ -32,4 +32,12 @@ parameters: short_option: a long_option: no-auth default_value: false - is_default_param: true
\ No newline at end of file + is_default_param: true + - name: no-catalog + type: bool + description: whether to use given host-url directly without looking into catalog, it will overrid the service->mode. + short_option: C + long_option: no-catalog + is_optional: true + is_default_param: true + default_value: false
\ No newline at end of file diff --git a/profiles/http/src/test/resources/open-cli.properties b/profiles/http/src/test/resources/open-cli.properties index 026b1f13..d64069a1 100644 --- a/profiles/http/src/test/resources/open-cli.properties +++ b/profiles/http/src/test/resources/open-cli.properties @@ -4,28 +4,28 @@ cli.version=1.0 cli.discover_always=false #schema validation -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.base.sections=open_cli_schema_version,name,description,parameters,results,http,info +cli.schema.base.sections.mandatory=open_cli_schema_version -cli.schema.info_params_list=product,service,type,author,ignore -cli.schema.info_params_mandatory_list=product,service +cli.schema.base.info.sections=product,service,type,author,ignore +cli.schema.base.info.sections.mandatory=product,service -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.base.parameters.sections=name,description,type,short_option,long_option, is_optional,default_value,is_secured,is_include +cli.schema.base.parameters.sections.mandatory=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.base.results.sections=name,description,scope,type,is_secured, default_value +cli.schema.base.results.sections.mandatory=name, description, type, scope cli.schema.boolean_values=true,false -cli.command.type=cmd,auth,catalog +cli.schema.command.type=cmd,auth,catalog # moco properties cli.sample.gen.enable=false cli.sample.gen.target=. # mrkanag Move this to db, once exteranl command registration is supported in place of discovery -cli.schema.type.supported=http +cli.schema.profile.available=http #other properties to load (it should be hanled when plugins are made as externally register-able #when command plugin management support is enabled in oclip -cli.plugins-prps=open-cli-http.properties
\ No newline at end of file +cli.schema.profile.confs=open-cli-http.properties
\ No newline at end of file |