Skip to content
Hoody.com

The exec service provides cache management and shared state operations for scripts running inside a container. Use these endpoints to clear the execution VM cache (for example, after a deployment that changes script sources) or to read, write, and delete entries in the shared state store keyed by hostname. All endpoints are scoped to a single container via the exec-1 service URL template below.

Base URL template for all endpoints on this page: https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.icu

Clear the execution VM cache, the shared state, or both for a given hostname. The VM cache is keyed by hostname, so clearAll=true or a target hostname is required to purge VM entries. The deprecated scriptPath field is rejected by the server and returns HTTP 400.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
hostnamestringNo-Hostname identifying the VM whose cache should be cleared.
scriptPathstringNo-DEPRECATED. Script-path-based clear returns HTTP 400. VM cache is keyed by hostname; use hostname or clearAll=true instead.
clearVmbooleanNotrueClear the VM cache.
clearStatebooleanNofalseClear the shared state for the hostname.
clearAllbooleanNofalseClear cache and shared state for every hostname on the container.
{
"cleared": true,
"vmCache": {
"cleared": 3,
"remaining": 0
},
"sharedState": {
"cleared": 0,
"remaining": 12
}
}
Terminal window
curl -X POST https://proj12345-cont67890-exec-1.us-east.containers.hoody.icu/api/v1/exec/cache/clear \
-H "Content-Type: application/json" \
-d '{"hostname":"node-app","clearVm":true,"clearState":false}'

The shared state store is keyed by hostname and optionally by path. Use get to read a value, set to write (or merge into) a value, and clear to remove entries.

Retrieve the current shared state for a hostname and optional path. When no value exists at the requested path the response indicates exists: false and state is null. When the value exists, the response includes the arbitrary JSON state and its size (number of top-level keys).

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
hostnamestringYes-Hostname identifying the shared state namespace.
pathstringNo-Optional dotted path to a sub-key within the hostname namespace.
{
"hostname": "node-app",
"path": null,
"exists": true,
"state": {
"counter": 42,
"lastUpdated": "2024-01-15T10:30:00Z"
},
"size": 2
}
Terminal window
curl -X POST https://proj12345-cont67890-exec-1.us-east.containers.hoody.icu/api/v1/exec/shared-state/get \
-H "Content-Type: application/json" \
-d '{"hostname":"node-app"}'

Write a value into the shared state namespace for a hostname and optional path. Pass merge: true to deep-merge the supplied value into the existing object instead of replacing it.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
hostnamestringYes-Hostname identifying the shared state namespace.
pathstringNo-Optional dotted path to a sub-key within the hostname namespace.
valuestringYes-Arbitrary JSON value to store.
mergebooleanNofalseWhen true, deep-merge value into the existing state instead of replacing it.
{
"hostname": "node-app",
"path": null,
"updated": true,
"merged": false,
"size": 1
}
Terminal window
curl -X POST https://proj12345-cont67890-exec-1.us-east.containers.hoody.icu/api/v1/exec/shared-state/set \
-H "Content-Type: application/json" \
-d '{"hostname":"node-app","value":{"counter":43},"merge":true}'

Remove entries from the shared state namespace. Provide path to clear a single sub-key, or clearAll: true to wipe every entry for the hostname.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
hostnamestringYes-Hostname identifying the shared state namespace to clear.
pathstringNo-Optional dotted path to a single sub-key to remove.
clearAllbooleanNofalseWhen true, remove every entry for the hostname (ignores path).
{
"cleared": true,
"count": 5,
"remaining": 7
}
Terminal window
curl -X POST https://proj12345-cont67890-exec-1.us-east.containers.hoody.icu/api/v1/exec/shared-state/clear \
-H "Content-Type: application/json" \
-d '{"hostname":"node-app","path":"counter","clearAll":false}'