HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/datapipeline/__pycache__/__init__.cpython-310.pyc
o

.&�a4B�@s2ddlZddlmZmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZd	Zd
ZdZdZd
ZGdd�de�ZGdd�de�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd,dd�ZGd d!�d!e�ZGd"d#�d#e�Z Gd$d%�d%e�Z!Gd&d'�d'e�Z"Gd(d)�d)e�Z#Gd*d+�d+e�Z$dS)-�N)�datetime�	timedelta)�
get_formatter)�CustomArgument)�BasicCommand)�
translator)�CreateDefaultRoles)�ListRunsFormatterz�The JSON pipeline definition.  If the pipeline definition
is in a file you can use the file://<filename> syntax to
specify a filename.
aThe JSON parameter objects.  If the parameter objects are
in a file you can use the file://<filename> syntax to
specify a filename. You can optionally provide these in
pipeline definition as well. Parameter objects provided
on command line would replace the one in definition.
aThe JSON parameter values.  If the parameter values are
in a file you can use the file://<filename> syntax to
specify a filename. You can optionally provide these in
pipeline definition as well. Parameter values provided
on command line would replace the one in definition.
aThe JSON parameter values. You can specify these as
key-value pairs in the key=value format. Multiple parameters
are separated by a space. For list type parameter values
you can use the same key name and specify each value as
a key value pair. e.g. arrayValue=value1 arrayValue=value2
�dc@seZdZdS)�DocSectionNotFoundErrorN)�__name__�
__module__�__qualname__�rr�M/usr/lib/python3/dist-packages/awscli/customizations/datapipeline/__init__.pyr8srcseZdZ�fdd�Z�ZS)�ParameterDefinitionErrorcs"d|}tt|��|�||_dS)NzError in parameter: %s
)�superr�__init__�msg)�selfr�full_msg��	__class__rrr=s
z!ParameterDefinitionError.__init__)rr
rr�
__classcell__rrrrr<srcCs@|�dt�|�dt�|�dt�|�dt�|�dt�dS)Nz<building-argument-table.datapipeline.put-pipeline-definitionz6building-argument-table.datapipeline.activate-pipelinez-after-call.datapipeline.GetPipelineDefinitionz#building-command-table.datapipelinez/doc-output.datapipeline.get-pipeline-definition)�register�add_pipeline_definition�activate_pipeline_definition�translate_definition�register_commands�
register_last�document_translation)�clirrr�register_customizationsCs(�����r"cKst|�|d<t|�|d<dS)N�	list-runszcreate-default-roles)�ListRunsCommandr)�
command_table�session�kwargsrrrrUsrcKsZ|j}d}|dkr!z|��}Wn
tytd|��w|dks	|�d�|�d�dS)N�z======
Output
======z7Could not find the "output" section for the command: %sz�
The output of this command is the pipeline definition, which is documented in the `Pipeline Definition File Syntax <http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-writing-pipeline-definition.html>`__)�doc�	pop_write�
IndexErrorr�write)�help_commandr'r)�currentrrrr Zs"����
	�r cKsTtddtd�|d<tddtd�|d<tddtd�|d<tdddtd	�|d<|d
=dS)Nzpipeline-definitionT��required�	help_textzparameter-objectsF�parameter-values-uri�parameter-values�+�r0�nargsr1zpipeline-objects)�PipelineDefinitionArgument�DEFINITION_HELP_TEXT�ParameterObjectsArgument�PARAMETER_OBJECTS_HELP_TEXT�ParameterValuesArgument�PARAMETER_VALUES_HELP_TEXT�ParameterValuesInlineArgument�!INLINE_PARAMETER_VALUES_HELP_TEXT��argument_tabler'rrrrrs(
�
�
�
�
rcKs*tddtd�|d<tdddtd�|d<dS)Nr2Fr/r3r4r5)r;r<r=r>r?rrrr�s
��rcKst�|�dS�N)r�api_to_definition)�parsedr'rrrr�srcCsjg}|D]$}|d|dd�}|dD]}|�d|�d��||d<q|�|�q|dur3|j|d�|S)	N�id�name)z@idrE�fields�stringValue�refValue�key)rI)�get�append�sort)�api_describe_objects�
sort_key_func�	converted�obj�
new_fields�fieldrrr�convert_described_objects�s��rSc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)�QueryArgBuilderzG
    Convert CLI arguments to Query arguments used by QueryObject.
    NcCs|durt��}||_dSrA)r�utcnow�current_time)rrVrrrr�s
zQueryArgBuilder.__init__cCs�g}|jdur.|jdur.|j}|tdd�}|�d�}|�d�}|�dd||gd�d��n|�||�|jdur?|�||�d|i}|S)	N�)�daysz%Y-%m-%dT%H:%M:%S�@actualStartTime�BETWEEN��type�values��	fieldName�operator�	selectors)	�start_interval�schedule_intervalrVr�strftimerK�_build_schedule_times�status�
_build_status)r�parsed_argsra�end_datetime�start_datetime�start_time_str�end_time_str�queryrrr�build_query�s$



�
�
zQueryArgBuilder.build_querycCsx|jdur|jd}|jd}|�dd||gd�d��|jdur:|jd}|jd}|�dd||gd�d��dSdS)Nr�rYrZr[r^�@scheduledStartTime)rbrKrc)rrarhrkrlrrrre�s&


��


