403Webshell
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/functions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/google-cloud-sdk/lib/surface/functions/__pycache__/upgrade.cpython-311.pyc
�

���)��n�dZddlmZddlmZddlmZddlZddlmZddlm	Z
ddlmZdd	lmZ
dd
lmZddlmZddlmZddlmZdd
lmZddlmZddlmZddlZejdgd���ZdZeddddez���Z eddddez���Z!eddddez���Z"eddd d!���Z#edd"d#d$���Z$e gge!e#ge e#ge#ge$e"e#ge!e#ge"e#gge$e#ggd%�Z%d&�Z&ej'ej(ej)ej*j+��Gd'�d(ej,��������Z-dS))�<Upgrade a 1st gen Cloud Function to the 2nd gen environment.�)�absolute_import)�division)�unicode_literalsN)�api_enablement)�client)�
exceptions)�util)�base)�types)�flags)�deploy_util)�log)�
console_io�
UpgradeAction)�target_state�
prompt_msg�op_description�success_msgz^You can abort the upgrade process at any time by rerunning this command with the --abort flag.�(SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFULayThis creates a 2nd gen function with the same name [{}], code, and configuration as the 1st gen function. The 1st gen function will continue to serve traffic until you redirect traffic to the 2nd gen function in the next step.

To learn more about the differences between 1st gen and 2nd gen functions, visit: https://cloud.google.com/functions/docs/concepts/version-comparisonz�Setting up the upgrade for function. Please wait while we duplicate the 1st gen function configuration and code to a 2nd gen function.z�The 2nd gen function is now ready for testing. View the function upgrade testing guide for steps on how to test the function before redirecting traffic to it.

Once you are ready to redirect traffic, rerun this command with the --redirect-traffic flag.

�,REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFULz�This will redirect all traffic from the 1st gen function [{}] to its 2nd gen copy. Please ensure that you have tested the 2nd gen function before proceeding.z,Redirecting traffic to the 2nd gen function.z�The 2nd gen function is now serving all traffic. If you experience issues, rerun this command with the --rollback-traffic flag. Otherwise, once you are ready to finalize the upgrade, rerun this command with the --commit flag.

z�This will rollback all traffic from the 2nd gen copy [{}] to the original 1st gen function. The 2nd gen function is still available for testing.z-Rolling back traffic to the 1st gen function.zgThe 1st gen function is now serving all traffic. The 2nd gen function is still available for testing.

�ELIGIBLE_FOR_2ND_GEN_UPGRADEz]This will abort the upgrade process and delete the 2nd gen copy of the 1st gen function [{}].z"Aborting the upgrade for function.zBUpgrade aborted and the 2nd gen function was successfully deleted.ztThis will complete the upgrade process for function [{}] and delete the 1st gen copy.

This action cannot be undone.zBCompleting the upgrade and deleting the 1st gen copy for function.z@Upgrade completed and the 1st gen copy was successfully deleted.)r�UPGRADE_OPERATION_IN_PROGRESSr�#SETUP_FUNCTION_UPGRADE_CONFIG_ERROR�ABORT_FUNCTION_UPGRADE_ERRORr�'REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR�'ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR�"COMMIT_FUNCTION_UPGRADE_SUCCESSFUL�COMMIT_FUNCTION_UPGRADE_ERROR�DETACH_IN_PROGRESSc�2�tj|��}|dkrtjd���||jkr'tjd�|�����|t|vr'tjd�|�����dS)zKValidates whether the action is a valid action for the given upgrade state.rzVAn upgrade operation is already in progress for this function. Please try again later.z9This function is already in the desired upgrade state: {}zTThis function is not eligible for this operation. Its current upgrade state is '{}'.N)�six�	text_typer	�FunctionsErrorr�format�_VALID_TRANSITION_ACTIONS)�
upgrade_state�action�upgrade_state_strs   � lib/surface/functions/upgrade.py�_ValidateStateTransitionr+�s����m�M�2�2���9�9�9�
�
#�	#����
�&�-�-�-�
�
#�C�J�J��	
�	
�����,�->�?�?�?�
�
#�	� �&��/�/����@�?�c�8�eZdZdZddd�Zed���Zd�ZdS)�UpgradeAlpharz
{description}a�          To start the upgrade process for a 1st gen function `foo` and create a 2nd gen copy, run:

            $ {command} foo --setup-config

          Once you are ready to redirect traffic to the 2nd gen copy, run:

            $ {command} foo --redirect-traffic

          If you find you need to do more local testing you can rollback traffic to the 1st gen copy:

            $ {command} foo --rollback-traffic

          Once you're ready to finish upgrading and delete the 1st gen copy, run:

            $ {command} foo --commit

          You can abort the upgrade process at any time by running:

            $ {command} foo --abort
          )�DESCRIPTION�EXAMPLESc�X�tj|d��tj|��dS)Nz
