| Server IP : 35.236.43.222 / Your IP : 216.73.216.143 Web Server : Apache System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64 User : deploy ( 1002) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/google-cloud-sdk/lib/surface/builds/triggers/__pycache__/ |
Upload File : |
�
��� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
ddlmZ dd l
mZ dd
lmZ ddlmZ ddlmZ dd
lmZ e
j e
j j e
j j � � G d� de
j � � � � ZdS )z+Export Cloud Build trigger to file command.� )�absolute_import)�division)�unicode_literals)�encoding)�cloudbuild_util)�base)�
resource_args)�concept_parsers)�
properties)� resources)�yaml)�filesc �6 � e Zd ZdZddiZed� � � Zd� ZdS )�ExportzExport a build trigger.�EXAMPLESz�
To export a build trigger to a file called trigger.yaml, run:
$ {command} MY-TRIGGER --destination=trigger.yaml
c �� � t j � dt j � � dd�� � � | � � | � dddd�� � d S )
z�Register flags for this command.
Args:
parser: An argparse.ArgumentParser-like object. It is mocked out in order
to capture some information, but behaves like an ArgumentParser.
�TRIGGERzBuild Trigger.T��requiredz
--destination�PATHz4File path where trigger should be exported.
)�metavarr �helpN)r
�
ConceptParser�ForResourcer �GetTriggerResourceSpec�AddToParser�add_argument)�parsers �%lib/surface/builds/triggers/export.py�ArgszExport.Args, s{ � � �!�-�-���,�.�.��� .� � � #�{�6�*�*�*�
������� �
�
�
�
�
� c � � t j � � }t j � � }t j j j � d�� � }t j j j � � � }|j p
|pt j
}|j }t j
� ||||d�d�� � � � � }|j � |� ||�� � � � } t% j |j � � 5 }
t+ j t/ j | � � |
�� � ddd� � dS # 1 swxY w Y dS ) z�Exports a build trigger.
Args:
args: an argparse namespace. All the arguments that were provided to this
command invocation.
Tr )�
projectsId�locationsId�
triggersIdz&cloudbuild.projects.locations.triggers)�params�
collection)�name� triggerId)�streamN)r �GetClientInstance�GetMessagesModuler �VALUES�core�project�Get�builds�region�DEFAULT_REGIONr r �REGISTRY�Parse�RelativeName�projects_locations_triggers�-CloudbuildProjectsLocationsTriggersGetRequestr �
FileWriter�destinationr
�dumpr �
MessageToDict)�self�args�client�messagesr/ �
regionprop�location�triggerr( �got_trigger�outs r �Runz
Export.RunC s� � � �
.�
0�
0�F��0�2�2�H���$�,�0�0�$�0�?�?�G��"�)�0�4�4�6�6�J��{�J�j�J�O�,J�H��l�G���#�#��!�#�!�
�
�
<� $� =� =� >J�\�^�^� � �4�8�8��>�>��� ?� *� *�+� +�K�
� �$�*� +� +� A�s�
�i��&�{�3�3�C�@�@�@�@�A� A� A� A� A� A� A� A� A� A� A� A���� A� A� A� A� A� As �)E�E�EN)�__name__�
__module__�__qualname__�__doc__�
detailed_help�staticmethodr rF � r! r r r sZ � � � � � ��� �
��-� �
�
� �<�
�,A� A� A� A� Ar! r N)rJ �
__future__r r r �apitools.base.pyr �!googlecloudsdk.api_lib.cloudbuildr �googlecloudsdk.callioper �%googlecloudsdk.command_lib.cloudbuildr �(googlecloudsdk.command_lib.util.conceptsr
�googlecloudsdk.corer r r
�googlecloudsdk.core.utilr �
ReleaseTracks�ReleaseTrack�ALPHA�BETA�Commandr rM r! r �<module>r[ sN �� 2� 1� &� &� &� &� &� &� � � � � � � '� '� '� '� '� '� %� %� %� %� %� %� =� =� =� =� =� =� (� (� (� (� (� (� ?� ?� ?� ?� ?� ?� D� D� D� D� D� D� *� *� *� *� *� *� )� )� )� )� )� )� $� $� $� $� $� $� *� *� *� *� *� *� ���D�%�+�T�->�-C�D�D�>A� >A� >A� >A� >A�T�\� >A� >A� E�D�>A� >A� >Ar!