Finalize creation of a machine definition version.

PUT /machines/{machineSlug}/v/{signedMachineVersionId}

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

  • machineSlug string Required

    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}$.

  • signedMachineVersionId string Required

    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. If false, 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.

    Hide indexSelectors attribute Show indexSelectors attribute object
    • Additional properties: string

Responses

  • 200

    The version was created.

    Hide response attribute Show response attribute object
    • machineVersionId string Required

      The ID of a machine definition version.

PUT /machines/{machineSlug}/v/{signedMachineVersionId}
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":{}}'
Request example
{
  "clientInfo": "string",
  "makeCurrent": true,
  "indexSelectors": {}
}
Request examples
{
  "clientInfo": "string",
  "makeCurrent": true,
  "indexSelectors": {
    "Additional properties:": "string"
  }
}
Response examples (200)
{
  "machineVersionId": "string"
}
Response examples (200)
{
  "machineVersionId": "string"
}