GET /api/audits
List all audits

GET /api/hosts/:host_id/audits
List all audits for a given host

Examples

GET /api/audits?search=host%3Dnewhost2.mydomain.net&per_page=3
200
{
  "total": 6,
  "subtotal": 1,
  "page": 1,
  "per_page": 3,
  "search": "host=newhost2.mydomain.net",
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "user_id": 135138680,
      "user_type": null,
      "user_name": "secret_admin",
      "version": 1,
      "comment": null,
      "associated_id": null,
      "associated_type": null,
      "remote_address": "127.0.0.1",
      "associated_name": null,
      "created_at": "2022-03-29 08:46:20 UTC",
      "request_uuid": "fb8d0982-a8ee-49d9-829d-aea106f72eef",
      "id": 980190967,
      "auditable_id": 16,
      "auditable_name": "newhost2.mydomain.net",
      "auditable_type": "Host::Base",
      "action": "create",
      "audited_changes": {
        "name": "newhost2.mydomain.net",
        "root_pass": "$5$gg30exToKwNGCr2A$zHgD7GpkVkq7X0oW1zoBDr/WB3czCV2r.n8CgxlsQk3",
        "architecture_id": 922134523,
        "operatingsystem_id": 1073012830,
        "ptable_id": 1007981703,
        "medium_id": 1011586620,
        "build": false,
        "comment": "",
        "disk": "",
        "installed_at": null,
        "model_id": null,
        "hostgroup_id": null,
        "owner_id": 135138680,
        "owner_type": "User",
        "enabled": true,
        "puppet_ca_proxy_id": null,
        "managed": true,
        "use_image": null,
        "image_file": null,
        "uuid": null,
        "compute_resource_id": 980190963,
        "puppet_proxy_id": null,
        "certname": null,
        "image_id": null,
        "organization_id": 447626438,
        "location_id": 255093256,
        "otp": null,
        "realm_id": null,
        "compute_profile_id": null,
        "provision_method": "build",
        "grub_pass": null,
        "pxe_loader": "",
        "initiated_at": null,
        "build_errors": null
      },
      "locations": [
        {
          "id": 255093256,
          "name": "Location 1",
          "title": "Location 1",
          "description": null
        }
      ],
      "organizations": [
        {
          "id": 447626438,
          "name": "Organization 1",
          "title": "Organization 1",
          "description": null
        }
      ]
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort and order by a searchable field, e.g. ‘

Maruku could not parse this XML/HTML: 
<field> DESC'

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, ‘all’ to return all results

Validations:

  • Must match regular expression /\A([1-9]\d|all)\Z$/.

Search fields

Field name Type Possible values
action string
auditable_id integer
authored_by_user string
authored_by_user.id integer
changes text
comment string
host string
hostgroup string
hostgroup_title string
id integer
interface_fqdn string
interface_ip string
interface_mac string
location string
location_id integer
organization string
organization_id integer
os string
os_title string
parameter string
partition_table string
provisioning_template string
puppetclass
remote_address string
request_uuid string
setting string
time datetime
type ptable, operatingsystem, provisioning_template, setting, user, auth_source, compute_resource, host, interface, location, organization, os, override_value, parameter, partition_table, smart_class_parameter, subnet
user string
username string

GET /api/audits/:id
Show an audit

Examples

GET /api/audits/980190962
200
{
  "user_id": null,
  "user_type": null,
  "user_name": null,
  "version": 1,
  "comment": null,
  "associated_id": 272,
  "associated_type": "Host",
  "remote_address": null,
  "associated_name": null,
  "created_at": "2009-12-14 08:01:17 UTC",
  "request_uuid": null,
  "id": 980190962,
  "auditable_id": 980190962,
  "auditable_name": null,
  "auditable_type": "Host",
  "action": "update",
  "audited_changes": {
    "architecture_id": [
      10463,
      10466
    ]
  },
  "locations": [],
  "organizations": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

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