コード例 #1
0
 def __init__(self):
     super(ExtendedServerVIFNetController, self).__init__()
     self.network_api = network.API()
コード例 #2
0
 def __init__(self):
     self.network_api = network.API()
     super(FloatingIPPoolsController, self).__init__()
コード例 #3
0
 def __init__(self):
     self.compute_api = compute.API()
     self.network_api = network.API()
     super(FloatingIPController, self).__init__()
コード例 #4
0
def get_metadata_by_address(address):
    ctxt = context.get_admin_context()
    fixed_ip = network.API().get_fixed_ip_by_address(ctxt, address)

    instance = db.instance_get_by_uuid(ctxt, fixed_ip['instance_uuid'])
    return InstanceMetadata(instance, address)
コード例 #5
0
 def __init__(self):
     self.compute_api = compute.API(skip_policy_check=True)
     self.network_api = network.API(skip_policy_check=True)
     super(ServerVirtualInterfaceController, self).__init__()
コード例 #6
0
ファイル: network_qos.py プロジェクト: bopopescu/nova-old
 def __init__(self):
     self.compute_api = compute.API()
     self.network_api = network.API()
     super(NetworkQosController, self).__init__()
コード例 #7
0
 def __init__(self):
     super(FloatingIPDNSDomainController, self).__init__()
     self.network_api = network.API()
コード例 #8
0
 def __init__(self):
     self.network_api = network.API()
     super(ServerVirtualInterfaceController, self).__init__()
コード例 #9
0
ファイル: shelve.py プロジェクト: Aman306/nova
 def __init__(self, *args, **kwargs):
     super(ShelveController, self).__init__(*args, **kwargs)
     self.compute_api = compute.API()
     self.network_api = network.API()
コード例 #10
0
 def __init__(self, network_api=None):
     self.network_api = network_api or network.API()
コード例 #11
0
 def __init__(self, *args, **kwargs):
     super(MigrateServerController, self).__init__(*args, **kwargs)
     self.compute_api = compute.API()
     self.network_api = network.API()
コード例 #12
0
 def __init__(self, ext_mgr):
     self.network_api = network.API()
     super(Floating_ip_dns, self).__init__(ext_mgr)
コード例 #13
0
 def __init__(self, ext_mgr):
     self.compute_api = compute.API()
     self.network_api = network.API()
     super(Floating_ips, self).__init__(ext_mgr)
コード例 #14
0
ファイル: base.py プロジェクト: zsharique/nova
def get_metadata_by_address(address):
    ctxt = context.get_admin_context()
    fixed_ip = network.API().get_fixed_ip_by_address(ctxt, address)

    return get_metadata_by_instance_id(fixed_ip['instance_uuid'], address,
                                       ctxt)
コード例 #15
0
ファイル: volume_driver.py プロジェクト: zhichangwu/icehouse
def _get_fixed_ips(instance):
    context = nova_context.get_admin_context()
    nw_info = network.API().get_instance_nw_info(context, instance)
    ips = nw_info.fixed_ips()
    return ips
コード例 #16
0
 def setUp(self):
     super(ApiTestCase, self).setUp()
     self.flags(use_neutron=False)
     self.network_api = network.API()
     self.context = context.RequestContext('fake-user',
                                           fakes.FAKE_PROJECT_ID)
コード例 #17
0
 def __init__(self, *args, **kwargs):
     super(FloatingIPActionController, self).__init__(*args, **kwargs)
     self.compute_api = compute.API(skip_policy_check=True)
     self.network_api = network.API(skip_policy_check=True)
コード例 #18
0
 def __init__(self):
     self.compute_api = compute.API(skip_policy_check=True)
     self.network_api = network.API(skip_policy_check=True)
     self.cloudpipe = pipelib.CloudPipe(skip_policy_check=True)
     self.setup()
コード例 #19
0
 def __init__(self):
     self.compute_api = compute.API(skip_policy_check=True)
     self.network_api = network.API(skip_policy_check=True)
     super(FloatingIPController, self).__init__()
