amazon-ec2 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +9 -9
  2. data/VERSION +1 -1
  3. data/amazon-ec2.gemspec +1 -1
  4. metadata +1 -1
@@ -23,7 +23,7 @@ Before you can make use of this gem you will need an Amazon Web Services develop
23
23
 
24
24
  === Install required gem pre-requisites
25
25
 
26
- The following gems should be installed automatically as part of your install of amazon-ec2. Most of them are needed for testing build dependencies but they should be painless to install even if you dont plan on running the tests or building this gem manually on your own.
26
+ The following gems should be installed automatically as part of your install of amazon-ec2. Most of them are needed for testing build dependencies but they should be painless to install even if you don't plan on running the tests or building this gem manually on your own.
27
27
 
28
28
  XmlSimple (required)
29
29
  Mocha (optional for testing)
@@ -64,7 +64,7 @@ The public methods on EC2::Base closely mirror the EC2 Query API, and as such th
64
64
 
65
65
  === Setting up
66
66
 
67
- The 'ec2sh' and 'ec2-gem-example.rb' scripts which will be introduced to you shortly expect your AWS EC2 credentials to be stored as shell environment variables which are accessible to those scripts. This makes them convenient to use whenever you need to do a quick query to see what images you have available to you, what's running now, or to start or stop an instance on EC2. Youll find 'ec2sh' to be a very handy tool. Ill describe only the OS X route for setting up (of course the setup steps will vary depending on your particular system and preferred shell). If you dont want to do it this way, feel free to copy these scripts from the gem dir to any location where you can run them from and modify them directly to include your credentials.
67
+ The 'ec2sh' and 'ec2-gem-example.rb' scripts which will be introduced to you shortly expect your AWS EC2 credentials to be stored as shell environment variables which are accessible to those scripts. This makes them convenient to use whenever you need to do a quick query to see what images you have available to you, what's running now, or to start or stop an instance on EC2. You'll find 'ec2sh' to be a very handy tool. I'll describe only the OS X route for setting up (of course the setup steps will vary depending on your particular system and preferred shell). If you don't want to do it this way, feel free to copy these scripts from the gem dir to any location where you can run them from and modify them directly to include your credentials.
68
68
 
69
69
  Edit the file ~/.bash_login and add the following to the existing contents:
70
70
 
@@ -82,9 +82,9 @@ If you are using EC2 in the EU region, make sure you also set:
82
82
 
83
83
  (which you have already if you configured standard EC2 command line tools to work with this region).
84
84
 
85
- Once you save the file you should close and re-open your terminal so the new variables are made available. Youll need to do this close/re-open step for each terminal window you have open (or issue the source ~/.bash_login command in each). Make sure that this file is only readable by your user so you dont inadvertently expose your credentials to other users on your system.
85
+ Once you save the file you should close and re-open your terminal so the new variables are made available. You'll need to do this close/re-open step for each terminal window you have open (or issue the 'source ~/.bash_login' command in each). Make sure that this file is only readable by your user so you don't inadvertently expose your credentials to other users on your system.
86
86
 
87
- You can verify that this setup is complete by running the set in a command window and seeing that your credentials are in the list of shell variables.
87
+ You can verify that this setup is complete by running the 'set' in a command window and seeing that your credentials are in the list of shell variables.
88
88
 
89
89
  === The basics
90
90
 
@@ -109,13 +109,13 @@ An example Ruby script which exercises the library a bit more is installed for y
109
109
 
110
110
  [your amazon-ec2 gem dir]/examples/ec2-example.rb
111
111
 
112
- Since we also package this sample file in the gems bin/ dir you should also be able to run it from anywhere on your shell path (once you have set your environment variables as described above).
112
+ Since we also package this sample file in the gem's bin/ dir you should also be able to run it from anywhere on your shell path (once you have set your environment variables as described above).
113
113
 
114
114
  ==== Using the 'ec2sh' command shell
