Windows Azure Automation and Dev/Test for the Enterprise - RightScale Compute 2013
RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013
-
Upload
rightscale -
Category
Technology
-
view
604 -
download
0
Transcript of RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013
april25-26 sanfrancisco
cloud success starts here
How to Build Your Own IT Vending MachineRyan J. Geyer, Cloud Solutions Engineer -
@rjgeyer
# 2# 2
#RightscaleCompute
Agenda• RightScale API is Powerful• RightScale API is Simple• Vending Machine Demo
#RightscaleCompute
# 3# 3
RightScale API is Powerful and SimplePowerful
# 4# 4
#RightscaleCompute
RightScale API is Powerful
# 5# 5
#RightscaleCompute
About the MultiCloud API
• RESTful: Resource URLs, HTTP Verbs, Error Codes, …
• Versioned: 1.5+ is our MultiCloud API
• Supports JSON and XML Response Formats• Flexible Authorization: Account (user/pass, OAuth2) or from Instance
(token)
• Simple resource queries through filters• Customer control of detail level through views• MediaTypes support and annotated responses• Extensive documentation, examples, and a Ruby client
A Common Programmatic Interface Across Multiple Clouds
# 6# 6
#RightscaleCompute
MediaTypes and Annotated Responses• Each Resource has an associated MediaType that
includes:• Attributes• Links (navigation hrefs to related resources)• Actions (possible actions to perform to the specific resource)
• Example response for an instance resource (simplified):Content-Type: application/vnd.rightscale.instance
<instance> <name>name_361342744</name> <state>operational</state> <links> <link rel="self” href="/api/clouds/479517647/instances/ABC2383349127DEF”/> <link rel="deployment” href="/api/deployments/1181”/> <link rel="server_template” href="/api/server_templates/1223”/> </links> <actions> <action rel="terminate"/> <action rel="run_executable"/> </actions></instance>
# 7# 7
#RightscaleCompute
Example from the RightScale Ops Team
POST /api/tags/by_tag (resource_type=instances,tags=[svc:app=true])
foreach instance_href as i {POST {i}/run_executable
(recipe_name=pull_code) // get 202 & task-id
do GET /…/task/{task-id}until(status == completed)
POST {i}/run_executable (recipe_name=web_restart)}
Get all servers by app tag
For each Server in result
Get new code
Wait for code to download
Restart Web server
•Rolling upgrade of your app servers:
#RightscaleCompute
# 8# 8
RightScale API is Powerful and Simple
Simple
# 9# 9
#RightscaleCompute
Simple
# 10# 10
#RightscaleCompute
Ruby Library• Handles authentication• Simple access to MediaType actions & References• http://bit.ly/15LyfQi
# 11# 11
#RightscaleCompute
Well Documented
#RightscaleCompute
# 12# 12
RightScale API is Powerful and Simple
Demo
# 13# 13
#RightscaleCompute
Vending Machine
# 14# 14
#RightscaleCompute
Summary• RightScale API is Powerful
• RESTful• JSON or XML• Descriptive MediaTypes
• RightScale API is Simple• Documented• API Libraries
• Vending Machine• Example of what you can do with the API
# 15# 15
#RightscaleCompute
What Now?• Think about business problems you can automate with
the API• Try out the Vending Machine or use it as an example for
your own• Ask me questions
• Email: [email protected]• Twitter: @rjgeyer
april25-26 sanfrancisco
cloud success starts here
Questions?