amazon-ec2 0.0.8 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +2 -186
- data/lib/EC2/version.rb +2 -2
- data/website/index.html +10 -1
- data/website/index.txt +7 -0
- metadata +1 -1
data/README.txt
CHANGED
@@ -1,186 +1,2 @@
|
|
1
|
-
=README.txt
|
2
|
-
|
3
|
-
AWS EC2 is an interface library that can be used to interact
|
4
|
-
with the Amazon EC2 system. The library exposes one main interface class,
|
5
|
-
'AWSAuthConnection'. This class performs all the operations for using
|
6
|
-
the EC2 service including header signing.
|
7
|
-
|
8
|
-
==Important note about this project:
|
9
|
-
Please note that I am packaging this sample code up as a service to the
|
10
|
-
Ruby community and do not plan to be actively maintaining this code
|
11
|
-
on a regular basis. If you can contribute documentation or additional tests as
|
12
|
-
Subversion patch files I will be happy to incorporate those directly into the library.
|
13
|
-
Alternatively, if you are interested in becoming a contributing developer with checkin
|
14
|
-
privileges on this source code please feel free to contact me.
|
15
|
-
|
16
|
-
==RubyForge Project Info
|
17
|
-
This project is hosted on the RubyForge project server. You can find the project at:
|
18
|
-
|
19
|
-
http://amazon-ec2.rubyforge.org/
|
20
|
-
http://rubyforge.org/projects/amazon-ec2/
|
21
|
-
|
22
|
-
Please actively report any bugs that you find using the bug tracker found on the RubyForge site. Please submit any patches as well through that mechanism. If you feel you want to help contribute to the project please contact me at:
|
23
|
-
|
24
|
-
grempe @no spam@ rubyforge.org
|
25
|
-
|
26
|
-
==Prerequisites:
|
27
|
-
|
28
|
-
An Amazon Web Services Developer account which is also signed up for Amazon EC2.
|
29
|
-
You will need the AWS Access Key ID and Secret Access Key that they provide when you
|
30
|
-
sign up.
|
31
|
-
|
32
|
-
|
33
|
-
==Installation:
|
34
|
-
|
35
|
-
The specific installation may vary according to your operation system. Some examples are below.
|
36
|
-
|
37
|
-
Linux/Mac OS X:
|
38
|
-
|
39
|
-
sudo gem install amazon-ec2
|
40
|
-
|
41
|
-
Windows:
|
42
|
-
|
43
|
-
gem install amazon-ec2
|
44
|
-
|
45
|
-
|
46
|
-
==Usage:
|
47
|
-
|
48
|
-
The public methods on AWSAuthConnection closely mirror the EC2 Query API, and
|
49
|
-
as such the Query API Reference in the EC2 Developer Guide should be consulted.
|
50
|
-
|
51
|
-
===Example Code Usage (Stand-alone Ruby Application):
|
52
|
-
|
53
|
-
#!/usr/bin/env ruby
|
54
|
-
require 'rubygems'
|
55
|
-
require_gem 'amazon-ec2'
|
56
|
-
AWS_ACCESS_KEY_ID = '--YOUR AWS ACCESS KEY ID--'
|
57
|
-
AWS_SECRET_ACCESS_KEY = '--YOUR AWS SECRET ACCESS KEY--'
|
58
|
-
conn = EC2::AWSAuthConnection.new(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
59
|
-
puts "----- listing images -----"
|
60
|
-
puts conn.describe_images()
|
61
|
-
|
62
|
-
|
63
|
-
An example client is provided as a starting point in this Gem installation which
|
64
|
-
you may consult for a few more detailed usage examples.
|
65
|
-
|
66
|
-
examples/ec2-example.rb
|
67
|
-
|
68
|
-
|
69
|
-
===Example Code Usage (Ruby on Rails Application):
|
70
|
-
|
71
|
-
config/environment.rb:
|
72
|
-
...
|
73
|
-
# Include Amazon Web Services EC2 library gem
|
74
|
-
require_gem 'amazon-ec2'
|
75
|
-
|
76
|
-
app/controllers/your_controller.rb:
|
77
|
-
conn = EC2::AWSAuthConnection.new(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
|
78
|
-
|
79
|
-
# The .parse method gives you back an array of values you can use in your view
|
80
|
-
@ec2_images = conn.describe_images().parse
|
81
|
-
|
82
|
-
-- OR with some params (in this case specific owner ID's) --
|
83
|
-
|
84
|
-
@ec2_images_mine = ec2.describe_images([],["522821470517"],[]).parse
|
85
|
-
|
86
|
-
|
87
|
-
app/views/your_view.rhtml:
|
88
|
-
|
89
|
-
<%= debug(@ec2_images) %>
|
90
|
-
|
91
|
-
-- OR --
|
92
|
-
|
93
|
-
<% @ec2_images.each do |image| %>
|
94
|
-
<% image.each_with_index do |value, index| %>
|
95
|
-
<%= "#{index} => #{value}" %><br />
|
96
|
-
<% end %>
|
97
|
-
<% end %>
|
98
|
-
|
99
|
-
-- OR --
|
100
|
-
|
101
|
-
<table>
|
102
|
-
<tr>
|
103
|
-
<th>Id</th>
|
104
|
-
<th>Location</th>
|
105
|
-
<th>Owner</th>
|
106
|
-
<th>State</th>
|
107
|
-
<th>Public?</th>
|
108
|
-
</tr>
|
109
|
-
|
110
|
-
<% for ec2_image in @ec2_images %>
|
111
|
-
<tr>
|
112
|
-
<td><%=h ec2_image[1] %></td>
|
113
|
-
<td><%=h ec2_image[2] %></td>
|
114
|
-
<td><%=h ec2_image[3] %></td>
|
115
|
-
<td><%=h ec2_image[4] %></td>
|
116
|
-
<td><%=h ec2_image[5] %></td>
|
117
|
-
</tr>
|
118
|
-
<% end %>
|
119
|
-
</table>
|
120
|
-
|
121
|
-
|
122
|
-
==To Do:
|
123
|
-
|
124
|
-
* As provided by Amazon, this library has nearly non-existent error handling.
|
125
|
-
All errors from lower libraries are simply passed up. The response code in
|
126
|
-
the returned object needs to be checked after each request to verify
|
127
|
-
whether the request succeeded.
|
128
|
-
* Documentation - The code is almost devoid of documentation. RDoc comments in
|
129
|
-
the code would be very useful.
|
130
|
-
* Automated Unit Tests - There are currently no unit tests for this code.
|
131
|
-
A suite of tests to help exercise the code would greatly improve our confidence.
|
132
|
-
|
133
|
-
|
134
|
-
==Credits:
|
135
|
-
|
136
|
-
* The original sample code for this library was provided by Amazon Web Services, LLC.
|
137
|
-
Thanks to them for providing the samples that got this started. They took the wind out
|
138
|
-
of the sails of my own version of this library (which was maybe 75% complete), but they
|
139
|
-
probably saved me some hair that otherwise would have suffered self-inflicted removal.
|
140
|
-
|
141
|
-
* Thanks to Dr. Nic Williams and his great 'newgem' Ruby Gem Generator which can be found
|
142
|
-
at http://drnicwilliams.com/2006/10/11/generating-new-gems. This helped me package up
|
143
|
-
this code for distribution in a flash.
|
144
|
-
|
145
|
-
|
146
|
-
=Original AWS README for this code (12/13/2006)
|
147
|
-
|
148
|
-
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=553
|
149
|
-
|
150
|
-
This is one of a collection of interface libraries that can be used to interact
|
151
|
-
with the Amazon EC2 system in a number of different languages. They each
|
152
|
-
expose one main interface class, AWSAuthConnection. This performs all the
|
153
|
-
operations using the appropriate libraries for the language, including header
|
154
|
-
signing.
|
155
|
-
|
156
|
-
|
157
|
-
==Usage:
|
158
|
-
|
159
|
-
The public methods on AWSAuthConnection closely mirror the EC2 Query API, and
|
160
|
-
as such the Query API Reference in the EC2 Developer Guide should be consulted.
|
161
|
-
|
162
|
-
An example client is provided as a starting point.
|
163
|
-
|
164
|
-
|
165
|
-
==Prerequisites:
|
166
|
-
|
167
|
-
An Amazon Web Services Developer account signed up for Amazon EC2.
|
168
|
-
|
169
|
-
|
170
|
-
==Limitations:
|
171
|
-
|
172
|
-
These libraries have nearly non-existent error handling. All errors from lower
|
173
|
-
libraries are simply passed up. The response code in the returned object needs
|
174
|
-
to be checked after each request to verify whether the request succeeded.
|
175
|
-
|
176
|
-
It is our intention that these libraries act as a starting point for future
|
177
|
-
development. They are meant to show off the various operations and provide an
|
178
|
-
example of how to negotiate the authentication process.
|
179
|
-
|
180
|
-
This software code is made available "AS IS" without warranties of any kind.
|
181
|
-
You may copy, display, modify and redistribute the software code either by
|
182
|
-
itself or as incorporated into your code; provided that you do not remove any
|
183
|
-
proprietary notices. Your use of this software code is at your own risk and
|
184
|
-
you waive any claim against Amazon Web Services LLC or its affiliates with
|
185
|
-
respect to your use of this software code. (c) 2006 Amazon Web Services LLC or
|
186
|
-
its affiliates. All rights reserved.
|
1
|
+
= README.txt
|
2
|
+
* Please see the project homepage at: http://amazon-ec2.rubyforge.org/
|
data/lib/EC2/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>Amazon Web Services EC2 Ruby Gem</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/amazon-ec2"; return false'>
|
35
35
|
Get Version
|
36
|
-
<a href="http://rubyforge.org/projects/amazon-ec2" class="numbers">0.0
|
36
|
+
<a href="http://rubyforge.org/projects/amazon-ec2" class="numbers">0.1.0</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘amazon-ec2’</h1>
|
39
39
|
|
@@ -65,6 +65,15 @@
|
|
65
65
|
<p>This project is managed as a RubyForge project which you can find at <a href="http://amazon-ec2.rubyforge.org/">http://amazon-ec2.rubyforge.org/</a> and this is always the best place to find the latest news, report any bugs, submit feature requests, or provide patches.</p>
|
66
66
|
|
67
67
|
|
68
|
+
<h2>Documentation</h2>
|
69
|
+
|
70
|
+
|
71
|
+
<p>You can browse the complete RDoc generated documentation at:</p>
|
72
|
+
|
73
|
+
|
74
|
+
<p><a href="http://amazon-ec2.rubyforge.org/rdoc/">http://amazon-ec2.rubyforge.org/rdoc/</a></p>
|
75
|
+
|
76
|
+
|
68
77
|
<h2>Installing</h2>
|
69
78
|
|
70
79
|
|
data/website/index.txt
CHANGED
@@ -20,6 +20,13 @@ h2. Project Info
|
|
20
20
|
|
21
21
|
This project is managed as a RubyForge project which you can find at "http://amazon-ec2.rubyforge.org/":http://amazon-ec2.rubyforge.org/ and this is always the best place to find the latest news, report any bugs, submit feature requests, or provide patches.
|
22
22
|
|
23
|
+
h2. Documentation
|
24
|
+
|
25
|
+
You can browse the complete RDoc generated documentation at:
|
26
|
+
|
27
|
+
"http://amazon-ec2.rubyforge.org/rdoc/":http://amazon-ec2.rubyforge.org/rdoc/
|
28
|
+
|
29
|
+
|
23
30
|
h2. Installing
|
24
31
|
|
25
32
|
This gem follows the standard conventions for installation on any system with Ruby and RubyGems installed. If you have worked with gems before this will look very familiar.
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: amazon-ec2
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0
|
6
|
+
version: 0.1.0
|
7
7
|
date: 2007-05-30 00:00:00 -07:00
|
8
8
|
summary: An interface library that allows Ruby or Ruby on Rails applications to easily connect to the HTTP 'Query API' for the Amazon Web Services Elastic Compute Cloud (EC2) and manipulate server instances.
|
9
9
|
require_paths:
|