PUT /api/instance_hosts/:host_id
Assign a host to the Foreman instance

Examples

PUT /api/instance_hosts/438
{
  "instance_host": {}
}
201

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

host_id
optional

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, dot(.), space, underscore(_), hypen(-) with no leading or trailing space.


GET /api/instance_hosts
List hosts forming the Foreman instance

Examples

GET /api/instance_hosts
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "ip": null,
      "ip6": null,
      "last_report": null,
      "mac": null,
      "realm_id": null,
      "realm_name": null,
      "sp_mac": null,
      "sp_ip": null,
      "sp_name": null,
      "domain_id": null,
      "domain_name": null,
      "architecture_id": null,
      "architecture_name": null,
      "operatingsystem_id": null,
      "operatingsystem_name": null,
      "subnet_id": null,
      "subnet_name": null,
      "subnet6_id": null,
      "subnet6_name": null,
      "sp_subnet_id": null,
      "ptable_id": null,
      "ptable_name": null,
      "medium_id": null,
      "medium_name": null,
      "pxe_loader": null,
      "build": false,
      "comment": null,
      "disk": null,
      "initiated_at": null,
      "installed_at": null,
      "model_id": null,
      "hostgroup_id": null,
      "owner_id": 135138680,
      "owner_name": "Admin User",
      "owner_type": "User",
      "creator_id": 135138680,
      "creator": "Admin User",
      "enabled": true,
      "managed": false,
      "use_image": null,
      "image_file": "",
      "uuid": null,
      "compute_resource_id": null,
      "compute_resource_name": null,
      "compute_profile_id": null,
      "compute_profile_name": null,
      "capabilities": [
        "build"
      ],
      "provision_method": "build",
      "certname": "host485",
      "image_id": null,
      "image_name": null,
      "created_at": "2024-02-22 15:46:14 UTC",
      "updated_at": "2024-02-22 15:46:14 UTC",
      "last_compile": null,
      "global_status": 0,
      "global_status_label": "OK",
      "bmc_available": false,
      "organization_id": 447626438,
      "organization_name": "Organization 1",
      "location_id": 255093256,
      "location_name": "Location 1",
      "puppet_status": 0,
      "model_name": null,
      "build_status": 0,
      "build_status_label": "Installed",
      "name": "host485",
      "id": 441,
      "display_name": "host485",
      "puppet_proxy_id": null,
      "puppet_proxy_name": null,
      "puppet_ca_proxy_id": null,
      "puppet_ca_proxy_name": null,
      "puppet_proxy": null,
      "puppet_ca_proxy": null,
      "cockpit_url": null,
      "compute_resource_provider": null,
      "hostgroup_name": null,
      "hostgroup_title": null,
      "infrastructure_facet": {
        "foreman_instance": true,
        "smart_proxy_id": null
      }
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer


DESTROY /api/instance_hosts/:host_id
Unassign a given host from the Foreman instance

Examples

DELETE /api/instance_hosts/436
{
  "instance_host": {}
}
404
{
  "error": {
    "message": "Resource instance_host not found by id '436'"
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer