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/sql/instances/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/google-cloud-sdk/lib/surface/sql/instances/__pycache__/switchover.cpython-311.pyc
�

��G��^�dZddlmZddlmZddlmZddlZddlZddlmZddlm	Z	ddlm
Z
dd	lmZdd
l
mZddlmZddlmZdd
lmZddiZd�Zd�Zejejejjejjejj��Gd�dej������ZdS)z�Switches over a Cloud SQL instance to one of its replicas.

Switches over a Cloud SQL instance to one of its replicas. Currently only
supported on Cloud SQL for SQL Server and MySQL instances.
�)�absolute_import)�division)�unicode_literalsN)�api_util)�
operations)�validate)�base)�flags)�log)�
properties)�
console_io�EXAMPLESz{        To switch over an instance to its replica called replica-instance:

          $ {command} replica-instance
        c��tj�|��|�dtjd���t	j|��dS)z>Declare flag and positional arguments for this command parser.�replicazCloud SQL replica ID.)�	completer�helpN)r	�
ASYNC_FLAG�AddToParser�add_argumentr
�InstanceCompleter�AddSwitchoverDbTimeout��parsers �'lib/surface/sql/instances/switchover.py�AddBaseArgsr.sY���/���f�%�%�%�����5�2�9P�������v�&�&�&�&�&�c���tjtj��}|j}|j}tj|j��|j�	|jdtjjj
jid���}tj�t%j���d��dz��t+jddd���|j}|�t1|j��d
z}|j�|�|j
|j|�����}|j�d|j|j
�
��}|jr9|j �!|�"|j
|j#�����St@j$�%||d��tLj'�d�(|�����d	S)a�Switches over a Cloud SQL instance to one of its replicas.

  Args:
    args: argparse.Namespace, The arguments that this command was invoked with.

  Returns:
    A dict object representing the operations resource describing the
    switchover operation if the switchover was successful.

  Raises:
    exceptions.OperationError: If the switchover operation is not supported for
    the instance.
  �projectz
sql.instances)�params�
collectionaSwitching over to a replica leads to a short period of downtime and results in the primary and replica instances "switching" roles. Before switching over to the replica, you must verify that both the primary and replica instances are online. Otherwise, use a promote operation.z

�T)�message�default�cancel_on_noN�s)r�instance�	dbTimeoutzsql.operations)�	operationr)rr(z#Switching over to Cloud SQL replicazSwitched over [{instance}].
)r&))r�	SqlClient�API_VERSION_DEFAULT�
sql_client�sql_messagesr�ValidateInstanceNamer�resource_parser�Parser�VALUES�corer�	GetOrFail�sys�stderr�write�textwrap�TextWrapper�fillr
�PromptContinue�
db_timeout�str�	instances�
Switchover�SqlInstancesSwitchoverRequestr&�Create�name�async_r�Get�SqlOperationsGetRequestr(�OperationsV1Beta4�WaitForOperationr�status�format)�args�clientr+r,�instance_ref�db_timeout_str�result�
operation_refs        r�RunBaseSwitchoverCommandrN7s����h�:�;�;�&�� �*��$�,�
����-�-�-��'�-�-�
�l���*�/�7�A�
B� �.���,��*�������!�!�1���	��	�	�	�
��B��4�H�H�H�H��?�.������)�)�C�/�N���*�*��0�0��&��(�"�1�����&��(�/�/��&�+�|�7K�0���-�
�[��� �$�$��,�,�!�)�]�5L�	-�	
�	
����
��/�/��-�!F�����*���%�,�,�l�,�C�C�����rc�2�eZdZdZeZd�Zed���ZdS)r=z{Switches over a Cloud SQL instance to one of its replicas.

  Switches over a Cloud SQL instance to one of its replicas.
  c� �t|��S)N)rN)�selfrHs  r�RunzSwitchover.Run�s��#�D�)�)�)rc�$�t|��dS)z�Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    N)rrs r�ArgszSwitchover.Args�s��������rN)	�__name__�
__module__�__qualname__�__doc__�
DETAILED_HELP�
detailed_helprR�staticmethodrT�rrr=r=�sO������
��
 �-�*�*�*�����<���rr=)rX�
__future__rrrr3r6�googlecloudsdk.api_lib.sqlrrr�googlecloudsdk.callioper	�googlecloudsdk.command_lib.sqlr
�googlecloudsdk.corerr�googlecloudsdk.core.consoler
rYrrN�DefaultUniverseOnly�
ReleaseTracks�ReleaseTrack�GA�BETA�ALPHA�Commandr=r\rr�<module>rjs�����'�&�&�&�&�&�������'�'�'�'�'�'�
�
�
�
�����/�/�/�/�/�/�1�1�1�1�1�1�/�/�/�/�/�/�(�(�(�(�(�(�0�0�0�0�0�0�#�#�#�#�#�#�*�*�*�*�*�*�2�2�2�2�2�2����
�'�'�'�F�F�F�R��������$�+�0�$�2C�2I������������������r

Youez - 2016 - github.com/yon3zu
LinuXploit