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__/create.cpython-312.pyc
�

��� ��"�dZddlmZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZddlmZdd
lmZddlmZddlZe
j2e
j4e
j6j8�Gd�de
j:���Ze
j4e
j6j>�Gd�de��Z e
j4e
j6jB�Gd�de ��Z"y)z,Command for creating Compute Engine routers.�)�absolute_import)�division)�unicode_literals)�base_classes)�poller)�waiter)�arg_parsers)�base)�resource_manager_tags_utils)�flags)�router_utils)�log)�	resourcesNc�n�eZdZdZdZdZdZed��Zed��Z	ed��Z
ed��Zd	�Zd
�Z
d�Zy)�Create��Create a Compute Engine router.

  *{command}* is used to create a router to provide dynamic routing to VPN
  tunnels and interconnects.
  NFTc���|jjtj�|js|j|�n|j
|�|jr'|jdtj�dd��tj�|_|jj|d��tjj!|�tj"|�tj$|�tj&|�tj(|�tj*|d�|jj-tj.�y)Nz--resource-manager-tagsz	KEY=VALUEaF            Comma-separated list of Resource Manager tags to attach to the router. Key-value pairs must be provided in the form tagKeys/{TagKey_Numeric_ID}=tagValues/{TagValue_Numeric_ID}.
            See [Listing tag keys](https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#listing_keys).
        )�type�metavar�help�create)�operation_type�router)�display_info�	AddFormatr�DEFAULT_CREATE_FORMAT�_support_ncc_gateway�add_network_arg�add_ncc_gateway_and_network_arg�_support_tagging_at_creation�add_argumentr	�ArgDict�RouterArgument�
ROUTER_ARG�AddArgumentr
�
ASYNC_FLAG�AddToParser�AddCreateRouterArgs�AddKeepaliveIntervalArg�AddBgpIdentifierRangeArg�AddEncryptedInterconnectRouter�!AddReplaceCustomAdvertisementArgs�AddCacheUpdater�RoutersCompleter��cls�parsers  �%lib/surface/compute/routers/create.py�_ArgszCreate._Args0s��
���!�!�%�"=�"=�>��#�#�	���&�!�	�)�)�&�1�
�'�'����
#��"�"�$���	���)�)�+�C�N��N�N���v�h��?��O�O����'�	���f�%�	�!�!�&�)�	�"�"�6�*�	�(�(��0�	�+�+�F�H�=�
���'�'��(>�(>�?�c��|jd��}tj|�tjdd��|_|j
j
|�y)NT)�requiredF�The network for this router)r6�
short_help)�add_mutually_exclusive_groupr�AddNccGatewayArg�
network_flags�NetworkArgumentForOtherResource�NETWORK_ARGr%)r0r1�link_parsers   r2rz&Create.add_ncc_gateway_and_network_argNsO���5�5�t�5�D�K�	���;�'�#�C�C��0��C�O��O�O����,r4c�n�tjd�|_|jj|�y)Nr7)r;r<r=r%r/s  r2rzCreate.add_network_argXs+��#�C�C�%��C�O��O�O����'r4c�&�|j|�y)zSee base.CreateCommand.N)r3r/s  r2�ArgszCreate.Args_s���I�I�f�r4c��tj|j��}|jj}|jj
j}|jj||j�}|j|j�|j��}|jr|j�|j|_|j r-|j"�!|j%||j"�|_|j(�;|j*j||j�}|j-�|_|j.�|j0�,|j3|j.|j0��|_|j7d�r|j8|_t=j>|�r�t=j@||j2|��\}}	}
||	|
d�}|j.�|j3�|_tCjD|�D]\}}
|
��	tG|j4||
��!|jH�FtK|j4d�s|j3�|_|jH|j4_&|jO|jQ||jR|jT���}tjVjY|jZd|jT|jRd	��
�}|j\rP|j7d�sd|_/tajb|d
j_|j��dd��|S|jjY|j�d|jT|jRd	��
�}tejf||�}tijj||dj_|j���S)N)�name�description)�asn�keepaliveInterval�encrypted_interconnect_router)�messages�resource_class�args)�
advertiseMode�advertisedGroups�advertisedIpRanges�identifierRange)r�region�projectzcompute.regionOperations)rPrO)�
collection�params�format�nonezrouter [{0}]Tz[Run the [gcloud compute operations describe] command to check the status of this operation.)�kind�is_async�detailszcompute.routerszCreating router [{0}])6r�ComputeApiHolder�ReleaseTrack�clientrH�apitools_client�routersr$�ResolveAsResourcer�Router�NamerDr�ncc_gateway�
nccGatewayr �resource_manager_tags�_CreateRouterParamsrR�networkr=�SelfLinkrE�keepalive_interval�	RouterBgp�bgp�IsSpecifiedrG�encryptedInterconnectRouterr
�HasReplaceAdvertisementFlags�ParseAdvertisements�six�	iteritems�setattr�bgp_identifier_range�hasattrrN�Insert�ComputeRoutersInsertRequestrOrP�REGISTRY�ParserC�async_rSr�CreatedResourcer�Pollerr�WaitFor)�selfrJ�holderrH�service�
router_ref�router_resource�network_ref�mode�groups�ranges�attrs�attr�value�result�
operation_ref�target_router_ref�operation_pollers                  r2�_RunzCreate._Runds���
�
*�
*�4�+<�+<�+>�
?�F��}�}�%�%�H��m�m�+�+�3�3�G����2�2�4��9I�9I�J�J��o�o�
�_�_�
��$�$�&��O�
� � �	
�	�	�	%�%)�%5�%5��"��(�(�	
�	#�	#�	/�!%�!9�!9��d�0�0�"
����|�|���$�$�6�6�t�V�=M�=M�N�k� +� 4� 4� 6�o���x�x��t�6�6�B�$�.�.��h�h�$�*A�*A�/��o�����7�8�
�
,�
,��1��0�0��6�)�=�=��H�,>�,>�T���d�F�F�
 �$� &��e�
