Json-report-format » History » Version 5
Marek Hulán, 12/18/2013 06:53 PM
1 | 1 | Romain Vrignaud | h1. Json-report-format |
---|---|---|---|
2 | |||
3 | 4 | Marek Hulán | h2. how to send reports |
4 | 2 | Romain Vrignaud | |
5 | * Foreman reports need to be sent to /api/reports |
||
6 | * Followind headers needs to be present : |
||
7 | 1 | Romain Vrignaud | <pre> |
8 | 2 | Romain Vrignaud | "Accept: application/json,version=2" |
9 | "Content-Type: application/json" |
||
10 | </pre> |
||
11 | |||
12 | 4 | Marek Hulán | h2. report JSON format |
13 | 2 | Romain Vrignaud | |
14 | <pre> |
||
15 | 1 | Romain Vrignaud | { |
16 | 3 | Romain Vrignaud | "report" => { |
17 | "host" => "fqdn.example.com", |
||
18 | "reported_at" => "2013-10-18 06:58:09 UTC", # Time.now.utc.to_s ruby style |
||
19 | "status" => { "applied" => n, # Number of resource that changed with n integer |
||
20 | "restarted" => n, # Number of services restarted with n integer |
||
21 | "failed" => n, # Number of failed resource with n integer |
||
22 | "failed_restarts" => n, # Number of failed service restart with n integer |
||
23 | "skipped" => n, # Number of skipped resource with n integer |
||
24 | "pending" => n # with n integer |
||
25 | }, |
||
26 | "metrics" => { "resources" => { 'total' => n} # Total number of resources |
||
27 | "time" => { "resource_type1" => n, # Time spent on that type of resource |
||
28 | "resource_type2" => n, # Time spent on that type of resource |
||
29 | "total" => n } # Total time spent for the run |
||
30 | }, |
||
31 | "logs" => [ { "log" => { "sources" => { "source" => "resource name" }, # Name of resource which output the message |
||
32 | "messages" => { "message" => "resource message" }, # Message of resource |
||
33 | "level" => "notice" # In ['notice','warning','error'] TODO: recheck this |
||
34 | } |
||
35 | ] |
||
36 | } |
||
37 | 1 | Romain Vrignaud | } |
38 | </pre> |
||
39 | 4 | Marek Hulán | |
40 | h2. Meaning of states |
||
41 | |||
42 | h3. Puppet |
||
43 | |||
44 | 5 | Marek Hulán | |applied | How many resources were attempted to be fixed | |
45 | |restarted | How many resources were restarted because their dependencies changed| |
||
46 | |failed | How many resources were not successfully fixed| |
||
47 | |failed_restarts | How many resources could not be restarted| |
||
48 | |skipped | How many resources were skipped, because of either tagging or scheduling restrictions| |
||
49 | |pending | Is for noop mode, e.g it would have made a change if it would actually run| |
||
50 | 4 | Marek Hulán | |
51 | h3. Chef |
||
52 | |||
53 | 5 | Marek Hulán | |applied | How many resources were executed| |
54 | |restarted | How many resources were executed and their action was restart| |
||
55 | |failed | How many resources were not successfully fixed| |
||
56 | |failed_restarts | How many resources were not successfully fixed and their action was restart| |
||
57 | |skipped | How many resources were skipped (e.g. action remained nothing)| |
||
58 | |pending | not used (why runs not supported)| |