o .&a-@s@ddlZddlmZddlmZddlmZGdddeZdS)N)partial)urlopen) BasicCommandc@s4eZdZdZdZddddddddgZd d Zd S) GetGameSessionLogCommandzget-game-session-logz2Download a compressed log file for a game session.zgame-session-idTzThe game session ID)namerequired help_textzsave-asz5The filename to which the file should be saved (.zip)c Cs|jjd|j|j|jd}|j|jd}|d}t|}tj d|jt |j d}t t|jddD]}| |q5Wdn1sGwYtj d |j|j fd S) Ngamelift) region_name endpoint_urlverify) GameSessionId PreSignedUrlz/Downloading log archive for game session %s... wbiz>Successfully downloaded log archive for game session %s to %s r)_session create_clientregionr verify_sslget_game_session_log_urlgame_session_idrsysstdoutwriteopensave_asiterrread) selfargsparsed_globalsclientresponseurlcontentsfchunkr'G/usr/lib/python3/dist-packages/awscli/customizations/gamelift/getlog.py _run_mains4  z"GetGameSessionLogCommand._run_mainN)__name__ __module__ __qualname__NAME DESCRIPTION ARG_TABLEr)r'r'r'r(rs r)r functoolsr awscli.compatrawscli.customizations.commandsrrr'r'r'r(s