preview_move_by_prefix
const url = 'https://example.com/api/v1/nodes/move-preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"node_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/nodes/move-preview \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "node_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The nodes to examine.
object
Examplegenerated
{ "node_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}Responses
Section titled “Responses”Which folder’s IP range contains each node’s address
What the IP-range match proposes. A proposal, not an action — nothing is written by the endpoint that returns this (ADR-124 decision 6).
object
One node claimed equally well by two or more folders. Never moved automatically.
object
Whether any folder this caller can see carries a range at all.
Without this, a deployment with no NetBox reports every node as unmatched and the operator cannot tell “these addresses are not covered” from “there was never anything to match against” — one message for two situations is how an inert feature looks like a working one.
Ids already in the folder their range names, or in a folder beneath it (ADR-176 decision 2). Not a move, so in none of the three lists above.
One node, and the single folder whose IP range contains its address.
object
The range that matched — shown so the operator can see why this folder is proposed.
Ids whose address falls inside no visible folder’s range.
Examplegenerated
{ "ambiguous": [ { "group_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "node_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "any_prefixes": true, "in_place": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "matched": [ { "group_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "node_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "prefix": "example" } ], "unmatched": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}More ids than one request may carry
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No valid bearer token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Role lacks ManageConfig
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}This deployment has no write side (skeleton mode)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}