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: //lib/google-cloud-sdk/lib/surface/compute/images/__pycache__/import.cpython-312.pyc
�

��|i����dZddlmZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlZdZ gd�Z!Gd�dejD�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)	d9d�Z*ejVejXjZ�ej\dd d!�"�ej^Gd#�d$ej`����Z1ejdejf�Gd%�d&e4��Z5Gd'�d(e5�Z6Gd)�d*e5�Z7Gd+�d,e5�Z8Gd-�d.e8�Z9Gd/�d0e8�Z:ejVejXjv�Gd1�d2e1��Z<ejVejXjz�Gd3�d4e<��Z>d5d6d7d8�e1_?y):zImport image command.�)�absolute_import)�division)�unicode_literalsN)�base_classes)�daisy_utils)�image_utils)�utils)�storage_api)�storage_util)�base)�
exceptions)�flags)�
os_choices)�log)�
properties)�	resources)�progress_trackerzbhttps://github.com/GoogleCloudPlatform/compute-image-import/tree/main/daisy_workflows/image_import)z[Daisyz[import-z	[onestep-zstarting buildz  import�ERRORc��eZdZdZdZy)�
CloudProviderr�N)�__name__�
__module__�__qualname__�UNKNOWN�AWS���$lib/surface/compute/images/import.pyrr9s��
�'�	�#rrc���|jxsR|jxsD|jxs6|jxs(|jxs|j
xs|jS�N)�aws_access_key_id�aws_secret_access_key�aws_session_token�
aws_region�
aws_ami_id�aws_ami_export_location�aws_source_ami_file_path��argss r�_HasAwsArgsr+>sh��
���'�	
�	#�	#�'�	
�	�	�'�
���'�
���	'�

�	%�	%�'�
�	&�	&�rc�:�t|�tjk7Sr!)�_GetExternalCloudProviderrrr)s r�_HasExternalCloudProviderr.Js��	"�4�	(�M�,A�,A�	A�Arc�X�t|�rtjStjSr!)r+rrrr)s rr-r-Ns"���������	�	�	�rc��|jr!tj|d|j�tj|d|j�y)N�os�custom_translate_workflow)r1r�	AppendArg�custom_workflow�r*�import_argss  r�_AppendTranslateWorkflowArgr7Ts;��	�W�W����+�t�T�W�W�5�
����.��0D�0D�rc��tj|d|j�tj|d|j�tj|d|j�tj|d|j
�|jr!tj|d|j�|jr!tj|d|j�|jr"tj|d|j�yy)	z)Appends args related to AWS image import.r"r#r$r%r&r'r(N)	rr3r"r#r$r%r&r'r(r5s  r�_AppendAwsArgsr9\s�������&��(>�(>������*�D�,F�,F������&��(>�(>������\�4�?�?�C�	�_�_����+�|�T�_�_�E�	�!�!�����.��0L�0L��
�"�"�����/��1N�1N��#rc���d}d}tjtjzdz�t|�dkDrd}n9|dtjvrd}n!t	�fd�|D��sd}n
|ddk(rd}|stjd	|��y
)z"Checks for a valid GCE image name.z�Name must start with a lowercase letter followed by up to 63 lowercase letters, numbers, or hyphens, and cannot end with a hyphen.T�-�@Frc3�&�K�|]}|�v���
y�wr!r)�.0�char�valid_charss  �r�	<genexpr>z"_CheckImageName.<locals>.<genexpr>�s�����:�z�t�t�{�"�z�s�����
IMAGE_NAMEN)�string�digits�ascii_lowercase�len�allr
�InvalidArgumentException)�
image_name�name_message�name_okr@s   @r�_CheckImageNamerMvs������

�'��
�
�� 6� 6�6��<�+���_�r���G��!�}�F�2�2�2��G��:�z�:�:��G��"�~����G�	�
�
-�
-�l�L�
I�I�
rFc��dg}|r||vrytjj|ddtjj
jji��}tj|j|j�}	|j|�}d}|s)|r'dj|�}	tj ||	��|r*|s'd	j|�}	tj ||	��yy#tj$rd}Y�owxYw)
zCheck if image already exists.zsample-image-123N�compute.images�project��
collection�paramsTFzThe image [{0}] already exists.zThe image [{0}] does not exist.)r�REGISTRY�Parser�VALUES�corerP�	GetOrFailr�
ImageExpander�client�GetImager	�ImageNotFoundError�formatr
rI)
rJ�compute_holder�arg_name�expect_to_exist�%expect_to_exist_image_name_exclusions�	image_ref�image_expander�_�image_exists�messages
          r�_CheckForExistingImagerg�s��,>�*>�'���'L�L�
�� � �&�&��!���*�*�/�/�7�7�A�A�
B�'��)��,�,����^�5�5��.�����	�*�A��L�
�\�/�6�6�z�B�G�
�
-�
-�h��
@�@��|�/�6�6�z�B�G�
�
-�
-�h��
@�@� ,���

�	!�	!���L��s�C1�1D	�D	z�This command is being deprecated. Instead, use the `gcloud migration vms image-imports` command. For more information, see https://cloud.google.com/migrate/virtual-machines/docs/5.0/migrate/image_import.z�This command hash been deprecated. Instead, use the `gcloud migration vms image-imports` command. For more information, see https://cloud.google.com/migrate/virtual-machines/docs/5.0/migrate/image_import.)�
is_removed�warning�errorc�n��eZdZdZej
Z�fd�Zed��Z	edd��Z
d�Zd�Zd�Z
�xZS)	�Importz$Import an image into Compute Engine.c�^��tj�|_tt|�|i|��yr!)r
�
StorageClient�storage_client�superrl�__init__)�selfr*�kwargs�	__class__s   �rrqzImport.__init__�s(���%�3�3�5�D��	�&�$� �$�1�&�1rc���|jd��}|j}|j}tj�t
_t
jj|d��tjj|ddd��|jdd	�
�}|jd��}|jd
d��tjj|d��|jd��}tj|�t!j"||�|j�}|j�}	tj$|	�|	jdt'|j(�d��|jddd��|jddj+t,�d��tj.|dd��|jdddd��|jd d!��|jd"d#��|jd$d%��|jd&d'��|j0j3tj4�|jd(d)��|jd*ddd+�,�tj6|d-d.�tj8|d-tj:�tj<|d-tj>�|jd/ddd0�1�y)2NT)�no_http�create)�operation_type�image�importz�Zone to use when importing the image. When you import an image, the import tool creates and uses temporary VMs in your project for the import process. Use this flag to specify the zone to use for these temporary VMs.)�	help_textF)�required�	sort_argszDImage import from local file, Cloud Storage or Compute Engine image.)�helpz
--source-fileaLA local file, or the Cloud Storage URI of the virtual
              disk file to import. For example: ``gs://my-bucket/my-image.vmdk''
              or ``./my-local-image.vmdk''. For more information about Cloud
            Storage URIs, see
            https://cloud.google.com/storage/docs/request-endpoints#json-api.
            zImage import from AWS.z--osz2Specifies the OS of the disk image being imported.)�choicesr~z--data-diskz�Specifies that the disk has no bootable OS installed on it. Imports the disk without making it bootable or installing Google tools on it.�
store_true)r~�actionz--custom-workflowz�              Specifies a custom workflow to use for image translation. Workflow
              should be relative to the image_import directory here: []({0}).
              For example: `debian/translate_debian_9.wf.json')r~�hiddenz	an importz�

          If you are importing a large image that takes longer than 24 hours to
          import, either use the RAW disk format to reduce the time needed for
          converting the image, or split the data into several smaller images.
          )�	operation�extra_timeout_helpz--guest-environmentzpInstalls the guest environment on the image. See https://cloud.google.com/compute/docs/images/guest-environment.)r��defaultr~z	--networkz�Name of the network in your project to use for the image import. When you import an image, the import tool creates and uses temporary VMs in your project for the import process. Use this flag to specify the network to use for these temporary VMs.z--subnetaH      Name of the subnetwork in your project to use for the image import. When
      you import an image, the import tool creates and uses temporary VMs in
      your project for the import process. Use this flag to specify the
      subnetwork to use for these temporary VMs.
          * If the network resource is in legacy mode, do not provide this
            property.
          * If the network is in auto subnet mode, specifying the subnetwork is
            optional.
          * If the network is in custom subnet mode, then this field must be
            specified.
        z--familyz%Family to set for the imported image.z
--descriptionz*Description to set for the imported image.z--storage-locationz�      Specifies a Cloud Storage location, either regional or multi-regional,
      where image content is to be stored. If not specified, the multi-region
      location closest to the source is chosen automatically.
      z--sysprep-windowsz6Whether to generalize the image using Windows Sysprep.)r�r�r~zimage importzShttps://cloud.google.com/compute/docs/import/importing-virtual-disks#no-external-ipz--cmd-deprecatedaE
        The command you're using is deprecated and will be removed by December 31,
        2025. We recommend using `gcloud compute migration image-imports` instead.
        See our official documentation for more information.
        https://cloud.google.com/migrate/virtual-machines/docs/5.0/migrate/image_import.
        )r�r|r~) �_GetComputeApiHolderrZ�messagesr�MakeDiskImageArgrl�DISK_IMAGE_ARG�AddArgument�
compute_flags�AddZoneFlag�add_mutually_exclusive_group�add_argument�SOURCE_IMAGE_ARG�	add_groupr�AddAWSImageImportSourceArgsr�AddGuestOsFeaturesArgForImport�
AddByolArg�sorted�_OS_CHOICESr]�_WORKFLOWS_URL�AddCommonDaisyArgs�display_info�AddCacheUpdater�ImagesCompleter�AddNoAddressArg�AddComputeServiceAccountArg�(IMPORT_ROLES_FOR_COMPUTE_SERVICE_ACCOUNT�AddCloudBuildServiceAccountArg�+IMPORT_ROLES_FOR_CLOUDBUILD_SERVICE_ACCOUNT)
�cls�parserr^�compute_clientr��source�import_from_local_or_gcs�import_from_aws�workflow�os_groups
          r�ArgszImport.Args�sH���-�-�d�-�;�N�#�*�*�N��&�&�H�!�2�2�4�F��
���%�%�f�X�%�F�	���#�#����
?�$�
��
0�
0�$�%�
0�
P�F�%�B�B�
$� C� ���)�)���*��
���&�&� ��'���&�&�,D�&�E�O��+�+�O�<��.�.�v�x�@��2�2�4�H��!�!�#�H����8�$������s���'�
A���
����
"����
����
B�CI�&��C�����"�"����	�������
N��	�����
O���������� ����@�������J������'�'��(=�(=�>�
����
���������
E�	�������]���+�+����<�<���.�.����?�?���������	�
rc�J�tj|j�|�Sr!)r�ComputeApiHolder�ReleaseTrack)r�rvs  rr�zImport._GetComputeApiHolder�s���(�(��)9�)9�);�W�E�Erc��|j�}t|j�t|j|�|j	||�}|j�}t
jd�dg}|j|||t�S)Nz-Importing image. This may take up to 2 hours.zgce-daisy-image-import)
r�rMrJrg�_CreateImportStager�Stagerri�_RunImageImport�_OUTPUT_FILTER)rrr*r^�stager�import_metadata�tagss      r�Runz
Import.Run�su���.�.�0�N��D�O�O�$��4�?�?�N�;�
�
%�
%�d�N�
;�F��l�l�n�O��K�K�?�@�$�%�D�����o�t�^�L�Lrc���tj�}t|d�r|j}t	|�r]tj
|||t|j�r.|j�jj�|��Sd|��Stj|||t|j�r.|j�jj�|��Sd|��S)N�docker_image_tag)�
release_trackr�)r�GetDefaultBuilderVersion�hasattrr�r.�RunOnestepImageImportr�r��id�lower�RunImageImport)rrr*r6r��
output_filter�	image_tags      rr�zImport._RunImageImport�s����4�4�6�I��t�'�(��'�'�i� ��&�
�
.�
.�
�
�
�
�
�
�
�
 ��)�)�+�.�.�4�4�6�%�	�	��$�	�	��%�%����������'�'�)�,�,�2�2�4�#�	�	��"�	�	rc���t|�rt|j||�S|jrt	|j||�Stj|j�rt|j||�S	tj|j�}t|j|||�S#tj$rtjdd��wxYw)Nzsource-filez3must be a path to an object in Google Cloud Storage)r.�%ImportFromExternalCloudProviderStagerro�source_image�ImportFromImageStagerr�IsLocalFile�source_file�ImportFromLocalFileStager�MakeGcsObjectUri�ImportFromGSFileStagerr�InvalidObjectNameErrorr
rI)rrr*r^�gcs_uris    rr�zImport._CreateImportStager�s��� ��&�
2�
�
�
�~�t������
"�4�#6�#6���
M�M����t�/�/�0�
&�
�
�
�~�t���	��,�,�T�-=�-=�>�g�$�
�
�
�~�t�W�����.�.���/�/�
�N�
���s�=B4�4*C)F)rrr�__doc__r�OS_CHOICES_IMAGE_IMPORT_GAr�rq�classmethodr�r�r�r�r��
__classcell__�rts@rrlrl�sU���$-��5�5�+�2��s��s�j�F��F�M� �6rrlc�(�eZdZdZd�Zd�Zd�Zd�Zy)�BaseImportStagerz�Base class for image import stager.

  An abstract class which is responsible for preparing import parameters, such
  as Daisy parameters and workflow, as well as creating Daisy scratch bucket in
  the appropriate location.
  c�X�||_||_||_|j�|_yr!)ror^r*�GetAndCreateDaisyBucket�daisy_bucket)rrror^r*s    rrqzBaseImportStager.__init__�s*��(�D��(�D���D�I��4�4�6�D�rc	��g}|jjj}tj|dt
jjjj��|jjr+tj|d|jj�tj|ddj|j��tj|ddjtj|j���tj|dd�tj|d	|jj�tj |d
|jj"�tj$|j|�tj|d|jj&�tj|d|jj(�d
|jvr+tj |d
|jj*�t-|jdd�xsd}|j.j0j2j4|v}|rtj |dd�d|jvr+tj |d|jj6�d|jvr+tj |d|jj8�d|jvr+tj|d|jj:�|S)z�Prepares for import args.

    It supports running new import wrapper (gce_vm_image_import).

    Returns:
      import_args - array of strings, import args.
    �zone�storage_location�scratch_bucket_gcs_pathz	gs://{0}/�timeoutz{}s�	client_id�gcloudrJ�no_guest_environment�description�family�byol�guest_os_featuresNr�uefi_compatibleT�sysprep_windows�
no_address�no_external_ip�compute_service_account)r^rZr�rr3rrV�computer��Getr*r�r]r��GetDaisyTimeoutrJ�
AppendBoolArg�guest_environment�AppendNetworkAndSubnetArgsr�r�r��getattr�GuestOsFeature�TypeValueValuesEnum�UEFI_COMPATIBLE�namer�r�r�)rrr6r�r�r�s     rr�zBaseImportStager.Stage�s����K��"�"�)�)�2�2�H�����V�Z�.�.�6�6�;�;�?�?�A���y�y�!�!����
�)�4�9�9�+E�+E������!����4�,�,�-��
�����
���[�0�0����;�<�����+�{�H�=����+�|�T�Y�Y�5I�5I�J�����+����1L�1L�-L���*�*�4�9�9�k�B����+�}�d�i�i�6K�6K�L����+�x����1A�1A�B�
���������V�T�Y�Y�^�^�D� ��	�	�+>��E�K������3�3�C�C�H�H��	�������->��E��D�I�I�%����
�(�$�)�)�*C�*C���t�y�y� ����
�'����)=�)=��!�D�I�I�-����
�
#�
�)�)�
+�
+��
�rc�d�tj|j�|jdd��S)NTr)�enable_uniform_level_access�soft_delete_duration)r�CreateDaisyBucketInProject�GetBucketLocationro�rrs rr�z(BaseImportStager.GetAndCreateDaisyBucket s0���1�1���� ����$(��	�rc�\�|jjr|jjSyr!)r*r�r�s rr�z"BaseImportStager.GetBucketLocation(s"���y�y�!�!�
�Y�Y�
'�
'�'�rN)rrrr�rqr�r�r�rrrr�r��s���7�D�L�rr�c�,��eZdZdZ�fd�Z�fd�Z�xZS)r�z4Image import stager from an external cloud provider.c���g}t|j|�t|j|�|jtt
|���|Sr!)r9r*r7�extendrpr�r��rrr6rts  �rr�z+ImportFromExternalCloudProviderStager.Stage2sH����K��4�9�9�k�*���	�	�;�7����
�3�T�@�B���rc���|jjr)tj|jj�Stt
|��Sr!)r*r�r�GetRegionFromZonerpr�r��rrrts �rr�z7ImportFromExternalCloudProviderStager.GetBucketLocation=s<����y�y�~�~�
�
*�
*�4�9�9�>�>�
:�:��-�t���r)rrrr�r�r�r�r�s@rr�r�/s���<�	��rr�c�2��eZdZdZ�fd�Zd�Z�fd�Z�xZS)r�z+Image import stager from an existing image.c���t|jj|jdd��g}t	j
|d|jj�|jjr,t	j|d|jj�nt|j|�|jtt|�3��|S)Nzsource-imageT)r_r`r��	data_disk)
rgr*r�r^rr3rr�r7r�rpr�r�r�s  �rr�zImportFromImageStager.StageHs������	�	��������	��K����+�~�t�y�y�7M�7M�N��y�y�������[�$�)�)�:M�:M�N�!�$�)�)�[�9����u�2�D�?�A�B��rc�D�tjj|jjddt
jjjji��}|j�t|j�j�dz�d}|S)NrOrPrQ�/)
rrTrUr*r�rrVrWrPrX�RelativeNamerG�Parent)rr�ref�source_names   r�_GetSourceImagez%ImportFromImageStager._GetSourceImageZs���
�
�
�
"�
"��	�	���#��:�,�,�1�1�9�9�C�C�D�#��C��"�"�$�S�����)B�)B�)D�s�)J�%K�%M�N�K��rc���|jjr)tj|jj�Stt
|��Sr!)r*r�rr�rpr�r�r�s �rr�z'ImportFromImageStager.GetBucketLocationds8����y�y�~�~�
�
*�
*�4�9�9�>�>�
:�:��&��?�A�Ar)rrrr�r�rr�r�r�s@rr�r�Es���3��$�B�Brr�c�L��eZdZdZ�fd�Zd�Zejd��Z�xZ	S)�BaseImportFromFileStagerz4Abstract image import stager for import from a file.c�`��|j�g}tj|d|j�|jj
r,tj|d|jj
�nt|j|�|jtt|�/��|S)Nr�r)�
_FileStagerr3r�r*rr�r7r�rprr�r�s  �rr�zBaseImportFromFileStager.Stagems�����O�O���K����+�}�d�l�l�C��y�y�������[�$�)�)�:M�:M�N�!�$�)�)�[�9����u�5�t�B�D�E��rc��|jjj�jd�rt	j
d�n{|jjj�jd�s3|jjj�jd�rt
jd��|j�|_	y)z!Prepare image file for importing.z.ovaz�The specified input file may contain more than one virtual disk. Only the first vmdk disk will be imported. To import a .ovacompletely, please try 'gcloud compute instances import'instead.z.tar.gzz.tgzaB`gcloud compute images import` does not support compressed archives. Please extract your image and try again.
 If you got this file by exporting an image from Compute Engine (e.g., by using `gcloud compute images export`) then you can instead use `gcloud compute images create` to create your image from your .tar.gz file.N)
r*r�r��endswithrrir
�BadFileException�_CopySourceFileToScratchBucketr�r�s rr
z#BaseImportFromFileStager._FileStage|s����y�y���"�"�$�-�-�f�5�	�k�k���
���	�	�	$�	$�	&�	/�	/��
�	
���	�	�	$�	$�	&�	/�	/��	7��'�'��
���6�6�8�D�Lrc��t�r!)�NotImplementedErrorr�s rrz7BaseImportFromFileStager._CopySourceFileToScratchBucket�s��
�r)
rrrr�r�r
�abc�abstractmethodrr�r�s@rrrjs*���<�
�9�.�����rrc�"�eZdZdZd�Zd�Zd�Zy)r�z&Image import stager from a local file.c��|j|jj|jj|jtj��Sr!)�_UploadToGcsr*�async_r�r��uuid�uuid4r�s rrz8ImportFromLocalFileStager._CopySourceFileToScratchBucket�s>������	�	���$�)�)�/�/��1B�1B�D�J�J�L��rc�b�tjj|�jdd�}dj	|||�}|rt
jjd�tjdj	||��5|j||�cddd�S#1swYyxYw)z@Uploads a local file to GCS. Returns the gs:// URI to that file.� r;�gs://{0}/tmpimage/{1}-{2}z_Async: After upload is complete, your image will be imported from Cloud Storage asynchronously.�Copying [{0}] to [{1}]N)r1�path�basename�replacer]r�status�Printr�ProgressTracker�_UploadToGcsStorageApi)rr�is_async�
local_pathr��
image_uuid�	file_name�	dest_paths       rrz&ImportFromLocalFileStager._UploadToGcs�s������ � ��,�4�4�S�#�>�I�+�2�2��j�)��I��	�j�j���8��
�	)�	)� �'�'�
�I�>�
��
(�
(��Y�
?�
�
�
�s�	B%�%B.c�|�tjj|�}|jj	||�|S)zJUploads a local file to Cloud Storage using the gcloud storage api client.)r�ObjectReference�FromUrlro�
CopyFileToGCS)rrr(r+�dest_objects    rr&z0ImportFromLocalFileStager._UploadToGcsStorageApi�s4���.�.�6�6�y�A�K����%�%�j�+�>��rN)rrrr�rrr&rrrr�r��s��.��
@� rr�c�.��eZdZdZ�fd�Zd�Zd�Z�xZS)r�z1Image import stager from a file in Cloud Storage.c�>��||_tt|�|||�yr!)�source_file_gcs_urirpr�rq)rrror^r*r�rts     �rrqzImportFromGSFileStager.__init__�s"���&�D��	�
 �$�0����rc�L�|jj|j�Sr!)ro�GetBucketLocationForFiler3r�s rr�z(ImportFromGSFileStager.GetBucketLocation�s$�����7�7�� � ��rc��tjj|j�}dj	|j
t
j�|�}tjj|jd��}tjj|d��}tjdj	|j|��5|jj||�ddd�|S#1swY|SxYw)Nrzstorage.objects)rRr)r1r r!r3r]r�rrrrTrUrr%ro�Rewrite)rr�
image_file�dest_uri�
src_objectr0s     rrz5ImportFromGSFileStager._CopySourceFileToScratchBucket�s������!�!�$�":�":�;�J�*�1�1����4�:�:�<���H��#�#�)�)�� � �->�*��J��$�$�*�*��.�+��K�
�	)�	)� �'�'��(@�(@�(�K�
����!�!�*�k�:�
��O�	
��O�s�C;�;D)rrrr�rqr�rr�r�s@rr�r��s���9���
rr�c�D��eZdZdZej
Ze�fd��Z�xZ	S)�
ImportBetaz6Import an image into Compute Engine for beta releases.c�V��tt|�|�tj|�yr!)rpr<r�r�AddExtraCommonDaisyArgs)r�r�rts  �rr�zImportBeta.Args�s ���	�*�c���'��'�'��/r)
rrrr�r�OS_CHOICES_IMAGE_IMPORT_BETAr�r�r�r�r�s@rr<r<�s#���>��7�7�+��0��0rr<c�(�eZdZdZej
Zy)�ImportAlphaz7Import an image into Compute Engine for alpha releases.N)rrrr�r�OS_CHOICES_IMAGE_IMPORT_ALPHAr�rrrrArA�s��?��8�8�+rrAz#Import an image into Compute Engineaf
        *{command}* imports Virtual Disk images, such as VMWare VMDK files
        and VHD files, into Compute Engine.

        Importing images involves four steps:
        *  Upload the virtual disk file to Cloud Storage.
        *  Import the image to Compute Engine.
        *  Detect the OS and bootloader contained on the disk.
        *  Translate the image to make a bootable image.
        This command performs all four of these steps as required,
        depending on the input arguments specified.

        Before importing an image, set up access to Cloud Storage and grant
        required roles to the user accounts and service accounts. For more
        information, see [](https://cloud.google.com/compute/docs/import/requirements-export-import-images).

        To override the detected OS, specify the `--os` flag.
        You can omit the translation step using the `--data-disk` flag.

        If you exported your disk from Compute Engine then you don't
        need to re-import it. Instead, use `{parent_command} create`
        to create more images from the disk.

        Files stored on Cloud Storage and images in Compute Engine incur
        charges. See [](https://cloud.google.com/compute/docs/images/importing-virtual-disks#resource_cleanup).

        Troubleshooting: Image import/export tools rely on CloudBuild default
        behavior. They has been using the default CloudBuild service account in
        order to import/export images to/from Google Cloud Platform. However,
        Cloud Build has changed this default behavior and in new projects a
        custom user managed service account may need to be provided to perform
        the builds. If you get a CloudBuild service account related error, run
        gcloud with --cloudbuild-service-account=<custom service account>.
        See `gcloud compute images import --help` for details.
        a
        To import a centos-7 VMDK file, run:

          $ {command} myimage-name --os=centos-7 --source-file=mysourcefile

        To import a data disk without operating system, run:

          $ {command} myimage-name --data-disk --source-file=mysourcefile
        )�brief�DESCRIPTION�EXAMPLES)rCF)@r��
__future__rrrr�enum�os.pathr1rDr�googlecloudsdk.api_lib.computerrrr	�googlecloudsdk.api_lib.storager
r�googlecloudsdk.callioperr
�)googlecloudsdk.command_lib.compute.imagesrr�googlecloudsdk.corerrr�googlecloudsdk.core.consoler�sixr�r��Enumrr+r.r-r7r9rMrg�
ReleaseTracksr��GA�	Deprecate�DefaultUniverseOnly�
CreateCommandrl�
add_metaclass�ABCMeta�objectr�r�r�rr�r��BETAr<�ALPHArA�
detailed_helprrr�<module>r\s���&��'�
���
��7�6�6�0�6�7�(�.�;�@�#�*�)�8�
�-����
�D�I�I�
�
	�B����4J�.HM�#A�L����D�%�%�(�(�)������	�	�����E�T�
�
�E���*�"E�P����3�;�;��`�v�`� �`�F�,<��,"B�,�"B�J+�/�+�\� 8��>�5��@����D�%�%�*�*�+�0��0�,�0�����D�%�%�+�+�,�9�*�9�-�9�3�"�F�K.��r