Skip to main content

spark ping

The AMPS spark CLI ping command is used to connect to the AMPS instance and attempt to logon. This tool is useful to determine if an AMPS instance is running and responsive.

Common Options - spark ping​

OptionDefinition

server

(required)

AMPS server to connect to.
proto

Protocol to use.

In this release, AMPS spark CLI supports amps, fix, nvfix and xml.

Defaults to amps. AMPS spark CLI also supports json as a synonym for amps in this release.

secure

(applies to SSL connections)

Specifies whether to use an SSL-secured connection (tcps URI scheme).

Values: false/0/no or true/1/yes

Default: false

uriopts

Custom connection URI parameters to be passed in the URI query string.

For example:

tcp_nodelay=true&tcp_sndbuf=8192

urischeme

(applies to SSL connections)

Allows a custom URI scheme to be specified.

When both secure and urischeme are specified, urischeme takes precedence.

Examples​

%> ./spark ping -server localhost:9007 -type json
Successfully connected to tcp://user@localhost:9007/amps/json

In the example above, AMPS spark CLI was able to successfully log onto the AMPS instance that was located on port 9007.

%> ./spark ping -server localhost:9119
Unable to connect to AMPS
(com.crankuptheamps.client.exception.ConnectionRefusedException: Unable to
connect to AMPS at localhost:9119).

In the example above, AMPS spark CLI was not able to successfully log onto the AMPS instance that was located on port 9119. The error shows the exception thrown by AMPS spark CLI, which in this case was a ConnectionRefusedException from Java.

For the full range of options, run spark help ping. See AMPS spark CLI Authentication and AMPS spark CLI Support for TCPS for shared connection settings.