maws 0.8.0

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.
Files changed (50) hide show
  1. data/bin/maws +10 -0
  2. data/lib/maws/chunk_source.rb +41 -0
  3. data/lib/maws/command.rb +62 -0
  4. data/lib/maws/command_loader.rb +28 -0
  5. data/lib/maws/command_options_parser.rb +37 -0
  6. data/lib/maws/commands/configure.rb +287 -0
  7. data/lib/maws/commands/console.rb +38 -0
  8. data/lib/maws/commands/create.rb +25 -0
  9. data/lib/maws/commands/describe.rb +15 -0
  10. data/lib/maws/commands/destroy.rb +11 -0
  11. data/lib/maws/commands/elb-add.rb +17 -0
  12. data/lib/maws/commands/elb-describe.rb +23 -0
  13. data/lib/maws/commands/elb-disable-zones.rb +17 -0
  14. data/lib/maws/commands/elb-enable-zones.rb +18 -0
  15. data/lib/maws/commands/elb-remove.rb +16 -0
  16. data/lib/maws/commands/set-prefix.rb +24 -0
  17. data/lib/maws/commands/set-security-groups.rb +442 -0
  18. data/lib/maws/commands/start.rb +11 -0
  19. data/lib/maws/commands/status.rb +25 -0
  20. data/lib/maws/commands/stop.rb +11 -0
  21. data/lib/maws/commands/teardown.rb +11 -0
  22. data/lib/maws/commands/volumes-cleanup.rb +22 -0
  23. data/lib/maws/commands/volumes-status.rb +43 -0
  24. data/lib/maws/commands/wait.rb +61 -0
  25. data/lib/maws/connection.rb +121 -0
  26. data/lib/maws/core_ext/object.rb +5 -0
  27. data/lib/maws/description/ebs.rb +40 -0
  28. data/lib/maws/description/ec2.rb +72 -0
  29. data/lib/maws/description/elb.rb +52 -0
  30. data/lib/maws/description/rds.rb +47 -0
  31. data/lib/maws/description.rb +78 -0
  32. data/lib/maws/instance/ebs.rb +45 -0
  33. data/lib/maws/instance/ec2.rb +144 -0
  34. data/lib/maws/instance/elb.rb +92 -0
  35. data/lib/maws/instance/rds.rb +84 -0
  36. data/lib/maws/instance.rb +167 -0
  37. data/lib/maws/instance_collection.rb +98 -0
  38. data/lib/maws/instance_display.rb +84 -0
  39. data/lib/maws/instance_matcher.rb +27 -0
  40. data/lib/maws/loader.rb +173 -0
  41. data/lib/maws/logger.rb +66 -0
  42. data/lib/maws/mash.rb +9 -0
  43. data/lib/maws/maws.rb +102 -0
  44. data/lib/maws/profile_loader.rb +92 -0
  45. data/lib/maws/specification.rb +127 -0
  46. data/lib/maws/ssh.rb +7 -0
  47. data/lib/maws/trollop.rb +782 -0
  48. data/lib/maws/volumes_command.rb +29 -0
  49. data/lib/maws.rb +25 -0
  50. metadata +115 -0
