webMethods Microgateway Help 10.3 | webMethods Microgateway Help | Command Line Reference | Microgateway Command Line Reference
 
Microgateway Command Line Reference
This section describes operations you can perform such as, start and stop Microgateway, retrieve Microgateway status, view the assets provisioned, create a Microgateway instance, create an asset archive, create a docker file, and so on through Command Line Interface(CLI).
Using Microgateway CLI
The Microgateway CLI script comes in 2 flavors: Windows (.bat) and Linux (.sh). Invoking the script provides usage information:
>microgateway.bat
Missing valid action
usage: microgateway <action> <options>

action:

start - Start a Microgateway server
stop - Stop a Microgateway server
status - Retrieve the Microgateway server status
assets - Show the provisioned assets of a running server
createInstance - Create a Microgateway instance
createAssetArchive - Create an asset archive
createDockerFile - Create a Microgateway docker file
Starting a Microgateway
Run the following command to start a Microgateway.
microgateway.bat start <options>
where the options are:
-Shortcut, --Name
Description
-a, --archive <arg>
List of API Gateway archives
-apis, --apis <arg>
List of API identifiers (name, unique identifier, name/version).
-apps, --applications <arg>
List of global applications (name, unique identifier)
-c,--config <arg>
Configuration (YAML) file
-gw,--api_gateway <arg>
API Gateway URL
-gwp,--api_gateway_password <arg>
API Gateway password
-gwu,--api_gateway_user <arg>
API Gateway user
-gwd,--api_gateway_dir <arg>
API Gateway install directory
-lv,--log_level <arg>
ERROR, WARN, INFO, DEBUG, TRACE
The default value is ERROR
-lp,--log_path <arg>
Path to log files
The default value is logs
-p,--http_port <arg>
HTTP port number
-pols,--policies <arg>
List of global policy identifiers (name, unique identifier).
-sp,--https_port <arg>
HTTPS port number
-adu,--admin_user <arg>
User for administration access
-adp,--admin_password <arg>
Password for administration access
-v,--verbose
Print more information to console
You will see a status message for each provisioned API. Also, the user authentication status is exposed.
-ua,--user_auth <arg>
User authentication method (internal or delegated)
-as, --apps_sync
Enable Applications sync
-asv, --apps_to_sync
Applications to sync (all, registeredApplications, comma separated ids)
-asi, --apps_sync_interval
Polling interval in secs for applications sync
-ast, --apps_sync_timeout
Connection timeout in secs for applications sync
-rs,--retain_settings
Retain settings given in system-settings.yml (true/false)
The default value is false
Stopping a Microgateway
Run the following command to stop a Microgateway.
microgateway.bat stop <options>
where the options are:
-Shortcut, --Name
Description
-c,--config <arg>
Configuration (YAML) file
-p,--http_port <arg>
HTTP port number
-sp,--https_port <arg>
HTTPS port number
Retrieving Microgateway Status
Run the following command to retrieve the status of a Microgateway.
microgateway.bat status <options>
where the options are:
-Shortcut, --Name
Description
-p,--http_port <arg>
HTTP port number
-sp,--https_port <arg>
HTTPS port number
Viewing the Provisioned Assets in Microgateway
Run the following command to view the assets provisioned in Microgateway.
microgateway.bat assets <options>
where the options are:
-Shortcut, --Name
Description
-c,--config <arg>
Configuration (YAML) file
-p,--http_port <arg>
HTTP port number
-sp,--https_port <arg>
HTTPS port number
-v,--verbose
Print all details
Creating a Microgateway Instance
Run the following command to create a Microgateway instance package.
microgateway.bat createInstance <options>
where the options are:
-Shortcut, --Name
Description
-gwd,--api_gateway_dir <arg>
API Gateway install directory for taking over the user credential file
-c,--config <arg>
Configuration (YAML) file which will be copied into the instance
-os,--os <arg>
Operating system (win / linux)
-ins,--instance <arg>
Zip filename to hold the resulting Microgateway instance (mandatory)
Creating an Asset Archive
Run the following command to create an asset archive from a running API Gateway instance.
microgateway.bat createAssetArchive <options>
where the options are:
-Shortcut, --Name
Description
-a, --archive <arg>
The resulting API Gateway archive
-apis, --apis <arg>
List of API identifiers (name, unique identifier, name/version).
-apps, --applications <arg>
List of global applications (name, unique identifier, name/version).
-gw,--api_gateway <arg>
API Gateway URL
-gwp,--api_gateway_password <arg>
API Gateway password
-gwu,--api_gateway_user <arg>
API Gateway user
-pols,--policies <arg>
List of global policy identifiers (name, unique identifier).
Creating a Microgateway Docker File
Run the following command to create a Microgateway docker file.
microgateway.bat createDockerFile <options>
where the options are:
-Shortcut, --Name
Description
-a, --archive <arg>
List of API Gateway archives
-c,--config <arg>
Configuration (YAML) file
-dod,--docker_dir
Microgateway directory to use in Docker file
-dof,--docker_file
Filename to hold Docker file
-dor,--docker_from
FROM image to use in Docker file
-lv,--log_level <arg>
ERROR, WARN, INFO, DEBUG, TRACE
The default value is ERROR
-p,--http_port <arg>
HTTP port number
-sp,--https_port <arg>
HTTPS port number
Config.yml
The following shows a sample config.yml file structure.
# Microgateway ports
ports:
http: 5554
https: 5553
key_alias: ssos

