From 886c6767ebbd2e3555e9fa3b40bcd430ce055ee0 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 3 Jan 2018 14:03:21 +0530 Subject: Add no-catalog param in http Issue-ID: CLI-66 Change-Id: I1054344a8a6ed6d82075c295007131a0c033856e Signed-off-by: Kanagaraj Manickam k00365106 --- .../org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java | 3 ++- .../org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java | 2 ++ .../open-cli-schema/http/default_input_parameters_http.yaml | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'profiles') 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..38688abb 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 @@ -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-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 -- cgit 1.2.3-korg