Delete a machine and any versions and migrations associated with it.
Delete a machine and any versions and migrations associated with it.
THIS IS OBVIOUSLY A DANGEROUS OPERATION AND WILL INTENTIONALLY CAUSE DATA LOSS
If any instances exist for the machine, a 409 error will be returned with an invalid-state
code.
You can delete the instances and then retry the machine deletion.
All versions associated with the machine and all migrations between those versions will be deleted.
There is no option to recover data after a machine is deleted.
To prevent accidental deletion, we require two validation parameters:
- hmacSha256OfMachineNameWithMachineNameKey -
base64urlEncode(hmacSha256(key = "machine name", "machine name"))
- dangerDataWillBeDeletedForever - true
A 400 error with the parameter
set to the name of the incorrect parameter will be returned
if the validation parameters are incorrect.
This endpoint requires admin access.
Path parameters
-
The slug/name for the machine definition to delete.
Minimum length is
1
. Format should match the following pattern:^[a-zA-Z0-9_-]{1,128}$
.
Body
Validation parameters to prove that you really do want to delete the machine.
-
Just to ensure that you understand the ramifications of this action.
Value is
true
. -
This parameter serves to verify that you have read the documentation prior to deleting a machine and have taken the time to consider whether you really want to do so.
Provide
base64urlEncode(hmacSha256(key = "machine name", "machine name"))
curl \
-X DELETE https://api.statebacked.dev/machines/my-machine \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"dangerDataWillBeDeletedForever":true,"hmacSha256OfMachineNameWithMachineNameKey":"string"}'
{
"dangerDataWillBeDeletedForever": true,
"hmacSha256OfMachineNameWithMachineNameKey": "string"
}
{
"dangerDataWillBeDeletedForever": true,
"hmacSha256OfMachineNameWithMachineNameKey": "string"
}
{
"error": "string",
"code": "specify-org",
"parameter": "string"
}
{
"error": "string",
"code": "specify-org",
"parameter": "string"
}
{
"error": "string",
"code": "missing-scope"
}
{
"error": "string",
"code": "missing-scope"
}
{
"code": "invalid-state",
"error": "string"
}
{
"code": "invalid-state",
"error": "string"
}