Finalize creation of a machine definition version.
After retrieving the machineDefinitionVersionId
and code upload
instructions from POST /machines/:machineSlug/v
, and after
uploading the code as described, call this operation to finalize
the creation of the machine definition version.
After this operation, you can create instances of the machine definition with this version.
Path parameters
-
The slug/name for the machine definition this version is related to.
Minimum length is
1
. Format should match the following pattern:^[a-zA-Z0-9_-]{1,128}$
. -
The signed machine version id returned from
POST /machines/:machineSlug/v
.
Body
Finalize creation of a machine definition version.
-
clientInfo string
Informational only. Any string that describes this version. Good uses would be a semantic version number or git commit.
-
makeCurrent boolean
Whether to make this version the current version for the machine definition. If
true
, the current version will be set to this version. Iffalse
, the current version will not be changed. -
indexSelectors object
Mapping from index names (must match index names from the corresponding machine) to JSON path selectors into machine context. On every state update, the pointed-to value in machine context will be extracted and used to index the machine.
curl \
-X PUT https://api.statebacked.dev/machines/my-machine/v/{signedMachineVersionId} \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"clientInfo":"string","makeCurrent":true,"indexSelectors":{}}'
{
"clientInfo": "string",
"makeCurrent": true,
"indexSelectors": {}
}
{
"clientInfo": "string",
"makeCurrent": true,
"indexSelectors": {
"Additional properties:": "string"
}
}
{
"machineVersionId": "string"
}
{
"machineVersionId": "string"
}