Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dcampillo
Copy link

No description provided.

Copy link
Owner

@yonjuuni yonjuuni left a 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'MXPrefs': record_mxprefs,
'TTL': record_ttl,
}
"""
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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')
Copy link
Owner

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,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'MXPref': record_mxpref,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants