apigw-cicd-cli
v1.2.24
Published
This is a Node CLI tool that allows you to make HTTP GET/POST request to REST APIs. It expects as parameter a JSON file `config.json` ,which contains the request URL and credentials necessary to make the requests. By default, responses to GET and POST req
Downloads
4
Readme
API Gateway CICD CLI
Install
To install apigw-cicd-cli locally:
npm i apigw-cicd-cli
To install apigw-cicd-cli globally:
npm i -g apigw-cicd-cli
To install the latest version of apigw-cicd-cli:
npm i apigw-cicd-cli@latest
About
This is a Node CLI tool that allows you to make HTTP GET/POST request to REST APIs. It expects as parameter a JSON file config.json
,which contains the request URL and credentials necessary to make the requests. By default, responses to GET and POST requests will be saved as getResponse.zip
and postResponse.zip
respectively in the current directory. Additionally, the CLI can also be used to copy a file from a src
folder to a dest
folder.
Commands
Note:
- Command argument within [] are optional and those within <> are mandatory.
- All commands have a broader and a shorter version. Example:
export
command can be wriiten ase
- All command arguments have a broader (starts with
--
) and a shorter version (starts with-
). Example:--filename
command argument can be written as-n
To make a GET request:
apigw-cicd-cli export <path-to-config.json-file> [--downloadDir <download-directory>] [--filename <name-for-response-file>] [--no-force]
or
apigw-cicd-cli e <path-to-config.json-file> [-d <download-directory>] [-n <name-for-response-file>] [--no-force]
To make a POST request:
apigw-cicd-cli import <path-to-config.json-file> <path-to-attachment-file> [--downloadDir <download-directory>] [--filename <name-for-response-file>] [--no-force]
or
apigw-cicd-cli i <path-to-config.json-file> <path-to-attachment-file> [-d <download-directory>] [-n <name-for-response-file>] [--no-force]
Note: attachment
is expected to be a .zip file
To copy a file from a src
to a dest
folder:
apigw-cicd-cli copy <complete-path-to-file> <download-directory> [--force]
or
apigw-cicd-cli cp <complete-path-to-file> <download-directory> [-f]
To see help:
apigw-cicd-cli --help
Usage: apigw-cicd-cli <command> <command-arguments> [options]
Global Options:
-V, --version output the version number
-h, --help display help for command
Commands:
export|e <path-to-config.json-file> [options] Send a GET request
import|i <path-to-config.json-file> <path-to-attachment-file> [options] Send a POST request
copy|cp <path-to-file> <download-directory> [force] Copy a file from a src folder to a dest folder
--help Display help for commands and options
--version Output the version number
Options for `export` and `import` commands:
-d, --downloadDir <dir> Set download directory for GET response (default: "C:\\Users\\nlas\\Desktop\\Workspace\\API-Gateway-CICD-CLI")
--no-force By default, duplicates are overwritten. But if --no-force is specifed, a new file will be created.
-n, --filename <name> Name to save GET response with (default: "getResponse")
-h, --help display help for command
Options for `copy` command:
--no-force By default, duplicates are overwritten. But if --no-force is specifed, a new file will be created.
-h, --help display help for command
Examples
The config.json
file should have the following format:
{ "url": "https://www.example.com/rest-endpoint", "username": "user", "password": "pass" }
Note: Currently, this tool only supports Basic Authentication.
Contributors
License
This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details
These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
Contact us at TECHcommunity if you have any questions.