Project

General

Profile

Actions

Json-fact-format » History » Revision 5

« Previous | Revision 5/8 (diff) | Next »
Greg Sutcliffe, 10/18/2013 09:12 AM


Json-fact-format

how to send facts

  • Foreman reports need to be sent to /api/hosts/facts
  • Following headers needs to be present:
      "Accept: application/json,version=2" 
      "Content-Type: application/json" 
    

facts JSON format

{
  "name"     => "fqdn.example.com",
  "certname" => "optional.certname.for.this.host",
  "facts"    => {
                  "fact1"                  => "value",
                  "fact2"                  => "value",
                  "_timestamp"             => "2013-10-18 07:47:45 +0000",
                  "operatingsystem"        => 'Debian',
                  "operatingsystemrelease" => '7.0'
                }
}

Note that _timestamp, operatingsystem and operatingsystemrelease are mandatory. Certname is optional, but if provided it will be preferred over name to identify the host object in the db.

Updated by Greg Sutcliffe about 11 years ago · 8 revisions