rightscale api: how to build your own it vending machine - rightscale compute 2013
TRANSCRIPT
![Page 1: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/1.jpg)
april25-26 sanfrancisco
cloud success starts here
How to Build Your Own IT Vending MachineRyan J. Geyer, Cloud Solutions Engineer -
@rjgeyer
![Page 2: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/2.jpg)
# 2# 2
#RightscaleCompute
Agenda• RightScale API is Powerful• RightScale API is Simple• Vending Machine Demo
![Page 3: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/3.jpg)
#RightscaleCompute
# 3# 3
RightScale API is Powerful and SimplePowerful
![Page 4: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/4.jpg)
# 4# 4
#RightscaleCompute
RightScale API is Powerful
![Page 5: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/5.jpg)
# 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
![Page 6: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/6.jpg)
# 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>
![Page 7: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/7.jpg)
# 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:
![Page 8: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/8.jpg)
#RightscaleCompute
# 8# 8
RightScale API is Powerful and Simple
Simple
![Page 9: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/9.jpg)
# 9# 9
#RightscaleCompute
Simple
![Page 10: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/10.jpg)
# 10# 10
#RightscaleCompute
Ruby Library• Handles authentication• Simple access to MediaType actions & References• http://bit.ly/15LyfQi
![Page 11: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/11.jpg)
# 11# 11
#RightscaleCompute
Well Documented
![Page 12: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/12.jpg)
#RightscaleCompute
# 12# 12
RightScale API is Powerful and Simple
Demo
![Page 13: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/13.jpg)
# 13# 13
#RightscaleCompute
Vending Machine
![Page 14: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/14.jpg)
# 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
![Page 15: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/15.jpg)
# 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
![Page 16: RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute 2013](https://reader030.vdocuments.mx/reader030/viewer/2022032514/55d536ddbb61eb7b088b463e/html5/thumbnails/16.jpg)
april25-26 sanfrancisco
cloud success starts here
Questions?