DockerService
Docker API Service.
Static Method Summary
Static Public Methods | ||
public static |
List Docker's containers. |
|
public static |
Create Docker's container from Docker Compose file. |
|
public static |
Delete Docker's container. |
|
public static |
Open WebSocket with auth token for reading events of a Docker's daemon. |
|
public static |
Retrieve informations about a Docker's container. |
|
public static |
Check if User is already logged. |
|
public static |
Login User given username and password. |
|
public static |
Logout User by removing User's token. |
|
public static |
Open WebSocket with auth token for reading logs of a Docker's container. |
|
public static |
Restart Docker's container. |
|
public static |
Start Docker's container. |
|
public static |
Stop Docker's container. |
Static Public Methods
public static create(name: String, composeFile: String): Promise source
Create Docker's container from Docker Compose file.
public static delete(containerId: String): Promise source
Delete Docker's container.
Params:
Name | Type | Attribute | Description |
containerId | String | Container's id |
public static events(onMessage: Function): Websocket source
Open WebSocket with auth token for reading events of a Docker's daemon.
Params:
Name | Type | Attribute | Description |
onMessage | Function | Callback for each input event from socket |
Return:
Websocket | Opened and authentified Websocket |
public static infos(containerId: String): Promise source
Retrieve informations about a Docker's container.
Params:
Name | Type | Attribute | Description |
containerId | String | Container's id |
public static login(username: String, password: String): Promise source
Login User given username and password. If success, store auth token in LocalStorage.
public static logs(containerId: String, onMessage: Function): Websocket source
Open WebSocket with auth token for reading logs of a Docker's container.
Return:
Websocket | Opened and authentified Websocket |
public static restart(containerId: String): Promise source
Restart Docker's container.
Params:
Name | Type | Attribute | Description |
containerId | String | Container's id |