to upgrade)r
�AddFunctionResourceArg�AddUpgradeFlags)�parsers r*�ArgszUpgradeAlpha.Args�s,��	� ���6�6�6�	��&�!�!�!�!�!r,c�^�tj|�����}|jj���}|���}|�|��}|s'tj	d�
|�����|js'tj	d�
|�����|jj}d}d}|j
rt}|j}no|jrt"}|j}nY|jrt(}|j}nC|jrt.}|j}n-|jrt4}|j}nt9jgd�d���t=||��|j�
|��}	tAj!|	d���sdS|t4kr�tEj#d��tEj#d��|j$}
|
r,tKj&|
j'��rtQj)��|
r2tKj*|
j'��rtQj+|
j,��||��}|j-}t]j/|j0|j1||��tdj3�4��tdj3�4|j5��dS)	NzFunction [{}] does not exist.z2Function [{}] is not eligible for 2nd gen upgrade.)z--abortz--commitz--redirect-trafficz--rollback-trafficz--setup-configz*One of the upgrade step must be specified.T)�defaultzcloudbuild.googleapis.comzartifactregistry.googleapis.com)6�	client_v2�FunctionsClient�ReleaseTrack�CONCEPTS�name�Parse�RelativeName�GetFunctionr	r$r%�upgradeInfo�upgradeState�redirect_traffic�_REDIRECT_TRAFFIC_ACTION�RedirectFunctionUpgradeTraffic�rollback_traffic�_ROLLBACK_TRAFFIC_ACTION�RollbackFunctionUpgradeTraffic�commit�_COMMIT_ACTION�CommitFunctionUpgrade�abort�
_ABORT_ACTION�AbortFunctionUpgrade�setup_config�_SETUP_CONFIG_ACTION�SetupFunctionUpgradeConfig�calliope_exceptions�OneOfArgumentsRequiredExceptionr+rr�PromptContinuer�PromptToEnableApiIfDisabled�eventTrigger�
trigger_types�IsPubsubType�	eventTyper�'ensure_pubsub_sa_has_token_creator_role�IsAuditLogType�#ensure_data_access_logs_are_enabled�eventFiltersr�api_util�WaitForOperationr�messagesr�status�Printr)
�self�argsr�function_ref�
function_name�functionr'r(�	action_fn�message�trigger�	operation�descriptions
             r*�RunzUpgradeAlpha.Run�s���
�
&�t�'8�'8�':�':�
;�
;�F��=�%�+�+�-�-�L� �-�-�/�/�M��!�!�-�0�0�H����%�
)�
0�
0��
?�
?�
�
�����
�%�
>�
E�
E����
�
���(�5�M�
�F��I����'�f��7�i�i�	
�	��'�f��7�i�i�	
����f��.�i�i�	
����f��-�i�i�	
�	�
�#�f��3�i�i��?����7�	
�	
�	��]�F�3�3�3���&�&�}�5�5�G��$�W�d�;�;�;�
��f�
�%�%�%��0�1L�M�M�M��0�
+�����%�g�	�>�]�/��0A�B�B�>��;�=�=�=�	�N�]�1�'�2C�D�D�N��7��8L�M�M�M��	�-�(�(�I��'�K����
�v��	�;�����J�������J���V�'�(�(�(�(�(r,N)�__name__�
__module__�__qualname__�__doc__�
detailed_help�staticmethodr5rl�r,r*r.r.�sb������E�D�%����-�2�"�"��<�"�N)�N)�N)�N)�N)r,r.).rp�
__future__rrr�collections� googlecloudsdk.api_lib.functionsr�#googlecloudsdk.api_lib.functions.v2rr8r	r
r]�googlecloudsdk.callioperrQ�#googlecloudsdk.command_lib.eventarcrrV�$googlecloudsdk.command_lib.functionsr
�'googlecloudsdk.command_lib.functions.v2r�googlecloudsdk.corer�googlecloudsdk.core.consolerr"�
namedtupler�_ABORT_GUIDANCE_MSGrOrCrFrLrIr&r+�Hidden�DefaultUniverseOnly�
ReleaseTracksr:�ALPHA�Commandr.rsr,r*�<module>r�s=��C�B�&�&�&�&�&�&�������'�'�'�'�'�'�����;�;�;�;�;�;�C�C�C�C�C�C�:�:�:�:�:�:�@�@�@�@�@�@�(�(�(�(�(�(�E�E�E�E�E�E�F�F�F�F�F�F�6�6�6�6�6�6�?�?�?�?�?�?�#�#�#�#�#�#�2�2�2�2�2�2�
�
�
�
�&��&�������
���%�}�;�	O�	�
�������2)�=�?�	�B�
�������$)�=�;�	�C�
�
������ �
�/�	&�8�L�
�
�
�
����	>�	M�	K����� &:�$:�%'� ��1�
	��,�&3�O�� ��5�	!��0�
	!��0�+-�&4�m�%D��7���>���0�������D�%�+�,�,�o)�o)�o)�o)�o)�4�<�o)�o)�-�,���
��o)�o)�o)r,

Youez - 2016 - github.com/yon3zu
LinuXploit