def delete(self, domainId, recordId): """ Delete a specific record. :param domainId: The ID of the :class:`Domain` to delete. :param recordId: The ID of the :class:`Record` to delete. """ self._delete("/domains/%s/records/%s" % (base.getid(domainId), base.getid(recordId)))
def modify(self, args, domainId): """ Modify a record in the dns system. The following parameters are required recordId and name. :param record_id: str :param domain: str :param name: str :param ttl: int :param data: str :param priority: int :param comment: str :rtype: list of :class:`Record` """ body = { "name": args.name, "comment": args.comment, "ttl": int(args.ttl), "data": args.data, "priority": args.priority } url = '/domains/%s/records/%s' % (base.getid(domainId), base.getid(args.record_id)) if hasattr(args, 'type'): if args.type == "PTR": url = '/rdns' body = { "recordsList": { "records": [{ "name": args.name, "id": args.record_id, "comment": args.comment, "ttl": int(args.ttl), "type": args.type, "data": args.data }] }, "link": { "content": "", "href": args.server_href, "rel": "cloudServersOpenStack" } } return self._update(url, body, return_raw=False, response_key="")
def list(self, domainId): """ Get a list of all records for the domain. :rtype: list of :class:`Record`. """ return self._list("/domains/%s/records" % base.getid(domainId), "records")
def delete(self, domain): """ Delete a specific domain. :param domain: The ID of the :class:`Domain` to delete. """ self._delete("/domains/%s" % base.getid(domain))
def subdomains_list(self, domainId): """ Get a list of all subdomains. :rtype: list of :class:`Domain`. """ return self._list("/domains/%s/subdomains" % base.getid(domainId), "domains")
def export(self, domain): """ Export a specific domain. :param domain: The ID of the :class:`Domain` to get. :rtype: :class:`Domain` """ return self._get_async("/domains/%s/export" % base.getid(domain), "")
def get(self, domain): """ Get a specific domain. :param domain: The ID of the :class:`Domain` to get. :rtype: :class:`Domain` """ return self._get("/domains/%s" % base.getid(domain), "")
def modify(self, args, domainId): """ Modify a record in the dns system. The following parameters are required recordId and name. :param record_id: str :param domain: str :param name: str :param ttl: int :param data: str :param priority: int :param comment: str :rtype: list of :class:`Record` """ body = { "name": args.name, "comment": args.comment, "ttl": int(args.ttl), "data": args.data, "priority": args.priority, } url = "/domains/%s/records/%s" % (base.getid(domainId), base.getid(args.record_id)) if hasattr(args, "type"): if args.type == "PTR": url = "/rdns" body = { "recordsList": { "records": [ { "name": args.name, "id": args.record_id, "comment": args.comment, "ttl": int(args.ttl), "type": args.type, "data": args.data, } ] }, "link": {"content": "", "href": args.server_href, "rel": "cloudServersOpenStack"}, } return self._update(url, body, return_raw=False, response_key="")
def modify(self, args, domainId): """ Modify a domain in the dns system. The following parameters are optional, except for name. :param name: str :param email_address: str :param ttl: int :param comment: str :rtype: list of :class:`Domain` """ body = {"comment": args.comment, "ttl": int(args.ttl), "emailAddress": args.email_address} return self._update("/domains/%s" % base.getid(domainId), body, return_raw=False, response_key="")
def create(self, args, domainId): """ Create a record in the dns system. The following parameters are required type, name, data. :param type: str :param name: str :param ttl: int :param data: str :param priority: int :param comment: str :rtype: list of :class:`Record` """ body = { "records": [{ "name": args.name, "comment": args.comment, "ttl": int(args.ttl), "type": args.type, "data": args.data, "priority": args.priority }] } url = '/domains/%s/records' % base.getid(domainId) if args.type == "PTR": url = '/rdns' body = { "recordsList": { "records": [{ "name": args.name, "comment": args.comment, "ttl": int(args.ttl), "type": args.type, "data": args.data }] }, "link": { "content": "", "href": args.server_href, "rel": "cloudServersOpenStack" } } return self._create_async(url, body, return_raw=False, response_key="")
def create(self, args, domainId): """ Create a record in the dns system. The following parameters are required type, name, data. :param type: str :param name: str :param ttl: int :param data: str :param priority: int :param comment: str :rtype: list of :class:`Record` """ body = { "records": [ { "name": args.name, "comment": args.comment, "ttl": int(args.ttl), "type": args.type, "data": args.data, "priority": args.priority, } ] } url = "/domains/%s/records" % base.getid(domainId) if args.type == "PTR": url = "/rdns" body = { "recordsList": { "records": [ { "name": args.name, "comment": args.comment, "ttl": int(args.ttl), "type": args.type, "data": args.data, } ] }, "link": {"content": "", "href": args.server_href, "rel": "cloudServersOpenStack"}, } return self._create_async(url, body, return_raw=False, response_key="")
def modify(self, args, domainId): """ Modify a domain in the dns system. The following parameters are optional, except for name. :param name: str :param email_address: str :param ttl: int :param comment: str :rtype: list of :class:`Domain` """ body = { "comment": args.comment, "ttl": int(args.ttl), "emailAddress": args.email_address } return self._update('/domains/%s' % base.getid(domainId), body, return_raw=False, response_key="")