| 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/secrets/__pycache__/ |
Upload File : |
�
���P � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm
Z
ddlmZ
dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ e j e j j � � e j G d� de j � � � � � � Z e j e j j � � e j G d� de� � � � � � ZdS )zUpdate an existing secret.� )�absolute_import)�division)�unicode_literals)�api)�base)�
exceptions)�args)�log)�util)�labels_util)�map_util)�
console_ioc �H � e Zd ZdZdZdZdZdZdZe d� � � Z
d� Zd � Zd
S )�Updatea� Update a secret's metadata.
Update a secret's metadata (e.g. labels). This command will
return an error if given a secret that does not exist.
## EXAMPLES
Update the label of a secret named `my-secret`.
$ {command} my-secret --update-labels=foo=bar
Update the label of a secret using an etag.
$ {command} my-secret --update-labels=foo=bar --etag=123
Update a secret to have a next-rotation-time:
$ {command} my-secret --next-rotation-time="2030-01-01T15:30:00-05:00"
Update a secret to have a next-rotation-time and rotation-period:
$ {command} my-secret --next-rotation-time="2030-01-01T15:30:00-05:00"
--rotation-period="7200s"
Update a secret to remove the next-rotation-time:
$ {command} my-secret --remove-next-rotation-time
Update a secret to clear rotation policy:
$ {command} my-secret --remove-rotation-schedule
Update version destroy ttl of a secret:
$ {command} my-secret --version-destroy-ttl="86400s"
Disable delayed secret version destroy:
$ {command} my-secret --remove-version-destroy-ttl
z9There are no changes to the secret [{secret}] for update.zxThe secret [{secret}] cannot be updated because it does not exist. Please use the create command to create a new secret.zrThis secret and all of its versions will be automatically deleted at the requested expire-time of [{expire_time}].zqThis secret and all of its versions will be automatically deleted after the requested ttl of [{ttl}] has elapsed.z�The --regional-kms-key-name or --remove-regional-kms-key-name flag can only be used when update a regional secret with "--location".c �, � t j | ddd�� � t j | dd�� � | � dd�� � }| � dd �� � }t j | � � t j | d
�� � t j | � � t j | � � t j | � � t j
| � � t j | � � t j
|ddt t � � t j |ddt � � t j |dd� � t j
|d
d t t � � t j |d
d t � � t j |d
d � � 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 will be
available to this command.
� to updateT��purpose�
positional�required�to update secretF�r �hidden�Version Aliases��mutex�help�Annotations�updated��action�version-aliases�annotationsN)�secrets_args� AddSecret�AddLocation� add_groupr �AddUpdateLabelsFlags�
AddSecretEtag�AddUpdateExpirationGroup�AddUpdateTopicsGroup�AddUpdateRotationGroup�AddUpdateVersionDestroyTTL�AddUpdateRegionalKmsKeyr
�AddMapUpdateFlag�str�int�AddMapRemoveFlag�AddMapClearFlag��parser�aliasr# s �lib/surface/secrets/update.py�ArgszUpdate.Args\ s� � � �����t�� � � � ��V�-?��N�N�N�N����4�.?��@�@�E��"�"��M�"�B�B�K��$�V�,�,�,���v�i�8�8�8�8��)�&�1�1�1��%�f�-�-�-��'��/�/�/��+�F�3�3�3��(��0�0�0���e�%6�8I�3�!�#� #� #���e�%6�8I�3�O�O�O���U�$5�7H�I�I�I���k�=�-��!�#� #� #���k�=�-��M�M�M���[�-��G�G�G�G�G� c � � t j | � � � � � }t j |�� � }|j j � � � }g }t j � |� � }|�
� � r|� d� � |� d� � r|� d� � |� d� � s|� d� � r|� d� � |� d� � s*|� d� � s|� d� � r|� d � � |� d
� � s*|� d� � s|� d� � r|� d� � |� d
� � s*|� d� � s|� d� � r|� d� � |� d� � s*|� d� � s|� d� � r|� d� � |� d� � s*|� d� � s|� d� � r|� d� � |� d� � s|� d� � r|� d� � |� d� � s|� d� � r|� d� � |sBt j g d�| j � |� � � �� � � � �|� |j j |j � � }|j } |j r|j } |j r7| j � |j � � � }
t3 j |
d!d!�"� � |j r7| j � |j �#� � }
t3 j |
d!d!�"� � d|v rt; j ||j � � }ng }g }d|v r�g }|j � |j �! g �$� � |_ t; j"