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
| Error | Condition |
|---|---|
| Invalid or expired API key |
| 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
for health status.client.apps.get(appId) - Credentials — the SDK API key must have the
scope.apps:restart
See also
{auto-injected}
Tested against
{auto-injected}