/
usr
/
lib
/
python2.6
/
site-packages
/
novaclient
/
v2
/
/usr/lib/python2.6/site-packages/novaclient/v2
mkdir
upload
Name
Size
Mode
Actions
contrib/
-
0755
rm
agents.py
2240
0644
edit
dl
rm
agents.pyc
2774
0644
edit
dl
rm
aggregates.py
3500
0644
edit
dl
rm
aggregates.pyc
4777
0644
edit
dl
rm
availability_zones.py
1588
0644
edit
dl
rm
availability_zones.pyc
1703
0644
edit
dl
rm
certs.py
1410
0644
edit
dl
rm
certs.pyc
1651
0644
edit
dl
rm
client.py
9859
0644
edit
dl
rm
client.pyc
8652
0644
edit
dl
rm
cloudpipe.py
1906
0644
edit
dl
rm
cloudpipe.pyc
2474
0644
edit
dl
rm
fixed_ips.py
1683
0644
edit
dl
rm
fixed_ips.pyc
2099
0644
edit
dl
rm
flavors.py
6824
0644
edit
dl
rm
flavors.pyc
7623
0644
edit
dl
rm
flavor_access.py
2654
0644
edit
dl
rm
flavor_access.pyc
3257
0644
edit
dl
rm
floating_ips.py
1730
0644
edit
dl
rm
floating_ips.pyc
2222
0644
edit
dl
rm
floating_ips_bulk.py
2108
0644
edit
dl
rm
floating_ips_bulk.pyc
2286
0644
edit
dl
rm
floating_ip_dns.py
4378
0644
edit
dl
rm
floating_ip_dns.pyc
6260
0644
edit
dl
rm
floating_ip_pools.py
1064
0644
edit
dl
rm
floating_ip_pools.pyc
1255
0644
edit
dl
rm
fping.py
1750
0644
edit
dl
rm
fping.pyc
2039
0644
edit
dl
rm
hosts.py
2094
0644
edit
dl
rm
hosts.pyc
3254
0644
edit
dl
rm
hypervisors.py
2826
0644
edit
dl
rm
hypervisors.pyc
4042
0644
edit
dl
rm
images.py
3151
0644
edit
dl
rm
images.pyc
4137
0644
edit
dl
rm
keypairs.py
3497
0644
edit
dl
rm
keypairs.pyc
3944
0644
edit
dl
rm
limits.py
3092
0644
edit
dl
rm
limits.pyc
4311
0644
edit
dl
rm
networks.py
4815
0644
edit
dl
rm
networks.pyc
5836
0644
edit
dl
rm
quotas.py
2264
0644
edit
dl
rm
quotas.pyc
2619
0644
edit
dl
rm
quota_classes.py
1500
0644
edit
dl
rm
quota_classes.pyc
1775
0644
edit
dl
rm
security_groups.py
3000
0644
edit
dl
rm
security_groups.pyc
4121
0644
edit
dl
rm
security_group_default_rules.py
2741
0644
edit
dl
rm
security_group_default_rules.pyc
3326
0644
edit
dl
rm
security_group_rules.py
2681
0644
edit
dl
rm
security_group_rules.pyc
2988
0644
edit
dl
rm
servers.py
45064
0644
edit
dl
rm
servers.pyc
50236
0644
edit
dl
rm
server_groups.py
2060
0644
edit
dl
rm
server_groups.pyc
2811
0644
edit
dl
rm
server_migrations.py
2924
0644
edit
dl
rm
server_migrations.pyc
3332
0644
edit
dl
rm
services.py
3305
0644
edit
dl
rm
services.pyc
4098
0644
edit
dl
rm
shell.py
148685
0644
edit
dl
rm
shell.pyc
149090
0644
edit
dl
rm
usage.py
2019
0644
edit
dl
rm
usage.pyc
2327
0644
edit
dl
rm
versions.py
3032
0644
edit
dl
rm
versions.pyc
2634
0644
edit
dl
rm
virtual_interfaces.py
1039
0644
edit
dl
rm
virtual_interfaces.pyc
1252
0644
edit
dl
rm
volumes.py
7731
0644
edit
dl
rm
volumes.pyc
8088
0644
edit
dl
rm
volume_snapshots.py
4475
0644
edit
dl
rm
volume_snapshots.pyc
4779
0644
edit
dl
rm
volume_types.py
3698
0644
edit
dl
rm
volume_types.pyc
3989
0644
edit
dl
rm
__init__.py
649
0644
edit
dl
rm
__init__.pyc
219
0644
edit
dl
rm
Edit:
/usr/lib/python2.6/site-packages/novaclient/v2/client.py
(9859B)
# Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from novaclient import api_versions from novaclient import client from novaclient.i18n import _LW from novaclient.v2 import agents from novaclient.v2 import aggregates from novaclient.v2 import availability_zones from novaclient.v2 import certs from novaclient.v2 import cloudpipe from novaclient.v2 import fixed_ips from novaclient.v2 import flavor_access from novaclient.v2 import flavors from novaclient.v2 import floating_ip_dns from novaclient.v2 import floating_ip_pools from novaclient.v2 import floating_ips from novaclient.v2 import floating_ips_bulk from novaclient.v2 import fping from novaclient.v2 import hosts from novaclient.v2 import hypervisors from novaclient.v2 import images from novaclient.v2 import keypairs from novaclient.v2 import limits from novaclient.v2 import networks from novaclient.v2 import quota_classes from novaclient.v2 import quotas from novaclient.v2 import security_group_default_rules from novaclient.v2 import security_group_rules from novaclient.v2 import security_groups from novaclient.v2 import server_groups from novaclient.v2 import servers from novaclient.v2 import services from novaclient.v2 import usage from novaclient.v2 import versions from novaclient.v2 import virtual_interfaces from novaclient.v2 import volume_snapshots from novaclient.v2 import volume_types from novaclient.v2 import volumes class Client(object): """ Top-level object to access the OpenStack Compute API. .. warning:: All scripts and projects should not initialize this class directly. It should be done via `novaclient.client.Client` interface. """ def __init__(self, username=None, api_key=None, project_id=None, auth_url=None, insecure=False, timeout=None, proxy_tenant_id=None, proxy_token=None, region_name=None, endpoint_type='publicURL', extensions=None, service_type='compute', service_name=None, volume_service_name=None, timings=False, bypass_url=None, os_cache=False, no_cache=True, http_log_debug=False, auth_system='keystone', auth_plugin=None, auth_token=None, cacert=None, tenant_id=None, user_id=None, connection_pool=False, session=None, auth=None, api_version=None, direct_use=True, **kwargs): """ :param str username: Username :param str api_key: API Key :param str project_id: Project ID :param str auth_url: Auth URL :param bool insecure: Allow insecure :param float timeout: API timeout, None or 0 disables :param str proxy_tenant_id: Tenant ID :param str proxy_token: Proxy Token :param str region_name: Region Name :param str endpoint_type: Endpoint Type :param str extensions: Exensions :param str service_type: Service Type :param str service_name: Service Name :param str volume_service_name: Volume Service Name :param bool timings: Timings :param str bypass_url: Bypass URL :param bool os_cache: OS cache :param bool no_cache: No cache :param bool http_log_debug: Enable debugging for HTTP connections :param str auth_system: Auth system :param str auth_plugin: Auth plugin :param str auth_token: Auth token :param str cacert: cacert :param str tenant_id: Tenant ID :param str user_id: User ID :param bool connection_pool: Use a connection pool :param str session: Session :param str auth: Auth :param api_version: Compute API version :type api_version: novaclient.api_versions.APIVersion """ if direct_use: import warnings warnings.warn( _LW("'novaclient.v2.client.Client' is not designed to be " "initialized directly. It is inner class of novaclient. " "Please, use 'novaclient.client.Client' instead. " "Related lp bug-report: 1493576")) # FIXME(comstud): Rename the api_key argument above when we # know it's not being used as keyword argument # NOTE(cyeoh): In the novaclient context (unlike Nova) the # project_id is not the same as the tenant_id. Here project_id # is a name (what the Nova API often refers to as a project or # tenant name) and tenant_id is a UUID (what the Nova API # often refers to as a project_id or tenant_id). password = api_key self.projectid = project_id self.tenant_id = tenant_id self.user_id = user_id self.flavors = flavors.FlavorManager(self) self.flavor_access = flavor_access.FlavorAccessManager(self) self.images = images.ImageManager(self) self.limits = limits.LimitsManager(self) self.servers = servers.ServerManager(self) self.versions = versions.VersionManager(self) self.api_version = api_version or api_versions.APIVersion("2.0") # extensions self.agents = agents.AgentsManager(self) self.dns_domains = floating_ip_dns.FloatingIPDNSDomainManager(self) self.dns_entries = floating_ip_dns.FloatingIPDNSEntryManager(self) self.cloudpipe = cloudpipe.CloudpipeManager(self) self.certs = certs.CertificateManager(self) self.floating_ips = floating_ips.FloatingIPManager(self) self.floating_ip_pools = floating_ip_pools.FloatingIPPoolManager(self) self.fping = fping.FpingManager(self) self.volumes = volumes.VolumeManager(self) self.volume_snapshots = volume_snapshots.SnapshotManager(self) self.volume_types = volume_types.VolumeTypeManager(self) self.keypairs = keypairs.KeypairManager(self) self.networks = networks.NetworkManager(self) self.quota_classes = quota_classes.QuotaClassSetManager(self) self.quotas = quotas.QuotaSetManager(self) self.security_groups = security_groups.SecurityGroupManager(self) self.security_group_rules = \ security_group_rules.SecurityGroupRuleManager(self) self.security_group_default_rules = \ security_group_default_rules.SecurityGroupDefaultRuleManager(self) self.usage = usage.UsageManager(self) self.virtual_interfaces = \ virtual_interfaces.VirtualInterfaceManager(self) self.aggregates = aggregates.AggregateManager(self) self.hosts = hosts.HostManager(self) self.hypervisors = hypervisors.HypervisorManager(self) self.hypervisor_stats = hypervisors.HypervisorStatsManager(self) self.services = services.ServiceManager(self) self.fixed_ips = fixed_ips.FixedIPsManager(self) self.floating_ips_bulk = floating_ips_bulk.FloatingIPBulkManager(self) self.os_cache = os_cache or not no_cache self.availability_zones = \ availability_zones.AvailabilityZoneManager(self) self.server_groups = server_groups.ServerGroupsManager(self) # Add in any extensions... if extensions: for extension in extensions: if extension.manager_class: setattr(self, extension.name, extension.manager_class(self)) self.client = client._construct_http_client( username=username, password=password, user_id=user_id, project_id=project_id, tenant_id=tenant_id, auth_url=auth_url, auth_token=auth_token, insecure=insecure, timeout=timeout, auth_system=auth_system, auth_plugin=auth_plugin, proxy_token=proxy_token, proxy_tenant_id=proxy_tenant_id, region_name=region_name, endpoint_type=endpoint_type, service_type=service_type, service_name=service_name, volume_service_name=volume_service_name, timings=timings, bypass_url=bypass_url, os_cache=self.os_cache, http_log_debug=http_log_debug, cacert=cacert, connection_pool=connection_pool, session=session, auth=auth, api_version=api_version, **kwargs) @client._original_only def __enter__(self): self.client.open_session() return self @client._original_only def __exit__(self, t, v, tb): self.client.close_session() @client._original_only def set_management_url(self, url): self.client.set_management_url(url) def get_timings(self): return self.client.get_timings() def reset_timings(self): self.client.reset_timings() @client._original_only def authenticate(self): """ Authenticate against the server. Normally this is called automatically when you first access the API, but you can call this method to force authentication right now. Returns on success; raises :exc:`exceptions.Unauthorized` if the credentials are wrong. """ self.client.authenticate()
Save
cmd:
run