Deplo

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.

ArgumentTypeDescription
appIdString!
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)".

ArgumentTypeDescription
inputShellLabelInput!
input.appIdString!
input.containerNameString
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.

ArgumentTypeDescription
inputExecConsoleInput!
input.appIdString!
input.commandString!
input.containerNameString
mutation {
  execConsole(input: { appId: "prj_9f1c2ab7d3e4f5a6", command: "ls -la /app" }) {
    output
  }
}

logsInfo

Needs view_logs. Returns LogsInfo.

Lighter instance list for the logs viewer.

ArgumentTypeDescription
appIdString!
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.

ArgumentTypeDescription
appIdString!
enabledBoolean!
mutation {
  setConsoleEnabled(appId: "prj_9f1c2ab7d3e4f5a6", enabled: true)
}

Database

databaseConsoleInfo

Any signed-in principal. Returns ConsoleInfo.

Attachable container + default target for a database's console.

ArgumentTypeDescription
databaseIdString!
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.

ArgumentTypeDescription
databaseIdString!
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.

ArgumentTypeDescription
inputExecDatabaseConsoleInput!
input.commandString!
input.databaseIdString!
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.

ArgumentTypeDescription
databaseIdString!
query {
  databaseLogsInfo(databaseId: "db_9f1c2ab7d3e4f5a6") {
    running
    streamable
    instances {
      name
      service
    }
  }
}

See also

Did this page help you?

On this page