Rolls a platform service's pods, in a named environment.
Rolls a platform service's pods, in a named environment.
POST /v1/platform/fleet/{app}/deploy
| Address | https://api.hanzo.ai/v1/platform/fleet/{app}/deploy |
| Method | POST |
| Operation | post_platform_fleet_by_app_deploy |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Rolls a platform service's pods, in a named environment.
It triggers a rolling restart of one platform service's Deployment by stamping a fresh restart annotation, and answers 202 with the app, the namespace, the environment and the timestamp. It restarts pods; it does NOT change the image — a version change is the release path, not this.
SuperAdmin ONLY, and deliberately narrower than the read gate beside it. The only namespaces this board touches are the platform's own tier, so a restart here recycles a SHARED service every tenant depends on. A brand-org admin is a customer-org admin, not a platform operator: observing the board is bounded and audited, and restarting production identity is not.
?env=main|test|dev is REQUIRED — a bare call does not default to production,
which is what closes the fat-finger and confused-deputy hazard — and any other
value is 400. A service with no Deployment to restart in that environment is 404.
Request
3 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
app | path | string | yes | App is the service's CR name, from the path. |
app | body | string | — | App is the service's CR name, from the path. |
env | body | string | — | Env is REQUIRED and must be main, test or dev. A bare call does not default to production, which is what closes the fat-finger and confused-deputy hazard. |
Response
| Status | Body | Meaning |
|---|---|---|
202 | restarted | accepted |
202 body — 5 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
app | body | string | — | App is the service that was restarted. |
env | body | string | — | Env is that namespace's lifecycle env. |
namespace | body | string | — | Namespace is the namespace its Deployment was patched in. |
ok | body | boolean | — | OK is always true — a failure is an error, not a false here. |
restartedAt | body | string | — | RestartedAt is the timestamp stamped onto the pod template, RFC3339 UTC. |
Failure carries the platform error shape — see Errors.
Examples
hanzo platform fleet deploy <app>import { Configuration, PlatformApi } from 'hanzoai';
const api = new PlatformApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postPlatformFleetByAppDeploy({ app: 'app', app: "<app>", env: "<env>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import PlatformApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = PlatformApi(client).post_platform_fleet_by_app_deploy(app='app', app="<app>", env="<env>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.PlatformAPI.PostPlatformFleetByAppDeploy(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, platform_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = platform_api::post_platform_fleet_by_app_deploy(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.PlatformApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new PlatformApi(client).postPlatformFleetByAppDeploy();curl -X POST https://api.hanzo.ai/v1/platform/fleet/<app>/deploy \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"app": "<app>",
"env": "<env>"
}'The door reaches platform through the platform tool, which names its 39 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_builds"
}
}
}'How is this guide?