anamo 1.1.5 → 1.2
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/anamo/api.rb +2 -2
- data/lib/anamo/node/start +1 -1
- data/lib/anamo/node/thor.rb +15 -11
- data/lib/anamo/runner.rb +1 -1
- data/lib/anamo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d31b3a718b2ebff86c2326ff4def5e2a13773760be6a308c286d4628f8af38e6
|
|
4
|
+
data.tar.gz: 5dab5a624a7da18e82dbc7613e46647bce6ecfb81502a2f5040ad982190dd542
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 729bb04c281bf3fcc4ab8132bae9abdc2a8f91fc445aac7a850b6358f1d70358d915d591e233b45adb20d6c41b25463801242cbe5dc31ea27c3d223567ea2ffc
|
|
7
|
+
data.tar.gz: 3753c8ecfd7b17d2171360c50ec19a455cf7f9752c9d696fd99a84ba94afb662c70164552c7238237d200bab0889811c891254cbe571532e9f0e34e4dc532cd9
|
data/lib/anamo/api.rb
CHANGED
|
@@ -7,8 +7,8 @@ module Anamo
|
|
|
7
7
|
|
|
8
8
|
def initialize
|
|
9
9
|
@api_base_url = 'https://app.anamo.io/api'
|
|
10
|
-
@config = YAML.load_file "/
|
|
11
|
-
@client_key = File.exists?("/
|
|
10
|
+
@config = YAML.load_file "/$HOME/anamo.conf.yml"
|
|
11
|
+
@client_key = File.exists?("/$HOME/anamo.client.key") ? File.open("/$HOME/anamo.client.key", 'rb') { |f| f.read } : nil
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def make_url path
|
data/lib/anamo/node/start
CHANGED
data/lib/anamo/node/thor.rb
CHANGED
|
@@ -37,8 +37,12 @@ module Anamo
|
|
|
37
37
|
|
|
38
38
|
ret = {}
|
|
39
39
|
|
|
40
|
-
config = YAML.load_file "/
|
|
40
|
+
config = YAML.load_file "/$HOME/anamo.conf.yml"
|
|
41
|
+
|
|
42
|
+
#train
|
|
41
43
|
train = Train.create('local')
|
|
44
|
+
# start or reuse a connection
|
|
45
|
+
conn = train.connection
|
|
42
46
|
|
|
43
47
|
ret['api_key'] = config['api_key']
|
|
44
48
|
ret['beacon_modules'] = config['modules']
|
|
@@ -50,14 +54,14 @@ module Anamo
|
|
|
50
54
|
ret['node']['os_release'] = Train.create('local').connection.os[:release]
|
|
51
55
|
|
|
52
56
|
# run a command on Linux/Unix/Mac
|
|
53
|
-
ret['node']['cpe'] conn.run_command('hostnamectl | grep "Static hostname: "').stdout
|
|
54
|
-
ret['node']['chassis'] conn.run_command('hostnamectl | grep "Chassis: "').stdout
|
|
55
|
-
ret['node']['machine_id'] conn.run_command('hostnamectl | grep "Machine ID: "').stdout
|
|
56
|
-
ret['node']['boot_id'] conn.run_command('hostnamectl | grep "Boot ID: "').stdout
|
|
57
|
-
ret['node']['virtualization'] conn.run_command('hostnamectl | grep "Virtualization: "').stdout
|
|
58
|
-
ret['node']['operating_system'] conn.run_command('hostnamectl | grep "Operating System: "').stdout
|
|
59
|
-
ret['node']['kernel'] conn.run_command('hostnamectl | grep "Kernel: "').stdout
|
|
60
|
-
ret['node']['architecture'] conn.run_command('hostnamectl | grep "Architecture: "').stdout
|
|
57
|
+
ret['node']['cpe'] = conn.run_command('hostnamectl | grep "Static hostname: "').stdout
|
|
58
|
+
ret['node']['chassis'] = conn.run_command('hostnamectl | grep "Chassis: "').stdout
|
|
59
|
+
ret['node']['machine_id'] = conn.run_command('hostnamectl | grep "Machine ID: "').stdout
|
|
60
|
+
ret['node']['boot_id'] = conn.run_command('hostnamectl | grep "Boot ID: "').stdout
|
|
61
|
+
ret['node']['virtualization'] = conn.run_command('hostnamectl | grep "Virtualization: "').stdout
|
|
62
|
+
ret['node']['operating_system'] = conn.run_command('hostnamectl | grep "Operating System: "').stdout
|
|
63
|
+
ret['node']['kernel'] = conn.run_command('hostnamectl | grep "Kernel: "').stdout
|
|
64
|
+
ret['node']['architecture'] = conn.run_command('hostnamectl | grep "Architecture: "').stdout
|
|
61
65
|
|
|
62
66
|
#Uname (General)
|
|
63
67
|
ret['node']['uname_sysname'] = Uname.sysname # => The operating system name. e.g. "SunOS"
|
|
@@ -143,7 +147,7 @@ module Anamo
|
|
|
143
147
|
if defined? @config_file_path
|
|
144
148
|
@config_file_path
|
|
145
149
|
else
|
|
146
|
-
return '/
|
|
150
|
+
return '/$HOME/anamo.conf.yml'
|
|
147
151
|
end
|
|
148
152
|
end
|
|
149
153
|
|
|
@@ -152,7 +156,7 @@ module Anamo
|
|
|
152
156
|
private
|
|
153
157
|
|
|
154
158
|
def key_file
|
|
155
|
-
"/
|
|
159
|
+
"/$HOME/anamo.client.key"
|
|
156
160
|
end
|
|
157
161
|
|
|
158
162
|
end
|
data/lib/anamo/runner.rb
CHANGED
data/lib/anamo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: anamo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: '1.2'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anamo, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-07-
|
|
11
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|