-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- Implementeation of namecheap.domains.dns.getHosts API #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look through the comments to the PR - the method should be somewhat extended before I can merge it. Also it needs a new unit test.
|
||
def get_host_records(self): | ||
pass | ||
https://www.namecheap.com/support/api/methods/domains-dns/get-list.aspx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct URL is https://www.namecheap.com/support/api/methods/domains-dns/get-hosts/
'MXPrefs': record_mxprefs, | ||
'TTL': record_ttl, | ||
} | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "Raises" section similar to get_nameservers() method, the exception may be raised by self._normalize_domain()
list/tuple of two elements: ('domain', 'tld'). | ||
|
||
Returns: | ||
A dict with domain nameserver information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A dict with DNS host records information
The return structure should be extended - there are attributes on DomainDNSGetHostsResult node (Domain, IsUsingOurDNS, EmailType) that should be included in the response, so...
{
'Domain': domain,
'IsUsingOurDNS': True/False,
'EmailType': 'NONE',
'Hosts': [
{
'ID': host_id,
'Type': record_type,
'Address': record_address,
'MXPrefs': record_mxprefs,
'TTL': record_ttl,
}
]
}
... which should also be reflected in the code. This will probably break your existing API and you would have to use a hypothetical response['Hosts']
instead of response
to access the same data.
}) | ||
|
||
return hosts | ||
#hosts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
record_name = host_record.get('Name') | ||
record_type = host_record.get('Type') | ||
record_address = host_record.get('Address') | ||
record_mxprefs = host_record.get('MXPrefs') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
record_mxpref = host_record.get('MXPref')
'Name': record_name, | ||
'Type': record_type, | ||
'Address': record_address, | ||
'MXPrefs': record_mxprefs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'MXPref': record_mxpref,
No description provided.