Examples

PUT /api/hosts/bulk/system_purpose
{
  "included": {
    "ids": [
      980191235,
      980191236
    ]
  },
  "service_level": "Standard",
  "purpose_role": "Red Hat Enterprise Linux Server",
  "purpose_usage": "Production",
  "purpose_addons": [
    "foo"
  ],
  "hosts_bulk_action": {
    "included": {
      "ids": [
        980191235,
        980191236
      ]
    },
    "service_level": "Standard",
    "purpose_role": "Red Hat Enterprise Linux Server",
    "purpose_usage": "Production",
    "purpose_addons": [
      "foo"
    ]
  }
}
202
{
  "id": "40f52010-a004-4e93-a681-841f45eb1ccf",
  "label": "Actions::BulkAction",
  "pending": false,
  "action": "Updating System Purpose for host updating system purpose for host; ...",
  "username": "restricted",
  "started_at": "2022-11-08 19:27:24 UTC",
  "ended_at": "2022-11-08 19:27:25 UTC",
  "state": "stopped",
  "result": "warning",
  "progress": 1.0,
  "input": {
    "action_class": "Actions::Katello::Host::UpdateSystemPurpose",
    "target_ids": [
      980191235,
      980191236
    ],
    "target_class": "Host::Managed",
    "args": [
      "Standard",
      "Red Hat Enterprise Linux Server",
      "Production",
      [
        "foo"
      ]
    ]
  },
  "output": {
    "planned_count": 2,
    "cancelled_count": 0,
    "total_count": 2,
    "failed_count": 2,
    "pending_count": 0,
    "success_count": 0
  },
  "humanized": {
    "action": "Updating System Purpose for host",
    "input": [
      "updating system purpose for host",
      "..."
    ],
    "output": "2 task(s), 0 success, 2 fail",
    "errors": [
      "A sub task failed"
    ]
  },
  "cli_example": null,
  "start_at": "2022-11-08 19:27:24 UTC",
  "available_actions": {
    "cancellable": false,
    "resumable": false
  }
}

Params

Param name Description
organization_id
required

ID of the organization

Validations:

  • Must be a number.

included
required

Validations:

  • Hash

included[search]
optional , nil allowed

Search string for hosts to perform an action on

Validations:

  • String

included[ids]
optional , nil allowed

List of host ids to perform an action on

Validations:

  • Must be an array of any type

excluded
required

Validations:

  • Hash

excluded[ids]
optional , nil allowed

List of host ids to exclude and not run an action on

Validations:

  • Must be an array of any type

service_level
optional

Service level of host

Validations:

  • String

purpose_role
optional

Role of host

Validations:

  • String

purpose_usage
optional

Usage of host

Validations:

  • String

purpose_addons
optional

Sets the system add-ons

Validations:

  • Must be an array of any type