%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyc |
� ���^c @@ s� d Z d d l m Z m Z m Z e Z y d d l Z Wn e k rQ e Z n Xd Z d � Z d � Z d � Z d � Z d � Z d S( 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 ( t absolute_importt print_functiont unicode_literalsNu namecheap_domains_nsc C@ s t r d St S( uH Check to make sure requests and xml are installed and requests u namecheap_domains_ns( t CAN_USE_NAMECHEAPt False( ( ( sE /usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt __virtual__+ s c C@ s~ t j j j d � } | | d <| | d <| | d <t j j j | � } | d k rX i S| j d � d } t j j j | � 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 u namecheap.domains.ns.deleteu SLDu TLDu Nameserveru DomainNSInfoResulti N( t saltt utilst namecheapt get_optst post_requestt Nonet getElementsByTagNamet xml_to_dict( t sldt tldt nameservert optst response_xmlt domainnsinforesult( ( sE /usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt get_info4 s c C@ s� t j j j d � } | | d <| | d <| | d <| | d <| | d <t j j j | � } | d k rl t S| j d � d } t j j j | 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 u namecheap.domains.ns.updateu SLDu TLDu Nameserveru OldIPu IPu DomainNSUpdateResulti u IsSuccessN( R R R R R R R R t string_to_valuet getAttribute( R R R t old_ipt new_ipR R t domainnsupdateresult( ( sE /usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt updateZ s c C@ s� t j j j d � } | | d <| | d <| | d <t j j j | � } | d k rX t S| j d � d } t j j j | 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 u namecheap.domains.ns.deleteu SLDu TLDu Nameserveru DomainNSDeleteResulti u IsSuccessN( R R R R R R R R R R ( R R R R R t domainnsdeleteresult( ( sE /usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt delete� s c C@ s� t j j j d � } | | d <| | d <| | d <| | d <t j j j | � } | d k rb t S| j d � d } t j j j | 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 u namecheap.domains.ns.createu SLDu TLDu Nameserveru IPu DomainNSCreateResulti u IsSuccessN( R R R R R R R R R R ( R R R t ipR R t domainnscreateresult( ( sE /usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt create� s ( t __doc__t __future__R R R t TrueR t salt.utils.namecheapR t ImportErrorR t __virtualname__R R R R R ( ( ( sE /usr/lib/python2.7/site-packages/salt/modules/namecheap_domains_ns.pyt <module> s & ) !