/usr/lib/python2.6/site-packages/novaclient/v2
NameSizeModeActions
contrib/-0755rm
agents.py22400644editdlrm
agents.pyc27740644editdlrm
aggregates.py35000644editdlrm
aggregates.pyc47770644editdlrm
availability_zones.py15880644editdlrm
availability_zones.pyc17030644editdlrm
certs.py14100644editdlrm
certs.pyc16510644editdlrm
client.py98590644editdlrm
client.pyc86520644editdlrm
cloudpipe.py19060644editdlrm
cloudpipe.pyc24740644editdlrm
fixed_ips.py16830644editdlrm
fixed_ips.pyc20990644editdlrm
flavors.py68240644editdlrm
flavors.pyc76230644editdlrm
flavor_access.py26540644editdlrm
flavor_access.pyc32570644editdlrm
floating_ips.py17300644editdlrm
floating_ips.pyc22220644editdlrm
floating_ips_bulk.py21080644editdlrm
floating_ips_bulk.pyc22860644editdlrm
floating_ip_dns.py43780644editdlrm
floating_ip_dns.pyc62600644editdlrm
floating_ip_pools.py10640644editdlrm
floating_ip_pools.pyc12550644editdlrm
fping.py17500644editdlrm
fping.pyc20390644editdlrm
hosts.py20940644editdlrm
hosts.pyc32540644editdlrm
hypervisors.py28260644editdlrm
hypervisors.pyc40420644editdlrm
images.py31510644editdlrm
images.pyc41370644editdlrm
keypairs.py34970644editdlrm
keypairs.pyc39440644editdlrm
limits.py30920644editdlrm
limits.pyc43110644editdlrm
networks.py48150644editdlrm
networks.pyc58360644editdlrm
quotas.py22640644editdlrm
quotas.pyc26190644editdlrm
quota_classes.py15000644editdlrm
quota_classes.pyc17750644editdlrm
security_groups.py30000644editdlrm
security_groups.pyc41210644editdlrm
security_group_default_rules.py27410644editdlrm
security_group_default_rules.pyc33260644editdlrm
security_group_rules.py26810644editdlrm
security_group_rules.pyc29880644editdlrm
servers.py450640644editdlrm
servers.pyc502360644editdlrm
server_groups.py20600644editdlrm
server_groups.pyc28110644editdlrm
server_migrations.py29240644editdlrm
server_migrations.pyc33320644editdlrm
services.py33050644editdlrm
services.pyc40980644editdlrm
shell.py1486850644editdlrm
shell.pyc1490900644editdlrm
usage.py20190644editdlrm
usage.pyc23270644editdlrm
versions.py30320644editdlrm
versions.pyc26340644editdlrm
virtual_interfaces.py10390644editdlrm
virtual_interfaces.pyc12520644editdlrm
volumes.py77310644editdlrm
volumes.pyc80880644editdlrm
volume_snapshots.py44750644editdlrm
volume_snapshots.pyc47790644editdlrm
volume_types.py36980644editdlrm
volume_types.pyc39890644editdlrm
__init__.py6490644editdlrm
__init__.pyc2190644editdlrm
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))