Update generated extension API reference from pinata#18357 (#14996)

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
Guillaume Tardif 2022-06-24 09:22:23 +02:00 committed by GitHub
parent 2e059f0eee
commit 474c285845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 214 additions and 464 deletions

View File

@ -1,18 +1,18 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
## Table of contents
# Extensions API Reference
### Dashboard Interfaces
## Dashboard Interfaces
- [Host](interfaces/Host.md)
- [NavigationIntents](interfaces/NavigationIntents.md)
- [Toast](interfaces/Toast.md)
### Other Interfaces
## Other Interfaces
- [ExecResultV0](interfaces/ExecResultV0.md)
- [RequestConfigV0](interfaces/RequestConfigV0.md)
@ -33,4 +33,5 @@ keywords: Docker, extensions, sdk, API, reference
- [ExtensionCli](interfaces/ExtensionCli.md)
- [HttpService](interfaces/HttpService.md)
- [RequestConfig](interfaces/RequestConfig.md)
- [ServiceError](interfaces/ServiceError.md)
- [DockerDesktopClient](interfaces/DockerDesktopClient.md)

View File

@ -1,32 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: BackendV0
## Table of contents
### Container Methods
- [execInContainer](BackendV0.md#execincontainer)
### HTTP Methods
- [get](BackendV0.md#get)
- [post](BackendV0.md#post)
- [put](BackendV0.md#put)
- [patch](BackendV0.md#patch)
- [delete](BackendV0.md#delete)
- [head](BackendV0.md#head)
- [request](BackendV0.md#request)
### VM Methods
- [execInVMExtension](BackendV0.md#execinvmextension)
- [spawnInVMExtension](BackendV0.md#spawninvmextension)
## Container Methods
### execInContainer
@ -36,9 +15,9 @@ keywords: Docker, extensions, sdk, API, reference
Executes a command inside a container.
```typescript
const output = await window.ddClient.backend.execInContainer(container, cmd);
const output = await window.ddClient.backend.execInContainer(container, cmd);
console.log(output);
console.log(output);
```
**`deprecated`** :warning: It will be removed in a future version.
@ -67,7 +46,7 @@ Performs an HTTP GET request to a backend service.
```typescript
window.ddClient.backend
.get("/some/service")
.then((value: any) => console.log(value)
.then((value: any) => console.log(value));
```
**`deprecated`** :warning: It will be removed in a future version. Use [HttpService.get](HttpService.md#get) instead.
@ -91,7 +70,7 @@ ___
Performs an HTTP POST request to a backend service.
```typescript
window.ddClient.backend
window.ddClient.backend
.post("/some/service", { ... })
.then((value: any) => console.log(value));
```
@ -118,7 +97,7 @@ ___
Performs an HTTP PUT request to a backend service.
```typescript
window.ddClient.backend
window.ddClient.backend
.put("/some/service", { ... })
.then((value: any) => console.log(value));
```
@ -145,7 +124,7 @@ ___
Performs an HTTP PATCH request to a backend service.
```typescript
window.ddClient.backend
window.ddClient.backend
.patch("/some/service", { ... })
.then((value: any) => console.log(value));
```
@ -172,7 +151,7 @@ ___
Performs an HTTP DELETE request to a backend service.
```typescript
window.ddClient.backend
window.ddClient.backend
.delete("/some/service")
.then((value: any) => console.log(value));
```
@ -198,7 +177,7 @@ ___
Performs an HTTP HEAD request to a backend service.
```typescript
window.ddClient.backend
window.ddClient.backend
.head("/some/service")
.then((value: any) => console.log(value));
```
@ -224,7 +203,7 @@ ___
Performs an HTTP request to a backend service.
```typescript
window.ddClient.backend
window.ddClient.backend
.request({ url: "/url", method: "GET", headers: { 'header-key': 'header-value' }, data: { ... }})
.then((value: any) => console.log(value));
```
@ -253,11 +232,11 @@ Executes a command inside the backend container.
If your extensions ships with additional binaries that should be run inside the backend container you can use the `execInVMExtension` function.
```typescript
const output = await window.ddClient.backend.execInVMExtension(
`cliShippedInTheVm xxx`
);
const output = await window.ddClient.backend.execInVMExtension(
`cliShippedInTheVm xxx`
);
console.log(output);
console.log(output);
```
**`deprecated`** :warning: It will be removed in a future version. Use [ExtensionCli.exec](ExtensionCli.md#exec) instead.

View File

@ -1,19 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: DesktopUI
## Table of contents
### Properties
- [toast](DesktopUI.md#toast)
- [dialog](DesktopUI.md#dialog)
- [navigate](DesktopUI.md#navigate)
## Properties
### toast

View File

@ -1,19 +1,13 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: Dialog
Allows opening native dialog boxes.
## Table of contents
### Methods
- [showOpenDialog](Dialog.md#showopendialog)
## Methods
### showOpenDialog

View File

@ -1,22 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: Docker
## Table of contents
### Properties
- [cli](Docker.md#cli)
### Methods
- [listContainers](Docker.md#listcontainers)
- [listImages](Docker.md#listimages)
## Properties
### cli
@ -26,23 +15,23 @@ keywords: Docker, extensions, sdk, API, reference
You can also directly execute the docker binary.
```typescript
const output = await ddClient.docker.cli.exec("info", [
"--format",
{% raw %}'"{{ json . }}"',{% endraw %}
const output = await ddClient.docker.cli.exec("volume", [
"ls",
"--filter",
"dangling=true"
]);
```
Output:
```
```json
{
"stderr": "...",
"stdout": "..."
}
```
In this example the docker command output is a json output.
For convenience, the command result object also has methods to easily parse it. See [ExecResult](ExecResult.md) instead.
For convenience, the command result object also has methods to easily parse it depending on output format. See [ExecResult](ExecResult.md) instead.
---
@ -53,15 +42,15 @@ It is useful when the output of the command is too long, or you need to get the
await ddClient.docker.cli.exec("logs", ["-f", "..."], {
stream: {
onOutput(data): void {
// As we can receive both `stdout` and `stderr`, we wrap them in a JSON object
JSON.stringify(
{
stdout: data.stdout,
stderr: data.stderr,
},
null,
" "
);
// As we can receive both `stdout` and `stderr`, we wrap them in a JSON object
JSON.stringify(
{
stdout: data.stdout,
stderr: data.stderr,
},
null,
" "
);
},
onError(error: any): void {
console.error(error);
@ -90,15 +79,15 @@ const containers = await ddClient.docker.listContainers();
#### Parameters
| Name | Type | Description |
| :--------- | :---- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList). |
#### Returns
`Promise`<`unknown`\>
---
___
### listImages
@ -112,9 +101,9 @@ const images = await ddClient.docker.listImages();
#### Parameters
| Name | Type | Description |
| :--------- | :---- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#tag/Image). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#tag/Image). |
#### Returns

View File

@ -1,17 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: DockerCommand
## Table of contents
### Properties
- [exec](DockerCommand.md#exec)
## Properties
### exec

View File

@ -1,60 +1,14 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: DockerDesktopClient
When we moved from the v0 to v1 schema, we made sure
window.ddClient satisfied both interfaces. This combined type
describes the resulting API. We should delete it when we stop providing
the v0 API.
## Table of contents
### Properties
- [backend](DockerDesktopClient.md#backend)
- [extension](DockerDesktopClient.md#extension)
- [desktopUI](DockerDesktopClient.md#desktopui)
- [host](DockerDesktopClient.md#host)
- [docker](DockerDesktopClient.md#docker)
### Container Methods
- [listContainers](DockerDesktopClient.md#listcontainers)
### Image Methods
- [listImages](DockerDesktopClient.md#listimages)
### Navigation Methods
- [navigateToContainers](DockerDesktopClient.md#navigatetocontainers)
- [navigateToContainer](DockerDesktopClient.md#navigatetocontainer)
- [navigateToContainerLogs](DockerDesktopClient.md#navigatetocontainerlogs)
- [navigateToContainerInspect](DockerDesktopClient.md#navigatetocontainerinspect)
- [navigateToContainerStats](DockerDesktopClient.md#navigatetocontainerstats)
- [navigateToImages](DockerDesktopClient.md#navigatetoimages)
- [navigateToImage](DockerDesktopClient.md#navigatetoimage)
- [navigateToVolumes](DockerDesktopClient.md#navigatetovolumes)
- [navigateToVolume](DockerDesktopClient.md#navigatetovolume)
- [navigateToDevEnvironments](DockerDesktopClient.md#navigatetodevenvironments)
### Other Methods
- [execHostCmd](DockerDesktopClient.md#exechostcmd)
- [spawnHostCmd](DockerDesktopClient.md#spawnhostcmd)
- [execDockerCmd](DockerDesktopClient.md#execdockercmd)
- [spawnDockerCmd](DockerDesktopClient.md#spawndockercmd)
- [openExternal](DockerDesktopClient.md#openexternal)
### Toast Methods
- [toastSuccess](DockerDesktopClient.md#toastsuccess)
- [toastWarning](DockerDesktopClient.md#toastwarning)
- [toastError](DockerDesktopClient.md#toasterror)
An amalgam of the v0 and v1 interfaces of the Docker Desktop API client,
provided for backwards compatibility reasons. Unless you're working with
a legacy extension, use the v1 type instead.
## Properties
@ -72,7 +26,7 @@ The client is already connected to the backend.
DockerDesktopClientV0.backend
---
___
### extension
@ -86,7 +40,7 @@ The client is already connected to the backend.
DockerDesktopClientV1.extension
---
___
### desktopUI
@ -96,7 +50,7 @@ DockerDesktopClientV1.extension
DockerDesktopClientV1.desktopUI
---
___
### host
@ -106,7 +60,7 @@ DockerDesktopClientV1.desktopUI
DockerDesktopClientV1.host
---
___
### docker
@ -135,9 +89,9 @@ const containers = await window.ddClient.listContainers();
#### Parameters
| Name | Type | Description |
| :-------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList). |
#### Returns
@ -147,7 +101,7 @@ const containers = await window.ddClient.listContainers();
DockerDesktopClientV0.listContainers
---
___
## Image Methods
@ -165,9 +119,9 @@ const images = await window.ddClient.listImages();
#### Parameters
| Name | Type | Description |
| :-------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#tag/Image). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#tag/Image). |
#### Returns
@ -177,7 +131,7 @@ const images = await window.ddClient.listImages();
DockerDesktopClientV0.listImages
---
___
## Navigation Methods
@ -186,7 +140,6 @@ DockerDesktopClientV0.listImages
**navigateToContainers**(): `void`
Navigate to the containers window in Docker Desktop.
```typescript
window.ddClient.navigateToContainers();
```
@ -201,14 +154,13 @@ window.ddClient.navigateToContainers();
DockerDesktopClientV0.navigateToContainers
---
___
### navigateToContainer
**navigateToContainer**(`id`): `Promise`<`any`\>
Navigate to the container window in Docker Desktop.
```typescript
await window.ddClient.navigateToContainer(id);
```
@ -217,8 +169,8 @@ await window.ddClient.navigateToContainer(id);
#### Parameters
| Name | Type | Description |
| :--- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | The full container id, e.g. `46b57e400d801762e9e115734bf902a2450d89669d85881058a46136520aca28`. You can use the `--no-trunc` flag as part of the `docker ps` command to display the full container id. |
#### Returns
@ -231,14 +183,13 @@ A promise that fails if the container doesn't exist.
DockerDesktopClientV0.navigateToContainer
---
___
### navigateToContainerLogs
**navigateToContainerLogs**(`id`): `Promise`<`any`\>
Navigate to the container logs window in Docker Desktop.
```typescript
await window.ddClient.navigateToContainerLogs(id);
```
@ -247,8 +198,8 @@ await window.ddClient.navigateToContainerLogs(id);
#### Parameters
| Name | Type | Description |
| :--- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | The full container id, e.g. `46b57e400d801762e9e115734bf902a2450d89669d85881058a46136520aca28`. You can use the `--no-trunc` flag as part of the `docker ps` command to display the full container id. |
#### Returns
@ -261,14 +212,13 @@ A promise that fails if the container doesn't exist.
DockerDesktopClientV0.navigateToContainerLogs
---
___
### navigateToContainerInspect
**navigateToContainerInspect**(`id`): `Promise`<`any`\>
Navigate to the container inspect window in Docker Desktop.
```typescript
await window.ddClient.navigateToContainerInspect(id);
```
@ -277,8 +227,8 @@ await window.ddClient.navigateToContainerInspect(id);
#### Parameters
| Name | Type | Description |
| :--- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | The full container id, e.g. `46b57e400d801762e9e115734bf902a2450d89669d85881058a46136520aca28`. You can use the `--no-trunc` flag as part of the `docker ps` command to display the full container id. |
#### Returns
@ -291,7 +241,7 @@ A promise that fails if the container doesn't exist.
DockerDesktopClientV0.navigateToContainerInspect
---
___
### navigateToContainerStats
@ -307,8 +257,8 @@ await window.ddClient.navigateToContainerStats(id);
#### Parameters
| Name | Type | Description |
| :--- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | The full container id, e.g. `46b57e400d801762e9e115734bf902a2450d89669d85881058a46136520aca28`. You can use the `--no-trunc` flag as part of the `docker ps` command to display the full container id. |
#### Returns
@ -321,14 +271,13 @@ A promise that fails if the container doesn't exist.
DockerDesktopClientV0.navigateToContainerStats
---
___
### navigateToImages
**navigateToImages**(): `void`
Navigate to the images window in Docker Desktop.
```typescript
await window.ddClient.navigateToImages(id);
```
@ -343,7 +292,7 @@ await window.ddClient.navigateToImages(id);
DockerDesktopClientV0.navigateToImages
---
___
### navigateToImage
@ -360,10 +309,10 @@ await window.ddClient.navigateToImage(id, tag);
#### Parameters
| Name | Type | Description |
| :---- | :------- | :----------------------------------------------------------------------------------------------------------------- |
| `id` | `string` | The full image id (including sha), e.g. `sha256:34ab3ae068572f4e85c448b4035e6be5e19cc41f69606535cd4d768a63432673`. |
| `tag` | `string` | The tag of the image, e.g. `latest`, `0.0.1`, etc. |
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | The full image id (including sha), e.g. `sha256:34ab3ae068572f4e85c448b4035e6be5e19cc41f69606535cd4d768a63432673`. |
| `tag` | `string` | The tag of the image, e.g. `latest`, `0.0.1`, etc. |
#### Returns
@ -375,7 +324,7 @@ A promise that fails if the container doesn't exist.
DockerDesktopClientV0.navigateToImage
---
___
### navigateToVolumes
@ -397,7 +346,7 @@ await window.ddClient.navigateToVolumes();
DockerDesktopClientV0.navigateToVolumes
---
___
### navigateToVolume
@ -413,8 +362,8 @@ window.ddClient.navigateToVolume(volume);
#### Parameters
| Name | Type | Description |
| :------- | :------- | :---------------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `volume` | `string` | The name of the volume, e.g. `my-volume`. |
#### Returns
@ -425,7 +374,7 @@ window.ddClient.navigateToVolume(volume);
DockerDesktopClientV0.navigateToVolume
---
___
### navigateToDevEnvironments
@ -447,7 +396,7 @@ window.ddClient.navigateToDevEnvironments();
DockerDesktopClientV0.navigateToDevEnvironments
---
___
## Other Methods
@ -459,7 +408,7 @@ You can run binaries defined in the host section in the extension metadata.
```typescript
window.ddClient.execHostCmd(`cliShippedOnHost xxx`).then((cmdResult: any) => {
console.log(cmdResult);
console.log(cmdResult);
});
```
@ -467,8 +416,8 @@ window.ddClient.execHostCmd(`cliShippedOnHost xxx`).then((cmdResult: any) => {
#### Parameters
| Name | Type | Description |
| :---- | :------- | :-------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to be executed. |
#### Returns
@ -479,7 +428,7 @@ window.ddClient.execHostCmd(`cliShippedOnHost xxx`).then((cmdResult: any) => {
DockerDesktopClientV0.execHostCmd
---
___
### spawnHostCmd
@ -505,10 +454,10 @@ window.ddClient.spawnHostCmd(
#### Parameters
| Name | Type | Description |
| :--------- | :---------------------------------------- | :----------------------------------------------------------------------------- |
| `cmd` | `string` | The command to be executed. |
| `args` | `string`[] | The arguments of the command to execute. |
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to be executed. |
| `args` | `string`[] | The arguments of the command to execute. |
| `callback` | (`data`: `any`, `error`: `any`) => `void` | The callback function where to listen from the command output data and errors. |
#### Returns
@ -519,7 +468,7 @@ window.ddClient.spawnHostCmd(
DockerDesktopClientV0.spawnHostCmd
---
___
### execDockerCmd
@ -528,20 +477,16 @@ DockerDesktopClientV0.spawnHostCmd
You can also directly execute the docker binary.
```typescript
const output = await window.ddClient.execDockerCmd(
"info",
"--format",
{% raw %}'"{{ json . }}"'{% endraw %}
);
const output = await window.ddClient.execDockerCmd("info");
```
**`deprecated`** :warning: It will be removed in a future version. Use [DockerCommand.exec](DockerCommand.md#exec) instead.
#### Parameters
| Name | Type | Description |
| :-------- | :--------- | :--------------------------------------- |
| `cmd` | `string` | The command to execute. |
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to execute. |
| `...args` | `string`[] | The arguments of the command to execute. |
#### Returns
@ -549,17 +494,13 @@ const output = await window.ddClient.execDockerCmd(
`Promise`<[`ExecResultV0`](ExecResultV0.md)\>
The result will contain both the standard output and the standard error of the executed command:
```
```json
{
"stderr": "...",
"stdout": "..."
}
```
In this example the docker command output is a json output.
For convenience, the command result object also has methods to easily parse it:
For convenience, the command result object also has methods to easily parse it depending on the output format:
- `output.lines(): string[]` splits output lines.
- `output.parseJsonObject(): any` parses a well-formed json output.
@ -578,7 +519,7 @@ window.ddClient.spawnDockerCmd("logs", ["-f", "..."], (data, error) => {
DockerDesktopClientV0.execDockerCmd
---
___
### spawnDockerCmd
@ -588,10 +529,10 @@ DockerDesktopClientV0.execDockerCmd
#### Parameters
| Name | Type |
| :--------- | :---------------------------------------- |
| `cmd` | `string` |
| `args` | `string`[] |
| Name | Type |
| :------ | :------ |
| `cmd` | `string` |
| `args` | `string`[] |
| `callback` | (`data`: `any`, `error`: `any`) => `void` |
#### Returns
@ -602,7 +543,7 @@ DockerDesktopClientV0.execDockerCmd
DockerDesktopClientV0.spawnDockerCmd
---
___
### openExternal
@ -618,8 +559,8 @@ window.ddClient.openExternal("https://docker.com");
#### Parameters
| Name | Type | Description |
| :---- | :------- | :------------------------------------------------------------------------ |
| Name | Type | Description |
| :------ | :------ | :------ |
| `url` | `string` | The URL the browser will open (must have the protocol `http` or `https`). |
#### Returns
@ -630,7 +571,7 @@ window.ddClient.openExternal("https://docker.com");
DockerDesktopClientV0.openExternal
---
___
## Toast Methods
@ -648,8 +589,8 @@ window.ddClient.toastSuccess("message");
#### Parameters
| Name | Type | Description |
| :---- | :------- | :----------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `msg` | `string` | The message to display in the toast. |
#### Returns
@ -660,7 +601,7 @@ window.ddClient.toastSuccess("message");
DockerDesktopClientV0.toastSuccess
---
___
### toastWarning
@ -676,8 +617,8 @@ window.ddClient.toastWarning("message");
#### Parameters
| Name | Type | Description |
| :---- | :------- | :----------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `msg` | `string` | The message to display in the toast. |
#### Returns
@ -688,7 +629,7 @@ window.ddClient.toastWarning("message");
DockerDesktopClientV0.toastWarning
---
___
### toastError
@ -704,8 +645,8 @@ window.ddClient.toastError("message");
#### Parameters
| Name | Type | Description |
| :---- | :------- | :----------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `msg` | `string` | The message to display in the toast. |
#### Returns

View File

@ -1,7 +1,7 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: Exec

View File

@ -1,17 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExecProcess
## Table of contents
### Methods
- [close](ExecProcess.md#close)
## Methods
### close

View File

@ -1,7 +1,7 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExecResult
@ -12,23 +12,6 @@ keywords: Docker, extensions, sdk, API, reference
**`ExecResult`**
## Table of contents
### Methods
- [lines](ExecResult.md#lines)
- [parseJsonLines](ExecResult.md#parsejsonlines)
- [parseJsonObject](ExecResult.md#parsejsonobject)
### Properties
- [cmd](ExecResult.md#cmd)
- [killed](ExecResult.md#killed)
- [signal](ExecResult.md#signal)
- [code](ExecResult.md#code)
- [stdout](ExecResult.md#stdout)
- [stderr](ExecResult.md#stderr)
## Methods
### lines

View File

@ -1,28 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExecResultV0
## Table of contents
### Properties
- [cmd](ExecResultV0.md#cmd)
- [killed](ExecResultV0.md#killed)
- [signal](ExecResultV0.md#signal)
- [code](ExecResultV0.md#code)
- [stdout](ExecResultV0.md#stdout)
- [stderr](ExecResultV0.md#stderr)
### Methods
- [lines](ExecResultV0.md#lines)
- [parseJsonLines](ExecResultV0.md#parsejsonlines)
- [parseJsonObject](ExecResultV0.md#parsejsonobject)
## Properties
### cmd

View File

@ -1,23 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExecStreamOptions
## Table of contents
### Methods
- [onOutput](ExecStreamOptions.md#onoutput)
- [onError](ExecStreamOptions.md#onerror)
- [onClose](ExecStreamOptions.md#onclose)
### Properties
- [splitOutputLines](ExecStreamOptions.md#splitoutputlines)
## Methods
### onOutput

View File

@ -1,18 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: Extension
## Table of contents
### Properties
- [vm](Extension.md#vm)
- [host](Extension.md#host)
## Properties
### vm

View File

@ -1,17 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExtensionCli
## Table of contents
### Properties
- [exec](ExtensionCli.md#exec)
## Properties
### exec

View File

@ -1,17 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExtensionHost
## Table of contents
### Properties
- [cli](ExtensionHost.md#cli)
## Properties
### cli
@ -34,24 +28,24 @@ Provided the `kubectl` binary is shipped as part of your extension, you can spaw
```typescript
await ddClient.extension.host.cli.exec("kubectl", ["-h"], {
stream: {
onOutput(data): void {
// As we can receive both `stdout` and `stderr`, we wrap them in a JSON object
JSON.stringify(
{
stdout: data.stdout,
stderr: data.stderr,
},
null,
" "
);
},
onError(error: any): void {
console.error(error);
},
onClose(exitCode: number): void {
console.log("onClose with exit code " + exitCode);
},
},
});
stream: {
onOutput(data): void {
// As we can receive both `stdout` and `stderr`, we wrap them in a JSON object
JSON.stringify(
{
stdout: data.stdout,
stderr: data.stderr,
},
null,
" "
);
},
onError(error: any): void {
console.error(error);
},
onClose(exitCode: number): void {
console.log("onClose with exit code " + exitCode);
},
},
});
```

View File

@ -1,18 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExtensionVM
## Table of contents
### Properties
- [cli](ExtensionVM.md#cli)
- [service](ExtensionVM.md#service)
## Properties
### cli
@ -24,7 +17,10 @@ Executes a command in the backend container.
Example: Execute the command `ls -l` inside the **backend container**:
```typescript
await ddClient.extension.vm.cli.exec("ls", ["-l"]);
await ddClient.extension.vm.cli.exec(
"ls",
["-l"]
);
```
Streams the output of the command executed in the backend container.
@ -33,26 +29,26 @@ Example: Spawn the command `ls -l` inside the **backend container**:
```typescript
await ddClient.extension.vm.cli.exec("ls", ["-l"], {
stream: {
onOutput(data): void {
// As we can receive both `stdout` and `stderr`, we wrap them in a JSON object
JSON.stringify(
{
stdout: data.stdout,
stderr: data.stderr,
},
null,
" "
);
},
onError(error: any): void {
console.error(error);
},
onClose(exitCode: number): void {
console.log("onClose with exit code " + exitCode);
},
},
});
stream: {
onOutput(data): void {
// As we can receive both `stdout` and `stderr`, we wrap them in a JSON object
JSON.stringify(
{
stdout: data.stdout,
stderr: data.stderr,
},
null,
" "
);
},
onError(error: any): void {
console.error(error);
},
onClose(exitCode: number): void {
console.log("onClose with exit code " + exitCode);
},
},
});
```
**`param`** Command to execute.
@ -61,7 +57,7 @@ await ddClient.extension.vm.cli.exec("ls", ["-l"], {
**`param`** The callback function where to listen from the command output data and errors.
---
___
### service

View File

@ -1,23 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: Host
## Table of contents
### Methods
- [openExternal](Host.md#openexternal)
### Properties
- [platform](Host.md#platform)
- [arch](Host.md#arch)
- [hostname](Host.md#hostname)
## Methods
### openExternal

View File

@ -1,23 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: HttpService
## Table of contents
### Methods
- [get](HttpService.md#get)
- [post](HttpService.md#post)
- [put](HttpService.md#put)
- [patch](HttpService.md#patch)
- [delete](HttpService.md#delete)
- [head](HttpService.md#head)
- [request](HttpService.md#request)
## Methods
### get
@ -27,7 +15,7 @@ keywords: Docker, extensions, sdk, API, reference
Performs an HTTP GET request to a backend service.
```typescript
ddClient.extension.vm.service
ddClient.extension.vm.service
.get("/some/service")
.then((value: any) => console.log(value)
```
@ -51,7 +39,7 @@ ___
Performs an HTTP POST request to a backend service.
```typescript
ddClient.extension.vm.service
ddClient.extension.vm.service
.post("/some/service", { ... })
.then((value: any) => console.log(value));
```
@ -76,7 +64,7 @@ ___
Performs an HTTP PUT request to a backend service.
```typescript
ddClient.extension.vm.service
ddClient.extension.vm.service
.put("/some/service", { ... })
.then((value: any) => console.log(value));
```
@ -101,7 +89,7 @@ ___
Performs an HTTP PATCH request to a backend service.
```typescript
ddClient.extension.vm.service
ddClient.extension.vm.service
.patch("/some/service", { ... })
.then((value: any) => console.log(value));
```
@ -126,7 +114,7 @@ ___
Performs an HTTP DELETE request to a backend service.
```typescript
ddClient.extension.vm.service
ddClient.extension.vm.service
.delete("/some/service")
.then((value: any) => console.log(value));
```
@ -150,7 +138,7 @@ ___
Performs an HTTP HEAD request to a backend service.
```typescript
ddClient.extension.vm.service
ddClient.extension.vm.service
.head("/some/service")
.then((value: any) => console.log(value));
```
@ -174,7 +162,7 @@ ___
Performs an HTTP request to a backend service.
```typescript
ddClient.extension.vm.service
ddClient.extension.vm.service
.request({ url: "/url", method: "GET", headers: { 'header-key': 'header-value' }, data: { ... }})
.then((value: any) => console.log(value));
```

View File

@ -1,35 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: NavigationIntents
## Table of contents
### Container Methods
- [viewContainers](NavigationIntents.md#viewcontainers)
- [viewContainer](NavigationIntents.md#viewcontainer)
- [viewContainerLogs](NavigationIntents.md#viewcontainerlogs)
- [viewContainerInspect](NavigationIntents.md#viewcontainerinspect)
- [viewContainerStats](NavigationIntents.md#viewcontainerstats)
### Images Methods
- [viewImages](NavigationIntents.md#viewimages)
- [viewImage](NavigationIntents.md#viewimage)
### Other Methods
- [viewDevEnvironments](NavigationIntents.md#viewdevenvironments)
### Volume Methods
- [viewVolumes](NavigationIntents.md#viewvolumes)
- [viewVolume](NavigationIntents.md#viewvolume)
## Container Methods
### viewContainers

View File

@ -1,19 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: OpenDialogResult
## Table of contents
### Properties
- [canceled](OpenDialogResult.md#canceled)
- [filePaths](OpenDialogResult.md#filepaths)
- [bookmarks](OpenDialogResult.md#bookmarks)
## Properties
### canceled

View File

@ -1,7 +1,7 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: RawExecResult
@ -12,17 +12,6 @@ keywords: Docker, extensions, sdk, API, reference
↳ [`ExecResult`](ExecResult.md)
## Table of contents
### Properties
- [cmd](RawExecResult.md#cmd)
- [killed](RawExecResult.md#killed)
- [signal](RawExecResult.md#signal)
- [code](RawExecResult.md#code)
- [stdout](RawExecResult.md#stdout)
- [stderr](RawExecResult.md#stderr)
## Properties
### cmd

View File

@ -1,20 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: RequestConfig
## Table of contents
### Properties
- [url](RequestConfig.md#url)
- [method](RequestConfig.md#method)
- [headers](RequestConfig.md#headers)
- [data](RequestConfig.md#data)
## Properties
### url

View File

@ -1,20 +1,11 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: RequestConfigV0
## Table of contents
### Properties
- [url](RequestConfigV0.md#url)
- [method](RequestConfigV0.md#method)
- [headers](RequestConfigV0.md#headers)
- [data](RequestConfigV0.md#data)
## Properties
### url

View File

@ -0,0 +1,28 @@
---
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ServiceError
Error thrown when an HTTP response is received with a status code that falls
out to the range of 2xx.
## Properties
### name
**name**: `string`
___
### message
**message**: `string`
___
### statusCode
**statusCode**: `number`

View File

@ -1,7 +1,7 @@
---
title: Docker extension API reference
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: Toast
@ -10,14 +10,6 @@ Toasts provide a brief notification to the user.
They appear temporarily and shouldn't interrupt the user experience.
They also don't require user input to disappear.
## Table of contents
### Methods
- [success](Toast.md#success)
- [warning](Toast.md#warning)
- [error](Toast.md#error)
## Methods
### success