forked from zambon/RightAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
31 lines (21 loc) · 1.08 KB
/
README
File metadata and controls
31 lines (21 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
RightAPI.rb
===========
A generic API wrapper to interface with the RightScale Cloud Computing API.
You need to handle formatting the API string properly with object ID's & the proper resource but it should do the rest.
Requires rest_client Ruby gem available online. 'gem install rest-client'
More details on the API calls can be found at:
http://support.rightscale.com/15-References/RightScale_API_Reference_Guide
api = RightAPI.new
api.log = true
api.login(username, password, account)
Allows you to send API messages to RightScale in a standard format (see API reference)
http://support.rightscale.com/15-References/RightScale_API_Reference_Guide
api.send(API_STRING,REST_TYPE, PARAMS)
# e.g. API_STRING = "ec2_ssh_keys/1234"
# REST_TYPE = GET | PUT | POST | DELETE
# PARAMS = optional depending on call
# Displays list of servers in XML format.
puts api.send("servers")
# Create new deployment with the following parameters
params = { 'deployment[nickname]' => 'my_deployment_name', 'deployment[description]' => 'my_description' }
api.send("deployments","post",params)