Reporting¶
The methods available here give the ability to do reporting on selections of computers.
GetCSVComplianceData¶
Get a breakdown of compliance data in CSV format (including a header row).
The method takes one optional argument:
- query: A query string used to select the computers you wish to report on. See Computer Queries for details.
For example, the following request will query for all machines running Ubuntu 12.04 (Precise):
?action=GetCSVComplianceData&query=distribution:12.04An example output looks like this:
u"name,is_pinging,schedule,USN 1234-12 (2012-08-19 14:51) Server 1,False,Every hour at 30 minutes past the hour,Not present Server 2,False,Every hour at 30 minutes past the hour,Not present Web,False,Every hour at 30 minutes past the hour,2012-08-20 14:51 DB,False,Every hour at 30 minutes past the hour,Not present "
GetComputersNotUpgraded¶
Get the ids of computers that are not currently covered by an upgrade profile..
This method takes one optional argument:
- query: A query string used to select the computers you wish to report on. See Computer Queries for details.
For example, the following request will query for all machines running Ubuntu 12.04 (Precise) that are not covered by an upgrade profile:
?action=GetComputersNotUpgraded&query=distribution:12.04An example output looks like this:
[1, 3, 39, 500]
GetNotPingingComputers¶
Get the ids of computers that have not pinged the server for a give number of minutes.
This method takes the following arguments:
- since_minutes: An integer number of minutes elapsed in which computers should have pinged the server.
- query: A query string used to select the computers you wish to report on. See Computer Queries for details. (optional)
For example, the following request will query for all machines running Ubuntu 12.04 (Precise) that have not pinged in more than 10 minutes:
?action=GetNotPingingComputers&query=distribution:12.04 &since_minutes=10An example output looks like this:
[44, 343, 5463]
GetUSNTimeToFix¶
Get a summary of the lengths of time machines waited to be patched after USN releases.
This method takes four optional arguments:
- query: A query string used to select the computers you wish to report on. See Computer Queries for details.
- fixed_in_days: A list of integer periods of days from a USN release into which we will group machines. The default value is [2, 14, 30].
- pending_in_days: The number of days in history to search for USN releases that are pending on the machines. Note, this parameter is independent of the in_last parameter. The default value is 60.
- in_last: The number of days in history to search for USN releases to be considered in patch time statistics. The default value is 30.
For example, the following request will query for all machines running Ubuntu 12.04 (Precise):
?action=GetUSNTimeToFix&query=distribution:12.04This example request will return machines fixed in 7,14,21 days:
?action=GetUSNTimeToFix&fixed_in_days.1=7&fixed_in_days.2=14 &fixed_in_days.3=21This example request will return statistics for unpatched times on USNs released in a window of 50 days prior to today’s date:
?action=GetUSNTimeToFix&in_last=50Example output looks like:
{u'30': [1, 2, 3, 4, 5, 6, 9, 10, 11], u'14': [1, 2, 3, 4, 5, 6, 7, 9, 10, 11], u'2': [1, 2, 3, 4, 5, 6, 9, 10, 11], u'pending': []}
GetUpgradedComputersByFrequency¶
Get a summary of the upgrade schedules of computers.
This method takes one optional argument:
- query: A query string used to select the computers you wish to report on. See Computer Queries for details.
For example, the following request will query for all machines running Ubuntu 12.04 (Precise):
?action=GetUpgradedComputersByFrequency&query=distribution:12.04Example output looks like:
{u'Every hour at 30 minutes past the hour': [1, 2, 3, 6, 7, 8]}