Example #1
0
class Client(object):
    def __init__(self, username, password, tenant_name, auth_url, **kwargs):
        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    **kwargs)

    def generate(self, include_networks, include_instances, include_volumes):
        return self.template_generator.generate(include_networks,
                                                include_instances,
                                                include_volumes)
Example #2
0
class Client(object):
    def __init__(self, username, password, tenant_name, auth_url, auth_token,
                 **kwargs):
        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    auth_token,
                                                    **kwargs)

    def generate(self, exclude_servers, exclude_volumes, exclude_keypairs,
                 generate_stack_data, extract_ports=False,
                 exclude_secgroups=False):
        self.template_generator.extract_vm_details(exclude_servers,
                                                   exclude_volumes,
                                                   exclude_keypairs,
                                                   generate_stack_data,
                                                   extract_ports,
                                                   exclude_secgroups
                                                   )
        self.template_generator.extract_data()
        return self.template_generator.heat_template_and_data()
Example #3
0
    def __init__(self, api_version, **kwargs):

        username = kwargs.get('username')
        password = kwargs.get('password')
        tenant_name = kwargs.get('tenant_name')
        auth_url = kwargs.get('auth_url')

        insecure = kwargs.get('insecure')
        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    insecure)
Example #4
0
class Client(object):
    def __init__(self, api_version, **kwargs):

        username = kwargs.get('username')
        password = kwargs.get('password')
        tenant_name = kwargs.get('tenant_name')
        tenant_id = kwargs.get('tenant_id')
        auth_url = kwargs.get('auth_url')
        insecure = kwargs.get('insecure')
        nova = kwargs.get('nova')
        neutron = kwargs.get('neutron')
        cinder = kwargs.get('cinder')

        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    insecure)
        if nova:
            self.template_generator.nova.set_client(nova)
        if neutron and tenant_id:
            self.template_generator.neutron.set_client(neutron)
            self.template_generator.neutron.set_project_id(tenant_id)
        if cinder:
            self.template_generator.cinder.set_client(cinder)

    def generate_template(self, include_instances, include_volumes,
                          include_data_file):
        self.template_generator.extract_vm_details(
            exclude_servers=not include_instances,
            exclude_volumes=not include_volumes,
            generate_data=include_data_file)
        self.template_generator.extract_data()
        flame_stream = self.template_generator.heat_template()
        data_stream = self.template_generator.stack_data_template()

        return (flame_stream, data_stream)
Example #5
0
    def __init__(self, api_version, **kwargs):

        username = kwargs.get('username')
        password = kwargs.get('password')
        tenant_name = kwargs.get('tenant_name')
        tenant_id = kwargs.get('tenant_id')
        auth_url = kwargs.get('auth_url')
        insecure = kwargs.get('insecure')
        nova = kwargs.get('nova')
        neutron = kwargs.get('neutron')
        cinder = kwargs.get('cinder')

        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    insecure)
        if nova:
            self.template_generator.nova.set_client(nova)
        if neutron and tenant_id:
            self.template_generator.neutron.set_client(neutron)
            self.template_generator.neutron.set_project_id(tenant_id)
        if cinder:
            self.template_generator.cinder.set_client(cinder)
Example #6
0
class Client(object):
    def __init__(self, api_version, **kwargs):

        username = kwargs.get('username')
        password = kwargs.get('password')
        tenant_name = kwargs.get('tenant_name')
        auth_url = kwargs.get('auth_url')

        insecure = kwargs.get('insecure')
        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    insecure)

    def generate(self, include_networks, include_instances, include_volumes):
        return self.template_generator.generate(include_networks,
                                                include_instances,
                                                include_volumes)
Example #7
0
    def __init__(self, api_version, **kwargs):

        username = kwargs.get('username')
        password = kwargs.get('password')
        tenant_name = kwargs.get('tenant_name')
        tenant_id = kwargs.get('tenant_id')
        auth_url = kwargs.get('auth_url')
        insecure = kwargs.get('insecure')
        nova = kwargs.get('nova')
        neutron = kwargs.get('neutron')
        cinder = kwargs.get('cinder')

        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    insecure)
        if nova:
            self.template_generator.nova.set_client(nova)
        if neutron and tenant_id:
            self.template_generator.neutron.set_client(neutron)
            self.template_generator.neutron.set_project_id(tenant_id)
        if cinder:
            self.template_generator.cinder.set_client(cinder)
Example #8
0
class Client(object):
    def __init__(self, username, password, tenant_name, auth_url, auth_token,
                 **kwargs):
        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    auth_token, **kwargs)

    def generate(self, exclude_servers, exclude_volumes, exclude_keypairs,
                 generate_stack_data):
        self.template_generator.extract_vm_details(exclude_servers,
                                                   exclude_volumes,
                                                   exclude_keypairs,
                                                   generate_stack_data)
        self.template_generator.extract_data()
        heat_template = self.template_generator.heat_template()
        if generate_stack_data:
            stack_data = self.template_generator.stack_data_template()
        else:
            stack_data = None
        return (heat_template, stack_data)
Example #9
0
class Client(object):
    def __init__(self, api_version, **kwargs):

        username = kwargs.get('username')
        password = kwargs.get('password')
        tenant_name = kwargs.get('tenant_name')
        tenant_id = kwargs.get('tenant_id')
        auth_url = kwargs.get('auth_url')
        insecure = kwargs.get('insecure')
        nova = kwargs.get('nova')
        neutron = kwargs.get('neutron')
        cinder = kwargs.get('cinder')

        self.template_generator = TemplateGenerator(username, password,
                                                    tenant_name, auth_url,
                                                    insecure)
        if nova:
            self.template_generator.nova.set_client(nova)
        if neutron and tenant_id:
            self.template_generator.neutron.set_client(neutron)
            self.template_generator.neutron.set_project_id(tenant_id)
        if cinder:
            self.template_generator.cinder.set_client(cinder)


    def generate_template(self, include_instances, include_volumes,
                          include_data_file):
        self.template_generator.extract_vm_details(
            exclude_servers=not include_instances,
            exclude_volumes=not include_volumes,
            generate_data=include_data_file)
        self.template_generator.extract_data()
        flame_stream = self.template_generator.heat_template()
        data_stream = self.template_generator.stack_data_template()

        return (flame_stream,  data_stream)
Example #10
0
 def __init__(self, username, password, tenant_name, auth_url, auth_token,
              **kwargs):
     self.template_generator = TemplateGenerator(username, password,
                                                 tenant_name, auth_url,
                                                 auth_token,
                                                 **kwargs)
Example #11
0
 def __init__(self, username, password, tenant_name, auth_url, **kwargs):
     self.template_generator = TemplateGenerator(username, password,
                                                 tenant_name, auth_url,
                                                 **kwargs)