Close the transport, and therefore the connection.
Optional
callback: ((code: number, callback: CloseCallback) => void)Called after the transport is closed, the callback receives the close code and optionally another callback. It is responsibility of the callback to call the provided callback if present.
Send a message to Juju.
A Juju API request, typically in the form of an object like {type: 'Client', request: 'DoSomething', version: 1, params: {}}. The request must not be already serialized and must not include the request id, as those are responsibilities of the transport.
Function called when the request is successful.
Function called when the request is not successful.
Generated using TypeDoc
A transport providing the ability of sending and receiving WebSocket messages to and from Juju controllers and models.
Param
The WebSocket instance already connected to a Juju controller or model.
Param
A callback to be called after the transport closes the connection. The callback receives the close code.
Param
When enabled, all API messages are logged at debug level.