Cloud API: RESTful Web Services<br />REST = Representational State Transfer<br />Conforming to the REST constraints is often referred to as being ‘RESTful’<br />Roy Fielding Doctoral Dissertation “Roy Fielding "Architectural Styles and the Design of Network-based Software Architectures” year 2000 http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm<br />“Adddressability is the idea that every object and resource in your system is reachable through a unique identifier……..URIs”<br />Scheme://host:port/path?queryString#fragment<br />http://example.com/customers?lastName=Burke&zipcode=02115<br />With REST over HTTP you do not have to worry about vendor interoperability you can focus on understanding the data format of the server and application interoperability . …. Bill Burke <br />
Cloud API: CURL<br />REST-esting with cURL<br />curl -i -H "Accept: application/json" -X POST -d "firstName=james" http://192.168.0.165/persons/person<br />Where<br />i – show response headers<br />H – pass request headers to the resource<br />X – pass a HTTP method name<br />d – pass in parameters enclosed in quotes; multiple parameters are separated by ‘&’The above command posts the first name “james” to the persons resource. Assuming the server creates a new person resource with first name of James, I also tell the server to return a json representation of the newly created resource.<br />Good Examples http://blogs.plexibus.com/2009/01/15/rest-esting-with-curl/<br />
Cloud API - API Authentication<br />Figure on page 7: API Authentication from Cloud Servers Developer Guide 10/15/09<br />GET /v1.0 HTTP/1.1<br />Host: auth.api.rackspacecloud.com<br />X-Auth-User: jdoe<br />X-Auth-Key: a86850deb2742ec3cb41518e26aa2d89 <br />Curl implementation of the above Authentication Request<br />curl -i -H "X-Auth-Key: a86850deb2742ec3cb41518e26aa2d89 " -H "X-Auth-User: jdoe" https://auth.api.rackspacecloud.com/v1.0<br />Rackspace Response<br />HTTP/1.1 204 No Content<br />Date: Sat, 27 Feb 2010 06:28:49 GMT<br />Server: Apache/2.2.3 (Mosso Engineering)<br />X-Storage-Token: 6ce9397a-4164-44ba-bbd4-e1b6c9a6abc1<br />X-Storage-Url: https://storage5.clouddrive.com/v1/MossoCloudFS_8c1e3b35-d250-4a6d-aa5a-35399b039b1d<br />X-Server-Management-Url: https://servers.api.rackspacecloud.com/v1.0/437001<br />X-CDN-Management-Url: https://cdn.clouddrive.com/v1/MossoCloudFS_8c1e3b35-d250-4a6d-aa5a-35399b039b1d<br />X-Auth-Token: 6ce9397a-4164-44ba-bbd4-e1b6c9a6abc1<br />Content-Length: 0<br />Connection: close<br />Content-Type: application/octet-stream<br />
References<br />http://www.productionscale.com/home/2009/8/2/using-curl-to-access-the-rackspace-cloud-api.html<br />http://blogs.plexibus.com/2009/01/15/rest-esting-with-curl/<br />http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm<br />https://manage.rackspacecloud.com/APIAccess.do<br />http://en.wikipedia.org/wiki/REST<br />http://oreilly.com/catalog/9780596529260/<br />http://www.oreillynet.com/pub/wlg/3005<br />http://15timez.blogspot.com/2010/03/virtual-world-therecom-to-close.html<br />I was recently talking with Jeff Barr, creator of syndic8 and now Amazon's chief web services evangelist. <br />He let drop an interesting tidbit. Amazon has both SOAP and REST interfaces to their web services, and <br />85% of their usage is of the REST interface. Despite all of the corporate hype over the SOAP stack, this is <br />pretty compelling evidence that developers like the simpler REST approach. <br />(I know there are many more complex applications where SOAP is better, but I've always liked <br />technologies that have low barriers to entry and grassroots adoption, and simple XML over HTTP <br />approach seems to have that winning combination.) ….. REST vs. SOAP Tim O’Reilly Apr 03, 2003<br />With REST over HTTP you do not have to worry about vendor interoperability you can focus on understanding the data format of the server and application interoperability . …. Bill Burke <br />
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.