File: //lib/python3/dist-packages/awscli/customizations/gamelift/__pycache__/getlog.cpython-310.pyc
o
.&�a- � @ s@ d dl Z d dlmZ d dlmZ d dlmZ G dd� de�ZdS )� N)�partial)�urlopen)�BasicCommandc @ s4 e Zd ZdZdZdddd�dddd�gZd d
� ZdS )�GetGameSessionLogCommandzget-game-session-logz2Download a compressed log file for a game session.zgame-session-idTzThe game session ID)�name�required� help_textzsave-asz5The filename to which the file should be saved (.zip)c C s� | j jd|j|j|jd�}|j|jd�}|d }t|�}tj �
d|j � t|jd��}t
t|jd�d�D ]}|�
|� q5W d � n1 sGw Y tj �
d |j|jf � d
S )N�gamelift)�region_name�endpoint_url�verify)�
GameSessionId�PreSignedUrlz/Downloading log archive for game session %s...
�wbi � z>Successfully downloaded log archive for game session %s to %s
r )�_session�
create_client�regionr �
verify_ssl�get_game_session_log_url�game_session_idr �sys�stdout�write�open�save_as�iterr �read) �self�args�parsed_globals�client�response�url�contents�f�chunk� r'