Project

General

Profile

Json-fact-format » History » Revision 4

Revision 3 (Marek Hulán, 10/18/2013 07:56 AM) → Revision 4/8 (Marek Hulán, 10/18/2013 07:58 AM)

h1. Json-fact-format 

 h3. how to send facts 

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

 h3. facts JSON format 

 <pre> 
 { 
   "name"      => "fqdn.example.com", 
   "facts"     => { 
                  "fact1"                           => "value", 
                  "fact2"                           => "value", "value" 
                  "_timestamp"               => "2013-10-18 07:47:45 +0000", 
                  "operatingsystem"          => 'Debian', 
                  "operatingsystemrelease" => '7.0' +0000" 
                } 
 } 
 </pre> 

 Note that _timestamp, operatingsystem and operatingsystemrelease are mandatory