DynamoDB - Describe Endpoints (#3716)
This commit is contained in:
parent
cc50acc8b5
commit
a6606cbf42
@ -1085,6 +1085,14 @@ class DynamoDBBackend(BaseBackend):
|
|||||||
def delete_table(self, name):
|
def delete_table(self, name):
|
||||||
return self.tables.pop(name, None)
|
return self.tables.pop(name, None)
|
||||||
|
|
||||||
|
def describe_endpoints(self):
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"Address": "dynamodb.{}.amazonaws.com".format(self.region_name),
|
||||||
|
"CachePeriodInMinutes": 1440,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
def tag_resource(self, table_arn, tags):
|
def tag_resource(self, table_arn, tags):
|
||||||
for table in self.tables:
|
for table in self.tables:
|
||||||
if self.tables[table].table_arn == table_arn:
|
if self.tables[table].table_arn == table_arn:
|
||||||
|
@ -190,6 +190,10 @@ class DynamoHandler(BaseResponse):
|
|||||||
er = "com.amazonaws.dynamodb.v20111205#ResourceNotFoundException"
|
er = "com.amazonaws.dynamodb.v20111205#ResourceNotFoundException"
|
||||||
return self.error(er, "Requested resource not found")
|
return self.error(er, "Requested resource not found")
|
||||||
|
|
||||||
|
def describe_endpoints(self):
|
||||||
|
response = {"Endpoints": self.dynamodb_backend.describe_endpoints()}
|
||||||
|
return dynamo_json_dump(response)
|
||||||
|
|
||||||
def tag_resource(self):
|
def tag_resource(self):
|
||||||
table_arn = self.body["ResourceArn"]
|
table_arn = self.body["ResourceArn"]
|
||||||
tags = self.body["Tags"]
|
tags = self.body["Tags"]
|
||||||
|
@ -6202,3 +6202,18 @@ def test_source_and_restored_table_items_are_not_linked():
|
|||||||
set(restored_table_guids).should.equal(
|
set(restored_table_guids).should.equal(
|
||||||
set(guids_original) | set(guids_added_after_restore)
|
set(guids_original) | set(guids_added_after_restore)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@mock_dynamodb2
|
||||||
|
@pytest.mark.parametrize("region", ["eu-central-1", "ap-south-1"])
|
||||||
|
def test_describe_endpoints(region):
|
||||||
|
client = boto3.client("dynamodb", region)
|
||||||
|
res = client.describe_endpoints()["Endpoints"]
|
||||||
|
res.should.equal(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"Address": "dynamodb.{}.amazonaws.com".format(region),
|
||||||
|
"CachePeriodInMinutes": 1440,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user