%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/namecheap_users.pyc |
� ���^c @@ st 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 d � Z d S( u[ Namecheap User 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_literalsNc C@ s t r d St S( uH Check to make sure requests and xml are installed and requests u namecheap_users( t CAN_USE_NAMECHEAPt False( ( ( s@ /usr/lib/python2.7/site-packages/salt/modules/namecheap_users.pyt __virtual__( s c C@ s` t j j j d � } t j j j | � } | d k r: i S| j d � d } t j j j | � S( u( Gets information about fund in the user's account. This method returns the following information: Available Balance, Account Balance, Earned Amount, Withdrawable Amount and Funds Required for AutoRenew. .. note:: If a domain setup with automatic renewal is expiring within the next 90 days, the FundsRequiredForAutoRenew attribute shows the amount needed in your Namecheap account to complete auto renewal. CLI Example: .. code-block:: bash salt 'my-minion' namecheap_users.get_balances u namecheap.users.getBalancesu UserGetBalancesResulti N( t saltt utilst namecheapt get_optst get_requestt Nonet getElementsByTagNamet atts_to_dict( t optst response_xmlt balance_response( ( s@ /usr/lib/python2.7/site-packages/salt/modules/namecheap_users.pyt get_balances1 s id c C@ s- t | � } t � } | d | k r) t St S( u� Checks if the provided minimum value is present in the user's account. Returns a boolean. Returns ``False`` if the user's account balance is less than the provided minimum or ``True`` if greater than the minimum. minimum : 100 The value to check CLI Example: .. code-block:: bash salt 'my-minion' namecheap_users.check_balances salt 'my-minion' namecheap_users.check_balances minimum=150 u accountbalance( t floatR R t True( t minimumt min_floatt result( ( s@ /usr/lib/python2.7/site-packages/salt/modules/namecheap_users.pyt check_balancesM s ( t __doc__t __future__R R R R R t salt.utils.namecheapR t ImportErrorR R R R ( ( ( s@ /usr/lib/python2.7/site-packages/salt/modules/namecheap_users.pyt <module> s