Skip to content

Capsule runs

14 calls. Every request needs the Authorization header: see the overview.

GET /capsule-processes

Every capsule run of the tenant (unbounded; prefer runs.list({ types: ["Capsule"] })).

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: CapsuleProcess[] (200)

curl -X GET "https://api.maitento.com/capsule-processes" \
-H "Authorization: $MAITENTO_AUTH"
GET /capsule-processes/by-id/{id}

The run 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

NameTypeRequiredDescription
iduuidyes

Response: CapsuleProcess (200)

curl -X GET "https://api.maitento.com/capsule-processes/by-id/<id>" \
-H "Authorization: $MAITENTO_AUTH"
POST /capsule-processes/by-id/{id}/commands

Queues a command and returns it Pending; it runs once the capsule is ready, after the commands queued before it. command is shell text, run by the user’s login shell from /. Each of arguments reaches the program as one word, exactly as given (spaces, quotes and $ included): to pipe or redirect, run sh with ["-c", "<line>"], or put the whole line in command. To get the result, use execAndWait (or getCommand).

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: CapsuleProcessRunCommandRequest

FieldTypeRequiredDescription
commandstringyesThe command: shell text run by the user’s login shell, from / — usually a program name, but it may be a whole command line (pipes, redirects and variables are then the shell’s).
argumentsstring[]The command’s arguments. Each is passed as one literal word, quoted for the shell as needed, so spaces, quotes, $, globs and operators in an argument reach the program exactly as given. To pipe or redirect, run sh with arguments ["-c", "<line>"], or put the line in command.
runAsUserstring | nullThe user to run it as: one of the capsule’s users or one added to the run. Null: the default user.
maximumDurationtimespan | nullThe longest the command may run before it is stopped. Null: five minutes.
asyncbooleanRun the command in the background: the capsule moves on to the next command without waiting for this one, and records its result when it ends.

Response: CapsuleProcessCommand (200)

curl -X POST "https://api.maitento.com/capsule-processes/by-id/<id>/commands" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"command":"..."}'
GET /capsule-processes/by-id/{id}/commands/{commandId}

One command (or operation) of a capsule run, with its status and output. One still queued or running when the run ended reads as AbortedOnTermination. 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

NameTypeRequiredDescription
iduuidyes
commandIduuidyes

Response: CapsuleProcessCommand (200)

curl -X GET "https://api.maitento.com/capsule-processes/by-id/<id>/commands/<commandId>" \
-H "Authorization: $MAITENTO_AUTH"
POST /capsule-processes/by-id/{id}/mounts/secrets

Mounts a secret as a file.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: CapsuleProcessMountSecretRequest

FieldTypeRequiredDescription
secretNamestringyesThe name of the secret to mount.
mountNamestringyesThe file name: the secret’s value is written to /mnt/secrets/<mountName>. Letters, digits, _ and -.

Response: CapsuleProcessCommand (200)

curl -X POST "https://api.maitento.com/capsule-processes/by-id/<id>/mounts/secrets" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"secretName":"...","mountName":"..."}'
DELETE /capsule-processes/by-id/{id}/mounts/secrets/{mountName}

Unmounts a secret.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes
mountNamestringyes

Response: CapsuleProcessCommand (200)

curl -X DELETE "https://api.maitento.com/capsule-processes/by-id/<id>/mounts/secrets/<mountName>" \
-H "Authorization: $MAITENTO_AUTH"
POST /capsule-processes/by-id/{id}/mounts/vfs

Mounts a virtual file system.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: CapsuleProcessMountVfsRequest

FieldTypeRequiredDescription
vfsIduuidyesThe id of the virtual file system to mount.
vfsNamespaceIduuidyesThe id of the namespace the virtual file system is in.
mountNamestringyesWhere it appears: /mnt/<mountName>. Letters, digits, _ and -, not already in use.

Response: CapsuleProcessCommand (200)

curl -X POST "https://api.maitento.com/capsule-processes/by-id/<id>/mounts/vfs" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"vfsId":"...","vfsNamespaceId":"...","mountName":"..."}'
DELETE /capsule-processes/by-id/{id}/mounts/vfs/{mountName}

Unmounts a virtual file system.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes
mountNamestringyes

Response: CapsuleProcessCommand (200)

curl -X DELETE "https://api.maitento.com/capsule-processes/by-id/<id>/mounts/vfs/<mountName>" \
-H "Authorization: $MAITENTO_AUTH"
POST /capsule-processes/by-id/{id}/packages

Installs a package.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: CapsuleProcessInstallPackageRequest

FieldTypeRequiredDescription
packageNamestringyesThe package name, such as jq: lowercase letters, digits, +, - and ..

Response: CapsuleProcessCommand (200)

curl -X POST "https://api.maitento.com/capsule-processes/by-id/<id>/packages" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"packageName":"..."}'
DELETE /capsule-processes/by-id/{id}/packages/{packageName}

Removes a package.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes
packageNamestringyes

Response: CapsuleProcessCommand (200)

curl -X DELETE "https://api.maitento.com/capsule-processes/by-id/<id>/packages/<packageName>" \
-H "Authorization: $MAITENTO_AUTH"
POST /capsule-processes/by-id/{id}/terminate

Terminates the capsule.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Response: CapsuleProcessCommand (200)

curl -X POST "https://api.maitento.com/capsule-processes/by-id/<id>/terminate" \
-H "Authorization: $MAITENTO_AUTH"
POST /capsule-processes/by-id/{id}/users

Adds a user.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: CapsuleProcessAddUserRequest

FieldTypeRequiredDescription
usernamestringyesThe user name: lowercase letters, digits, _ and -, starting with a letter or _, at most 32 characters, and not root.
sudoAsUsersstring[]Other users of the capsule this user may run commands as, with sudo.

Response: CapsuleProcessCommand (200)

curl -X POST "https://api.maitento.com/capsule-processes/by-id/<id>/users" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"username":"..."}'
DELETE /capsule-processes/by-id/{id}/users/{username}

Removes a user.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes
usernamestringyes

Response: CapsuleProcessCommand (200)

curl -X DELETE "https://api.maitento.com/capsule-processes/by-id/<id>/users/<username>" \
-H "Authorization: $MAITENTO_AUTH"
GET /namespaces/{namespaceName}/capsules/processes

The capsule runs of the namespace that have not finished.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
namespaceNamestringyes

Response: CapsuleProcessWithDetails[] (200)

curl -X GET "https://api.maitento.com/namespaces/<namespaceName>/capsules/processes" \
-H "Authorization: $MAITENTO_AUTH"