Sync apps
Syncs one app now: CD applies the commit it compared, to this one Application.
POST /v1/platform/apps/{app}/sync
| Address | https://api.hanzo.ai/v1/platform/apps/{app}/sync |
| Method | POST |
| Operation | post_platform_apps_by_app_sync |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Syncs one app now: CD applies the commit it compared, to this one Application.
Every Application is manual — its AppProject admits only a manual sync — so this is the deploy step, requested the way cd.hanzo.ai requests one: an operation on the Application, initiated by the caller, applying the compared commit with the Application's own sync options and no pruning. It answers the Application with the operation queued; poll the app's cd read for how it ends. SuperAdmin only, the predicate CD's own RBAC holds sync to, and recorded in the audit trail like every mutation. 409 while another operation is queued, running or terminating, before CD has compared the Application with git, and when the Application changes between the read and the request.
Request
3 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
app | path | string | yes | App is the declaration's name, from the path. |
app | body | string | — | App is the declaration's name, from the path. |
org | body | string | — | Org is the values directory the declaration lives in, defaulting to the caller's own org. |
Response
| Status | Body | Meaning |
|---|---|---|
202 | platform.cdDiff | accepted |
default | problem-details | refused |
202 body — 21 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
application | body | string | — | Application is the CD Application the declaration renders as. |
applied | body | string | — | Applied is the universe commit CD last synced, "" before its first sync. |
compared | body | string | — | Compared is the universe commit CD compared the cluster against — the one a sync applies. |
operation | body | string | — | Operation is the phase of a sync in flight or last run, "" when none ran. |
pending | body | platform.CDResource[] | — | Pending are the objects that differ from git: what a sync would apply. |
pending[].group | body | string | — | Group is the object's API group, "" for the core group. |
pending[].health | body | string | — | Health is the object's health, "" for a kind CD holds no health for. |
pending[].kind | body | string | — | Kind is the object's kind. |
pending[].name | body | string | — | Name is the object's name. |
pending[].namespace | body | string | — | Namespace is the object's namespace, "" for a cluster-scoped one. |
pending[].prune | body | boolean | — | Prune is true for a live object git no longer declares. |
pending[].status | body | string | — | Status is CD's verdict on the object: Synced or OutOfSync. |
resources | body | platform.CDResource[] | — | Resources is every object the Application manages. |
resources[].group | body | string | — | Group is the object's API group, "" for the core group. |
resources[].health | body | string | — | Health is the object's health, "" for a kind CD holds no health for. |
resources[].kind | body | string | — | Kind is the object's kind. |
resources[].name | body | string | — | Name is the object's name. |
resources[].namespace | body | string | — | Namespace is the object's namespace, "" for a cluster-scoped one. |
resources[].prune | body | boolean | — | Prune is true for a live object git no longer declares. |
resources[].status | body | string | — | Status is CD's verdict on the object: Synced or OutOfSync. |
sync | body | string | — | Sync is CD's verdict: Synced or OutOfSync. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, PlatformApi } from 'hanzoai';
const api = new PlatformApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postPlatformAppsByAppSync({ app: 'app', app: "<app>", org: "<org>" });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_apps_by_app_sync(app='app', app="<app>", org="<org>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.PlatformAPI.PostPlatformAppsByAppSync(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::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_apps_by_app_sync(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.PlatformApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new PlatformApi(client).postPlatformAppsByAppSync();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X POST https://api.hanzo.ai/v1/platform/apps/<app>/sync \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"app": "<app>",
"org": "<org>"
}'MCP reaches platform through the platform tool, which names its 39 operations with its own verbs — this one among them, under a name only MCP 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?