コード例 #20
0
ファイル: cloudpipe.py プロジェクト: mba811/nova
 def __init__(self):
     self.compute_api = compute.API()
     self.network_api = network.API()
     self.cloudpipe = pipelib.CloudPipe()
     self.setup()
コード例 #21
0
 def __init__(self):
     super(FloatingIPDNSDomainController, self).__init__()
     self.network_api = network.API(skip_policy_check=True)
コード例 #22
0
 def __init__(self, ext_mgr=None, *args, **kwargs):
     super(FloatingIPActionController, self).__init__(*args, **kwargs)
     self.compute_api = compute.API()
     self.network_api = network.API()
     self.ext_mgr = ext_mgr
コード例 #23
0
ファイル: test_api.py プロジェクト: blahRus/nova
 def setUp(self):
     super(ApiTestCase, self).setUp()
     self.network_api = network.API()
     self.context = context.RequestContext('fake-user',
                                           'fake-project')
コード例 #24
0
 def __init__(self, network_api=None):
     self.network_api = network_api or network.API(skip_policy_check=True)
コード例 #25
0
 def __init__(self):
     self.compute_api = compute.API()
     self.network_api = network.API()
     super(InterfaceAttachmentController, self).__init__()
コード例 #26
0
    def __init__(self, instance, address=None, content=[], extra_md=None):
        """Creation of this object should basically cover all time consuming
        collection.  Methods after that should not cause time delays due to
        network operations or lengthy cpu operations.

        The user should then get a single instance and make multiple method
        calls on it.
        """

        self.instance = instance
        self.extra_md = extra_md

        ctxt = context.get_admin_context()

        services = db.service_get_all_by_host(ctxt.elevated(),
                                              instance['host'])
        self.availability_zone = ec2utils.get_availability_zone_by_host(
            services, instance['host'])

        self.ip_info = ec2utils.get_ip_info_for_instance(ctxt, instance)

        self.security_groups = db.security_group_get_by_instance(
            ctxt, instance['id'])

        self.mappings = _format_instance_mapping(ctxt, instance)

        if instance.get('user_data', None) is not None:
            self.userdata_raw = base64.b64decode(instance['user_data'])
        else:
            self.userdata_raw = None

        self.ec2_ids = {}

        self.ec2_ids['instance-id'] = ec2utils.id_to_ec2_inst_id(
            instance['id'])
        self.ec2_ids['ami-id'] = ec2utils.glance_id_to_ec2_id(
            ctxt, instance['image_ref'])

        for image_type in ['kernel', 'ramdisk']:
            if self.instance.get('%s_id' % image_type):
                image_id = self.instance['%s_id' % image_type]
                ec2_image_type = ec2utils.image_type(image_type)
                ec2_id = ec2utils.glance_id_to_ec2_id(ctxt, image_id,
                                                      ec2_image_type)
                self.ec2_ids['%s-id' % image_type] = ec2_id

        self.address = address

        # expose instance metadata.
        self.launch_metadata = {}
        for item in instance.get('metadata', []):
            self.launch_metadata[item['key']] = item['value']

        self.uuid = instance.get('uuid')

        self.content = {}
        self.files = []

        # get network info, and the rendered network template
        ctxt = context.get_admin_context()
        network_info = network.API().get_instance_nw_info(ctxt, instance)

        self.network_config = None
        cfg = netutils.get_injected_network_template(network_info)

        if cfg:
            key = "%04i" % len(self.content)
            self.content[key] = cfg
            self.network_config = {
                "name": "network_config",
                'content_path': "/%s/%s" % (CONTENT_DIR, key)
            }

        # 'content' is passed in from the configdrive code in
        # nova/virt/libvirt/driver.py.  Thats how we get the injected files
        # (personalities) in. AFAIK they're not stored in the db at all,
        # so are not available later (web service metadata time).
        for (path, contents) in content:
            key = "%04i" % len(self.content)
            self.files.append({
                'path': path,
                'content_path': "/%s/%s" % (CONTENT_DIR, key)
            })
            self.content[key] = contents
コード例 #27
0
 def __init__(self):
     self.network_api = network.API()
     self.cert_rpcapi = nova.cert.rpcapi.CertAPI()
     super(CertificatesController, self).__init__()