Adding describe table end point

This commit is contained in:
zmsmith 2013-02-19 20:39:04 -05:00
commit 7e3aa7c8ee
4 changed files with 99 additions and 3 deletions

View file

@ -1,5 +1,6 @@
import re
import json
from .models import dynamodb_backend
@ -28,6 +29,11 @@ class DynamoHandler(object):
response = {"TableNames": tables}
return json.dumps(response)
def DescribeTable(self, uri, body, headers):
name = json.loads(body)['TableName']
table = dynamodb_backend.tables[name]
return json.dumps(table.describe)
def handler(uri, body, headers):
return DynamoHandler(uri, body, headers).dispatch()