salt.modules.namecheap_domains module

Namecheap management

New in version 2017.7.0.

General Notes

Use this module to manage domains through the namecheap api. The Namecheap settings will be set in grains.

Installation Prerequisites

  • This module uses the following python libraries to communicate to the namecheap API:

    • requests
    pip install requests
    
  • As saltstack depends on requests this shouldn't be a problem

Prerequisite Configuration

  • The namecheap username, api key and url should be set in a minion configuration file or pillar

    namecheap.name: companyname
    namecheap.key: a1b2c3d4e5f67a8b9c0d1e2f3
    namecheap.client_ip: 162.155.30.172
    #Real url
    namecheap.url: https://api.namecheap.com/xml.response
    #Sandbox url
    #namecheap.url: https://api.sandbox.namecheap.xml.response
    
salt.modules.namecheap_domains.check(*domains_to_check)

Checks the availability of domains

returns a dictionary where the domain name is the key and
the availability is the value of True/False
domains_to_check
array of strings List of domains to check

CLI Example:

salt 'my-minion' namecheap_domains.check domain-to-check
salt.modules.namecheap_domains.create(domain_name, years, **kwargs)

Try to create the specified domain name for the specified number of years

returns the following information in a dictionary
registered True/False amount charged for registration domainid unique integer value for the domain orderid unique integer value for the order transactionid unique integer value for the transaction whoisguardenable True,False if enabled for this domain nonrealtimedomain True,False if domain registration is instant or not

CLI Example:

salt 'my-minion' namecheap_domains.create my-domain-name 2
salt.modules.namecheap_domains.get_info(domain_name)

Returns information about the requested domain

returns a dictionary of information about the domain_name

domain_name
string Domain name to get information about

CLI Example:

salt 'my-minion' namecheap_domains.get_info my-domain-name
salt.modules.namecheap_domains.get_list(list_type=None, search_term=None, page=None, page_size=None, sort_by=None)

Returns a list of domains for the particular user as a list of objects offset by page length of page_size

list_type
string Possible values are ALL/EXPIRING/EXPIRED
Default: ALL
search_term
string Keyword to look for on the domain list
page
integer Page to return
Default: 1
page_size
integer Number of domains to be listed in a page
Minimum value is 10 and maximum value is 100 Default: 20
sort_by
string Possible values are NAME/NAME_DESC/EXPIREDATE/
EXPIREDATE_DESC/CREATEDATE/CREATEDATE_DESC

CLI Example:

salt 'my-minion' namecheap_domains.get_list
salt.modules.namecheap_domains.get_tld_list()

Returns a list of TLDs as objects

CLI Example:

salt 'my-minion' namecheap_domains.get_tld_list
salt.modules.namecheap_domains.reactivate(domain_name)

Try to reactivate the expired domain name

returns the following information in a dictionary
issuccess bool indicates whether the domain was renewed successfully amount charged for reactivation orderid unique integer value for the order transactionid unique integer value for the transaction

CLI Example:

salt.modules.namecheap_domains.renew(domain_name, years, promotion_code=None)

Try to renew the specified expiring domain name for a specified number of years

returns the following information in a dictionary
renew bool indicates whether the domain was renewed successfully domainid unique integer value for the domain orderid unique integer value for the order transactionid unique integer value for the transaction amount charged for renewal
Required parameters:
domain_name
string The domain name you wish to renew

CLI Example:

salt 'my-minion' namecheap_domains.renew my-domain-name 5