Module: Arbor::Peakflow::Reports

Included in:
Client
Defined in:
lib/arbor_peakflow_ruby/actions/reports.rb

Instance Method Summary collapse

Instance Method Details

#configured_reports(filter = nil, limit = nil, format = 'json') ⇒ Object

Allows you to view a list of the configured wizard reports in Peakflow SP

Parameters:

  • filter: (Optional) Keywords by which you want to filter search

results. You can enter the same search strings that you can enter in the Search box on the Alerts pages in the Web UI.

  • limit: (Optional) The maximum number of alerts to return that match

the filter.

  • format: The format in which you want the data returned:

‘json’ or ‘xml’

Example

response = client.configured_reports


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/arbor_peakflow_ruby/actions/reports.rb', line 19

def configured_reports(filter = nil, limit = nil, format = 'json')
  response = @conn.get do |req|
    req.url 'arborws/reports/configured'
    req.params['api_key'] = @api_key
    req.params['format'] = format
    req.params['filter'] = filter unless filter.nil?
    req.params['limit'] = limit unless limit.nil?
  end

  response
end

#download_report(name, request_time, format) ⇒ Object

Allows you to download a completed wizard report.

Parameters:

  • name: The name of the configured wizard report result that you want

to download.

  • request_time: The time of the wizard report result that you want to

download, which can be one of the following: last (The “last” parameter downloads the most recent wizard report result), time (the “time” parameter is the time at which a wizard report ran, in seconds and microseconds since the epoch.)

  • format: The format in which you want a wizard report returned, which

can be one of the following: “PDF”, “XML”, “CSV”.

Example

response = client.download_report 'myReport', 'last', 'PDF'


94
95
96
97
98
99
100
101
102
103
104
# File 'lib/arbor_peakflow_ruby/actions/reports.rb', line 94

def download_report(name, request_time, format)
  response = @conn.get do |req|
    req.url 'arborws/reports/configured'
    req.params['api_key'] = @api_key
    req.params['name'] = name
    req.params['request_time'] = request_time
    req.params['format'] = format
  end

  response
end

#queue_report(name) ⇒ Object

Allows you to queue a wizard report to run

Parameters:

  • name: The name of the configured wizard report that you want to run.

The returned value is one of the following: an HTTP status code 204, which indicates success or an error message.

Example

response = client.queue_report 'example_report'


41
42
43
44
45
46
47
48
49
# File 'lib/arbor_peakflow_ruby/actions/reports.rb', line 41

def queue_report(name)
  response = @conn.get do |req|
    req.url 'arborws/reports/queue'
    req.params['api_key'] = @api_key
    req.params['name'] = name
  end

  response
end

#report_results(filter = nil, limit = nil, format = 'json') ⇒ Object

Allows you to view a list of wizard report results that can be downloaded from Peakflow SP.

Parameters:

  • filter: (Optional) Keywords by which you want to filter search

results. You can enter the same search strings that you can enter in the Search box on the Alerts pages in the Web UI.

  • limit: (Optional) The maximum number of alerts to return that match

the filter.

  • format: The format in which you want the data returned:

‘json’ or ‘xml’

Example

response = client.report_results


66
67
68
69
70
71
72
73
74
75
76
# File 'lib/arbor_peakflow_ruby/actions/reports.rb', line 66

def report_results(filter = nil, limit = nil, format = 'json')
  response = @conn.get do |req|
    req.url 'arborws/reports/results'
    req.params['api_key'] = @api_key
    req.params['format'] = format
    req.params['filter'] = filter unless filter.nil?
    req.params['limit'] = limit unless limit.nil?
  end

  response
end