List all primary and secondary Indexes in Amazon DynamoDB for a Table using BOTO-Python

StackOverflow https://stackoverflow.com/questions/23653731

  •  22-07-2023
  •  | 
  •  

문제

I have a table in Amazon DynamoDB. I dont have the schema of the table. So i used 'DescribeTable()' function. It lists me the key schema as

u'KeySchema': 
 {u'RangeKeyElement': 
     {u'AttributeName': u'PUT_TIMESTAMP', 
      u'AttributeType': u'S'}, 
  u'HashKeyElement': 
     {u'AttributeName': u'DATASET_ID', 
      u'AttributeType': u'S'}
 }

Is there anyway i can get the list of secondary indexes related to the table, or check if secondary indexes are present in the table?

도움이 되었습니까?

해결책

Are you using the boto.dynamodb module or boto.dynamodb2? If you are using boto.dynamodb2 it should return all local and global secondary indexes in a call to describe_table(). The boto.dynamodb module is based on an older version of the service API prior to the secondary index features.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top