File: //lib/python3.9/site-packages/sos/upload/__pycache__/__init__.cpython-39.pyc
a
\��h�3 � @ s` d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlm
Z
G dd� de�ZdS )� N)�SoSComponent)�_sos)�__version__c s� e Zd ZdZdZdddddddddddddddddd�Zd#� fd d
� Zedd� �Zed
d� �Z dd� Z
dd� Zdd� Zdd� Z
dd� Zedd� �Zedd� �Zedd� �Zdd � Zd!d"� Z� ZS )$� SoSUploadz�
This class is designed to upload files to a distribution
defined location. These files can be either sos reports,
sos collections, or other kind of files like: vmcores,
application cores, logs, etc.
z9Upload a file to a user or policy defined remote location� FN�autozhttps://s3.amazonaws.com)�upload_file�case_id�low_priorityZ
upload_url�upload_directoryZupload_userZupload_passZ
upload_methodZupload_no_ssl_verifyZupload_protocolZupload_s3_endpointZupload_s3_regionZupload_s3_bucketZupload_s3_access_keyZupload_s3_secret_keyZupload_s3_object_prefix�
upload_targetc s~ |st � �|||� d| _nN|d | _|d | _|d | _|| _|| _|| _|| _ t
�d�| _d| _|| _
| �� | _d | _d S )NT�options�policy�manifestZsos_uiF)�super�__init__�from_cmdline�optsr r �parser�cmdline�argsZ_upload_file�loggingZ getLogger�ui_log�archive�load_upload_targets�upload_targetsr )�selfr r r Zin_placeZhook_commonsr �� __class__� �7/usr/lib/python3.9/site-packages/sos/upload/__init__.pyr 5 s
zSoSUpload.__init__c C s. d|_ |�dd�}|jdddd� |jdd d
dd� |jd
d dd� |jdd dd� |jdd dd� |jdd ddd� |jdd dd� |jdd dd� |jdd dd� |jdd dd� |jdd d d� |jd!d d"d� |jd#d$g d%�d&d'� |jd(d$g d)�d*d'� |jd+d,d-d.d/� |jd0d1g d2�d3d'� d S )4Nzsos upload FILE [options]zUpload Optionsz.These options control how upload manages filesr �FILEzThe file or archive to upload)�metavar�helpz --case-id�storer zspecify case identifier)�action�destr# z--upload-urlz&Upload the archive to specified server)�defaultr# z
--upload-userzUsername to authenticate withz
--upload-passzPassword to authenticate withz--upload-directoryr z$Specify upload directory for archivez--upload-s3-endpointz#Endpoint to upload to for S3 bucketz--upload-s3-regionz!Region to upload to for S3 bucketz--upload-s3-bucketz"Name of the S3 bucket to upload toz--upload-s3-access-keyzAccess key for the S3 bucketz--upload-s3-secret-keyzSecret key for the S3 bucketz--upload-s3-object-prefixzPrefix for the S3 object/keyz--upload-methodr )r ZputZpostz HTTP method to use for uploading)r'