pec2 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/pec2.rb +1 -0
- data/lib/pec2/ec2.rb +2 -2
- data/lib/pec2/metadata.rb +24 -0
- data/lib/pec2/version.rb +1 -1
- data/pec2.gemspec +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aae3254890f35de4ab62acc17677af602abffd98fc94750f896ea583b244556
|
4
|
+
data.tar.gz: 29a0a05f43fc40628fc3922256847294873e58a4085e47ea805c7e30b2d36ded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6a39f87cf00d4cd1a1e720a7275409c8304db83260646e3488c0b3baec394c369b321fe39a2f02f78ae98c83d732d56b9efa26010d4b56320961a887fc2382
|
7
|
+
data.tar.gz: ea605a802dd27d25631d3159951cd9206d3312ced4a6d5a3c77811e0e12a6ad6fc35d532d1709fc7787cbf4dd3ef55b448a796ec1d78cd772abeb40464e2f128
|
data/.travis.yml
CHANGED
data/lib/pec2.rb
CHANGED
data/lib/pec2/ec2.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'aws-sdk'
|
1
|
+
require 'aws-sdk-ec2'
|
2
2
|
require 'hashie/mash'
|
3
3
|
require 'logger'
|
4
4
|
require 'open-uri'
|
@@ -49,7 +49,7 @@ module Pec2
|
|
49
49
|
|
50
50
|
def get_param(profile)
|
51
51
|
param = {}
|
52
|
-
|
52
|
+
if profile
|
53
53
|
param[:profile] = profile
|
54
54
|
else
|
55
55
|
param[:region] = if ENV['AWS_REGION']
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
3
|
+
module Pec2
|
4
|
+
class Metadata
|
5
|
+
class << self
|
6
|
+
def get_document
|
7
|
+
JSON.parse(get_metadata('/latest/dynamic/instance-identity/document/'))
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_metadata(path)
|
11
|
+
begin
|
12
|
+
result = {}
|
13
|
+
::Timeout.timeout(TIME_OUT) {
|
14
|
+
body = open('http://169.254.169.254' + path).read
|
15
|
+
return body
|
16
|
+
}
|
17
|
+
return result
|
18
|
+
rescue Timeout::Error => e
|
19
|
+
raise "not EC2 instance"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/pec2/version.rb
CHANGED
data/pec2.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.require_paths = ['lib']
|
19
19
|
|
20
20
|
gem.add_dependency 'thor'
|
21
|
-
gem.add_dependency 'aws-sdk'
|
21
|
+
gem.add_dependency 'aws-sdk-ec2'
|
22
22
|
gem.add_dependency 'hashie'
|
23
23
|
gem.add_dependency 'net-ssh'
|
24
24
|
gem.add_dependency 'parallel'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toyama0919
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: aws-sdk
|
28
|
+
name: aws-sdk-ec2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hashie
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- lib/pec2/cli.rb
|
200
200
|
- lib/pec2/constants.rb
|
201
201
|
- lib/pec2/ec2.rb
|
202
|
+
- lib/pec2/metadata.rb
|
202
203
|
- lib/pec2/pssh.rb
|
203
204
|
- lib/pec2/version.rb
|
204
205
|
- pec2.gemspec
|