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/services/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

ckF[��@s�ddlmZddlmZddlmZddlmZddlZddl	Z	ddl
Z
ddlmZGdd�de
�Zed	kr?e�Ze��dSdS)
�)�OptionParser)�
ServiceDef)�	Submitter)�ResultProcessorN)�StringIOc@sjeZdZdZddddddd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�BSz*usage: %prog [options] config_file commandz#Clear input queue and output bucketz!Submit local files to the servicezStart the servicez6Report on the status of the service buckets and queuesz$Retrieve output generated by a batchz0List all batches stored in current output_domain)�reset�submit�start�status�retrieve�batchescCsd|_t|jd�|_|jjddddd�|jjddd	d
dd�|jjd
dd	d
dd�|jjddd	d
ddd�|jjddd	d
ddd�|jjdddddd�|jjdd�|jjdd d	d
d!d"d�|jjd#d$�|jjd%d&d'd
d(d)d�|jjd*d+d	d
d,d-d�dS).N)�usagez--help-commands�
store_true�
help_commandsz'provides help on the available commands)�action�dest�helpz-az--access-key�store�stringzyour AWS Access Key)r�typerz-sz--secret-keyzyour AWS Secret Access Keyz-pz--path�pathz3the path to local directory for submit and retrieve)rrrrz-kz	--keypair�keypairz.the SSH keypair used with launched instance(s)z-lz--leave�leavez>leave the files (don't retrieve) files during retrieve commandF)rz-nz--num-instances�
num_instancesz"the number of launched instance(s)�)rz-iz
--ignore-dirs�append�ignorez4directories that should be ignored by submit commandz-bz
--batch-id�batchz1batch identifier required by the retrieve command)�service_namer�Usage�parser�
add_option�set_defaults)�self�r%�2/usr/lib/python3/dist-packages/boto/services/bs.py�__init__)s>��������
�zBS.__init__cCs2td�|j��D]
}td||j|f�q	dS)Nz

Commands:z  %s		%s)�print�Commands�keys)r$�keyr%r%r&�print_command_helpAs�zBS.print_command_helpcCs�|j�d�}|r)td�d}|��}|r#|d7}|�|�|��}|std|�|j�d�}|j�d�}|r\|rA|j|jkrAdStd�d}|D]
}|d7}|��qItd	|�dSdS)
N�input_queuezclearing out input queuerrzdeleted %d messages�
output_bucket�input_bucketz'delete generated files in output bucketzdeleted %d keys)�sd�get_objr(�read�delete_message�name�delete)r$�iq�i�m�ob�ib�kr%r%r&�do_resetFs.
�
�zBS.do_resetc	Cs�|jjs
|j�d�tj�|jj�s|j�d|jj�t|j�}|�|jjd|jj	ddd|jj�}t
d|d�t
d|d�dS)N�No path provided�Invalid path (%s)Tz"A total of %d files were submittedrzBatch Identifier: %sr)�optionsrr!�error�os�existsrr0�submit_pathrr()r$�s�tr%r%r&�	do_submit]s

�zBS.do_submitc
Cs�|j�d�}|j�dd�}|j�dd�}|s|j�d�t��}|j�d�s>|j�d�|j�dd|j	�|j�dd	|j
�t�}|j�|�|�
|g�}|d
}|j|��|jj|jj||gd�}td|�td
|j�|jD]	}	td|	j�qrdS)N�ami_id�
instance_typezm1.small�security_group�defaultz3ami_id option is required when starting the service�Credentials�aws_access_key_id�aws_secret_access_keyr)�	user_data�key_name�	max_countrH�security_groupszStarting AMI: %sz0Reservation %s contains the following instances:z	%s)r0�getr!r@�boto�connect_ec2�has_section�add_section�setrLrMr�write�get_all_images�run�getvaluer?rrr(�id�	instances)
r$rGrHrI�ec2rD�rs�img�rr7r%r%r&�do_starths0�
�zBS.do_startcCs�|j�d�}|rtd|j|��f�|j�d�}|j�d�}|rA|r+|j|jkr+dSd}|D]}|d7}q/td|j|f�dSdS)Nr-z7The input_queue (%s) contains approximately %s messagesr.r/rrz'The output_bucket (%s) contains %d keys)r0r1r(r\�countr4)r$r6r9r:�totalr;r%r%r&�	do_status�s
�zBS.do_statuscCsx|jjs
|j�d�tj�|jj�s|j�d|jj�|jjs&|j�d�t|jj|j�}|j	|jj|jj
d�dS)Nr=r>z1batch identifier is required for retrieve command)�get_file)r?rr!r@rArBrrr0�get_resultsr)r$rDr%r%r&�do_retrieve�szBS.do_retrievecCsN|j�d�}|rtd�|�d�}|D]	}td|j�qdS|j�d�dS)N�
output_domainzAvailable Batches:z['type'='Batch']z  %sz&No output_domain specified for service)r0r1r(�queryr4r!r@)r$�dr_�itemr%r%r&�
do_batches�s
�z
BS.do_batchescCs�|j��\|_|_|jjr|��t�d�t|j�dkr#|j�	d�|jd|_
t|j
�|_|jd|_
t|d|j
�rJt|d|j
�}|�dS|j�	d|j
�dS)Nr�z$config_file and command are requiredrzdo_%szcommand (%s) not recognized)r!�
parse_argsr?�argsrr,�sys�exit�lenr@�config_filerr0�command�hasattr�getattr)r$�methodr%r%r&�main�s

zBS.mainN)�__name__�
__module__�__qualname__r r)r'r,r<rFrbrerhrmryr%r%r%r&rs$�

r�__main__)�optparser�boto.services.servicedefr�boto.services.submitr�boto.services.resultrrSrqrA�boto.compatr�objectrrz�bsryr%r%r%r&�<module>s�

https://t.me/RX1948 - 2025