Project

General

Profile

Json-fact-format » History » Version 5

Greg Sutcliffe, 10/18/2013 09:12 AM

1 1 Romain Vrignaud
h1. Json-fact-format
2
3
h3. how to send facts
4
5
* Foreman reports need to be sent to /api/hosts/facts
6 3 Marek Hulán
* Following headers needs to be present: 
7 1 Romain Vrignaud
<pre>
8
  "Accept: application/json,version=2"
9
  "Content-Type: application/json"
10
</pre>
11
12
h3. facts JSON format
13
14
<pre>
15
{
16 5 Greg Sutcliffe
  "name"     => "fqdn.example.com",
17
  "certname" => "optional.certname.for.this.host",
18
  "facts"    => {
19
                  "fact1"                  => "value",
20
                  "fact2"                  => "value",
21
                  "_timestamp"             => "2013-10-18 07:47:45 +0000",
22
                  "operatingsystem"        => 'Debian',
23
                  "operatingsystemrelease" => '7.0'
24
                }
25 1 Romain Vrignaud
}
26
</pre>
27 4 Marek Hulán
28 5 Greg Sutcliffe
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.