本文整理汇总了Python中boto.cloudfront.CloudFrontConnection.get_all_distributions方法的典型用法代码示例。如果您正苦于以下问题:Python CloudFrontConnection.get_all_distributions方法的具体用法?Python CloudFrontConnection.get_all_distributions怎么用?Python CloudFrontConnection.get_all_distributions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boto.cloudfront.CloudFrontConnection
的用法示例。
在下文中一共展示了CloudFrontConnection.get_all_distributions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AwsCloudFrontTools
# 需要导入模块: from boto.cloudfront import CloudFrontConnection [as 别名]
# 或者: from boto.cloudfront.CloudFrontConnection import get_all_distributions [as 别名]
class AwsCloudFrontTools(object):
''' Aws CloudFront Tools
:param str aws_access_key_id: aws_access_key_id
:param str aws_secret_access_key: aws_secret_access_key
'''
def __init__(self, aws_access_key_id, aws_secret_access_key):
self.conn = CloudFrontConnection(aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key)
def get_all_distributions(self, fields=['id', 'cnames', 'domain_name',
'origin']):
''' Get all distributions
:param list fields: Get distributions info fields.
:rtype: dict in list
.. todo::
- Add show all distributions data.
'''
result = []
for target in self.conn.get_all_distributions():
result.append({key: getattr(target, key) for key in fields})
return result