lightswitch-cloud 0.0.2 → 0.0.3
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 +7 -0
- data/lib/lightswitch/cloud.rb +24 -0
- metadata +11 -17
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4f6e1a437f901dcaa67d8352d69b07af7172845e
|
4
|
+
data.tar.gz: 21716546788be7a33592a3eba9e1fd523089b894
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e65349b7f073c6cff22d7ebf71ab5ff00c79cceb4aff6420c1abbefc7a8f02708d14121a6101262b3b12c18c4412610ff3323f37133cc4e29d478ed7c964f498
|
7
|
+
data.tar.gz: 13638df14c0d78c2178ca65d5b56eb7e315fff0c972c6fdad554d47cbdc6ff4fa7688f481cf034775349d1dfad0c91c7efc5a3138b4d7326f39a743d7a3459bb
|
data/lib/lightswitch/cloud.rb
CHANGED
@@ -15,6 +15,30 @@ module Lightswitch
|
|
15
15
|
validate_access
|
16
16
|
end
|
17
17
|
|
18
|
+
def list_instances(region_name)
|
19
|
+
instance_info = []
|
20
|
+
begin
|
21
|
+
client = get_client(region_name)
|
22
|
+
response = client.describe_instances
|
23
|
+
|
24
|
+
if response
|
25
|
+
instances = response['reservations'].collect do |struct|
|
26
|
+
struct['instances']
|
27
|
+
end
|
28
|
+
instance_info = instances.collect do |instance_struct|
|
29
|
+
instance = instance_struct.first
|
30
|
+
{
|
31
|
+
instance_id: instance.instance_id,
|
32
|
+
name_tag: (instance['tags'].last.value || ''),
|
33
|
+
state: instance.state['name'],
|
34
|
+
public_dns_name: instance.public_dns_name,
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
instance_info
|
40
|
+
end
|
41
|
+
|
18
42
|
def get_instance_status(instance_id, region_name)
|
19
43
|
begin
|
20
44
|
client = get_client(region_name)
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lightswitch-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Krishnan M
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-
|
11
|
+
date: 2015-07-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: riot
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: aws-sdk
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: Implements functionality in lightswitch for AWS!
|
@@ -54,26 +49,25 @@ files:
|
|
54
49
|
homepage: http://rubygems.org/gems/lightswitch-cloud
|
55
50
|
licenses:
|
56
51
|
- MIT
|
52
|
+
metadata: {}
|
57
53
|
post_install_message:
|
58
54
|
rdoc_options: []
|
59
55
|
require_paths:
|
60
56
|
- lib
|
61
57
|
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
63
58
|
requirements:
|
64
|
-
- -
|
59
|
+
- - ">="
|
65
60
|
- !ruby/object:Gem::Version
|
66
61
|
version: '0'
|
67
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
63
|
requirements:
|
70
|
-
- -
|
64
|
+
- - ">="
|
71
65
|
- !ruby/object:Gem::Version
|
72
66
|
version: '0'
|
73
67
|
requirements: []
|
74
68
|
rubyforge_project:
|
75
|
-
rubygems_version:
|
69
|
+
rubygems_version: 2.2.2
|
76
70
|
signing_key:
|
77
|
-
specification_version:
|
71
|
+
specification_version: 4
|
78
72
|
summary: Turn instances on and off in the cloud at will!
|
79
73
|
test_files: []
|