File: //lib/python3.6/site-packages/sos/upload/__pycache__/__init__.cpython-36.pyc
3
\��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 � j|||� d| _nN|d | _|d | _|d | _|| _|| _|| _|| _ t
jd�| _d| _|| _
| j� | _d | _d S )NTZoptions�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__� �/usr/lib/python3.6/__init__.pyr 5 s
zSoSUpload.__init__c C s: d|_ |jdd�}|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$d$d%d&gd'd(� |jd)d$d$d*d+d,d-gd.d(� |jd/d0d1d2d3� |jd4d5d6d7d8d5gd9d(� d S ):Nzsos upload FILE [options]zUpload Optionsz.These options control how upload manages filesr �FILEzThe file or archive to upload)�metavar�helpz --case-idZstorer 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 ZputZpostz HTTP method to use for uploading)r$ �choicesr! z--upload-protocolZhttpsZftpZsftpZs3z$Manually specify the upload protocolz--upload-no-ssl-verifyF�
store_truez'Disable SSL verification for upload url)r$ r"