Skip to content

Commit

Permalink
Merge branch 'gh-pages' of https://github.com/iron-io/docs into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Paddy Foran committed Dec 29, 2012
2 parents 5ac77a1 + 9d586eb commit 7455ff1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
24 changes: 24 additions & 0 deletions cache/reference/api/index.md
Expand Up @@ -20,6 +20,7 @@ IronCache provides a REST/HTTP API to allow you to interact programmatically wit
<tbody>
<tr><td>/projects/<span class="project_id variable">{Project ID}</span>/caches</td><td>GET</td><td><a href="#list_caches" title="List Caches">List Caches</a></td></tr>
<tr><td>/projects/<span class="project_id variable">{Project ID}</span>/caches/<span class="cache_name variable">{Cache Name}</span></td><td>GET</td><td><a href="#get_info_about_a_cache" title="Get Info About a Cache">Get Info About a Cache</a></td></tr>
<tr><td>/projects/<span class="project_id variable">{Project ID}</span>/caches/<span class="cache_name variable">{Cache Name}</span></td><td>DELETE</td><td><a href="#delete_a_cache" title="Delete a Cache">Delete a Cache</a></td></tr>
<tr><td>/projects/<span class="project_id variable">{Project ID}</span>/caches/<span class="cache_name variable">{Cache Name}</span>/clear</td><td>POST</td><td><a href="#clear_a_cache" title="Clear a Cache">Clear a Cache</a></td></tr>
<tr><td>/projects/<span class="project_id variable">{Project ID}</span>/caches/<span class="cache_name variable">{Cache Name}</span>/items/<span class="item_key variable">{Key}</span></td><td>PUT</td><td><a href="#add_an_item_to_a_cache" title="Add an Item to a Cache">Add an Item to a Cache</a></td></tr>
<tr><td>/projects/<span class="project_id variable">{Project ID}</span>/caches/<span class="cache_name variable">{Cache Name}</span>/items/<span class="item_key variable">{Key}</span>/increment</td><td>POST</td><td><a href="#increment_an_items_value" title="Increment an Item's value">Increment an Item's value</a></td></tr>
Expand Down Expand Up @@ -190,6 +191,29 @@ GET /projects/<span class="variable project_id">{Project ID}</span>/caches/<span
}
{% endhighlight %}

## Delete a Cache

Delete a cache and all items in it.

### Endpoint

<div class="grey-box">
DELETE /projects/<span class="variable project_id">{Project ID}</span>/caches/<span class="variable cache_name">{Cache Name}</span>
</div>

#### URL Parameters

* **Project ID**: Project the cache belongs to
* **Cache Name**: The name of the cache

### Response

{% highlight js %}
{
"msg": "Deleted."
}
{% endhighlight %}

## Clear a Cache

Delete all items in a cache. This cannot be undone.
Expand Down
14 changes: 7 additions & 7 deletions worker/languages/python/index.md
Expand Up @@ -64,18 +64,18 @@ parse it as JSON.

In your worker:
{% highlight python %}
payload = None
import sys, json

payload_file = None
payload = None

for i in range(len(sys.argv)):
if sys.argv[i] == "-payload" and (i + 1) < len(sys.argv):
payload_file = sys.argv[i]
payload_file = sys.argv[i + 1]
with open(payload_file,'r') as f:
payload = json.loads(f.read())
break

f = open(payload_file, "r")
contents = f.read()
f.close()

payload = json.loads(contents)
{% endhighlight %}

### Environment
Expand Down

0 comments on commit 7455ff1

Please sign in to comment.