# Microgateway API endpoint base path
api_endpoint:
base_path: /gateway

# Microgateway admin API configuration
admin_api:
admin_path: /rest/microgateway
user: Administrator
password: <pwd>

# API Gateway configuration
api_gateway:
url: http://localhost:5555
user: Administrator
password: <pwd>
dir: /opt/softwareag/IntegrationServer/instances/default
retain_settings: true | false

# Asset archive configuration
archive:
file: export.zip,export1.zip,export2.zip

# Specifying assets to download from API Gateway
downloads:
apis: EmployeeService
applications:
policies:

# Specify the runtime authorization method
policies:
user_auth: internal | delegated

# Microgateway logging configuration
logging:
level: ERROR
path: logs

# Application Sychronization
applications_sync:
enabled: true | false
applications_to_sync: "all | registeredApplications | comma separated ids"
polling_interval_secs: 2
connection_timeout_secs: 10
system-settings.yml
The following shows a sample system-settings.yml file structure.
---
faults:
default_error_message: "API Gateway encountered an error.
Error Message: $ERROR_MESSAGE. Request Details: Service - $SERVICE,
Operation - $OPERATION, Invocation Time:$TIME, Date:$DATE,
Client IP - $CLIENT_IP, User - $USER and Application:$CONSUMER_APPLICATION"

native_provider_fault: "false"

extended_settings:
defaultEncoding: "UTF-8"
apiKeyHeader: "x-Gateway-APIKey"
apig_MENConfiguration_tickInterval: "60"
events.collectionQueue.size: "10000"
events.collectionPool.minThreads: "1"
events.collectionPool.maxThreads: "8"

gateway_destination:
sendPolicyViolationEvent: "true"

es_destination:
protocol: "http"
hostName: "localhost"
port: "9240"
indexName: "gateway_default_analytics"
userName: ""
password: ""
sendPolicyViolationEvent: "true"

key_store:
type: JKS
provider: SUN
location: config/keystore.jks
password: manage

system:
version: "@full_version@"
---
REST APIs in Microgateway
Administration API
The Microgateway exposes a REST API for administration purpose. The methods of the API allow to query the status, the provisioned assets, and the configure settings of a running Microgateway instance.
If there are credentials configured in the Microgateway configuration, the Administration API requires a basic authentication.
GET /rest/microgateway/status
Retrieves a status message showing the version of the Microgateway.
GET /rest/microgateway/settings
Retrieves the configured settings of the Microgateway.
GET /rest/microgateway/assets
Retrieves the provisioned assets.

Copyright © 2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.