bus-integration-cloud
Cloud Integration Contract
bus-integration-cloud defines the provider-neutral event contract for Bus
cloud work. It is the shared boundary used by bootstrap tools, API providers,
and provider-specific cloud integrations.
Run the discovery commands after installing the bus-integration-cloud binary
from the same BusDK release set as bus-api-provider-cloud,
bus-operator-cloud, and the selected cloud provider integration. No cloud
credentials are required for these local contract checks. --events prints one
event name per line, --events --format json prints provider, event, and
direct-bootstrap capability metadata, and --self-test prints
OK bus-integration-cloud self-test.
Confirm the release set before running them:
bus-integration-cloud --version
bus-api-provider-cloud --version
bus-operator-cloud --version
# UpCloud example; replace with the selected provider integration binary.
bus-integration-upcloud --version
The printed versions must be the same BusDK release tag, or all be local development builds from the same checkout.
The JSON capability fields are provider_neutral boolean, providers string
array, events string array, and direct_bootstrap boolean.
provider_neutral must be true for this contract module. providers lists
registered provider ids; the static diagnostic provider may appear even without
cloud credentials. events is the authoritative event-name list for routing.
direct_bootstrap tells bootstrap tools whether they can call the Go contract
without a remote Events service.
bus-integration-cloud --events
bus-integration-cloud --events --format json
bus-integration-cloud --self-test
Cloud request and response events include:
-
bus.cloud.plan.requestandbus.cloud.plan.response: request fields identify provider, deployment id, environment, desired resources, and credential references; response fields includeok, planned actions, diagnostics, and validation errors. -
bus.cloud.apply.requestandbus.cloud.apply.response: request fields include the reviewed plan or desired state plus dry-run/confirmation flags; response fields include applied actions, provider-neutral resource ids, and error class. -
bus.cloud.status.requestandbus.cloud.status.response: request fields identify provider and deployment id; response fields include resource status summaries and diagnostics. -
bus.cloud.destroy.requestandbus.cloud.destroy.response: request fields include provider, deployment id, and explicit confirmation; response fields include deleted or retained resources and destructive-operation diagnostics.
Concrete providers such as bus-integration-upcloud register behind these
contracts. Operator commands and API providers call the provider-neutral
contract first so a Bus deployment can add another cloud provider without
changing the deployment controller.
This is a minimal bus.cloud.plan.request schema example. Submit it through
the Bus Events POST $BUS_EVENTS_API_BASE_URL/api/v1/events API using
Content-Type: application/json and a bearer token with events:write, or use
bus operator cloud for the operator CLI path. The
Events API envelope uses this outer shape:
{
"name": "bus.cloud.plan.request",
"correlation_id": "deploy-001-cloud-plan",
"delivery": "broadcast",
"payload": {}
}
Put the cloud request fields below inside payload.
{
"deployment_id": "example-dev",
"provider": "upcloud",
"environment": "dev",
"dry_run": true,
"credentials": {
"token_secret": "secret://deployment/upcloud-token"
},
"resources": {
"network": "example-dev-private",
"nodes": ["proxy", "gpu"]
}
}
Minimal cloud response payloads use this shape:
{
"ok": true,
"deployment_id": "example-dev",
"provider": "upcloud",
"actions": ["discover-provider", "compute-cloud-plan"],
"resources": {
"network": "example-dev-private",
"nodes": ["proxy", "gpu"]
},
"diagnostics": []
}
Required fields per event are:
-
bus.cloud.plan.request:deployment_idstring,providerstring, optionalenvironmentstring defaulting todev, optionalresourcesobject withnetworkstring,nodesstring array or object map, optionaladdressesstring array, and optionaldnsobject, pluscredentials.token_fileorcredentials.token_secretunless credentials are configured in the provider service environment;dry_rundefaults totrue. -
bus.cloud.apply.request:deployment_idstring,providerstring,resourcesobject using the same shape asplan.request, optionalplanned_actionsstring array from a reviewed plan, optionaldry_runboolean defaulting totrue,credentials.token_fileorcredentials.token_secretunless credentials are configured in the provider service environment, andconfirmboolean;confirmmust betrueunlessdry_runistrue. -
bus.cloud.status.request:deployment_idstring,providerstring, and optionalresourcesfilter object withnodesstring array andnetworkstring when only part of a deployment should be inspected. -
bus.cloud.destroy.request:deployment_idstring,providerstring,credentials.token_fileorcredentials.token_secretunless credentials are configured in the provider service environment, andconfirmboolean set totrue.
Required response fields per event are:
-
bus.cloud.plan.response:okboolean,deployment_idstring,providerstring,actionsstring array,resourcesobject using the plan-request shape with planned provider-neutral ids when known, anddiagnosticsstring array; whenokisfalse, includeerror_class. -
bus.cloud.apply.response:okboolean,deployment_idstring,providerstring,actionsstring array,resourcesobject using the plan-request shape plus provider-neutral ids for created or updated resources, anddiagnosticsstring array; whenokisfalse, includeerror_class. -
bus.cloud.status.response:okboolean,deployment_idstring,providerstring,resourcesobject using the same keys but containing current provider state, anddiagnosticsstring array. -
bus.cloud.destroy.response:okboolean,deployment_idstring,providerstring,actionsstring array,deleted_resourcesstring array,retained_resourcesstring array, anddiagnosticsstring array; whenokisfalse, includeerror_class.
Plan/apply/destroy requests require provider credentials unless the selected
provider has credentials in its service environment. Supported credential keys
are token_file for file references such as ./local/upcloud-token and
token_secret for secret references such as
secret://deployment/upcloud-token. Inline token values are invalid and should
fail validation with error_class: "bad_request". When submitted through the
Events API, token_file must be readable by the provider service process, not
only by the publisher shell; prefer token_secret for remote submissions. The resources object may
contain network string, nodes string array or object map, addresses
string array, and dns object. An apply request should reuse the reviewed
resources object and may include planned_actions string array copied from a
prior plan response for auditability. Destroy requests accept only the
deployment id, provider, credentials, and confirm: true; they must not accept
inline token values.
Error responses set ok to false, include error_class, and include a
human-readable diagnostic. Allowed error_class values are bad_request for
invalid JSON, invalid credentials references, or unsupported resource keys;
unauthorized for missing or rejected provider credentials; conflict when a
provider resource exists with incompatible ownership; provider_error for
cloud API failures; and timeout when provider operations exceed the request
deadline.
Using from .bus files
Inside a .bus file, call the integration diagnostic command directly:
# same as: bus-integration-cloud --events
run command -- bus-integration-cloud --events