Skip to main content

Dagger NodeJS SDK

api/client.gen.Service

A content-addressed service providing TCP connectivity.

Hierarchy​

  • BaseClient

    ↳ Service

Constructors​

constructor​

new Service(parent?, _id?, _endpoint?, _hostname?, _start?, _stop?, _up?): Service

Constructor is used for internal usage only, do not create object from it.

Parameters​

NameType
parent?Object
parent.ctxContext
parent.queryTree?QueryTree[]
_id?ServiceID
_endpoint?string
_hostname?string
_start?ServiceID
_stop?ServiceID
_up?Void

Returns​

Service

Overrides​

BaseClient.constructor

Properties​

_endpoint​

Private Optional Readonly _endpoint: string = undefined


_hostname​

Private Optional Readonly _hostname: string = undefined


_id​

Private Optional Readonly _id: ServiceID = undefined


_start​

Private Optional Readonly _start: ServiceID = undefined


_stop​

Private Optional Readonly _stop: ServiceID = undefined


_up​

Private Optional Readonly _up: Void = undefined

Methods​

endpoint​

endpoint(opts?): Promise<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.

Parameters​

NameType
opts?ServiceEndpointOpts

Returns​

Promise<string>


hostname​

hostname(): Promise<string>

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

Returns​

Promise<string>


id​

id(): Promise<ServiceID>

A unique identifier for this Service.

Returns​

Promise<ServiceID>


ports​

ports(): Promise<Port[]>

Retrieves the list of ports provided by the service.

Returns​

Promise<Port[]>


start​

start(): Promise<Service>

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

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

Returns​

Promise<Service>


stop​

stop(opts?): Promise<Service>

Stop the service.

Parameters​

NameType
opts?ServiceStopOpts

Returns​

Promise<Service>


up​

up(opts?): Promise<Void>

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

Parameters​

NameType
opts?ServiceUpOpts

Returns​

Promise<Void>