Skip to navigation

Delete a Machine from a Site

View as Markdown

Requires Provider Admin access to the Machine’s Infrastructure Provider. Regular deletion requires the Machine to be missing on Site for at least 24 hours, with no attached Instance or assigned Instance Type. The confirmed-complete retained-deletion recovery exception is described below. Starting forced deletion requires a Registered Site and the applicable overrides. Authoritative Core Instance-consent enforcement and the Instance Type override require Core builds containing https://github.com/dsx-ai-factory/infra-controller/pull/5394. Older Core ignores the new protobuf fields; REST-side checks against REST records do not establish Core’s current ownership state or replace server-side enforcement. It also supports missing Machines without waiting 24 hours. Before contacting Core, REST records an attempt ID and makes the Machine unavailable for every Instance placement path and for new Allocation capacity. A timeout, transport failure, or unavailable workflow history keeps that attempt and quarantine. Retrying retrieves the exact recorded execution instead of issuing another Core deletion. If no result is available, including after a crash before dispatch, provide the attempt ID from the error to the Site operator; ordinary deletion remains blocked. A definitive Core precondition or validation rejection allows a corrected forced request to start a new attempt. A confirmed incomplete result returns HTTP 409 with Retry-After: 5; repeat the same forced DELETE after at least 5 seconds. No automatic continuation is scheduled. Only a confirmed complete result or an actual Core NotFound response records completion. Missing Temporal history is not completion. Forced deletion returns HTTP 202 only after confirmed Site completion. REST records are removed only when no Instance deletion was requested, no Instance remains attached, and remaining Allocation capacity is sufficient. Otherwise, owner records remain. Allocation Constraints are never deleted by this operation. Present inventory cannot clear the retained marker, and completed forced requests replay locally without deleting a newly rediscovered Core Machine. A later REST cleanup failure preserves completion proof for local replay without workflow history. After confirmed completion, owners may remove the retained Instance and all Machine Instance Type associations; existing quota guards may require them to reduce or rebalance Allocation Constraints before unlinking. Ordinary DELETE, with force omitted or false and no overrides, then removes only REST Machine records even if Core reports the Machine present and no missing inventory was observed. The Machine must be unassigned and have neither an Instance Type ID nor association rows. This cleanup never calls Core and returns HTTP 202; a later fresh inventory may restore the rediscovered Machine.

Authentication

AuthorizationBearer
export JWT_BEARER_TOKEN="<jwt-bearer-token>"

# Example org name: "acme-inc
export ORG_NAME=<org-name>

# Use the JWT bearer token in your API request auth header:
curl -v -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $JWT_BEARER_TOKEN" https://nico-rest-api.nico.svc.cluster.local/v2/org/$ORG_NAME/nico/user/current

Path parameters

orgstringRequired
Name of the Org
machineIdstringRequired
ID of the Machine

Query parameters

forcebooleanOptionalDefaults to false

Request forced deletion on the Site, including host, DPU, and BMC interfaces. Starting a new attempt requires a Registered Site; a confirmed-complete retained request is replayed locally. Machines marked missing on Site can be force deleted without waiting 24 hours, including when their missing-status history is unavailable. This alone does not override attached Instances, assigned Instance Types, or Allocation Constraints. BMC credentials, discovery suppressions, and retained boot-interface pairs are preserved; orphaned DPF resources are not overridden.

allowDeleteWithInstanceTypebooleanOptionalDefaults to false

Requires force=true when enabled. Authorize removing an assigned Instance Type on the Site. This does not authorize deletion of an attached Instance or violating Allocation Constraints.

allowDeleteWithInstancebooleanOptionalDefaults to false

Requires force=true when enabled. Authorize deletion of the attached Instance control-plane record on the Site without first requesting a graceful workload shutdown; cleanup may forcibly restart the host. Also authorizes removal of its Instance Type, even if allowDeleteWithInstanceType=false. REST Machine, Instance, interfaces, capabilities, and Instance Type associations are retained for deliberate cleanup by their owners. Allocation Constraints require a separate acknowledgment.

allowDeleteWithAllocationbooleanOptionalDefaults to false

Requires force=true when enabled. Acknowledge that removing this Machine may leave fewer Machines than existing Instance Type Allocation Constraints require. Without this acknowledgment, such a request is rejected before Site deletion. When capacity would be insufficient, the Site deletion proceeds while REST Machine records and Instance Type associations are retained and Allocation Constraints remain unchanged. Machines with a recorded force-deletion attempt do not count toward capacity in later Allocation or deletion checks, even before inventory marks them missing. Does not imply either Instance or Instance Type deletion permission.

Response

Deletion request was accepted
messagestring

Human-readable outcome of the request

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
412
Precondition Failed Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error
504
Gateway Timeout Error