HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //usr/lib/google-cloud-sdk/lib/surface/compute/routers/__pycache__/update.cpython-312.pyc
�

������dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZe
j(e
j*j,�Gd�de
j.��Ze
j(e
j*j2�Gd�de��Ze
j(e
j*j6�Gd�de��Zddie_y)z,Command for updating Compute Engine routers.�)�absolute_import)�division)�unicode_literals)�base_classes)�
routers_utils)�poller)�waiter)�base)�flags)�router_utils)�log)�	resourcesc�@�eZdZdZdZed��Zed��Zd�Zd�Z	y)�Update�Update a Compute Engine router.Nc�X�tj�|_|jj|d��tj
j
|�tj|�tj|�tj|�tj|d�y)N�update)�operation_type�router)r�RouterArgument�
ROUTER_ARG�AddArgumentr
�
ASYNC_FLAG�AddToParser�AddKeepaliveIntervalArg�AddBgpIdentifierRangeArg�	AddAsnArg� AddUpdateCustomAdvertisementArgs��cls�parsers  �%lib/surface/compute/routers/update.py�_ArgszUpdate._Args&ss���)�)�+�C�N��N�N���v�h��?��O�O����'�	�!�!�&�)�	�"�"�6�*�	�O�O�F��	�*�*�6�8�<�c�&�|j|�y)N)r#rs  r"�ArgszUpdate.Args0s���I�I�f�r$c	�6�tj|�tj|j	��}|j
j}|j
jj}|jj||j�}|j}|j|di|j����}|jxs|j!�|_|jj"}|j$�!t'|jd|j$�|j(�!t'|jd|j(�|j*�!t'|jd|j*�tj,|�r�tj.||j |��\}	}
}tj0||j ||	��|	|
|d�}|j3�D]\}
}|��	t'|j|
|��!tj4|��r�tj6||j |j��|j8rPt;j<|j |j8��}|jj>jA|�|jBrXt;j<|j |jB��}tjD||j |j|�	�|jFrFt;jH||jF�
�}|jjJjA|�|jLr7tjN||j |j|jL��g}|jj>s|jQd�|jjJs|jQd
�|j
jjS|�5|jT}|jW||jX|jZ|j]�|���}ddd�tj^jajbd|jX|jZd���}|jdr8tgjh|djk|j]��dd��|S|jja|j]�d|jX|jZd���}tmjn||�}tqjr||djk|j]���S#1swY��xYw)N�keepaliveInterval�identifierRange�asn)�messages�resource_class�args)r+r,�
existing_mode�new_mode)�
advertiseMode�advertisedGroups�advertisedIpRanges)r+r,�resource)r,�groups)r+r,r3r4)r+�	ip_ranges)r+r,r3r5zbgp.advertisedGroupszbgp.advertisedIpRanges)�project�regionr�routerResourcezcompute.regionOperations)r6r7)�
collection�paramszrouter [{0}]Tz[Run the [gcloud compute operations describe] command to check the status of this operation.)�kind�is_async�detailszcompute.routerszUpdating router [{0}]�):r�CheckIncompatibleFlagsOrRaiser�ComputeApiHolder�ReleaseTrack�clientr+�apitools_client�routersr�ResolveAsResourcer�ComputeRoutersGetRequest�Get�AsDict�bgp�	RouterBgpr0�keepalive_interval�setattr�bgp_identifier_ranger*�HasReplaceAdvertisementFlags�ParseAdvertisements�PromptIfSwitchToDefaultMode�items� HasIncrementalAdvertisementFlags�ValidateCustomMode�add_advertisement_groupsr�ParseGroupsr1�extend�remove_advertisement_groups�RemoveGroupsFromAdvertisements�add_advertisement_ranges�
ParseIpRangesr2�remove_advertisement_ranges� RemoveIpRangesFromAdvertisements�append�
IncludeFields�ComputeRoutersPatchRequest�Patchr6r7�Name�REGISTRY�Parse�name�async_r
�UpdatedResource�formatr�Pollerr	�WaitFor)�selfr-�holderr+�service�
router_ref�request_type�replacementr.�moder4�ranges�attrs�attr�value�
groups_to_add�groups_to_remove�ip_ranges_to_add�cleared_fields�result�
operation_ref�target_router_ref�operation_pollers                       r"�_RunzUpdate._Run4s����.�.�t�4�
�
*�
*�4�+<�+<�+>�
?�F��}�}�%�%�H��m�m�+�+�3�3�G����2�2�4��9I�9I�J�J��4�4�L��+�+�l�A�Z�->�->�-@�A�B�K�!�o�o�=��);�);�)=�K�O��O�O�1�1�M����*�
�k�o�o�2�D�4K�4K�L�� � �,�
�k�o�o�0�$�2K�2K�L��x�x��
�k�o�o�u�d�h�h�/��0�0��6�)�=�=��H�,>�,>�T���d�F�F��.�.��!�+�+�%��	� �$� &��e�����+�$����
�+�/�/�4��
/�'��4�4�T�:��%�%��!�+�+��?�?��
�	&�	&�%�1�1�#�-�-��0�0�
�
�	���(�(�/�/�
�>�	
�	)�	)�(�4�4�#�-�-��3�3�
��	�3�3��#�-�-� �_�_�#�		
�
�	&�	&�(�6�6���)F�)F�
��	���*�*�1�1�2B�C�	
�	)�	)��5�5��#�-�-� �_�_��6�6�		
��N��?�?�+�+����2�3��?�?�-�-����4�5�	���	&�	&�	4�	4�^�	D��8�8�l��}�}�
� �(�(��&�&��_�_�&�(�	��f�
E��&�&�,�,����-�!�)�)� �'�'�
�-��M��{�{�	���
��$�$�Z�_�_�%6�7��7���m��(�(�.�.�����$�!�)�)� �'�'�
�/����}�}�W�.?�@���>�>����&�&�z���'8�9���U
E�	D�s
�(A
V�Vc�$�|j|�S)zSee base.UpdateCommand.)r})rjr-s  r"�Runz
Update.Run�s���9�9�T�?�r$)
�__name__�
__module__�__qualname__�__doc__r�classmethodr#r&r}rr>r$r"rr s<��'��*��=��=�����M�^r$rc��eZdZdZy)�
UpdateBetarN�r�r�r�r�r>r$r"r�r�����'�r$r�c��eZdZdZy)�UpdateAlpharNr�r>r$r"r�r��r�r$r��DESCRIPTIONzH
        *{command}* is used to update a Compute Engine router.
        N)r��
__future__rrr�googlecloudsdk.api_lib.computerr�)googlecloudsdk.api_lib.compute.operationsr�googlecloudsdk.api_lib.utilr	�googlecloudsdk.callioper
�*googlecloudsdk.command_lib.compute.routersrr�googlecloudsdk.corer
r�
ReleaseTracksrA�GA�
UpdateCommandr�BETAr��ALPHAr��
detailed_helpr>r$r"�<module>r�s���3�&��'�7�8�<�.�(�<�C�#�)�����D�%�%�(�(�)�d�T�
�
�d�*�d�N����D�%�%�*�*�+����,������D�%�%�+�+�,��*��-������r$