Capsules
7 calls. Every request needs the Authorization header: see the overview.
capsules.list
Section titled “capsules.list”GET /capsulesEvery definition of the tenant, or of one namespace with { namespace }.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Response: Capsule[] (200)
curl -X GET "https://api.maitento.com/capsules" \ -H "Authorization: $MAITENTO_AUTH"const capsules = await mt.capsules.list();mt.capsules.list()capsules.delete
Section titled “capsules.delete”DELETE /capsules/by-id/{id}Deletes the definition (refused with a 400 while something still uses it or a run of it is going).
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes |
Response: no body (204)
curl -X DELETE "https://api.maitento.com/capsules/by-id/<id>" \ -H "Authorization: $MAITENTO_AUTH"await mt.capsules.delete("a1a2a3a4-b1b2-4c1c-8d1d-e1e2e3e4e5e6");mt.capsules.delete("c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f")capsules.get
Section titled “capsules.get”GET /capsules/by-id/{id}The definition with this id. Throws NotFoundError when there is none.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes |
Response: Capsule (200)
curl -X GET "https://api.maitento.com/capsules/by-id/<id>" \ -H "Authorization: $MAITENTO_AUTH"const capsule = await mt.capsules.get("a1a2a3a4-b1b2-4c1c-8d1d-e1e2e3e4e5e6");mt.capsules.get("c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f")capsules.start
Section titled “capsules.start”PUT /capsules/by-id/{id}/versions/{versionNumber}/startStarts a capsule (status New); by name the latest version, by { id, version? } as for apps. Never retried.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | |
versionNumber | integer | yes |
Request body: CapsuleProcessStartRequest
| Field | Type | Required | Description |
|---|---|---|---|
virtualFileSystemMounts | CapsuleVirtualFileSystemMountInput[] | Virtual file system mounts for this run. Unless replaceMounts is true, a non-empty list replaces the capsule’s own mounts and an empty list keeps them. | |
secretMounts | CapsuleSecretMountInput[] | Secret mounts for this run. Unless replaceMounts is true, a non-empty list replaces the capsule’s own secret mounts and an empty list keeps them. | |
commands | CapsuleProcessCommandInput[] | Shell commands to run, in order, after the capsule’s startup commands. Only each one’s command, arguments, runAsUser and maximumDuration are read. | |
replaceMounts | boolean | null | True: virtualFileSystemMounts and secretMounts are this run’s complete mounts, so an empty list means none of that kind. Null or false: an empty list keeps the capsule’s own mounts of that kind. |
Response: CapsuleProcess (200)
curl -X PUT "https://api.maitento.com/capsules/by-id/<id>/versions/<versionNumber>/start" \ -H "Authorization: $MAITENTO_AUTH" \ -H "Content-Type: application/json" \ -d '{"virtualFileSystemMounts":[],"secretMounts":[],"commands":[],"replaceMounts":false}'const run = await mt.capsules.start({ id: "a1a2a3a4-b1b2-4c1c-8d1d-e1e2e3e4e5e6", version: 2 });mt.capsules.start(id="c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f", version=2)capsules.list
Section titled “capsules.list”GET /namespaces/{namespaceName}/capsulesEvery definition of the tenant, or of one namespace with { namespace }.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceName | string | yes |
Response: Capsule[] (200)
curl -X GET "https://api.maitento.com/namespaces/<namespaceName>/capsules" \ -H "Authorization: $MAITENTO_AUTH"const capsules = await mt.capsules.list({ namespace: "support" });mt.capsules.list(namespace="demo")capsules.getByName
Section titled “capsules.getByName”GET /namespaces/{namespaceName}/capsules/by-name/{name}The definition with this name in the namespace. Throws NotFoundError when there is none.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceName | string | yes | |
name | string | yes |
Response: Capsule (200)
curl -X GET "https://api.maitento.com/namespaces/<namespaceName>/capsules/by-name/<name>" \ -H "Authorization: $MAITENTO_AUTH"const capsule = await mt.capsules.getByName("python-sandbox", { namespace: "support" });mt.capsules.get_by_name("python-sandbox", namespace="demo")capsules.start
Section titled “capsules.start”PUT /namespaces/{namespaceName}/capsules/by-name/{name}/versions/latest/startStarts a capsule (status New); by name the latest version, by { id, version? } as for apps. Never retried.
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespaceName | string | yes | |
name | string | yes |
Request body: CapsuleProcessStartRequest
| Field | Type | Required | Description |
|---|---|---|---|
virtualFileSystemMounts | CapsuleVirtualFileSystemMountInput[] | Virtual file system mounts for this run. Unless replaceMounts is true, a non-empty list replaces the capsule’s own mounts and an empty list keeps them. | |
secretMounts | CapsuleSecretMountInput[] | Secret mounts for this run. Unless replaceMounts is true, a non-empty list replaces the capsule’s own secret mounts and an empty list keeps them. | |
commands | CapsuleProcessCommandInput[] | Shell commands to run, in order, after the capsule’s startup commands. Only each one’s command, arguments, runAsUser and maximumDuration are read. | |
replaceMounts | boolean | null | True: virtualFileSystemMounts and secretMounts are this run’s complete mounts, so an empty list means none of that kind. Null or false: an empty list keeps the capsule’s own mounts of that kind. |
Response: CapsuleProcess (200)
curl -X PUT "https://api.maitento.com/namespaces/<namespaceName>/capsules/by-name/<name>/versions/latest/start" \ -H "Authorization: $MAITENTO_AUTH" \ -H "Content-Type: application/json" \ -d '{"virtualFileSystemMounts":[],"secretMounts":[],"commands":[],"replaceMounts":false}'const run = await mt.capsules.start({ name: "python-sandbox", namespace: "support" });mt.capsules.start("python-sandbox", namespace="demo")