Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Latest commit

 

History

History
127 lines (79 loc) · 4.44 KB

client.md

File metadata and controls

127 lines (79 loc) · 4.44 KB

Jackal Client Guide

Each command supported by the Jackal client can be run using the following syntax:

jackal [command] [options] [parameters]

In addition to the command specific options detailed below, each command may be run with a help option to output usage information:

// Short Flag
jackal [command] -h

// Long Flag
jackal [command] --help

Commands

Start

The Start command starts a Jackal server. A configuration file may be specified in order to start the Jackal server with a custom configuration.

By default Jackal will look for a configuration file named jackal.json in the directory it is being started from, and, if this is not found, use the default configuration.

Details on how to specify the configuration file can be found in the Jackal Configuration Guide.

Usage:
jackal start [options]
Options:
-c, --config-path [configPath]

Send

The Send command sends the contracts in the specified file or directory to the Jackal server at the specified URL.

In order to prevent large, unwieldy contracts files becoming a necessity, it is possible to specify contracts for a single consumer across multiple files. This behaviour is only possible when using the Jackal client to communicate with the Jackal server - it is not possible to upload many files to the server in a single request.

Each file must follow the format illustrated above and must share a common consumer at the top level. Currently, these files are merged at consumer level, so if a provider is defined in multiple files then contracts defined for the same provider in a later file may overwrite those in an earlier one.

By default Jackal will output the results of this command in spec format, if a different output format is desired, then teamcity style output or JSON output can be specified using the reporter command-line option.

If the specified file or directory cannot be found, the Jackal client will throw an error. In order to aid gradual integration of Jackal with existing code, this error can be avoided by specifying the skip-missing-contract command-line option.

Usage:
jackal send [options] <jackalUrl> <contractsPath>
Options:
-r, --reporter [json | spec | teamcity]
--skip-missing-contract

Run

The Run command runs the contracts for the specified Provider stored by the Jackal server at the specified URL.

By default Jackal will output the results of this command in spec format, if a different output format is desired, then teamcity style output or JSON output can be specified using the reporter command-line option.

By default Jackal will attempt to execute the contracts against the specified Provider using the default URL specified in the original contracts submitted by the Consumer. If Jackal should attempt to execute the contracts for the specified Provider using a different base URL then this can be specified using the provider-url command line option.

The base URL encompasses the entirety of the URL including any non standard port, the path and query string can be omitted.

Usage:
jackal run [options] <jackalUrl> <provideName>
Options:
-r, --reporter [json | spec | teamcity]
-p, --provider-url [providerUrl]

Dump

The Dump command retrieves the current state of the Jackal database for the Jackal server at the specified URL.

By default Jackal will output the results of this command in JSON format, if a different output format is desired, then pretty output can be specified using the reporter command-line option.

Usage:
jackal dump [options] <jackalUrl>
Options:
-r, --reporter [json | pretty]

Stats

The Stats command retrieves usage statistics for the Jackal server at the specified URL.

By default Jackal will output the results of this command in pretty format, if a different output format is desired, then JSON output can be specified using the reporter command-line option.

By default Jackal will retrieve the default statistics package for the Jackal server at the specified URL, if it is desired, the statistics output can be customised by specifying a consumer, a provider or both using the consumer and provider command line options.

Usage:
jackal stats [options] <jackalUrl>
Options:
-c, --consumer [consumer]
-p, --provider [provider]
-r, --reporter [json | pretty]