CloudDNS

class CloudDNS.CloudDNS(env, region=None)[source]

Bases: Cloud.Cloud

A class that handles actions to Cloud DNS via public methods listed.

service = 'DNS'
getLimits(type=None)[source]

Lists all current api limits for CloudDB. Passing type=list_types will show all available types of limits and passing type=<type> will show you assigned limits for that type.

Arguments: type – Limit type(string)(Optional)

Returns: JSON results as a python dict

getDomains(name=None)[source]

Lists all account domains. Filter by name, if specified. Use getDomainsId for more detailed response.

Arguments: name – Domain name(string)

Returns: JSON results as a python dict

getDomain(domainId, attrDict={})[source]

List details for a specific domain, using the showRecords and showSubdomains parameters that specify whether to request information for records and subdomains.

Arguments: domainId – attrDict –

showRecords – (Optional) showSubdomains – (Optional)

Returns: JSON results as python dict

getDomainChanges(domainId, changeSince)[source]

Show all changes to the specified domain since the specified date/time in ISO format(2011-09-13T00:00:00-0500)

Arguments: domainId – changeSince – format 2011-05-19T08:07:08-0500 etc

Returns: JSON results as python dict

getDomainExport(domainId)[source]

Export details of the specified domain id.

Arguments: domainId –

Returns: JSON results as python dict

createDomains(attrList, returnResults=False)[source]

Create domain requests given the provided info. The recordsList is a list of “records” using name, type(A,CNAME, etc), data and ttl. The subdomains is a list of “domains” using name, comment and emailAddress. See api docs for examples.

Arguments: attrList: python list of dictionaries:

name – (Required) emailAddress – (Required) ttl – (Optional) commment – (Optional) #recordsList – (Optional) #subdomains – (Optional)

returnResults – True / False - receive the Async Json (True) or the Response Code (Optional)

Returns: Depends on returnResults arg.

createDomain(name, email, attrDict={}, returnResults=False)[source]

Create domain request given the provided info. The recordsList is a list of “records” using name, type(A,CNAME, etc), data and ttl. The subdomains is a list of “domains” using name, comment and emailAddress. See api docs for examples.

Arguments: name – (Required) email – (Required) attrDict: python dictionary:

ttl – (Optional) commment – (Optional) #recordsList – (Optional) #subdomains – (Optional)

returnResults – True / False - receive the Async Json (True) or the Response Code (Optional)

Returns: Depends on returnResults arg.

importDomain(contents, contentType='BIND_9')[source]

Import a new domain with the configuration specified by the request. Currently “BIND_9” is the only type supported and is defaulted to.

Arguments: contentType – contents –

Returns: JSON results as a python dict

updateDomains(domainList)[source]

Update the configuration of a domain or domains. This allows for updating of comments, ttl’s or emailAddresses set on the domain. Domain dict should include id and optionally comment, ttl and emailAddress

Arguments: domainList –

id – emailAddress – (Optional) ttl – (Optional) comment – (Optional)

Returns: JSON results as a python dict

updateDomain(domainId, domainDict={})[source]

Update the configuration of a domain. This allows for updating of comments, ttl’s or emailAddresses set on the domain. Domain dict should include id and optionally comment, ttl and emailAddress

Arguments: domainId – Domain id(int) domainDict – Dictionary containing optionally:(dict)

email – (Optional) ttl – (Optional) comment – (Optional)

Returns: JSON results as a python dict

deleteDomain(domainId, deleteSubdomains=False, returnResults=False)[source]

Remove domain from account. Pass True to delete subdomains.

Arguments: domainId – Domain id(int) deleteSubdomains – Boolean(Optional) returnResults – True / False - receive the Async Json (True) or the Response Code (Optional)

Returns: Depends on returnResults arg.

deleteDomains(domainList, deleteSubdomains=False, returnResults=False)[source]

Remove domain(s) from account. Pass True to delete subdomains.

Arguments: domainList – list of domain ids to delete deleteSubdomains – Boolean(Optional) returnResults – True / False - receive the Async Json (True) or the Response Code (Optional)

Returns: Depends on returnResults arg.

getSubdomains(domainId)[source]

List domains that are subdomains of the specified domain.

Arguments: domainId – Domain id

Returns: JSON results as python dict

getRecord(domainId, recordId=None)[source]

List all records configured for the domain. SOA cannot be modified. Pass recordId to get record details.

Arguments: domainId – Domain id recordId – Record id

getRecords(domainId, recordType, attrDict={})[source]

List all records for the specified domain of the specified type that match the specified name and/or data.

Arguments: domainId – recordType – attrDict:

name – (Optional) data – (Optional)

Returns: JSON results as python dict

createRecords(domainId, recordList, returnResults=False)[source]

