right-scale-api 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.
- data/README.md +24 -2
- data/VERSION +1 -1
- data/lib/right-scale-api/account.rb +1 -0
- data/lib/right-scale-api/client.rb +1 -1
- data/lib/right-scale-api/ec2_elastic_ip.rb +1 -0
- data/right-scale-api.gemspec +2 -2
- metadata +3 -3
data/README.md
CHANGED
@@ -8,10 +8,32 @@ RightScale's [API Docs]("http://support.rightscale.com/15-References/RightScale_
|
|
8
8
|
Usage Examples
|
9
9
|
----------------------
|
10
10
|
|
11
|
+
###Stopping a Server
|
11
12
|
RightScaleAPI.login user, pass
|
13
|
+
account = RightScaleAPI::Account.get id
|
14
|
+
foo_server = account.servers.find {|s| s.nickname == 'foo'}
|
15
|
+
foo_server.stop
|
12
16
|
|
17
|
+
### Spinning up a new server with an elastic ip associated at launch
|
18
|
+
RightScaleAPI.login user, pass
|
13
19
|
account = RightScaleAPI::Account.get id
|
20
|
+
|
21
|
+
ip = account.create_ec2_elastic_ip :nickname => 'foo'
|
14
22
|
|
15
|
-
|
23
|
+
foo_template = account.server_templates.find {|s| s.nickname == 'foo template'}
|
24
|
+
foo_deployment = account.deployments.find {|d| d.nickname == 'foo deployment'}
|
25
|
+
foo_security_group = account.ec2_security_groups.find { |s| s.aws_group_name == 'foo security group' }
|
26
|
+
|
27
|
+
#since there is no index for ssh keys, you need to find their id through the UI and get them directly(ugh).
|
28
|
+
foo_ssh_key = account.get_ec2_ssh_key("1234567890")
|
29
|
+
|
30
|
+
server = account.create_server :nickname => 'foo',
|
31
|
+
:server_template => foo_template,
|
32
|
+
:deployment => foo_deployment,
|
33
|
+
:ec2_ssh_key => foo_ssh_key,
|
34
|
+
:ec2_security_groups => foo_security_group
|
16
35
|
|
17
|
-
|
36
|
+
#we do this as an update, because rightscale's api doesn't let you set this on create (as of May 2010)
|
37
|
+
server.update :associate_eip_at_launch => true,
|
38
|
+
:ec2_elastic_ip => ip
|
39
|
+
server.start
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/right-scale-api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{right-scale-api}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nick Howard"]
|
12
|
-
s.date = %q{2010-05-
|
12
|
+
s.date = %q{2010-05-21}
|
13
13
|
s.description = %q{A client for the RightScale API that hides some of the complexity of the API
|
14
14
|
(It doesn't require passing around hrefs as much). Based on HTTParty
|
15
15
|
}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nick Howard
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-21 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|