Skip to content

`POST /v1/orgs/{org}/hosts/bulk` (DAWG-78): one action on many hosts.

POST
/v1/orgs/{org}/hosts/bulk
curl --request POST \
--url https://api.updawg.net/v1/orgs/example/hosts/bulk \
--header 'Content-Type: application/json' \
--data '{ "action": { "group_id": "example", "kind": "add_to_group" }, "dry_run": true, "filter": { "distro": [ "example" ], "label": [ "example" ], "reboot_required": [ "example" ], "status": [ "example" ] }, "hosts": [ "example" ] }'

Add to a group needs manage_group; setting labels, refreshing, decommissioning and deleting need manage_host; a reboot, which opens a proposal, needs run_job. Decommissioned hosts are skipped and say so, except by decommission (unchanged) and delete, which acts on nothing else. At most 5,000 hosts; past that the request is refused whole.

org
required
string

Organization slug.

Media typeapplication/json

Which hosts a bulk action is for: by id, or every host the fleet list shows for a filter. Exactly one of the two.

object
action
required
One of:

A static member of the group.

object
group_id
required
string
kind
required
string
Allowed values: add_to_group
dry_run

Resolve the selection and change nothing: the hosts it would act on.

boolean
filter
One of:

The fleet list’s filters, as its query takes them.

object
distro
Array<string>
label

key=value, all of which a host must carry.

Array<string>
reboot_required

yes, no, unknown.

Array<string>
status
Array<string>
hosts

hst_… ids.

Array<string> | null

Done, or what a dry run would do.

Media typeapplication/json
object
count
required

How many hosts the selection came to (a dry run), or were answered for.

integer
dry_run
required
boolean
hosts

A dry run: the hosts it would act on.

Array<object>
object
host_id
required
string
hostname
required
string
proposal
One of:

A reboot: the proposal it opened, to approve.

object
id
required
string
number
required
integer format: int32
results

Otherwise: one per host, skipped ones included.

Array<object>
object
detail

Why it was skipped.

string | null
host_id
required
string
hostname
required

Empty for an id that is not a host here.

string
outcome
required

changed, unchanged or skipped.

string
Examplegenerated
{
"count": 1,
"dry_run": true,
"hosts": [
{
"host_id": "example",
"hostname": "example"
}
],
"proposal": {
"id": "example",
"number": 1
},
"results": [
{
"detail": "example",
"host_id": "example",
"hostname": "example",
"outcome": "example"
}
]
}

Neither or both of hosts and filter; a bad filter or label; more than 5,000 hosts.

Media typeapplication/json
object
detail
string | null
status
required
integer format: int32
title
required
string
type
required
string
Examplegenerated
{
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

No session.

Media typeapplication/json
object
detail
string | null
status
required
integer format: int32
title
required
string
type
required
string
Examplegenerated
{
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

Not permitted for this role.

Media typeapplication/json
object
detail
string | null
status
required
integer format: int32
title
required
string
type
required
string
Examplegenerated
{
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

No such group here.

Media typeapplication/json
object
detail
string | null
status
required
integer format: int32
title
required
string
type
required
string
Examplegenerated
{
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

update_agent to a channel no agent build has been seen on yet.

Media typeapplication/json
object
detail
string | null
status
required
integer format: int32
title
required
string
type
required
string
Examplegenerated
{
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

Over the organization’s request limit. Retry-After says when to try again; RateLimit-Limit is the burst.

Media typeapplication/json
object
detail
string | null
status
required
integer format: int32
title
required
string
type
required
string
Examplegenerated
{
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}