我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用boto.ec2.attach_volume()。
def attach(self, server=None): if self.attachment_state == 'attached': print('already attached') return None if server: self.server = server self.put() ec2 = self.get_ec2_connection() ec2.attach_volume(self.volume_id, self.server.instance_id, self.device)
def attach(self, server=None): if self.attachment_state == 'attached': print 'already attached' return None if server: self.server = server self.put() ec2 = self.get_ec2_connection() ec2.attach_volume(self.volume_id, self.server.instance_id, self.device)