|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/boto3/__pycache__/ |
U
Q��g�T � @ sv d dl Z d dlZd dlZd dlmZ d dlmZmZm Z d dl
Z
d dlZ
d dlm
Z
mZ ddlmZ G dd� d�ZdS ) � N)�Config)�DataNotFoundError�NoCredentialsError�UnknownServiceError)�ResourceNotExistsError�UnknownAPIVersionError� )�ResourceFactoryc
@ s� e Zd ZdZd(dd�Zdd� Zedd� �Zed d
� �Zedd� �Z ed
d� �Z
dd� Zdd� Zdd� Z
dd� Zd)dd�Zdd� Zdd� Zd*d d!�Zd+d"d#�Zd$d%� Zd&d'� ZdS ),�Sessionaz
A session stores configuration state and allows you to create service
clients and resources.
:type aws_access_key_id: string
:param aws_access_key_id: AWS access key ID
:type aws_secret_access_key: string
:param aws_secret_access_key: AWS secret access key
:type aws_session_token: string
:param aws_session_token: AWS temporary session token
:type region_name: string
:param region_name: Default region when creating new connections
:type botocore_session: botocore.session.Session
:param botocore_session: Use this Botocore session instead of creating
a new default one.
:type profile_name: string
:param profile_name: The name of a profile to use. If not given, then
the default profile is used.
:type aws_account_id: string
:param aws_account_id: AWS account ID
Nc
C s� |d k r|| _ ntj�� | _ | j jdkrnd| j j� �}| j jrT| j jd| 7 _n|| j _d| j _tj| j _|d k r�| j � d|� ||||f} t
| �r�| �|||�r�t� �| j �
||||� |d k r�| j � d|� t| j �d��| _| �� | �� d S )NZBotocorez Botocore/� ZBoto3�profile�region�
event_emitter)�_session�botocore�sessionZget_sessionZuser_agent_nameZuser_agent_version�user_agent_extra�boto3�__version__Zset_config_variable�any�#_account_id_set_without_credentialsr Zset_credentialsr �
get_component�resource_factory�
_setup_loader�_register_default_handlers)
�self�aws_access_key_id�aws_secret_access_key�aws_session_token�region_nameZbotocore_session�profile_name�aws_account_idZ
botocore_info�creds� r# �:/opt/cppython/lib/python3.8/site-packages/boto3/session.py�__init__7 sJ
� ��
�zSession.__init__c C s d� | jjt| j�d���S )Nz{}(region_name={})r
)�format� __class__�__name__�reprr �get_config_variable�r r# r# r$ �__repr__o s �zSession.__repr__c C s | j jp
dS )z1
The **read-only** profile name.
�default)r r r+ r# r# r$ r u s zSession.profile_namec C s | j �d�S )z0
The **read-only** region name.
r
)r r* r+ r# r# r$ r | s zSession.region_namec C s | j �d�S )z1
The event emitter for a session
r )r r r+ r# r# r$ �events� s zSession.eventsc C s | j jS )zC
The profiles available to the session credentials
)r �available_profilesr+ r# r# r$ r/ � s zSession.available_profilesc C s2 | j �d�| _| jj�tj�tj�t �d�� dS )zC
Setup loader paths so that we can load resources.
Zdata_loader�dataN)
r r �_loaderZsearch_paths�append�os�path�join�dirname�__file__r+ r# r# r$ r � s �zSession._setup_loaderc C s
| j �� S )z�
Get a list of available services that can be loaded as low-level
clients via :py:meth:`Session.client`.
:rtype: list
:return: List of service names
)r �get_available_servicesr+ r# r# r$ r8 � s zSession.get_available_servicesc C s | j jdd�S )z�
Get a list of available services that can be loaded as resource
clients via :py:meth:`Session.resource`.
:rtype: list
:return: List of service names
�resources-1)� type_name)r1 Zlist_available_servicesr+ r# r# r$ �get_available_resources� s zSession.get_available_resourcesc C s
| j �� S )z�Lists the available partitions
:rtype: list
:return: Returns a list of partition names (e.g., ["aws", "aws-cn"])
)r �get_available_partitionsr+ r# r# r$ r<