���z%QueryArgBuilder._build_schedule_timescCs&|�dddd�|jD�d�d��dS)Nz@status�EQcS�g|]}|���qSr)�upper)�.0rfrrr�
<listcomp>�sz1QueryArgBuilder._build_status.<locals>.<listcomp>r[r^)rKrf)rrarhrrrrg�s��zQueryArgBuilder._build_statusrA)rr
r�__doc__rrnrergrrrrrT�s
rTc@�eZdZdd�ZdS)r7cCsx|durdSt�|�}t�|�}t�|�}t�|�}||d<d|vr*|dur*||d<d|vr8|dur:||d<dSdSdS)N�pipelineObjects�parameterObjects�parameterValues)�json�loadsr�definition_to_api_objects�definition_to_api_parameters�definition_to_parameter_values)r�
parameters�valuerC�api_objects�parameter_objects�parameter_valuesrrr�
add_to_params�s



�z(PipelineDefinitionArgument.add_to_paramsN�rr
rr�rrrrr7��r7c@rw)r9cCs,|durdSt�|�}t�|�}||d<dS)Nry)r{r|rr~)rr�r�rCr�rrrr�
s


z&ParameterObjectsArgument.add_to_paramsNr�rrrrr9	r�r9c@rw)r;cCsD|durdS|�dd�durtd��t�|�}t�|�}||d<dS)Nrz�8Only parameter-values or parameter-values-uri is allowed)rJ�	Exceptionr{r|rr)rr�r�rCr�rrrr�s�

z%ParameterValuesArgument.add_to_paramsNr�rrrrr;r�r;c@rw)r=c		Cs�|durdS|�dd�durtd��i}|D]?}z0|�dd�}|d}|d}||vrCt||t�r:||�|�n
|||g||<n|||<WqtyUtd|��wd|i}t�	|�}||d<dS)Nrzr��=rorz#Invalid inline parameter format: %sr])
rJr��split�
isinstance�listrKr+rrr)	rr�r��parameter_object�argument�argument_componentsrIrCr�rrrr�#s4����
z+ParameterValuesInlineArgument.add_to_paramsNr�rrrrr="r�r=c	@s�eZdZdZdZdddddd�d	d
dd�dd
dddd�dddddd�gZgd�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d d!�Zd"S)#r$r#z�Lists the times the specified pipeline has run. You can optionally filter the complete list of results to include only the runs you are interested in.zpipeline-idzThe identifier of the pipeline.�storeT�string)rEr1�actionr0�
cli_type_namerfz�Filters the list to include only runs in the specified statuses. The valid statuses are as follows: waiting, pending, cancelled, running, finished, failed, waiting_for_runner, and waiting_on_dependencies.)rEr1r�zstart-intervalzQFilters the list to include only runs that started within the specified interval.Fzschedule-intervalz`Filters the list to include only runs that are scheduled to start within the specified interval.)	�waiting�pending�	cancelled�running�finished�failed�waiting_for_runner�waiting_on_dependencies�
shutting_downcKs$|�|�|�|�|�||�dSrA)�_set_client�_parse_type_args�
_list_runs)rrh�parsed_globalsr'rrr�	_run_mainds

zListRunsCommand._run_maincCs |jjd|j|j|jd�|_dS)N�datapipeline)�region_name�endpoint_url�verify)�_session�
create_client�regionr��
verify_ssl�client)rr�rrrr�is�zListRunsCommand._set_clientcCsz|jdurdd�|j�d�D�|_|jdur"dd�|j�d�D�|_|jdur;dd�|j�d�D�|_|�|j�dSdS)NcSrrr��strip�rt�argrrrruw��z4ListRunsCommand._parse_type_args.<locals>.<listcomp>�,cSrrrr�r�rrrru{r�cSrrrr�r�rrrrur�)rbr�rcrf�_validate_status_choices)rrhrrrr�rs

�

�

��z ListRunsCommand._parse_type_argscCs0|D]}||jvrtd|d�|j�f��qdS)Nz&Invalid status: %s, must be one of: %sz, )�VALID_STATUS�
ValueError�join)r�statusesrfrrrr��s
���z(ListRunsCommand._validate_status_choicescCsRt��|�}|�|j|�}|�|j|�}t|dd�d�}|�|�}||j|�dS)NcSs|�d�|�d�fS)NrprE)rJ)�xrrr�<lambda>�s�z,ListRunsCommand._list_runs.<locals>.<lambda>)rN)rTrn�_query_objects�pipeline_id�_describe_objectsrS�_get_formatter�NAME)rrhr�rm�
object_ids�objectsrO�	formatterrrrr��s�
zListRunsCommand._list_runscCsLg}tdt|�t�D]}|||t�}|jj||d�}|�|d�q
|S)Nr)�
pipelineId�	objectIdsrx)�range�len�MAX_ITEMS_PER_DESCRIBEr��describe_objects�extend)rr�r�r��i�current_object_ids�resultrrrr��s�z!ListRunsCommand._describe_objectscCs(|j�d�j|d|d�}|��}|dS)N�
query_objects�INSTANCE)r��sphererm�ids)r��
get_paginator�paginate�build_full_result)rr�rm�	paginatorrCrrrr��s�zListRunsCommand._query_objectscCs |j}|durt|�St||�SrA)�outputr	r)rr�r�rrrr��s
zListRunsCommand._get_formatterN)rr
rr��DESCRIPTION�	ARG_TABLEr�r�r�r�r�r�r�r�r�rrrrr$Ds:������	
r$rA)%r{rr�awscli.formatterr�awscli.argumentsr�awscli.customizations.commandsr�"awscli.customizations.datapipeliner�5awscli.customizations.datapipeline.createdefaultrolesr�4awscli.customizations.datapipeline.listrunsformatterr	r8r:r<r>r�r�rrr"rr rrrrS�objectrTr7r9r;r=r$rrrr�<module>s8

B	"