BlueForge Docs

client.apps.restart

Restart all containers for an app via the SDK.

Signature

class Client {
  apps: {
    restart(appId: string): Promise<RestartResult>
  }
}

interface RestartResult {
  app_id: string
  status: 'restarting' | 'healthy'
  containers: number
  started_at: string
}

Throws

ErrorCondition
AuthError
Invalid or expired API key
NotFoundError
App ID does not exist

Examples

Basic:

import { Client } from "@blueforge/client"
const client = new Client({ apiKey: process.env.BF_API_KEY! })
const result = await client.apps.restart("app_xxxxx")
console.log(result.status) // "restarting"

Pitfalls

  • Non-blocking — the SDK returns as soon as the restart is initiated. Poll
    client.apps.get(appId)
    for health status.
  • Credentials — the SDK API key must have the
    apps:restart
    scope.

See also

{auto-injected}

Tested against

{auto-injected}