Spike API

Control Spike service routing, delays, and failure testing.

Host

When running locally: http://localhost:9700

Otherwise: http://spikehost:9700

Summary

Path Operation Description
/api/env POST

Set the current environment

/api/env GET

Get the current environment

/api/delay POST

Sets the delay for a service

/api/failmode POST

Sets the fail-mode for a service

Paths

Set the current environment

POST /api/env

Set the current environment. This will change the service routing for services with different endpoints.

env

Name of environment to make current.

Form param string
Body
200

Success

Returns a map of the endpoint name for each service.

{
    "assignments": {
        "service-name-1": "current-endpoint-1",
        "service-name-2": "current-endpoint-2",
        ...
    }
}
400

Failure

Get the current environment

GET /api/env

Get the current environment.

Body
200

Success

Returns the current environment name.

{
   "payload": "current-env-name"
}
Sets the delay for a service

POST /api/delay

When set, requests will be delayed before being forwarded to the service.

serviceID

Name of service.

Form param string
value

Amount of time to delay, in milliseconds.

Form param number
Body
200

Success

400

Failure

Sets the fail-mode for a service

POST /api/failmode

When set, requests will immediately return a failure code, instead of being forwarded to the service.

serviceID

Name of service.

Form param string
value

Fail mode. 0 for reset (no fail-mode). Otherwise, the HTTP status code

Form param integer
Body
200

Success

400

Failure