115
115
 
116
- The 'ec2sh' command shell is actually a standard 'irb' Ruby shell, with the main difference being we read your AWS credentials from your environment and pre-configure a connection string for you. This lets you run any EC2 command very simply. This has proven to be a valuable tool during the development of this gem and you should try it out. Since we install this tool in your system path as part of the installation of this gem, you should be able to simply run 'ec2sh' from any terminal command prompt on your local system. Youll see some basic instructions for use, and a few examples when you start 'ec2sh'. Go ahead and try it out now. Well wait...
116
+ The 'ec2sh' command shell is actually a standard 'irb' Ruby shell, with the main difference being we read your AWS credentials from your environment and pre-configure a connection string for you. This lets you run any EC2 command very simply. This has proven to be a valuable tool during the development of this gem and you should try it out. Since we install this tool in your system path as part of the installation of this gem, you should be able to simply run 'ec2sh' from any terminal command prompt on your local system. You'll see some basic instructions for use, and a few examples when you start 'ec2sh'. Go ahead and try it out now. We'll wait...
117
117
 
118
- If you're not in front of a terminal shell now (perhaps youre browsing this site on your iPhone) this is what you would see:
118
+ If you're not in front of a terminal shell now (perhaps you're browsing this site on your iPhone) this is what you would see:
119
119
 
120
120
 
121
121
  hostname:/tmp/rails/amazon_test glenn$ ec2sh
@@ -155,7 +155,7 @@ If you're not in front of a terminal shell now (perhaps you’re browsing this s
155
155
 
156
156
  === Ruby script usage example:
157
157
 
158
- Try out the following bit of code. This should walk through each image returned by a call to #describe_images and print out its key data. Note in the example below that you cannot walk through the results of the #describe_images call with the '.each' iterator (Youll get errors if you try). You need to instead walk through the Array of items which are in the 'imagesSet' embedded in the response. This reflects exactly the XML hierarchy of data returned from EC2 which we parse to Ruby OpenStruct objects (EC2::Response).
158
+ Try out the following bit of code. This should walk through each image returned by a call to #describe_images and print out its key data. Note in the example below that you cannot walk through the results of the #describe_images call with the '.each' iterator (You'll get errors if you try). You need to instead walk through the Array of items which are in the 'imagesSet' embedded in the response. This reflects exactly the XML hierarchy of data returned from EC2 which we parse to Ruby OpenStruct objects (EC2::Response).
159
159
 
160
160
  #!/usr/bin/env ruby
161
161
 
@@ -303,7 +303,7 @@ So, for example, if you wanted to get the image ID of the third image listed in
303
303
  >> puts @ec2.describe_images(:owner_id => 'amazon').imagesSet.item[2].imageId
304
304
  ami-23b6534a
305
305
 
306
- EC2 will typically return sets of things (imagesSet, reservationSet, etc.) which we map to ruby Arrays (.imagesSet.item in the example above). If you want to iterate over a response set you will need to iterate over this array. The Arrays will typically contain additional EC2::Response objects that represent each individual item. Youll find that you can use the 'ec2sh' to help you understand the structure more completely if you try issuing commands there as a way to practice seeing what will be returned and making sure you get exactly what you want.
306
+ EC2 will typically return sets of things (imagesSet, reservationSet, etc.) which we map to ruby Arrays (.imagesSet.item in the example above). If you want to iterate over a response set you will need to iterate over this array. The Arrays will typically contain additional EC2::Response objects that represent each individual item. You'll find that you can use the 'ec2sh' to help you understand the structure more completely if you try issuing commands there as a way to practice seeing what will be returned and making sure you get exactly what you want.
307
307
 
308
308
 
309
309
  == Additional Resources
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.4
1
+ 0.4.5
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{amazon-ec2}
5
- s.version = "0.4.4"
5
+ s.version = "0.4.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Glenn Rempe"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glenn Rempe