/
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/floating_ip_dns.py
(4378B)
# Copyright 2011 Andrew Bogott for The Wikimedia Foundation # All Rights Reserved. # # 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 six.moves.urllib import parse from novaclient import base def _quote_domain(domain): """Special quoting rule for placing domain names on a url line. Domain names tend to have .'s in them. Urllib doesn't quote dots, but Routes tends to choke on them, so we need an extra level of by-hand quoting here. """ return parse.quote(domain.replace('.', '%2E')) class FloatingIPDNSDomain(base.Resource): def delete(self): self.manager.delete(self.domain) def create(self): if self.scope == 'public': self.manager.create_public(self.domain, self.project) else: self.manager.create_private(self.domain, self.availability_zone) def get(self): entries = self.manager.domains() for entry in entries: if entry.get('domain') == self.domain: return entry return None class FloatingIPDNSDomainManager(base.Manager): resource_class = FloatingIPDNSDomain def domains(self): """Return the list of available dns domains.""" return self._list("/os-floating-ip-dns", "domain_entries") def create_private(self, fqdomain, availability_zone): """Add or modify a private DNS domain.""" body = {'domain_entry': {'scope': 'private', 'availability_zone': availability_zone}} return self._update('/os-floating-ip-dns/%s' % _quote_domain(fqdomain), body, 'domain_entry') def create_public(self, fqdomain, project): """Add or modify a public DNS domain.""" body = {'domain_entry': {'scope': 'public', 'project': project}} return self._update('/os-floating-ip-dns/%s' % _quote_domain(fqdomain), body, 'domain_entry') def delete(self, fqdomain): """Delete the specified domain.""" self._delete("/os-floating-ip-dns/%s" % _quote_domain(fqdomain)) class FloatingIPDNSEntry(base.Resource): def delete(self): self.manager.delete(self.name, self.domain) def create(self): self.manager.create(self.domain, self.name, self.ip, self.dns_type) def get(self): return self.manager.get(self.domain, self.name) class FloatingIPDNSEntryManager(base.Manager): resource_class = FloatingIPDNSEntry def get(self, domain, name): """Return a list of entries for the given domain and IP or name.""" return self._get("/os-floating-ip-dns/%s/entries/%s" % (_quote_domain(domain), name), "dns_entry") def get_for_ip(self, domain, ip): """Return a list of entries for the given domain and IP or name.""" qparams = {'ip': ip} params = "?%s" % parse.urlencode(qparams) return self._list("/os-floating-ip-dns/%s/entries%s" % (_quote_domain(domain), params), "dns_entries") def create(self, domain, name, ip, dns_type): """Add a new DNS entry.""" body = {'dns_entry': {'ip': ip, 'dns_type': dns_type}} return self._update("/os-floating-ip-dns/%s/entries/%s" % (_quote_domain(domain), name), body, "dns_entry") def modify_ip(self, domain, name, ip): """Add a new DNS entry.""" body = {'dns_entry': {'ip': ip, 'dns_type': 'A'}} return self._update("/os-floating-ip-dns/%s/entries/%s" % (_quote_domain(domain), name), body, "dns_entry") def delete(self, domain, name): """Delete entry specified by name and domain.""" self._delete("/os-floating-ip-dns/%s/entries/%s" % (_quote_domain(domain), name))
Save
cmd:
run