403Webshell
Server IP : 157.22.201.140  /  Your IP : 216.73.216.74
Web Server : nginx/1.30.1
System : Linux mit.vincode.fvds.ru 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64
User : root ( 0)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/libcloud/dns/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/libcloud/dns/__pycache__/base.cpython-312.pyc
�

�q�a�F����ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	l
Z
dd
lmZddl
mZddl
mZmZdd
lmZgd�ZGd�de�ZGd�de�ZGd�de�Zy	)�)�with_statement)�Dict)�Iterator)�List)�Optional)�Union)�Type)�AnyN)�__version__)�
Connection)�ConnectionUserAndKey�
BaseDriver)�
RecordType)�Zone�Record�	DNSDriverc�P�eZdZdZ	dd�Zd�Zdd�Z				dd�Zd�Zd�Z	d	�Z
d
�Zy)
rz
    DNS zone.
    Nc��|rt|�nd|_||_||_|xsd|_||_|xsi|_y)a�
        :param id: Zone id.
        :type id: ``str``

        :param domain: The name of the domain.
        :type domain: ``str``

        :param type: Zone type (master, slave).
        :type type: ``str``

        :param ttl: Default TTL for records in this zone (in seconds).
        :type ttl: ``int``

        :param driver: DNSDriver instance.
        :type driver: :class:`DNSDriver`

        :param extra: (optional) Extra attributes (driver specific).
        :type extra: ``dict``
        N)�str�id�domain�type�ttl�driver�extra)�selfrrrrrrs       �3/usr/lib/python3/dist-packages/libcloud/dns/base.py�__init__z
Zone.__init__-s>��6 �#�b�'�T��������	��;�$�������[�b��
�c�:�|jj|��S�N��zone)r�list_records�rs rr$zZone.list_recordsOs���{�{�'�'�T�'�2�2rc�B�|jj|||||��S)N)�namer#r�datar)r�
create_record�rr'rr(rs     rr)zZone.create_recordSs+���{�{�(�(�d��D�.2�%�)�A�	Arc�B�|jj|||||��S)N)r#rrrr)r�update_zone�rrrrrs     r�updatezZone.updateXs+���{�{�&�&�D��d�+.�e�'�=�	=rc�:�|jj|��Sr!)r�delete_zoner%s r�deletezZone.deletebs���{�{�&�&�D�&�1�1rc�:�|jj|��Sr!)r�export_zone_to_bind_formatr%s r�export_to_bind_formatzZone.export_to_bind_formatfs���{�{�5�5�4�5�@�@rc�>�|jj||��y)N)r#�	file_path)r�export_zone_to_bind_zone_file)rr6s  r�export_to_bind_zone_filezZone.export_to_bind_zone_filejs�����1�1�t�<E�	2�	Grc�j�d|j�d|j�d|jj�d�S)Nz<Zone: domain=�, ttl=�, provider=� ...>)rrrr'r%s r�__repr__z
Zone.__repr__os'�����d�h�h����(8�(8�:�	;r�N�NNNN)�__name__�
__module__�__qualname__�__doc__rr$r)r.r1r4r8r=�rrrr(sF����
 !�D3�A�����	=�2�A�G�
;rrc�>�eZdZdZ		dd�Z				d	d�Zd�Zd�Zd�Zy)
rz!
    Zone record / resource.
    Nc	��|rt|�nd|_||_||_||_||_||_||_|xsi|_y)a�
        :param id: Record id
        :type id: ``str``

        :param name: Hostname or FQDN.
        :type name: ``str``

        :param type: DNS record type (A, AAAA, ...).
        :type type: :class:`RecordType`

        :param data: Data for the record (depends on the record type).
        :type data: ``str``

        :param zone: Zone instance.
        :type zone: :class:`Zone`

        :param driver: DNSDriver instance.
        :type driver: :class:`DNSDriver`

        :param ttl: Record TTL.
        :type ttl: ``int``

        :param extra: (optional) Extra attributes (driver specific).
        :type extra: ``dict``
        N)	rrr'rr(r#rrr)	rrr'rr(r#rrrs	         rrzRecord.__init__zsI��F �#�b�'�T�����	���	���	���	��������[�b��
rc�B�|jj|||||��S)N)�recordr'rr(r)r�
update_recordr*s     rr.z
Record.update�s-���{�{�(�(��4�d�.2�%�)�A�	Arc�:�|jj|��S)N�rH)r�
delete_recordr%s rr1z
Record.delete�s���{�{�(�(��(�5�5rc�^�|j}|�y|j�r
t|�}|S|S)z�
        Return numeric ID for the provided record if the ID is a digit.

        This method is used for sorting the values when exporting Zone to a
        BIND format.
        �)r�isdigit�int)r�	record_id�
record_id_ints   r�_get_numeric_idzRecord._get_numeric_id�s7���G�G�	���������	�N�M� � ��rc
�(�|jjr|jjn|jj}d|�d|j�d|j�d|j
�d|jj�d|j�d�
S)Nz<Record: zone=z, name=z, type=z, data=r;r:r<)r#rrr'rr(rr�rr#s  rr=zRecord.__repr__�s[��#'�9�9�#3�#3�t�y�y����������t�y�y�$�)�)�T�Y�Y����!�!�4�8�8�-�	.r)NNr?)	r@rArBrCrr.r1rSr=rDrrrrus8�����*!�Z����	A�6��&.rrc���eZdZdZeZdZdZiZ				d�fd�	Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zdd�Z			dd�Zdd
�Z	dd�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)rzj
    A base DNSDriver class to derive from

    This class is always subclassed by a specific driver.
    Nc	�8��tt|�
