Skip to main content

Service

The Service type represents a content-addressed service providing TCP connectivity.

API reference

A content-addressed service providing TCP connectivity.

Implements Node, Syncer

endpoint
Retrieves an endpoint that clients can use to reach this container.
hostname
Retrieves a hostname which can be used by clients to reach this container.
id
A unique identifier for this Service.
up
Creates a tunnel that forwards traffic from the caller's network to this service.
ports
Retrieves the list of ports provided by the service.
start
Start the service and wait for its health checks to succeed.
stop
Stop the service.
sync
Forces evaluation of the pipeline in the engine.
terminal
withHostname
Configures a hostname which can be used by clients within the session to reach this container.

endpoint(port: Int, scheme: String = ""): String!

Retrieves an endpoint that clients can use to reach this container.

If no port is specified, the first exposed port is used. If none exist an error is returned.

If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.

port: Int

The exposed port number for the endpoint

scheme: String = ""

Return a URL with the given scheme, eg. http for http://

hostname: String!

Retrieves a hostname which can be used by clients to reach this container.

id: ID!

A unique identifier for this Service.

up(ports: [PortForward!] = [], random: Boolean = false): Void

Creates a tunnel that forwards traffic from the caller's network to this service.

ports: [PortForward!] = []

List of frontend/backend port mappings to forward.

Frontend is the port accepting traffic on the host, backend is the service port.

random: Boolean = false

Bind each tunnel port to a random port on the host.

ports: [Port!]!

Retrieves the list of ports provided by the service.

start: Service!

Start the service and wait for its health checks to succeed.

Services bound to a Container do not need to be manually started.

stop(kill: Boolean = false): Service!

Stop the service.

kill: Boolean = false

Immediately kill the service without waiting for a graceful exit

sync: Service!

Forces evaluation of the pipeline in the engine.

terminal(cmd: [String!] = []): Service!

cmd: [String!] = []

withHostname(hostname: String!): Service!

Configures a hostname which can be used by clients within the session to reach this container.

hostname: String!

The hostname to use.

References

Returned by

Accepted as an argument by