%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyc

�
���^c@@s�dZddlmZmZmZeZyddlZWne	k
rQe
ZnXdZd�Zd�Z
d�Zd�Zd	�ZdS(
ua
Namecheap Nameserver Management

.. versionadded:: 2017.7.0

Prerequisites
-------------

This module uses the ``requests`` Python module to communicate to the namecheap
API.

Configuration
-------------

The Namecheap username, API key and URL should be set in the minion configuration
file, or in the Pillar data.

.. code-block:: yaml

    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
i(tabsolute_importtprint_functiontunicode_literalsNunamecheap_domains_nscC@str
dStS(uH
    Check to make sure requests and xml are installed and requests
    unamecheap_domains_ns(tCAN_USE_NAMECHEAPtFalse(((sE/usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt__virtual__+scC@s~tjjjd�}||d<||d<||d<tjjj|�}|dkrXiS|jd�d}tjjj|�S(u�
    Retrieves information about a registered nameserver. Returns the following
    information:

    - IP Address set for the nameserver
    - Domain name which was queried
    - A list of nameservers and their statuses

    sld
        SLD of the domain name

    tld
        TLD of the domain name

    nameserver
        Nameserver to retrieve

    CLI Example:

    .. code-block:: bash

        salt '*' namecheap_domains_ns.get_info sld tld nameserver
    unamecheap.domains.ns.deleteuSLDuTLDu
NameserveruDomainNSInfoResultiN(tsalttutilst	namecheaptget_optstpost_requesttNonetgetElementsByTagNametxml_to_dict(tsldttldt
nameservertoptstresponse_xmltdomainnsinforesult((sE/usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pytget_info4s


cC@s�tjjjd�}||d<||d<||d<||d<||d<tjjj|�}|d
krltS|jd�d}tjjj|j	d	��S(u�
    Deletes a nameserver. Returns ``True`` if the nameserver was updated
    successfully.

    sld
        SLD of the domain name

    tld
        TLD of the domain name

    nameserver
        Nameserver to create

    old_ip
        Current ip address

    new_ip
        New ip address

    CLI Example:

    .. code-block:: bash

        salt '*' namecheap_domains_ns.update sld tld nameserver old_ip new_ip
    unamecheap.domains.ns.updateuSLDuTLDu
NameserveruOldIPuIPuDomainNSUpdateResultiu	IsSuccessN(
RRRR	R
RRRtstring_to_valuetgetAttribute(RRRtold_iptnew_ipRRtdomainnsupdateresult((sE/usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pytupdateZs




cC@s�tjjjd�}||d<||d<||d<tjjj|�}|dkrXtS|jd�d}tjjj|j	d��S(	uI
    Deletes a nameserver. Returns ``True`` if the nameserver was deleted
    successfully

    sld
        SLD of the domain name

    tld
        TLD of the domain name

    nameserver
        Nameserver to delete

    CLI Example:

    .. code-block:: bash

        salt '*' namecheap_domains_ns.delete sld tld nameserver
    unamecheap.domains.ns.deleteuSLDuTLDu
NameserveruDomainNSDeleteResultiu	IsSuccessN(
RRRR	R
RRRRR(RRRRRtdomainnsdeleteresult((sE/usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pytdelete�s


cC@s�tjjjd�}||d<||d<||d<||d<tjjj|�}|d	krbtS|jd�d}tjjj|j	d��S(
uw
    Creates a new nameserver. Returns ``True`` if the nameserver was created
    successfully.

    sld
        SLD of the domain name

    tld
        TLD of the domain name

    nameserver
        Nameserver to create

    ip
        Nameserver IP address

    CLI Example:

    .. code-block:: bash

        salt '*' namecheap_domains_ns.create sld tld nameserver ip
    unamecheap.domains.ns.createuSLDuTLDu
NameserveruIPuDomainNSCreateResultiu	IsSuccessN(
RRRR	R
RRRRR(RRRtipRRtdomainnscreateresult((sE/usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pytcreate�s



(t__doc__t
__future__RRRtTrueRtsalt.utils.namecheapRtImportErrorRt__virtualname__RRRRR(((sE/usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt<module>s

			&	)	!

Zerion Mini Shell 1.0