d|||||d�|��y)aP
        :param    key: API key or username to used (required)
        :type     key: ``str``

        :param    secret: Secret password to be used (required)
        :type     secret: ``str``

        :param    secure: Whether to use HTTPS or HTTP. Note: Some providers
                only support HTTPS, and it is on by default.
        :type     secure: ``bool``

        :param    host: Override hostname used for connections.
        :type     host: ``str``

        :param    port: Override port used for connections.
        :type     port: ``int``

        :return: ``None``
        )�key�secret�secure�host�portNrD)�superrr)rrXrYrZr[r\�kwargs�	__class__s       �rrzDNSDriver.__init__�s/���8	�i��'�	H�C��v�-1��	H�@F�	Hrc�H�t|jj��S)z�
        Return a list of RecordType objects supported by the provider.

        :return: ``list`` of :class:`RecordType`
        )�list�RECORD_TYPE_MAP�keysr%s r�list_record_typeszDNSDriver.list_record_types�s���D�(�(�-�-�/�0�0rc��td��)zu
        Return a generator to iterate over available zones.

        :rtype: ``generator`` of :class:`Zone`
        z-iterate_zones not implemented for this driver��NotImplementedErrorr%s r�
iterate_zoneszDNSDriver.iterate_zoness��"�;�=�	=rc�4�t|j��S)zU
        Return a list of zones.

        :return: ``list`` of :class:`Zone`
        )rarhr%s r�
list_zoneszDNSDriver.list_zoness���D�&�&�(�)�)rc��td��)z�
        Return a generator to iterate over records for the provided zone.

        :param zone: Zone to list records for.
        :type zone: :class:`Zone`

        :rtype: ``generator`` of :class:`Record`
        z/iterate_records not implemented for this driverrfrUs  r�iterate_recordszDNSDriver.iterate_recordss��"�=�?�	?rc�6�t|j|��S)z�
        Return a list of records for the provided zone.

        :param zone: Zone to list records for.
        :type zone: :class:`Zone`

        :return: ``list`` of :class:`Record`
        )rarlrUs  rr$zDNSDriver.list_records%s���D�(�(��.�/�/rc��td��)z�
        Return a Zone instance.

        :param zone_id: ID of the required zone
        :type  zone_id: ``str``

        :rtype: :class:`Zone`
        z(get_zone not implemented for this driverrf)r�zone_ids  r�get_zonezDNSDriver.get_zone1s��"�6�8�	8rc��td��)z�
        Return a Record instance.

        :param zone_id: ID of the required zone
        :type  zone_id: ``str``

        :param record_id: ID of the required record
        :type  record_id: ``str``

        :rtype: :class:`Record`
        z*get_record not implemented for this driverrf)rrorQs   r�
get_recordzDNSDriver.get_record>s��"�8�:�	:rc��td��)a�
        Create a new zone.

        :param domain: Zone domain name (e.g. example.com)
        :type domain: ``str``

        :param type: Zone type (master / slave).
        :type  type: ``str``

        :param ttl: TTL for new records. (optional)
        :type  ttl: ``int``

        :param extra: Extra attributes (driver specific). (optional)
        :type extra: ``dict``

        :rtype: :class:`Zone`
        z+create_zone not implemented for this driverrfr-s     r�create_zonezDNSDriver.create_zoneNs��&"�9�;�	;rc��td��)a�
        Update an existing zone.

        :param zone: Zone to update.
        :type  zone: :class:`Zone`

        :param domain: Zone domain name (e.g. example.com)
        :type  domain: ``str``

        :param type: Zone type (master / slave).
        :type  type: ``str``

        :param ttl: TTL for new records. (optional)
        :type  ttl: ``int``

        :param extra: Extra attributes (driver specific). (optional)
        :type  extra: ``dict``

        :rtype: :class:`Zone`
        z+update_zone not implemented for this driverrf)rr#rrrrs      rr,zDNSDriver.update_zoneds��8"�9�;�	;rc��td��)a�
        Create a new record.

        :param name: Record name without the domain name (e.g. www).
                     Note: If you want to create a record for a base domain
                     name, you should specify empty string ('') for this
                     argument.
        :type  name: ``str``

        :param zone: Zone where the requested record is created.
        :type  zone: :class:`Zone`

        :param type: DNS record type (A, AAAA, ...).
        :type  type: :class:`RecordType`

        :param data: Data for the record (depends on the record type).
        :type  data: ``str``

        :param extra: Extra attributes (driver specific). (optional)
        :type extra: ``dict``

        :rtype: :class:`Record`
        z-create_record not implemented for this driverrf)rr'r#rr(rs      rr)zDNSDriver.create_record�s��2"�;�=�	=rc��td��)a�
        Update an existing record.

        :param record: Record to update.
        :type  record: :class:`Record`

        :param name: Record name without the domain name (e.g. www).
                     Note: If you want to create a record for a base domain
                     name, you should specify empty string ('') for this
                     argument.
        :type  name: ``str``

        :param type: DNS record type (A, AAAA, ...).
        :type  type: :class:`RecordType`

        :param data: Data for the record (depends on the record type).
        :type  data: ``str``

        :param extra: (optional) Extra attributes (driver specific).
        :type  extra: ``dict``

        :rtype: :class:`Record`
        z-update_record not implemented for this driverrf)rrHr'rr(rs      rrIzDNSDriver.update_record�s��<"�;�=�	=rc��td��)z�
        Delete a zone.

        Note: This will delete all the records belonging to this zone.

        :param zone: Zone to delete.
        :type  zone: :class:`Zone`

        :rtype: ``bool``
        z+delete_zone not implemented for this driverrfrUs  rr0zDNSDriver.delete_zone�s��"�9�;�	;rc��td��)z�
        Delete a record.

        :param record: Record to delete.
        :type  record: :class:`Record`

        :rtype: ``bool``
        z-delete_record not implemented for this driverrf)rrHs  rrLzDNSDriver.delete_record�s��"�;�=�	=rc��|jdk7rtd��g}|j�}t|tj