Add new record(s) to the specified domains in a “records” list with name, type and data required.

Arguments: domainId – Domain Id recordList – Python List of Dictionaries:

type – Specifies the record type to add. name – Specifies the name for the domain or subdomain. Must be a valid domain name. data – The data field for PTR, A, and AAAA records must be a valid IPv4 or IPv6 IP address priority – (MX and SRV records only) Must be an integer from 0 to 65535. ttl – Must be greater than 300. Defaults to the domain TTL or 3600 (Optional) comment – If included, its length must be less than or equal to 160 characters. (Optional)

returnResults – True / False - receive the Async Json (True) or the Response Code (Optional)

Returns: Depends on returnResults arg.

createRecord(domainId, type, name, data, recordDict={}, returnResults=False)[source]

Add new record to the specified domains in a “records” list with name, type and data required.

Arguments: domainId – Domain Id type – Specifies the record type to add. name – Specifies the name for the domain or subdomain. Must be a valid domain name. data – The data field for PTR, A, and AAAA records must be a valid IPv4 or IPv6 IP address recordDict –

priority – (MX and SRV records only) Must be an integer from 0 to 65535. ttl – Must be greater than 300. Defaults to the domain TTL or 3600 (Optional) comment – If included, its length must be less than or equal to 160 characters. (Optional)

returnResults – True / False - receive the Async Json (True) or the Response Code (Optional)

Returns: Depends on returnResults arg.

updateRecords(domainId, recordList)[source]

Modify the configuration of records in the domain.

Arguments: domainId – Domain Id recordList –

rId – Record Id type – Specifies the record type to add. name – Specifies the name for the domain or subdomain. Must be a valid domain name. data – The data field for PTR, A, and AAAA records must be a valid IPv4 or IPv6 IP address priority – (MX and SRV records only) Must be an integer from 0 to 65535. ttl – Must be greater than 300. Defaults to the domain TTL or 3600 (Optional) comment – If included, its length must be less than or equal to 160 characters. (Optional)

Returns: JSON results as python dict

updateRecord(domainId, rId, recordDict)[source]

Modify the configuration of records in the domain.

Arguments: domainId – Domain Id rId – Record Id recordDict –

type – Specifies the record type to add. name – Specifies the name for the domain or subdomain. Must be a valid domain name. data – The data field for PTR, A, and AAAA records must be a valid IPv4 or IPv6 IP address priority – (MX and SRV records only) Must be an integer from 0 to 65535. ttl – Must be greater than 300. Defaults to the domain TTL or 3600 (Optional) comment – If included, its length must be less than or equal to 160 characters. (Optional)

Returns: JSON results as python dict

deleteRecords(domainId, recordIdList, returnResults=False)[source]

Remove records from the domain.

Arguments: domainId – recordIdList – List containing record ids

deleteRecord(domainId, recordId, returnResults=False)[source]

Remove a record from the domain.

Arguments: domainId – Domain Id recordId – Record Id

getRdns(serviceType, deviceUri, recordId=None)[source]

List all PTR records configured for a Rackspace Cloud device or details on a specified record.

Arguments: serviceType – Current available options are cloudServersOpenStack or cloudLoadBalancers deviceUri – Device href for associated service recordId – Id specified in ptr record listing

Returns: JSON results as python dict

createRdns(recordList, serviceType, deviceUri)[source]

Add new PTR record(s) for the specified Cloud device.

Arguments: recordList – { ‘records’: [ { ‘name’: required, ‘type’: ‘PTR’, ‘data’: required, ‘ttl’: optional } ] } etc serviceType – cloudServersOpenStack or cloudLoadBalancers deviceUri – Uri from service

Returns: JSON result as python dict

updateRdns(recordList, serviceType, deviceUri)[source]

Modify existing PTR record(s) for specified Cloud device(s).

Arguments: recordList – { ‘records’: [ { ‘name’: required, ‘id’: required, ‘type’: ‘PTR’, ‘data’: required, ‘ttl’: optional } ] } etc serviceType – cloudServersOpenStack or cloudLoadBalancers deviceUri – Uri from service

Returns: JSON result as python dict

deleteRdns(serviceType, deviceUri, ip=None)[source]

Remove one or all PTR records associated with a Rackspace Cloud device. Use the optional ip query parameter to specify a specific record to delete. Omitting this parameter removes all PTR records associated with the specified device.

Arguments: serviceType – cloudServersOpenStack or cloudLoadBalancers deviceUri – Uri from service ip – Optional ipv4 or ipv6 addy

Returns: status code

getAsync(url, detail=False)[source]

List status of the specified asynchronous request. Display details, as specified by the showDetails parameter.

Arguments: url – callbackUrl(string) detail – (bool)

Returns: JSON results as python dict

Previous topic

CloudDB

Next topic

CloudFiles