https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/route53/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/route53/__pycache__/zone.cpython-310.pyc
o

ckF[g?�@sDdZddlZddlmZddlmZddlmZGdd�de�Z	dS)�<�N)�TooManyRecordsException)�ResourceRecordSets)�Statusc@s�eZdZdZdd�Zdd�Zdd�Z	d5d	d
�Z		d6d
d�Z		d7dd�Z	d5dd�Z
d7dd�Zd7dd�Zd7dd�Z
d8dd�Zd9dd�Zd9dd �Zd9d!d"�Zd7d#d$�Zd7d%d&�Zd7d'd(�Zd:d)d*�Zd:d+d,�Zd:d-d.�Zd/d0�Zd1d2�Zd3d4�ZdS);�Zonez�
    A Route53 Zone.

    :ivar route53connection: A :class:`boto.route53.connection.Route53Connection` connection
    :ivar id: The ID of the hosted zone
    cCsD||_|D]}|dkr|d�dd�|_q|�|��||�qdS)N�Idz/hostedzone/�)�route53connection�replace�id�__setattr__�lower)�selfr	�	zone_dict�key�r�3/usr/lib/python3/dist-packages/boto/route53/zone.py�__init__(s�z
Zone.__init__cCs
d|jS)Nz	<Zone:%s>)�name�rrrr�__repr__0s
z
Zone.__repr__cCs|��}|ddS)z�
        Commit a set of changes and return the ChangeInfo portion of
        the response.

        :type changes: ResourceRecordSets
        :param changes: changes to be committed
        � ChangeResourceRecordSetsResponse�
ChangeInfo)�commit)r�changes�responserrr�_commit3szZone._commitrc	Cs�d}d}	|dur%zt|d�|d}|d}Wn|d}	|d}Y|jd||||||	d�}
t|�tttfvrF|D]}|
�|�q<dS|
�|�dS)aw
        Add a CREATE change record to an existing ResourceRecordSets

        :type changes: ResourceRecordSets
        :param changes: change set to append to

        :type name: str
        :param name: The name of the resource record you want to
            perform the action on.

        :type resource_type: str
        :param resource_type: The DNS record type

        :param value: Appropriate value for resource_type

        :type ttl: int
        :param ttl: The resource record cache time to live (TTL), in seconds.

        :type identifier: tuple
        :param identifier: A tuple for setting WRR or LBR attributes.  Valid
           forms are:

           * (str, int): WRR record [e.g. ('foo',10)]
           * (str, str): LBR record [e.g. ('foo','us-east-1')

        :type comment: str
        :param comment: A comment that will be stored with the change.
        N�r�CREATE)�
identifier�weight�region)�int�
add_change�type�list�tuple�set�	add_value)rr�
resource_typer�value�ttlr�commentr r!�change�recordrrr�_new_record>s&
��zZone._new_recordrNc	Cs8t|j|j|�}|�|||||||�t|j|�|��S)z�
        Add a new record to this Zone.  See _new_record for parameter
        documentation.  Returns a Status object.
        )rr	rr/rr)rr)rr*r+rr,rrrr�
add_recordos
�zZone.add_recordc	CsZ|pt}t�|�}t|j|j|�}|�d|�|�||j|j||||�t	|j|�
|��S)a

        Update an existing record in this Zone.  Returns a Status object.

        :type old_record: ResourceRecord
        :param old_record: A ResourceRecord (e.g. returned by find_records)

        See _new_record for additional parameter documentation.
        �DELETE)�default_ttl�copyrr	r�add_change_recordr/r$rrr)r�
old_record�	new_value�new_ttl�new_identifierr,r.rrrr�
update_recordzs

�zZone.update_recordcCsXt|j|j|�}t|�tttfvr|D]}|�d|�qn|�d|�t|j|�	|��S)a8
        Delete one or more records from this Zone.  Returns a Status object.

        :param record: A ResourceRecord (e.g. returned by
           find_records) or list, tuple, or set of ResourceRecords.

        :type comment: str
        :param comment: A comment that will be stored with the change.
        r1)
rr	rr$r%r&r'r4rr)rr.r,r�rrrr�
delete_record�s
�zZone.delete_recordcCs6|pt}|j�|�}|j�|�}|jd|||||d�S)z�
        Add a new CNAME record to this Zone.  See _new_record for
        parameter documentation.  Returns a Status object.
        �CNAME�r)rr*r+rr,�r2r	�_make_qualifiedr0�rrr*r+rr,rrr�	add_cname�s�zZone.add_cnamecCs*|pt}|j�|�}|jd|||||d�S)z�
        Add a new A record to this Zone.  See _new_record for
        parameter documentation.  Returns a Status object.
        �Ar=r>r@rrr�add_a���z
Zone.add_acCs*|pt}|j�|�}|jd|||||d�S)z�
        Add a new MX record to this Zone.  See _new_record for
        parameter documentation.  Returns a Status object.
        �MXr=r>)rr�recordsr+rr,rrr�add_mx�rDzZone.add_mxrFc