���	�&�0�0�2������u�-�+�$����
�/�%�%�t�U�
3�.�� � �,�
�_�(�(�*;�
<�&�0�0�2���,0�,E�,E�o���)�
�^�^��,�,�"��$�$��&�&�	-�	
��F��&�&�,�,����-�!�)�)� �'�'�
�-��M��{�{�
�
�
�h�
'����	���
��$�$�Z�_�_�%6�7��7���m��(�(�.�.�����$�!�)�)� �'�'�
�/����}�}�W�.?�@���>�>����&�&�z���'8�9��r4c�$�|j|�S)zSee base.UpdateCommand.)r�)rzrJs  r2�Runz
Create.Run�s���9�9�T�?�r4c��tj|�}|j}tt	j
|��D��cgc]"\}}|jj||����$}}}||j
|����Scc}}w)N)�keyr�)�additionalProperties)�resourceManagerTags)r�GetResourceManagerTags�RouterParams�sortedrmrn�ResourceManagerTagsValue�AdditionalProperty)rzrHrb�resource_manager_tags_maprRr�r��additional_propertiess        r2rczCreate._CreateRouterParams�s���#�:�:�!�	
��
�
"�
"�F�!����/H�!I�J��J�J�C��	�'�'�:�:�s�%�:�P�J����"�;�;�!6�<�
����	s�'B)�__name__�
__module__�__qualname__�__doc__r$rr �classmethodr3rrrAr�r�rc�r4r2rr#s{����*���!%���@��@�:�-��-��(��(�����h�T�r4rc��eZdZdZdZdZy)�
CreateBetarTN�r�r�r�r�rr r�r4r2r�r��s�����!%�r4r�c��eZdZdZdZdZy)�CreateAlpharTNr�r�r4r2r�r��s���
��!%�r4r�)#r��
__future__rrr�googlecloudsdk.api_lib.computer�)googlecloudsdk.api_lib.compute.operationsr�googlecloudsdk.api_lib.utilr�googlecloudsdk.callioper	r
�"googlecloudsdk.command_lib.computer�+googlecloudsdk.command_lib.compute.networksrr;�*googlecloudsdk.command_lib.compute.routersr
�googlecloudsdk.corerrrm�UniverseCompatible�
ReleaseTracksrY�GA�
CreateCommandr�BETAr��ALPHAr�r�r4r2�<module>r�s���3�&��'�7�<�.�/�(�J�N�<�C�#�)�
��������D�%�%�(�(�)�|�T�
�
�|�*��|�~����D�%�%�*�*�+�&��&�,�&�����D�%�%�+�+�,�&�*�&�-�&r4