admin.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:cloud-custodian 作者: capitalone 项目源码 文件源码
def records(account_id):
    """Fetch locks data
    """
    s = boto3.Session()
    table = s.resource('dynamodb').Table('Sphere11.Dev.ResourceLocks')
    results = table.scan()

    for r in results['Items']:
        if 'LockDate' in r:
            r['LockDate'] = datetime.fromtimestamp(r['LockDate'])
        if 'RevisionDate' in r:
            r['RevisionDate'] = datetime.fromtimestamp(r['RevisionDate'])

    print(tabulate.tabulate(
        results['Items'],
        headers="keys",
        tablefmt='fancy_grid'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号