Support create_table with PAY_PER_REQUEST billing mode of DynamoDB
This commit is contained in:
parent
4a286c4bc2
commit
b822db8d8c
2 changed files with 37 additions and 2 deletions
|
|
@ -156,8 +156,16 @@ class DynamoHandler(BaseResponse):
|
|||
body = self.body
|
||||
# get the table name
|
||||
table_name = body['TableName']
|
||||
# get the throughput
|
||||
throughput = body["ProvisionedThroughput"]
|
||||
# check billing mode and get the throughput
|
||||
if "BillingMode" in body.keys() and body["BillingMode"] == "PAY_PER_REQUEST":
|
||||
if "ProvisionedThroughput" in body.keys():
|
||||
er = 'com.amazonaws.dynamodb.v20111205#ValidationException'
|
||||
return self.error(er,
|
||||
'ProvisionedThroughput cannot be specified \
|
||||
when BillingMode is PAY_PER_REQUEST')
|
||||
throughput = None
|
||||
else: # Provisioned (default billing mode)
|
||||
throughput = body["ProvisionedThroughput"]
|
||||
# getting the schema
|
||||
key_schema = body['KeySchema']
|
||||
# getting attribute definition
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue