arbor_peakflow_ruby 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arbor_peakflow_ruby/actions/alerts.rb +3 -7
- data/lib/arbor_peakflow_ruby/actions/cp5500.rb +3 -9
- data/lib/arbor_peakflow_ruby/actions/managed_object.rb +2 -5
- data/lib/arbor_peakflow_ruby/actions/mitigations.rb +4 -9
- data/lib/arbor_peakflow_ruby/actions/traffic.rb +10 -14
- data/lib/arbor_peakflow_ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d0cb86cdce4c6b9e050f079a60dea7fdc9c4fd8
|
4
|
+
data.tar.gz: d84fdcef51b993c25ceec09187ff1971b75fd065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71d23cb845cb175d2c4b267116cfe20fd6617f498f4402f69a36ba36f0f350cda104529608f5470545e2bf7dbdf9d64137b765d162abd5d7c9fcd8faf0ec63cd
|
7
|
+
data.tar.gz: ef3a37836b57a5770c8f7454559b3747de6b122fb4f0253cf2a90438ecbca666087f7e42e7b3e6840863adceb7bf6869010ee7e9871a6b402956ced139478874
|
@@ -5,13 +5,9 @@ module Arbor
|
|
5
5
|
# alert information.
|
6
6
|
#
|
7
7
|
# == Parameters:
|
8
|
-
# - filter
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# - limit: (Optional) The maximum number of alerts to return that match
|
12
|
-
# the filter.
|
13
|
-
# - format: The format in which you want the data returned:
|
14
|
-
# 'json' or 'xml'
|
8
|
+
# - +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.
|
9
|
+
# - +limit+: (Optional) The maximum number of alerts to return that match the filter.
|
10
|
+
# - +format+: The format in which you want the data returned: `json` or `xml`
|
15
11
|
#
|
16
12
|
# ==== Example
|
17
13
|
#
|
@@ -1,17 +1,11 @@
|
|
1
1
|
module Arbor
|
2
2
|
module Peakflow
|
3
3
|
module CP5500
|
4
|
-
# The CP 5500 function allows you to view CP 5500 appliance configurations
|
5
|
-
# in JSON format. *Note:* This function is only available with
|
6
|
-
# appliance-based licensing for Traffic and Analysis Routing appliances
|
7
|
-
# (formally Collector Platform (CP) appliances).
|
4
|
+
# The CP 5500 function allows you to view CP 5500 appliance configurations in JSON format. *Note:* This function is only available with appliance-based licensing for Traffic and Analysis Routing appliances (formally Collector Platform (CP) appliances).
|
8
5
|
#
|
9
6
|
# == Parameters:
|
10
|
-
# - action
|
11
|
-
#
|
12
|
-
# - filter: (Optional) Keywords by which you want to filter search
|
13
|
-
# results. You can enter the same search strings that you can enter in
|
14
|
-
# the Search box on the Configure Routers page in the Web UI.
|
7
|
+
# - +action+: One of the following actions that you want to initiate: `list`, `show_schema`, `update`.
|
8
|
+
# - +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 Configure Routers page in the Web UI.
|
15
9
|
#
|
16
10
|
# ==== Example
|
17
11
|
#
|
@@ -1,13 +1,10 @@
|
|
1
1
|
module Arbor
|
2
2
|
module Peakflow
|
3
3
|
module Managed_Object
|
4
|
-
# The managed object function allows you to view managed object
|
5
|
-
# configuration data in JSON format.
|
4
|
+
# The managed object function allows you to view managed object configuration data in JSON format.
|
6
5
|
#
|
7
6
|
# == Parameters:
|
8
|
-
# - filter
|
9
|
-
# results. You can enter the same search strings that you can enter in
|
10
|
-
# the Search box on the Managed Objects pages in the Web UI.
|
7
|
+
# - +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 Managed Objects pages in the Web UI.
|
11
8
|
#
|
12
9
|
# ==== Example
|
13
10
|
#
|
@@ -1,17 +1,12 @@
|
|
1
1
|
module Arbor
|
2
2
|
module Peakflow
|
3
3
|
module Mitigations
|
4
|
-
# The mitigations function allows you to search for and retrieve JSON and
|
5
|
-
# XML mitigation information.
|
4
|
+
# The mitigations function allows you to search for and retrieve JSON and XML mitigation information.
|
6
5
|
#
|
7
6
|
# == Parameters:
|
8
|
-
# - filter
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# - limit: (Optional) The maximum number of mitigations to return that
|
12
|
-
# match the filter.
|
13
|
-
# - format: The format in which you want the data returned:
|
14
|
-
# 'json' or 'xml'
|
7
|
+
# - +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 Mitigations pages in the Web UI.
|
8
|
+
# - +limit+: (Optional) The maximum number of mitigations to return that match the filter.
|
9
|
+
# - +format+: The format in which you want the data returned: `json` or `xml`
|
15
10
|
#
|
16
11
|
# ==== Example
|
17
12
|
#
|
@@ -25,33 +25,29 @@ module Arbor
|
|
25
25
|
response = @conn.get do |req|
|
26
26
|
req.url 'arborws/traffic'
|
27
27
|
req.params['api_key'] = @api_key
|
28
|
-
req.params['query'] =
|
29
|
-
req.params['graph'] =
|
28
|
+
req.params['query'] = remove_returns_and_spaces(query)
|
29
|
+
req.params['graph'] = remove_returns_and_spaces(graph) unless graph.nil?
|
30
30
|
end
|
31
31
|
|
32
32
|
response
|
33
33
|
end
|
34
34
|
|
35
|
-
# The
|
36
|
-
# content. This is used automatically when calling the traffic method.
|
35
|
+
# The remove_returns_and_spaces function allows you to remove newlines and spaces that are not within tags in XML.
|
37
36
|
#
|
38
37
|
# == Parameters:
|
39
|
-
# - file_contents: The XML content which should be
|
40
|
-
# usable format.
|
38
|
+
# - file_contents: The XML content which should be cleaned in preparation for URL encoding.
|
41
39
|
#
|
42
40
|
# ==== Example
|
43
41
|
#
|
44
42
|
# file = File.read('path/to/file.xml')
|
45
|
-
#
|
46
|
-
def
|
47
|
-
|
48
|
-
URI.encode(
|
43
|
+
# clean_file = client.remove_returns_and_spaces file
|
44
|
+
def remove_returns_and_spaces(file_contents)
|
45
|
+
clean_file =
|
49
46
|
file_contents
|
50
|
-
|
51
|
-
|
52
|
-
).gsub!(/\?/, '%3F')
|
47
|
+
.gsub!(/\n+/, '')
|
48
|
+
.gsub!(/(\s+)(?![^<])/, '')
|
53
49
|
|
54
|
-
|
50
|
+
clean_file
|
55
51
|
end
|
56
52
|
end
|
57
53
|
end
|