CloudCache API version 1.0 The CloudCache API is ReSTful and uses OAuth . To test Authentication, you may use: - http-get http://cloudcache.ws/auth
- Headers must include:
- access-key - issued to you when you setup your CloudCache account - may be retrieved at this URL.
- timestamp - must be set to current time using RFC822 format
- signature - HMAC hash of service name ("CloudCache"), operation ("auth"), and timestamp
- If the request is successful, an HTTP "200 OK" response code is returned in the response headers
- If the request fails due to authentication mismatch, an HTTP "401 Unauthorized" is returned in the response headers and a useful error message is provide in the response body
Next you'll want to set a value in CloudCache: - http-put http://cloudcache.ws/<key>
- key cannot be [auth | list | listkeys | myusage | mystats] - for reasons that will become obvious
- Headers must include:
- access-key
- timestamp
- signature - operation="put"
- [Optional] - ttl = number of seconds to keep value in cache - after this many seconds, a get on the key will return 404 Not Found. A 0 (zero) value means no TTL and will live forever, same as not sending a TTL.
- Request body includes the value to be set in CloudCache
- Response for successfully putting data into CloudCache is "202 Accepted"
You may also use POST to set a value in CloudCache: - http-post http://cloudcache.ws/<key>
- Headers must include access-key, timestamp, and signature with operation = "post"
- [Optional] - ttl is headers, as with PUT
- In this case in contrast to PUT, the value to be assigned to the key should be in the DATA section of the request rather than the body. See python example for more information.
To get the value associated with the key just set, use: - http-get http://cloudcache.ws/<key>
- Same headers, except signature is made with operation = "get"
- Responds w/ 200 OK if successful,
- If not found, responds with "404 Not Found"
To get multiple values at the same time: - http-get http://cloudcache.ws/getmulti
- Same headers, except signature is made with operation = "GET"
- Plus extra header "keys"
- keys=<json array of keys>
- Responds w/ 200 OK if successful
- Response format is:
- VALUE <key> <bytes> \r\n
- <data block>\r\n
- VALUE <key> <bytes> \r\n
- <data block>\r\n
- Marc Byrd: END
To delete: - http-delete http://cloudcache.ws/<key>
- Same headers, operation = "delete"
- If there is no such key/val pair, responds with "404 Not Found"
- If there is such a value and it is deleted, responds with "202 Accepted"
Increment counter: - http-post http://cloudcache.ws/<key>/incr
- Same headers, operation = "POST"
- [Optional] Parameters:
- val=<integer value to increment by> - default 1
- [Optional] Headers:
- x-cc-set-if-not-found=<integer value to be set if the increment value does not already exist>
Decrement counter: - http-post http://cloudcache.ws/<key>/decr
- Same headers, operation = "POST"
- [Optional] Parameters:
- val=<integer value to decrement by> - default 1
To flush: - http-get http://cloudcache.ws/flush
- Same headers, operation= "flush"
To list the keys associated with your account: - http-get http://cloudcache.ws/listkeys
- Same headers, operation = "listkeys"
- Returned as json list in http resposne body
To list both keys and values associated with your account: - http-get http://cloudcache.ws/list
- Same headers, operation = "list"
- Returned as json dictionary in http response body
- Suitable for backing up, inspecting, or copying cache contents.
To find out your current usage of CloudCache (in bytes): - http-get http://cloudcache.ws/myusage
- Same headers, operation = "myusage"
- Returns actual bytes currently used - accounts for timeout (ttl)
CloudCache Registration: - Quetzall.com has paired with Amazon DevPay for billing of their services. Register with Amazon at this URL.
- Once you have registered at Amazon, you will get an Activation Key.
- Amazon will direct you to Quetzall registration page or you can use this URL.
- After providing Quetzall with Amazon DevPay Activation Key, email address and password, CloudCache access and secret keys will be emailed to you.
- You can use forgot_password feature at this URL to retrieve any information. Information will be emailed to you if your record exist with Quetzall.
|
|