right-scale-api 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
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
- foo_server = account.servers.find {|s| s.nickname == 'foo'}
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
- foo_server.stop
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.2
1
+ 0.0.3
@@ -18,6 +18,7 @@ module RightScaleAPI
18
18
  sub_resources :alert_specs,
19
19
  :deployments,
20
20
  :ec2_ebs_volumes,
21
+ :ec2_ebs_snapshots,
21
22
  :ec2_elastic_ips,
22
23
  :ec2_security_groups,
23
24
  :server_templates,
@@ -1,5 +1,5 @@
1
1
  module RightScaleAPI
2
- class RightScaleAPI::Client
2
+ class Client
3
3
  include HTTParty
4
4
 
5
5
  base_uri BASE_URI
@@ -5,6 +5,7 @@ module RightScaleAPI
5
5
  public_ip
6
6
  cloud_id
7
7
  server_href
8
+ instance_href
8
9
  )
9
10
  end
10
11
  end
@@ -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.2"
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-10}
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
- - 2
9
- version: 0.0.2
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-10 00:00:00 -06:00
17
+ date: 2010-05-21 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency