File: //usr/lib/google-cloud-sdk/lib/surface/compute/disks/__pycache__/create.cpython-312.pyc
�
��
� � � � d Z ddlmZ ddlmZ ddlmZ ddlZddlZddlZddlm Z m
Z
ddlmZ ddlm
Z
dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlmZ! ddl"mZ# ddl"m$Z% ddl&m'Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/Z/dddd�Z0 d4d�Z1 d5d �Z2d!� Z3d"� Z4d#e
e5 d$e
e5 fd%�Z6d&ejn d'e d(e
e5 d$e
e5 fd)�Z8d&ejn d'e d$e
e5 fd*�Z9d&ejn d'e d$e
e5 fd+�Z:ejv ejx ejz j| � G d,� d-ej~ � � � Z@ejv ejx ejz j� � G d.� d/e@� � � ZBejv ejx ejz j� � G d0� d1eB� � � ZDd2� ZEd3� ZFe0e@_G y)6zCommand for creating disks.� )�absolute_import)�division)�unicode_literalsN)�Any�Optional)�base_classes)� constants)�
csek_utils)�
disks_util)�image_utils)� kms_utils)�utils)�
zone_utils)�arg_parsers)�base)�
exceptions)�
completers)�flags)�scope)�create)�util)�
resource_args)� arg_utils)�labels_util)�logz&Create Compute Engine persistent disksa8 *{command}* creates one or more Compute Engine
persistent disks. When creating virtual machine instances,
disks can be attached to the instances through the
`gcloud compute instances create` command. Disks can also be
attached to instances that are already running using
`gcloud compute instances attach-disk`.
Disks are zonal resources, so they reside in a particular zone
for their entire lifetime. The contents of a disk can be moved
to a different zone by snapshotting the disk (using
`gcloud compute disks snapshot`) and creating a new disk using
`--source-snapshot` in the desired zone. The contents of a
disk can also be moved across project or zone by creating an
image (using `gcloud compute images create`) and creating a
new disk using `--image` in the desired project and/or
zone.
For a comprehensive guide, including details on minimum and maximum
disk size, refer to:
https://cloud.google.com/compute/docs/disks
z� When creating disks, be sure to include the `--zone` option. To create
disks 'my-disk-1' and 'my-disk-2' in zone us-east1-a:
$ {command} my-disk-1 my-disk-2 --zone=us-east1-a
)�brief�DESCRIPTION�EXAMPLESc � � | j � }|j � }d� }|j d|�� t j |� |j dd�� t j
|� |r"t j j | |�� nt j j |� |rt
j | � t j j |� t j j | |�� t j j | |�� t
j | � t
j | � y)z#Add mutually exclusive source args.c �
� d} | S )z-Returns detailed help for `--image` argument.a= An image to apply to the disks being created. When using
this option, the size of the disks must be at least as large as
the image size. Use ``--size'' to adjust the size of the disks.
This flag is mutually exclusive with ``--source-snapshot'' and
``--image-family''.
� )�templates �#lib/surface/compute/disks/create.py�AddImageHelpz!_SourceArgs.<locals>.AddImageHelp` s � ��H� �O� z--image��helpz--image-familya� The image family for the operating system that the boot disk will be
initialized with. Compute Engine offers multiple Linux
distributions, some of which are available as both regular and
Shielded VM images. When a family is specified instead of an image,
the latest non-deprecated image associated with that family is
used. It is best practice to use --image-family when the latest
version of an image is needed.
)�mutex_groupN)� add_group�add_mutually_exclusive_group�add_argumentr �AddImageProjectFlag�AddImageFamilyScopeFlag�disks_flags�SOURCE_SNAPSHOT_ARG_ALPHA�AddArgument�SOURCE_SNAPSHOT_ARG�AddSourceInstantSnapshotProject�SOURCE_INSTANT_SNAPSHOT_ARG�SOURCE_DISK_ARG�ASYNC_PRIMARY_DISK_ARG�AddPrimaryDiskProject�AddLocationHintArg)�parser�support_source_snapshot_region�source_instant_snapshot_enabled�source_parent_group�source_groupr$ s r# �_SourceArgsr= W s' � � �(�(�*��$�A�A�C�,�
� ���I�L��9�
�!�!�"5�6������ �
� �%�%�&9�:�#��)�)�5�5��L� 6� � �#�#�/�/��=�$��/�/��7�
�)�)�5�5�l�C�
���)�)�&�l�)�K�
�$�$�0�0��,� 1� � �#�#�F�+�
� � ��(r% c �x � t j j |d�� |j dd�� |j dt j
dg d�� � d
j
t j t j t j t j t j t j t j t j � �� |j dt j d
�� |r|j dd�� |j j! d� |j dt j"