Console and logs
What a client needs to open a console or a log stream for an app or a database, and running one command.
The console and the log viewer are byte streams, so they are REST, not GraphQL: see REST endpoints. These operations tell a client which containers exist and what shell they have, and run one command without a session.
Opening an app console needs open_app_console; a database console needs open_database_console. Both are arbitrary code execution inside the container.
App
consoleInfo
Any signed-in principal. Returns ConsoleInfo.
Attachable instances + default target for an app's console.
| Argument | Type | Description |
|---|---|---|
appId | String! |
query {
consoleInfo(appId: "prj_9f1c2ab7d3e4f5a6") {
running
containerName
instances {
name
service
running
}
}
}shellLabel
Any signed-in principal. Returns String.
The default (or chosen) container's shell label, e.g. "/bin/sh" or "raw exec (no shell)".
| Argument | Type | Description |
|---|---|---|
input | ShellLabelInput! | |
input.appId | String! | |
input.containerName | String |
query {
shellLabel(input: { appId: "prj_9f1c2ab7d3e4f5a6" })
}execConsole
Needs open_app_console. Returns ExecResult.
Run a command in the app's live container (docker exec). Gated on the deploy capability - this is arbitrary code execution.
| Argument | Type | Description |
|---|---|---|
input | ExecConsoleInput! | |
input.appId | String! | |
input.command | String! | |
input.containerName | String |
mutation {
execConsole(input: { appId: "prj_9f1c2ab7d3e4f5a6", command: "ls -la /app" }) {
output
}
}logsInfo
Needs view_logs. Returns LogsInfo.
Lighter instance list for the logs viewer.
| Argument | Type | Description |
|---|---|---|
appId | String! |
query {
logsInfo(appId: "prj_9f1c2ab7d3e4f5a6") {
running
streamable
instances {
name
service
}
}
}setConsoleEnabled
Needs configure_apps. Returns Boolean.
Turn the container console on or off for one app. Off closes the attach sessions already open and hides the console everywhere.
| Argument | Type | Description |
|---|---|---|
appId | String! | |
enabled | Boolean! |
mutation {
setConsoleEnabled(appId: "prj_9f1c2ab7d3e4f5a6", enabled: true)
}Database
databaseConsoleInfo
Any signed-in principal. Returns ConsoleInfo.
Attachable container + default target for a database's console.
| Argument | Type | Description |
|---|---|---|
databaseId | String! |
query {
databaseConsoleInfo(databaseId: "db_9f1c2ab7d3e4f5a6") {
running
containerName
instances {
name
service
running
}
}
}databaseShellLabel
Any signed-in principal. Returns String.
The database container's shell label - drives the console's "no shell" notice, like shellLabel does for apps.
| Argument | Type | Description |
|---|---|---|
databaseId | String! |
query {
databaseShellLabel(databaseId: "db_9f1c2ab7d3e4f5a6")
}execDatabaseConsole
Needs open_database_console. Returns ExecResult.
Run a command in the database's live container (docker exec). Gated on manage_infra - arbitrary code execution inside infrastructure.
| Argument | Type | Description |
|---|---|---|
input | ExecDatabaseConsoleInput! | |
input.command | String! | |
input.databaseId | String! |
mutation {
execDatabaseConsole(
input: { command: "ls -la /app", databaseId: "db_9f1c2ab7d3e4f5a6" }
) {
output
}
}databaseLogsInfo
Needs view_logs. Returns LogsInfo.
Container list for a database's logs viewer.
| Argument | Type | Description |
|---|---|---|
databaseId | String! |
query {
databaseLogsInfo(databaseId: "db_9f1c2ab7d3e4f5a6") {
running
streamable
instances {
name
service
}
}
}See also
Did this page help you?