s,|j�|�}|jj|j||d�}g}|D]}|j|kr&|j|kr&|�|�qd�d��durDzt�d��d�Wn�d�Y�durR��fdd�|D�}�dur`��fdd�|D�}|s�t|�|kr�d||f}	|	d7}	|	d	�	d
d�|D��7}	t
|	��t|�dkr�|St|�dkr�|dSdS)a�
        Search this Zone for records that match given parameters.
        Returns None if no results, a ResourceRecord if one result, or
        a ResourceRecordSets if more than one result.

        :type name: str
        :param name: The name of the records should match this parameter

        :type type: str
        :param type: The type of the records should match this parameter

        :type desired: int
        :param desired: The number of desired results.  If the number of
           matching records in the Zone exceeds the value of this parameter,
           throw TooManyRecordsException

        :type all: Boolean
        :param all: If true return all records that match name, type, and
          identifier parameters

        :type identifier: Tuple
        :param identifier: A tuple specifying WRR or LBR attributes.  Valid
           forms are:

           * (str, int): WRR record [e.g. ('foo',10)]
           * (str, str): LBR record [e.g. ('foo','us-east-1')

        )rr$Nrc�(g|]}|j�kr|j�dkr|�qS�r)r r��.0r:)rr rr�
<listcomp>���z%Zone.find_records.<locals>.<listcomp>crHrI)r!rrJ)rr!rrrLrMzSearch: name %s type %sz
Found: z, cSs"g|]
}d|j|j|��f�qS)z%s %s %s)rr$�to_printrJrrrrLs�r)r	r?�get_all_rrsetsrrr$�appendr"�len�joinr)
rrr$�desired�allr�returned�resultsr:�messager)rr!r r�find_records�sB�

�zZone.find_recordscC�|j|d|d�S)z�
        Search this Zone for CNAME records that match name.

        Returns a ResourceRecord.

        If there is more than one match return all as a
        ResourceRecordSets if all is True, otherwise throws
        TooManyRecordsException.
        r<�rT�rX�rrrTrrr�	get_cname�
zZone.get_cnamecCrY)z�
        Search this Zone for A records that match name.

        Returns a ResourceRecord.

        If there is more than one match return all as a
        ResourceRecordSets if all is True, otherwise throws
        TooManyRecordsException.
        rBrZr[r\rrr�get_ar^z
Zone.get_acCrY)z�
        Search this Zone for MX records that match name.

        Returns a ResourceRecord.

        If there is more than one match return all as a
        ResourceRecordSets if all is True, otherwise throws
        TooManyRecordsException.
        rErZr[r\rrr�get_mx*r^zZone.get_mxcC�@|j�|�}|j�|�}|�|�}|p|j}|j|||||d�S)z�
        Update the given CNAME record in this Zone to a new value, ttl,
        and identifier.  Returns a Status object.

        Will throw TooManyRecordsException is name, value does not match
        a single record.
        �r6r7r8r,)r	r?r]r+r9�rrr*r+rr,r5rrr�update_cname6�

�zZone.update_cnamecCs4|j�|�}|�|�}|p|j}|j|||||d�S)z�
        Update the given A record in this Zone to a new value, ttl,
        and identifier.  Returns a Status object.

        Will throw TooManyRecordsException is name, value does not match
        a single record.
        rb)r	r?r_r+r9rcrrr�update_aHs

�z
Zone.update_acCra)z�
        Update the given MX record in this Zone to a new value, ttl,
        and identifier.  Returns a Status object.

        Will throw TooManyRecordsException is name, value does not match
        a single record.
        rb)r	r?r`r+r9rcrrr�	update_mxYrezZone.update_mxcC�(|j�|�}|j|d||d�}|�|�S)z�
        Delete a CNAME record matching name and identifier from
        this Zone.  Returns a Status object.

        If there is more than one match delete all matching records if
        all is True, otherwise throws TooManyRecordsException.
        r<�rrT�r	r?rXr;�rrrrTr.rrr�delete_cnamek�

�
zZone.delete_cnamecCrh)z�
        Delete an A record matching name and identifier from this
        Zone.  Returns a Status object.

        If there is more than one match delete all matching records if
        all is True, otherwise throws TooManyRecordsException.
        rBrirjrkrrr�delete_axrmz
Zone.delete_acCrh)z�
        Delete an MX record matching name and identifier from this
        Zone.  Returns a Status object.

        If there is more than one match delete all matching records if
        all is True, otherwise throws TooManyRecordsException.
        rErirjrkrrr�	delete_mx�rmzZone.delete_mxcCs|j�|j�S)zS
        Return a ResourceRecordsSets for all of the records in this zone.
        )r	rOrrrrr�get_records�szZone.get_recordscCs|j�|j�dS)z>
        Request that this zone be deleted by Amazon.
        N)r	�delete_hosted_zonerrrrr�delete�szZone.deletecCs |�|jd�}|dur|j}|S)z+ Get the list of nameservers for this zone.�NSN)rXr�resource_records)r�nsrrr�get_nameservers�szZone.get_nameservers)r)rNr)NNr)rFN)F)NF)�__name__�
__module__�__qualname__�__doc__rrrr/r0r9r;rArCrGrXr]r_r`rdrfrgrlrnrorprrrvrrrrr!s<
�1
�
�





I









r)
r2r3�boto.exceptionr�boto.route53.recordr�boto.route53.statusr�objectrrrrr�<module>s

https://t.me/RX1948 - 2025