Пример #1
0
    def __init__(self,
                 access_key=None,
                 allow_copy=False,
                 image_id=None,
                 image_name=None,
                 image_name_fragment=None,
                 image_name_match=None,
                 secret_key=None,
                 verbose=None,
                 visibility='all'):
        EC2Utils.__init__(self)

        self.access_key = access_key
        self.allow_copy = allow_copy
        self.image_id = image_id
        self.image_name = image_name
        self.image_name_fragment = image_name_fragment
        self.image_name_match = image_name_match
        self.secret_key = secret_key
        self.verbose = verbose
        self.visibility = visibility

        if self.visibility == 'all':
            self.publish_msg = '\tPublished: %s\t\t%s'
        elif self.visibility == 'none':
            self.publish_msg = '\tSet to private: %s\t\t%s'
        else:
            self.publish_msg = '\tShared: %s\t\t%s\t with: %s'
Пример #2
0
    def __init__(self, access_key, region, secret_key, session_token, verbose):
        EC2Utils.__init__(self)
        self.access_key = access_key
        self.region = region
        self.secret_key = secret_key
        self.session_token = session_token
        self.verbose = verbose

        self.internet_gateway_id = ''
        self.key_pair_name = ''
        self.route_table_id = ''
        self.security_group_id = ''
        self.ssh_private_key_file = ''
        self.temp_dir = ''
        self.vpc_subnet_id = ''
        self.vpc_id = ''
Пример #3
0
    def __init__(self,
                 access_key=None,
                 deprecation_period=6,
                 deprecation_image_id=None,
                 deprecation_image_name=None,
                 deprecation_image_name_fragment=None,
                 deprecation_image_name_match=None,
                 force=None,
                 image_virt_type=None,
                 public_only=None,
                 replacement_image_id=None,
                 replacement_image_name=None,
                 replacement_image_name_fragment=None,
                 replacement_image_name_match=None,
                 secret_key=None,
                 verbose=None):
        EC2Utils.__init__(self)

        self.access_key = access_key
        self.deprecation_period = deprecation_period
        self.deprecation_image_id = deprecation_image_id
        self.deprecation_image_name = deprecation_image_name
        self.deprecation_image_name_fragment = deprecation_image_name_fragment
        self.deprecation_image_name_match = deprecation_image_name_match
        self.force = force
        self.image_virt_type = image_virt_type
        self.public_only = public_only
        self.replacement_image_id = replacement_image_id
        self.replacement_image_name = replacement_image_name
        self.replacement_image_name_fragment = replacement_image_name_fragment
        self.replacement_image_name_match = replacement_image_name_match
        self.secret_key = secret_key
        self.verbose = verbose

        self._set_deprecation_date()
        self._set_deletion_date()

        self.replacement_image_tag = None
Пример #4
0
    def __init__(self,
                 access_key=None,
                 backing_store='ssd',
                 billing_codes=None,
                 bootkernel=None,
                 config=None,
                 ena_support=False,
                 image_arch='x86_64',
                 image_description='AWS EC2 AMI',
                 image_name='default',
                 image_virt_type='hvm',
                 inst_user_name=None,
                 launch_ami=None,
                 launch_inst_type='m1.small',
                 region=None,
                 root_volume_size=10,
                 running_id=None,
                 secret_key=None,
                 security_group_ids='',
                 session_token=None,
                 sriov_type=None,
                 ssh_key_pair_name=None,
                 ssh_key_private_key_file=None,
                 ssh_timeout=300,
                 use_grub2=False,
                 use_private_ip=False,
                 verbose=None,
                 vpc_subnet_id='',
                 wait_count=1):
        EC2Utils.__init__(self)

        self.access_key = access_key
        self.backing_store = backing_store
        self.billing_codes = billing_codes
        self.bootkernel = bootkernel
        self.ena_support = ena_support
        self.image_arch = image_arch
        self.image_description = image_description
        self.image_name = image_name
        self.image_virt_type = image_virt_type
        self.inst_user_name = inst_user_name
        self.launch_ami_id = launch_ami
        self.launch_ins_type = launch_inst_type
        self.region = region
        self.root_volume_size = int(root_volume_size)
        self.running_id = running_id
        self.secret_key = secret_key
        self.security_group_ids = security_group_ids
        self.session_token = session_token
        self.sriov_type = sriov_type
        self.ssh_key_pair_name = ssh_key_pair_name
        self.ssh_key_private_key_file = ssh_key_private_key_file
        self.ssh_timeout = ssh_timeout
        self.use_grub2 = use_grub2
        self.use_private_ip = use_private_ip
        self.verbose = verbose
        self.vpc_subnet_id = vpc_subnet_id
        self.wait_count = wait_count

        self.created_volumes = []
        self.default_sleep = 10
        self.device_ids = ['f', 'g', 'h', 'i', 'j']
        self.instance_ids = []
        self.next_device_id = 0
        self.operation_complete = False
        self.percent_transferred = 0
        self.ssh_client = None
        self.storage_volume_size = 2 * self.root_volume_size