vectra 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vectra/rules.rb +14 -7
- data/lib/vectra/sensors.rb +14 -7
- data/lib/vectra/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: 3c9a1c188116e3e862f39524b91e6b7a6caa67ac
|
4
|
+
data.tar.gz: e3432222c1f70cb6fe51c36fb487d9deed5868b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a6c36c751bf22194a6f3e48015801d64e5cc8a5a6e408877f4dfec524f5e295ff3c131e130d289d9a052aed694525a7154f47cc837618e0ec624d59e9b2aa3
|
7
|
+
data.tar.gz: 7b68a33208086df1fad9b6602cc30b1b3467b11fb341980ca2e2ee2fea82a8570686642ee0e8f2fc68d0cb3a2e13c373a7c5f6ba84ee34d6a92e8f072897ed7a
|
data/lib/vectra/rules.rb
CHANGED
@@ -1,18 +1,25 @@
|
|
1
1
|
module Vectra
|
2
2
|
class Rules
|
3
|
-
|
4
|
-
attr_reader :id
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
end
|
4
|
+
attr_accessor :target
|
5
|
+
@target = "/rules"
|
9
6
|
|
10
7
|
def self.all
|
11
|
-
|
8
|
+
Vectra::API.pull(@target)
|
12
9
|
end
|
13
10
|
|
11
|
+
def each
|
12
|
+
self.all.each do |host|
|
13
|
+
yield host
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
14
17
|
def self.get(id)
|
15
|
-
|
18
|
+
unless id.is_a? Integer
|
19
|
+
id = id.split("/").last
|
20
|
+
end
|
21
|
+
|
22
|
+
Vectra::API.pull("#{@target}/#{id}")
|
16
23
|
end
|
17
24
|
|
18
25
|
end
|
data/lib/vectra/sensors.rb
CHANGED
@@ -1,18 +1,25 @@
|
|
1
1
|
module Vectra
|
2
2
|
class Sensors
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
def self.target
|
7
|
-
"sensors"
|
8
|
-
end
|
4
|
+
attr_accessor :target
|
5
|
+
@target = "/sensors"
|
9
6
|
|
10
7
|
def self.all
|
11
|
-
|
8
|
+
Vectra::API.pull(@target)
|
12
9
|
end
|
13
10
|
|
11
|
+
def each
|
12
|
+
self.all.each do |host|
|
13
|
+
yield host
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
14
17
|
def self.get(id)
|
15
|
-
|
18
|
+
unless id.is_a? Integer
|
19
|
+
id = id.split("/").last
|
20
|
+
end
|
21
|
+
|
22
|
+
Vectra::API.pull("#{@target}/#{id}")
|
16
23
|
end
|
17
24
|
|
18
25
|
end
|
data/lib/vectra/version.rb
CHANGED