Skip to content

preview_move_by_prefix

POST
/api/v1/nodes/move-preview
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" ] }'
Media typeapplication/json

The nodes to examine.

object
node_ids
required
Array<string>
Examplegenerated
{
"node_ids": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
]
}

Which folder’s IP range contains each node’s address

Media typeapplication/json

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
ambiguous
required
Array<object>

One node claimed equally well by two or more folders. Never moved automatically.

object
group_ids
required
Array<string>
node_id
required
string format: uuid
any_prefixes
required

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.

boolean
in_place
required

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.

Array<string>
matched
required
Array<object>

One node, and the single folder whose IP range contains its address.

object
group_id
required
string format: uuid
node_id
required
string format: uuid
prefix
required

The range that matched — shown so the operator can see why this folder is proposed.

string
unmatched
required

Ids whose address falls inside no visible folder’s range.

Array<string>
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

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

No valid bearer token

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Role lacks ManageConfig

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

This deployment has no write side (skeleton mode)

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}