��}tjj�jd�}t|d�}|jd|z�|jdd|jiz�|jd	d
|jiz�|D]%}|j|��}|j|��'dj|�}|S)
z�
        Export Zone object to the BIND compatible format.

        :param zone: Zone to export.
        :type  zone: :class:`Zone`

        :return: Zone data in BIND compatible format.
        :rtype: ``str``
        �masterz/You can only generate BIND out for master zones)rXz%Y-%m-%d %H:%M:%S)�version�datez4; Generated by Libcloud v%(version)s on %(date)s UTCz$ORIGIN %(domain)s.rz$TTL %(domain_ttl)s
�
domain_ttlrK�
)r�
ValueErrorr$�sortedrrS�datetime�utcnow�strftimer�appendrr�_get_bind_record_line�join)	rr#�lines�recordsr}�valuesrH�line�outputs	         rr3z$DNSDriver.export_zone_to_bind_format�s����9�9�� ��N�O�O����#�#�%����f�&<�&<�=��� � �'�'�)�2�2�3F�G��(�$�7��
���K���	�
���*�h����-D�D�E�
���,��d�h�h�/G�G�H��	�F��-�-�V�-�<�D��L�L���	����5�!���
rc��|j|��}t|d�5}|j|�ddd�y#1swYyxYw)a
        Export Zone object to the BIND compatible format and write result to a
        file.

        :param zone: Zone to export.
        :type  zone: :class:`Zone`

        :param file_path: File path where the output will be saved.
        :type  file_path: ``str``
        r"�wN)r3�open�write)rr#r6�result�fps     rr7z'DNSDriver.export_zone_to_bind_zone_file�sD���0�0�d�0�;��
�)�S�
!�	�R��H�H�V��	�	�	�s	�:�Ac���g}|jr'd|j|jjd�z}n|jj}|dz
}d|jvr|jdn|jj}t|�}|j}|jtjtjtjtjtjfvr|t|�dz
dk7r|dz
}|jtjtj fvrd|vr|j#dd�}d	|z}|jtjtjfvr4t|jd
�}||dt|j�||g}n||dt|j�|g}dj%|�}|S)
z�
        Generate BIND record line for the provided record.

        :param record: Record to generate the line for.
        :type  record: :class:`Record`

        :return: Bind compatible record line.
        :rtype: ``str``
        z%(name)s.%(domain)s)r'r�.r�� �"z\"z"%s"�priority�IN�	)r'r#rrrrr(rr�CNAME�DNAME�MX�PTR�SRV�len�TXT�SPF�replacer�)rrH�partsr'rr(r�r�s        rr�zDNSDriver._get_bind_record_lines������;�;�(�F�K�K�6<�k�k�6H�6H�,J�J�D��;�;�%�%�D�����%*�f�l�l�%:�f�l�l�5�!��������#�h���{�{���;�;�:�+�+�Z�-=�-=�z�}�}�%�>�>�:�>�>�;�;��C��I��M�"�c�)������;�;�:�>�>�:�>�>�:�:�s�d�{��<�<��U�+�D��T�?�D��;�;�:�=�=�*�.�.�9�9��6�<�<�
�3�4�H��3��c�&�+�+�&6��$�G�E��3��c�&�+�+�&6��=�E��y�y�����rc�F�|j�}tt|�}|S)z�
        Return a string representation of a DNS record type to a
        libcloud RecordType ENUM.

        :rtype: ``str``
        )�upper�getattrr)r�string�record_types   r�_string_to_record_typez DNSDriver._string_to_record_type?s!��������j�&�1���r)NTNN)r{NNr>)r@rArBrCr
�
connectionClsr'�websiterbrrdrhrjrlr$rprrrtr,r)rIr0rLr3r7r�r��
__classcell__)r_s@rrr�s�����
)�M��D��G��O�����H�>1�=�*�?�
0�8�:� ;�2"���;�>=�B!�=�B
;�=�!�F�"-�^
rr)�
__future__r�typingrrrrrr	r
r��libcloudr�libcloud.common.baserr
r�libcloud.dns.typesr�__all__�objectrrrrDrr�<module>r�sa�� &��������� �+�A�)���J;�6�J;�ZX.�V�X.�vy�
�yr

Youez - 2016 - github.com/yon3zu
LinuXploit