@@ -0,0 +1,29 @@
1
+ require 'maws/command'
2
+
3
+ class VolumesCommand < Command
4
+ def create_ebs_from_descriptions
5
+ specified_roles = @maws.specified_roles
6
+ specified_zones = @maws.specified_zones
7
+
8
+ connection.ebs_descriptions.map { |description|
9
+ instance = description.create_instance(self, @config)
10
+ next unless instance.name
11
+ instances.add(instance)
12
+ instance.groups << "aws"
13
+ if specified_roles.include?(instance.role) && specified_zones.include?(instance.zone)
14
+ instance.groups << "specified"
15
+ end
16
+ }
17
+
18
+
19
+ info "\n"
20
+ info "EBS:"
21
+ info "TOTAL #{@config.profile.name.upcase} EBS VOLUMES ON AWS: #{instances.aws.ebs.count} "
22
+ info "TOTAL EBS VOLUMES SELECTED: #{instances.ebs.specified.count}"
23
+ info "TOTAL EBS VOLUMES SELECTED ON AWS: #{instances.ebs.specified.aws.count}"
24
+ end
25
+
26
+ def run!
27
+ create_ebs_from_descriptions
28
+ end
29
+ end
data/lib/maws.rb ADDED
@@ -0,0 +1,25 @@
1
+ require 'maws/logger'
2
+ require 'maws/mash'
3
+ require 'maws/core_ext/object'
4
+
5
+ require 'maws/loader'
6
+
7
+
8
+ begin
9
+ # optional awesome print
10
+ require 'ap'
11
+ rescue LoadError
12
+ def ap(x)
13
+ p x
14
+ end
15
+ end
16
+
17
+
18
+ class Maws
19
+ def self.load_and_run!
20
+ base_path = Dir.pwd
21
+ cc_path = 'maws.yml'
22
+
23
+ Loader.new(base_path, cc_path).load_and_run
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: maws
3
+ version: !ruby/object:Gem::Version
4
+ hash: 63
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 8
9
+ - 0
10
+ version: 0.8.0
11
+ platform: ruby
12
+ authors:
13
+ - Juozas Gaigalas
14
+ - Vinu Somayaji
15
+ - Bradly Feeley
16
+ autorequire:
17
+ bindir: bin
18
+ cert_chain: []
19
+
20
+ date: 2012-01-24 00:00:00 Z
21
+ dependencies: []
22
+
23
+ description: Tool set for provisioning and managing AWS infrastructures
24
+ email: juozasgaigalas@gmail.com
25
+ executables:
26
+ - maws
27
+ extensions: []
28
+
29
+ extra_rdoc_files: []
30
+
31
+ files:
32
+ - lib/maws/chunk_source.rb
33
+ - lib/maws/command.rb
34
+ - lib/maws/command_loader.rb
35
+ - lib/maws/command_options_parser.rb
36
+ - lib/maws/commands/configure.rb
37
+ - lib/maws/commands/console.rb
38
+ - lib/maws/commands/create.rb
39
+ - lib/maws/commands/describe.rb
40
+ - lib/maws/commands/destroy.rb
41
+ - lib/maws/commands/elb-add.rb
42
+ - lib/maws/commands/elb-describe.rb
43
+ - lib/maws/commands/elb-disable-zones.rb
44
+ - lib/maws/commands/elb-enable-zones.rb
45
+ - lib/maws/commands/elb-remove.rb
46
+ - lib/maws/commands/set-prefix.rb
47
+ - lib/maws/commands/set-security-groups.rb
48
+ - lib/maws/commands/start.rb
49
+ - lib/maws/commands/status.rb
50
+ - lib/maws/commands/stop.rb
51
+ - lib/maws/commands/teardown.rb
52
+ - lib/maws/commands/volumes-cleanup.rb
53
+ - lib/maws/commands/volumes-status.rb
54
+ - lib/maws/commands/wait.rb
55
+ - lib/maws/connection.rb
56
+ - lib/maws/core_ext/object.rb
57
+ - lib/maws/description/ebs.rb
58
+ - lib/maws/description/ec2.rb
59
+ - lib/maws/description/elb.rb
60
+ - lib/maws/description/rds.rb
61
+ - lib/maws/description.rb
62
+ - lib/maws/instance/ebs.rb
63
+ - lib/maws/instance/ec2.rb
64
+ - lib/maws/instance/elb.rb
65
+ - lib/maws/instance/rds.rb
66
+ - lib/maws/instance.rb
67
+ - lib/maws/instance_collection.rb
68
+ - lib/maws/instance_display.rb
69
+ - lib/maws/instance_matcher.rb
70
+ - lib/maws/loader.rb
71
+ - lib/maws/logger.rb
72
+ - lib/maws/mash.rb
73
+ - lib/maws/maws.rb
74
+ - lib/maws/profile_loader.rb
75
+ - lib/maws/specification.rb
76
+ - lib/maws/ssh.rb
77
+ - lib/maws/trollop.rb
78
+ - lib/maws/volumes_command.rb
79
+ - lib/maws.rb
80
+ - bin/maws
81
+ homepage: http://github.com/live-community/maws
82
+ licenses: []
83
+
84
+ post_install_message:
85
+ rdoc_options: []
86
+
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ hash: 3
95
+ segments:
96
+ - 0
97
+ version: "0"
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ hash: 3
104
+ segments:
105
+ - 0
106
+ version: "0"
107
+ requirements: []
108
+
109
+ rubyforge_project:
110
+ rubygems_version: 1.8.6
111
+ signing_key:
112
+ specification_version: 3
113
+ summary: MAWS
114
+ test_files: []
115
+