volume.py 文件源码

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

项目:learneveryword 作者: karan 项目源码 文件源码
def create_from_volume_id(cls, region_name, volume_id, name):
        vol = None
        ec2 = boto.ec2.connect_to_region(region_name)
        rs = ec2.get_all_volumes([volume_id])
        if len(rs) == 1:
            v = rs[0]
            vol = cls()
            vol.volume_id = v.id
            vol.name = name
            vol.region_name = v.region.name
            vol.zone_name = v.zone
            vol.put()
        return vol
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号