From 39f345954434553d10e0cea114e15e0521ec9471 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Tue, 26 Sep 2017 10:04:10 +0530 Subject: Migrate onap-cli-schema into open-cli-schema Issue-Id: CLI-66 Change-Id: I719719194bc5f21f4316380e606ce1a58f0f046c Signed-off-by: Kanagaraj Manickam k00365106 --- main/src/main/resources/onap-readme.txt | 34 +++++----- .../java/org/onap/cli/main/OnapCliMainTest.java | 4 +- .../onap-cli-schema/sample-create-schema.yaml | 72 ---------------------- .../open-cli-schema/sample-create-schema.yaml | 72 ++++++++++++++++++++++ 4 files changed, 92 insertions(+), 90 deletions(-) delete mode 100644 main/src/test/resources/onap-cli-schema/sample-create-schema.yaml create mode 100644 main/src/test/resources/open-cli-schema/sample-create-schema.yaml (limited to 'main') diff --git a/main/src/main/resources/onap-readme.txt b/main/src/main/resources/onap-readme.txt index 0795cf5e..39990700 100644 --- a/main/src/main/resources/onap-readme.txt +++ b/main/src/main/resources/onap-readme.txt @@ -1,23 +1,25 @@ -Onap Command-line interface (CLI). +OPEN Command-line interface (CLI) +================================== - ____ __ ___ - ___ _ __ __ _ _ __ / ___| | |_ _| - / _ \| '_ \ / _` | '_ \ | | | | | | -| (_) | | | | (_| | |_) | | |___| |___ | | - \___/|_| |_|\__,_| .__/ \____|_____|___| - |_| + _____ _____ _ _____ +| _ | / __ \| | |_ _| +| | | |_ __ ___ _ __ | / \/| | | | +| | | | '_ \ / _ \ '_ \ | | | | | | +\ \_/ / |_) | __/ | | | | \__/\| |_____| |_ + \___/| .__/ \___|_| |_| \____/\_____/\___/ + | | + |_| + +Provides unified commands to operate any cloud enabled software +products from Linux/Web console. Configure the following environment +variables, before using it: - -One Command to command whole Onap !! It provides the unified commands -to access and operate Onap functionalities. To use this CLI, please -configure the following environment variables: - -1. ONAP_MSB_URL - Onap Micro service bus(MSB) URL -2. HOST_USERNAME - Onap user name -3. HOST_PASSWORD - Onap user password +1. HOST_URL - Catalog service URL or a service URL +2. HOST_USERNAME - Service user name +3. HOST_PASSWORD - Service password To know the CLI version, type onap [-v|--version] To know the CLI usage, type onap [-h|--help] To know the usage of sub commands, type onap [-h|--help] -To know more, please refer the Onap wiki https://wiki.onap.org +To know more, please refer the wiki https://wiki.onap.org diff --git a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java index 0ac00d1f..acf66a52 100644 --- a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java +++ b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java @@ -77,7 +77,7 @@ public class OnapCliMainTest { @Test public void testVersionShort() { - this.handle(new String[] { "--v" }); + this.handle(new String[] { "-v" }); } @Test @@ -143,7 +143,7 @@ public class OnapCliMainTest { } @Test - public void testHandleSampleCommandFailure() throws OnapCommandException { + public void testHandleSampleCommandFailure() throws OnapCommandException{ this.handle(new String[] { "sample-test", "--string-param"}); } diff --git a/main/src/test/resources/onap-cli-schema/sample-create-schema.yaml b/main/src/test/resources/onap-cli-schema/sample-create-schema.yaml deleted file mode 100644 index ff24c0aa..00000000 --- a/main/src/test/resources/onap-cli-schema/sample-create-schema.yaml +++ /dev/null @@ -1,72 +0,0 @@ -open_cli_schema_version: 1.0 -name: sample-create -description: Sample create into Onap -version: cli-1.0 -service: - name: sample - version: v1 - auth: none -parameters: - - name: service-name - description: Onap service name - type: string - short_option: x - long_option: service-name - is_optional: false - - name: node-ip - description: Onap service running node IP - type: array - short_option: i - long_option: node-ip - - name: node-port - description: Onap service running node port - type: map - short_option: o - long_option: node-port -results: - direction: portrait - attributes: - - name: name - description: Onap service name - scope: short - type: string - - name: version - description: Onap service version - scope: short - type: string - - name: url - description: Onap service base url - scope: short - type: url - - name: status - description: Onap service status - scope: short - type: digit - - name: nodes - description: Onap service running nodes - scope: long - type: string - - name: location - description: Onap service location - scope: long - type: url -http: - request: - uri: /services - method: POST - body: '{"serviceName":"${service-name}","nodeIp":"${node-ip}","nodePort":"${node-port}"}' - headers: - queries: - success_codes: - - 201 - - 200 - result_map: - name: $b{$.serviceName} - version: $b{$.version} - url: $b{$.url} - status: $b{$.status} - nodes: $b{$.nodes[*].ip}:$b{$.nodes[*].port} - location: $h{Location} - - sample_response: - body: {"serviceName":"test","version":"v1","url":"/api/test/v1","protocol":"REST","visualRange":"1","lb_policy":"hash","nodes":[{"ip":"127.0.0.1","port":"8012","ttl":0,"nodeId":"test_127.0.0.1_8012","expiration":"2017-02-10T05:33:25Z","created_at":"2017-02-10T05:33:25Z","updated_at":"2017-02-10T05:33:25Z"}],"status":"1"} \ No newline at end of file diff --git a/main/src/test/resources/open-cli-schema/sample-create-schema.yaml b/main/src/test/resources/open-cli-schema/sample-create-schema.yaml new file mode 100644 index 00000000..ff24c0aa --- /dev/null +++ b/main/src/test/resources/open-cli-schema/sample-create-schema.yaml @@ -0,0 +1,72 @@ +open_cli_schema_version: 1.0 +name: sample-create +description: Sample create into Onap +version: cli-1.0 +service: + name: sample + version: v1 + auth: none +parameters: + - name: service-name + description: Onap service name + type: string + short_option: x + long_option: service-name + is_optional: false + - name: node-ip + description: Onap service running node IP + type: array + short_option: i + long_option: node-ip + - name: node-port + description: Onap service running node port + type: map + short_option: o + long_option: node-port +results: + direction: portrait + attributes: + - name: name + description: Onap service name + scope: short + type: string + - name: version + description: Onap service version + scope: short + type: string + - name: url + description: Onap service base url + scope: short + type: url + - name: status + description: Onap service status + scope: short + type: digit + - name: nodes + description: Onap service running nodes + scope: long + type: string + - name: location + description: Onap service location + scope: long + type: url +http: + request: + uri: /services + method: POST + body: '{"serviceName":"${service-name}","nodeIp":"${node-ip}","nodePort":"${node-port}"}' + headers: + queries: + success_codes: + - 201 + - 200 + result_map: + name: $b{$.serviceName} + version: $b{$.version} + url: $b{$.url} + status: $b{$.status} + nodes: $b{$.nodes[*].ip}:$b{$.nodes[*].port} + location: $h{Location} + + sample_response: + body: {"serviceName":"test","version":"v1","url":"/api/test/v1","protocol":"REST","visualRange":"1","lb_policy":"hash","nodes":[{"ip":"127.0.0.1","port":"8012","ttl":0,"nodeId":"test_127.0.0.1_8012","expiration":"2017-02-10T05:33:25Z","created_at":"2017-02-10T05:33:25Z","updated_at":"2017-02-10T05:33:25Z"}],"status":"1"} \ No newline at end of file -- cgit 1.2.3-korg