
    -                     0   S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJr  SSKJ	r	  SS	KJ
r
  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ r!  SSK"Jr#  SSK$J%r%  SSK&J'r'  SSK(Jr)  SSK(J*r*  SSK+r+SSK,J-r-  SSS.r.                              S#S jr/\R`                  \Rb                  " \Rd                  Rf                  5       " S S\Rh                  5      5       5       r5\Rb                  " \Rd                  Rl                  5       " S S \55      5       r7\Rb                  " \Rd                  Rp                  5       " S! S"\75      5       r9\.\5l:        g)$zCommand for creating instances.    )absolute_import)division)unicode_literalsN)base_classes)
csek_utils)instance_utils)	kms_utils)metadata_utils)partner_metadata_utils)utils)poller)base)
exceptions)
completers)flags)scope)secure_tags_utils)util)	arg_utils)labels_util)log)zipa)  
        *{command}* facilitates the creation of Compute Engine
        virtual machines.

        When an instance is in RUNNING state and the system begins to boot,
        the instance creation is considered finished, and the command returns
        with a list of new virtual machines.  Note that you usually cannot log
        into a new instance until it finishes booting. Check the progress of an
        instance using `gcloud compute instances get-serial-port-output`.

        For more examples, refer to the *EXAMPLES* section below.
        ap  
        To create an instance with the latest 'Red Hat Enterprise Linux 8' image
        available, run:

          $ {command} example-instance --image-family=rhel-8 --image-project=rhel-cloud --zone=us-central1-a

        To create instances called 'example-instance-1', 'example-instance-2',
        and 'example-instance-3' in the 'us-central1-a' zone, run:

          $ {command} example-instance-1 example-instance-2 example-instance-3 --zone=us-central1-a

        To create an instance called 'instance-1' from a source snapshot called
        'instance-snapshot' in zone 'us-central1-a' and attached regional disk
        'disk-1', run:

          $ {command} instance-1 --source-snapshot=https://compute.googleapis.com/compute/v1/projects/myproject/global/snapshots/instance-snapshot --zone=us-central1-a --disk=name=disk1,scope=regional

        To create an instance called instance-1 as a Shielded VM instance with
        Secure Boot, virtual trusted platform module (vTPM) enabled and
        integrity monitoring, run:

          $ {command} instance-1 --zone=us-central1-a --shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring

        To create a preemptible instance called 'instance-1', run:

          $ {command} instance-1 --machine-type=n1-standard-1 --zone=us-central1-b --preemptible --no-restart-on-failure --maintenance-policy=terminate

        )DESCRIPTIONEXAMPLESc                    [         R                  " U 5        [        R                  " XUS9  [        R                  " U USUUSUUUUUUS9  [        R
                  " U 5        [        R                  " U SU	SUUUUUS9	  [        R                  " U 5        [        R                  " U 5        [        R                  " XS9  [        R                  " U 5        [        R                  " U 5        [        R                  " U SSS9  [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                   " U 5        [        R"                  " U 5        [        R$                  " U SSUUS	9  [        R&                  " U 5        [        R(                  " U SS
9  [        R*                  " U 5        [        R,                  " U SS
9  [        R.                  " U 5        [        R0                  " U 5        [        R2                  " U 5        [        R4                  " U 5        [        R6                  " U 5        [        R8                  " U 5        [        R:                  " U 5        U(       a  [        R<                  " U 5        [        R>                  " U US9  [        R@                  " U 5        [        RB                  " U 5        [        RD                  " U 5        [        RF                  " U 5        [        RH                  " U 5        [        RJ                  " U 5        [        RL                  " U 5        [        RN                  " U SSUS9  [P        RR                  " U SS5        [T        RV                  " U 5        [        RX                  " U 5        U(       a  [Z        R\                  " U S5        [^        R`                  " U 5        U Rc                  SSS9  [        Rd                  Rg                  U SS9  [h        Rj                  " U 5        [l        Rn                  Rq                  U 5        U(       ad  U Rr                  Ru                  [        Rv                  5        U Rr                  Ry                  [        Rz                  [        R|                  S.5        O)U Rr                  Ru                  [        R~                  5        U Rr                  R                  [        R                  5        [        R                  " U 5        U(       a  [        R                  " U SS9  U
(       a  [        R                  " U 5        U(       a  [        R                  " U 5        U(       a  [        R                  " U 5        U(       a,  [        R                  " U 5        [        R                  " U 5        U(       a  [        R                  " U 5        U(       a  [        R                  " U 5        O[        R                  " U 5        U(       a  [        R                  " U 5        [        R                  " U 5        U(       a  [        R                  " U 5        U(       a  [        R                  " U 5        [        R                  " U 5        g)z*Register parser args common to all tracks.)
enable_kmsT)r   enable_snapshotssource_snapshot_csek
image_cseksupport_bootsupport_multi_writersupport_replica_zonesenable_source_instant_snapshotsenable_confidential_computesupport_disk_labelssupport_source_snapshot_region)	instancessupport_subinterfaceinstance_createsupport_network_queue_countsupport_vlan_nicsupport_ipv6_onlysupport_igmp_querysupport_enable_vpc_scoped_dns)	deprecateFax  However, if neither `--scopes` nor `--no-scopes` are specified and the project has no default service account, then the instance will be created with no scopes. Note that the level of access that a service account has is determined by a combination of access scopes and IAM roles so you must configure both access scopes and IAM roles for the service account to work properly.)extra_scopes_help)r   support_image_family_scopeenable_instant_snapshotsr&   instance)r,   z+Specifies the reservation for the instance.z)The type of reservation for the instance.)
group_textaffinity_text support_specific_then_x_affinityzadded tor4   z(source snapshots or source machine imagez--descriptionz1Specifies a textual description of the instances.)helpcreate)operation_type)external_ipinternal_ip)	is_createN)Rr
   AddMetadataArgsinstances_flagsAddDiskArgsAddCreateDiskArgsAddCanIpForwardArgsAddAddressArgsAddAcceleratorArgsAddMachineTypeArgsAddMaintenancePolicyArgsAddNoRestartOnFailureArgsAddPreemptibleVmArgsAddServiceAccountAndScopeArgsAddTagsArgsAddCustomMachineTypeArgsAddNetworkArgsAddPrivateNetworkIpArgsAddHostnameArgAddImageArgsAddDeletionProtectionFlagAddPublicPtrArgsAddIpv6PublicPtrDomainArgAddNetworkTierArgsAddShieldedInstanceConfigArgsAddDisplayDeviceArgAddMinNodeCpuArgAddNestedVirtualizationArgsAddThreadsPerCoreArgsAddEnableUefiNetworkingArgsAddResourceManagerTagsArgsAddNumaNodeCountArgsAddStackTypeArgsAddIpv6NetworkTierArgs AddNetworkPerformanceConfigsArgs"AddInstanceTerminationActionVmArgsAddIPv6AddressArgsAddIPv6PrefixLengthArgsAddInternalIPv6AddressArgsAddInternalIPv6PrefixLengthArgsAddReservationAffinityGroupmaintenance_flagsAddResourcePoliciesArgssole_tenancy_flagsAddNodeAffinityFlagToParserAddLocationHintArgr   AddEraseVssSignaturer   AddCreateLabelsFlagsadd_argumentINSTANCES_ARG_FOR_CREATEAddArgumentr   AddCsekKeyArgsr   
ASYNC_FLAGAddToParserdisplay_info	AddFormatDEFAULT_LIST_FORMAT_WITH_IPV6AddTransformsTransformInstanceExternalIpTransformInstanceInternalIpDEFAULT_LIST_FORMATAddCacheUpdaterr   InstancesCompleterAddNodeProjectArgsAddGracefulShutdownArgsAddHostErrorTimeoutSecondsArgsAddLocalSsdRecoveryTimeoutArgsAddInstanceKmsArgsAddMaxRunDurationVmArgsAddDiscardLocalSsdVmArgsAddPreemptionNoticeDurationArgsAddLocalSsdArgsWithSizeAddLocalSsdArgsAddWatchdogTimerArgAddTurboModeArgsAddSkipGuestOsShutdownArgsAddWorkloadIdentityConfigArgsAddRequestValidForDurationArgs)parserenable_regionalr   deprecate_maintenance_policysupports_erase_vsssnapshot_csekr   r!   r"   r(   "support_host_error_timeout_secondssupport_numa_node_countr*   support_instance_kmssupport_max_run_duration"support_local_ssd_recovery_timeoutsupport_local_ssd_sizer+   support_source_instant_snapshot#support_enable_confidential_computer7   r,   support_graceful_shutdownr-   support_watchdog_timerr%   r&   support_skip_guest_os_shutdown"support_preemption_notice_durationr.    support_workload_identity_configs                                  'lib/surface/compute/instances/create.py_CommonArgsr   `   s   D   (f*M##(/1&E"E-%C %%f-  /"=')+$A
 $$V,$$V,**6++F3&&v.//
 f%**62  ())&1  (!%>%C ++F3""6D9++F3$$Vd;//7%%f-""6*--f5''/--f5,,V4((0""6=NO((0226:44V<$$V,))&1,,V411&9-->?'G	 ++FJ
K008$$V,	v (( ) ""6*O  Q **66X 7 ' F#//f%
!!/"O"OP
%%&BB&BB' 
 !!/"E"EF%%j&C&CD$$V,++FdC'226:'226:&&v.++F3,,V4'33F;++F3##F+''/""6*#..v6%11&9008    c                       \ rS rSrSrSrSrSrSrSr	Sr
SrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,Sr-Sr.Sr/Sr0Sr1Sr2Sr3Sr4\5S 5       r6S r7S r8S r9S	 r:S
r;g)Createi  0Create Compute Engine virtual machine instances.TFc                    [        U40 SU R                  _SU R                  _SU R                  _SU R                  _SU R
                  _SU R                  _SU R                  _SU R                  _S	U R                  _S
U R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                   _SU R"                  _SU R$                  _SU R&                  _SU R(                  _SU R*                  _SU R,                  _SU R.                  _SU R0                  _SU R2                  _6  [4        R6                  " 5       U l        U R8                  R;                  U5        [4        R<                  " 5       U l        U R>                  R;                  U5        [4        R@                  " U5        [4        RB                  " U[D        RF                  RH                  5        [4        RJ                  " U[L        RN                  5        [4        RP                  " UU RR                  U RT                  U RV                  S9  [4        RX                  " U5        [4        RZ                  " U5        [4        R\                  " U5        [4        R^                  " U5        [4        R`                  " USS9  g )Nr   r!   r"   r   r(   r   r   r   r   r   r   r   r*   r+   r   r7   r   r-   r   r%   r,   r&   r   r   r.   !support_confidential_compute_type%support_confidential_compute_type_tdxsupport_snp_svsmTsupport_flex_start)1r   _support_kms_support_multi_writer_support_replica_zones_support_regional_support_subinterface#_support_host_error_timeout_seconds_support_numa_node_count_support_instance_kms_support_max_run_duration_support_erase_vss#_support_local_ssd_recovery_timeout_support_local_ssd_size_support_network_queue_count_support_vlan_nic$_support_enable_confidential_compute!_support_specific_then_x_affinity_support_graceful_shutdown_support_igmp_query_support_watchdog_timer_support_disk_labels_support_ipv6_only_support_source_snapshot_region_support_skip_guest_os_shutdown#_support_preemption_notice_duration_support_enable_vpc_scoped_dnsr?   MakeSourceInstanceTemplateArgSOURCE_INSTANCE_TEMPLATErn   AddMachineImageArgSOURCE_MACHINE_IMAGE"AddSourceMachineImageEncryptionKeyAddMinCpuPlatformArgsr   ReleaseTrackGAAddPrivateIpv6GoogleAccessArgr   COMPUTE_GA_API_VERSIONAddConfidentialComputeArgs"_support_confidential_compute_type&_support_confidential_compute_type_tdx_support_snp_svsmAddKeyRevocationActionTypeArgsAddVisibleCoreCountArgsAddAvailabilityDomainAgrs AddPerformanceMonitoringUnitArgsAddProvisioningModelVmArgsclsr   s     r   ArgsCreate.ArgsT  s   ## !66 "88	
 -- !66 ,/+R+R !$ < < !66 "%!>!> 11 ,/+R+R  #:: %($D$D ..  -0,T,T!" *-)N)N#$ #&"@"@%& 22'(  #::)*  44+, 00-. (+'J'J/0 (+'J'J12 ,/+R+R34 '*&H&H5: 	557     ,,V4 / B B DC((066v>))&$2C2C2F2FG11&272N2NP..*-	+	+.1	/	/..0 226:++F3--f544V<..r   c                     g)Nzcompute.instances )selfs    r   
CollectionCreate.Collection  s    r   c                     UR                  S5      (       d  gU R                  R                  X5      nUR                  5       $ a/  Retrieves the specified source machine image's selflink.

Args:
  args: The arguments passed into the gcloud command calling this function.
  resources: Resource parser used to retrieve the specified resource
    reference.

Returns:
  A string containing the specified source machine image's selflink.
source_machine_imageNIsSpecifiedr   ResolveAsResourceSelfLinkr   args	resourcesrefs       r   GetSourceMachineImageCreate.GetSourceMachineImage  ;     233

#
#
5
5d
FC<<>r   c                    [         R                  " XU R                  5      nUSLn	U R                  X5      n
U	=(       d    U
SLn	[         R                  " UUU	SSU R
                  U R                  U R                  U R                  U R                  U R                  S9n[         R                  " X5      n[         R                  " X5      n[         R                  " XU	5      n[         R                  " U5      n[        R                   " UUUUUU["        R$                  R&                  U	U R(                  U R*                  U R,                  U R.                  S9n[         R0                  " XR2                  5      n[         R4                  " UR6                  =(       d    / UR8                  =(       d    / -   5      (       + n[        R:                  " UUUUUUUR<                  SS9n[        R>                  " UR@                  US9n[        RB                  " UR@                  UU R2                  U RD                  U RF                  S9n[H        RJ                  RM                  UU RN                  5      n[        RP                  " XXY5      n[         RR                  " UUR@                  U RT                  5      n/ nU G	H  n/ n[        RV                  " XU RX                  S9(       Ga  [        RZ                  " S60 S	U_S
UR]                  5       _SUR^                  _SUR`                  _S["        R$                  R&                  _SU_SU_SU_SU_SU_SU_SU_SU RX                  _SU Rb                  _SU Rd                  _SU Rf                  _SU Rh                  _SU Rj                  _SU Rl                  _SU Rn                  _SU Rp                  _SU Rr                  _SU Rt                  _S U Rv                  _S!U Rx                  _6nSn[         Rz                  " X5      (       aF  [         R|                  " UUUUR^                  UR`                  ["        R$                  R&                  US"9n[         R~                  " X5      n[        R                  " UUUUR^                  UR`                  ["        R$                  R&                  S#9nUR@                  R                  UUR                  UR                  UUUR                  UUUUR                  UR]                  5       UUUR^                     UUS$9nU RT                  (       a  U(       a  UUlF        U R                  (       a  UR                  (       d  UR                  (       a  [        R                  " U5      n [        R                  " U 5        UR@                  R                  R                  5       n!U R                  5        Hl  u  n"n#U!R                  R                  UR@                  R                  R                  R                  U"[        R                  " U#UR@                  5      S%95        Mn     U!UlS        U R                  (       aK  UR                  R                  (       a0  [        R                  " UUR@                  UR                  SS&9UlY        U R                  (       a6  UR                  (       a%  [        R                  " UR                  5      Ul^        UR                  (       d  UR                  S'5      (       a  [         R                  " X5      Ulb        UR                  b>  [        R                  " UR@                  5      R                  UR                  5      Ulg        U R                  =(       a    UR                  SLn$UR                  c  UR                  c  U R                  (       a  UR                  ca  U$(       dZ  UR                  cM  U R                  (       a  UR                  (       d+  U R                  (       a  UR                  c  UR                  b  U$(       a  UR                  OSn%[         R                  " UR@                  UR                  UR                  U R                  (       a  UR                  OSU%UR                  U R                  (       a  UR                  OSU R                  (       a  UR                  OSUR                  5	      Ulu        [        US(S5      n&U&(       a\  / n'U& HM  n([        R                  " UU(UR^                  UR`                  S)9n)U'R                  U)R                  5       5        MO     U'Ulz        U(       a  UUl{        U(       a  UUl|        U R                  (       a'  UR                  S*5      (       a  UR                  Ul        U GR                  (       a^  UR                  S+5      (       aH  G[        GR                  " UGR                  UR@                  R                  GR
                  5      Ul        UR                  S,5      (       aH  G[        GR                  " UGR                  UR@                  R                  GR                  5      Ul        UR                  S-5      (       a  [         GR                  " X5      Ul        UR@                  GR                  UUR^                  UR`                  S.9n*U(       a  UU*l        U
(       a]  U
U*GR                  l        UR                  S/5      (       a5  [         GR                   " XGR"                  XW5      n+U+U*GR                  l        U GR&                  (       aE  UR                  S/5      (       a/  UR                  S05      (       d  G[(        GR*                  " S1S25      eUR                  S35      (       a5  UR@                  GR-                  UGR.                  S49U*GR                  l        [         GR2                  " XU GR4                  5      U*GR                  l        UR                  UGR8                  GR:                  S5U*45        G	M     U$ )7z6Creates a request for gcloud based on parameters.
    NT)support_node_affinitysupport_node_projectr   r   r   r   r   r   )r   resource_parsercompute_clientholderprojectlocationr   skip_defaultssupport_public_dnssupport_ipv6_assignment!support_internal_ipv6_reservationr.   )image_family_scoper1   )messagesr   )r   r   r   r   r   )r   r   support_kmsr   instance_namer   r   r   r   r   boot_disk_size_gb	image_uricreate_boot_disk	csek_keysr   r   support_nvdimmsupport_source_snapshot_cseksupport_boot_snapshot_urisupport_image_cseksupport_create_disk_snapshotsr"   r!   r   !support_boot_instant_snapshot_urir   r%   r&   )r   r   r   r   r   r   confidential_vm_type)r   r   r   r   r   r   )canIpForwarddeletionProtectiondescriptiondisksguestAcceleratorshostnamelabelsmachineTypemetadataminCpuPlatformnamenetworkInterfacesserviceAccounts
schedulingtags)keyvalue)instance_prefixrequest_valid_for_durationresource_policies)r   zoneerase_windows_vss_signaturepost_key_revocation_action_typekey_revocation_action_typenetwork_performance_configs)r4   r   r  "source_machine_image_csek_key_filer   z`--source-machine-image`zY`--source-machine-image-csek-key-file` requires `--source-machine-image` to be specified`enable_display_device)enableDisplayInsertr   )r   GetSourceInstanceTemplater   r   GetSchedulingr   r   r   r   r   r   GetTags	GetLabelsGetMetadataGetBootDiskSizeGbcreate_utils"GetNetworkInterfacesWithValidationcompute_scopes	ScopeEnumZONE_support_public_dns_support_ipv6_assignment"_support_internal_ipv6_reservationr   GetConfidentialVmTyper   UseExistingBootDiskdiskcreate_diskGetImageUrir   "BuildShieldedInstanceConfigMessager   &BuildConfidentialInstanceConfigMessager   r   r   CsekKeyStoreFromArgs_support_rsa_encryptedGetProjectToServiceAccountMap#CreateWorkloadIdentityConfigMessage!_support_workload_identity_configCheckSpecifiedDiskArgsr   CreateDiskMessagesNamer   r  _support_nvdimm_support_source_snapshot_csek_support_boot_snapshot_uri_support_image_csek_support_create_disk_snapshotsr   r    _support_source_instant_snapshot"_support_boot_instant_snapshot_urir   r   r   CheckSpecifiedMachineTypeArgsCreateMachineTypeUriGetCanIpForwardGetAcceleratorsInstancedeletion_protectionr	  r  min_cpu_platformworkloadIdentityConfig_support_partner_metadatapartner_metadatapartner_metadata_from_filer   CreatePartnerMetadataDictValidatePartnerMetadataPartnerMetadataValueitemsadditionalPropertiesappendAdditionalPropertyConvertStructuredEntriespartnerMetadatar   CONCEPTSinstance_kms_keyr	   MaybeGetKmsKeyinstanceEncryptionKey_support_secure_tagsecure_tagsr   GetSecureTags
secureTagsresource_manager_tagsIsKnownAndSpecifiedCreateParamsparamsprivate_ipv6_google_access_typer?   (GetPrivateIpv6GoogleAccessTypeFlagMapperGetEnumForChoiceprivateIpv6GoogleAccess_support_visible_core_countvisible_core_countenable_nested_virtualizationthreads_per_corer   numa_node_countenable_uefi_networking$_support_performance_monitoring_unitperformance_monitoring_unitr   enable_watchdog_timer
turbo_mode$CreateAdvancedMachineFeaturesMessageadvancedMachineFeaturesgetattrmaintenance_utilParseResourcePolicyWithZoner   resourcePoliciesshieldedInstanceConfigconfidentialInstanceConfigr   r   r  eraseWindowsVssSignature(_support_post_key_revocation_action_typer   ChoiceToEnumr  *PostKeyRevocationActionTypeValueValuesEnumpostKeyRevocationActionTyper  &KeyRevocationActionTypeValueValuesEnumkeyRevocationActionTypeGetNetworkPerformanceConfignetworkPerformanceConfigComputeInstancesInsertRequestsourceInstanceTemplater4   sourceMachineImageGetSourceMachineImageKeyr   sourceMachineImageEncryptionKey_support_machine_image_keyr   RequiredArgumentExceptionDisplayDevicer!  displayDeviceGetReservationAffinityr   reservationAffinityapitools_clientr'   ),r   r   instance_refsr   r  r   r   r   source_instance_templater   r   r  r  r  r  r   network_interfacesr  r   r   shielded_instance_configconfidential_instance_configr   project_to_saworkload_identity_configrequestsinstance_refr
  machine_type_urican_ip_forwardguest_acceleratorsr4   partner_metadata_dictpartner_metadata_message	namespacestructured_entrieshas_visible_core_countrn  r  parsed_resource_policiespolicyresource_policy_refrequestr  s,                                               r   _CreateRequestsCreate._CreateRequests  s$     .GGt<<  -D8M55dL!E%9%EM--"!+/+S+S!%!?!?+/+S+S"&"A"A'+'K'K+/+S+SJ !!$7D%%d;F))$NH&88>%HH'%&&++#33 $ = =*.*Q*Q&*&I&I *??557 	**DIIO,0,<,<,B,D 	EF ((22#')I  ,NN((t 5 	;;#,,.2//2633!33	5 ! ''00151L1LNI !>>^<M 	::##22	
  H%e		,	,''
) 
) // 

&++-
 !((
 "&&	

 !**//
 *
 ,
 0
  
 .
  
 
 ))
  //
 *.)K)K
  '+&E&E!
"  $77#
$ +/*M*M%
& #'"="='
( "&!;!;)
* -1,Q,Q+
, /3.U.U-
. 150Y0Y/
0 !% 9 91
2 ,0+O+O3
8 		5	5d	J	J)>>)+ ((!&& **//!57 &55dJn'77')&&$$((--/  ((11%!55&&.==&..  ".'(<(<= 2 h$ 
	/	/4L*B'		'	'


4#B#B #<<TB 	 	667LM##,,AAC 	! .C-H-H-J)I)
"
7
7
>
>%%..CCVV.GG(.*A*A W  .K $< 		#	#(F(F)2)A)A##** 	*"& 
	!	!d&6&6/==d>N>NO		#	#

"
"#?
@
@(55dK		-	-	9DD''))9)988*: 	( 
*
* .

!
!
-  
+
+
7"".++0D0D0P#((47722 **,,8oo) (>D##4 	 ??''11%%(,(E(E$$4"++<< 00// ** 	($ "$(;TB	#% 'F 0 L L"**$$	!&

 #
)
)*=*F*F*H
I ( %=!	!*B'	%.J+		 	 T%5%5
'&) &),0,L,L)		6	6	64;K;K
+<- <-/8/E/E00.2I2IX@@0B, 
		6	7	7+4+A+A++^-D-D-M-M33,5( 
		7	8	866tL 	) ''EE&&   F "g
 
")A&	.B+@AA77--~G#=@'


:		(	(	(T-=-=
..0 .0 67744(:; ;
 
		1	2	2)7)@)@)N)N44 *O *6& 
/
/D$J$J * oo))33Xw
GIM &P Or   c           	         [         R                  " UU R                  SU R                  U R                  U R
                  S9  [         R                  " U5        [         R                  " U5        [         R                  " U5        [         R                  " U5        [         R                  " U5        [         R                  " U5        [         R                  " U5        [         R                  " U5        [         R                  " XR                  S9  [         R"                  " U R%                  5       5      nUR&                  nUR(                  n[*        R,                  " XU5      n[/        U5      S:  a-  UR1                  S5      (       a  [2        R4                  " SS5      eU R7                  XUS   R8                  US   R:                  UXB5      nUR<                  (       d   UR?                  U5      $ / n	URO                  Xi5      n
U
 HH  n[Q        USS 5      nU(       d  M  U	RS                  [T        RV                  " URX                  5      5        MJ     U	(       a  [Z        R\                  " U	5      eU
 Vs/ s H'  oR(                  R_                  UR`                  5      PM)     nn[b        Rd                  Rg                  S5        [i        X]5       HL  u  p[b        Rd                  Rg                  SRk                  URl                  URo                  5       5      5        MN     [b        Rd                  Rg                  S5        UR1                  S5      (       d  SUl5        U
$ ! [2        R@                   ae  nS	n[B        RD                  " U[F        RH                  " U5      5      (       a-  [J        RL                  " [F        RH                  " U5      S
-   5      ee S nAff = fs  snf )NT)r   r   enable_source_snapshot_csekenable_image_csekenable_source_instant_snapshot)r      addressz	--addresszkMultiple instances were specified for creation. --address flag can be used when creating a single instance.r   zsInvalid value for field \'resource.machineType\': .+. Machine type with name \'.+\' does not exist in zone \'.+\'\.zU
Use `gcloud compute machine-types list --zones` to see the available machine  types.errorzDNOTE: The users will be charged for public IPs when VMs are created.z*Instance creation in progress for [{}]: {}z]Use [gcloud compute operations describe URI] command to check the status of the operation(s).formatdisable)8r?   ValidateDiskFlagsr   rC  rE  rG  ValidateImageFlagsValidateLocalSsdFlagsValidateNicFlags"ValidateServiceAccountAndScopeArgsValidateAcceleratorArgsValidateNetworkTierArgs ValidateReservationAffinityGroup%ValidateNetworkPerformanceConfigsArgsValidateInstanceSchedulingr   r   ComputeApiHolderr   clientr   r   GetInstanceRefslenr   r   BadArgumentExceptionr  r   r  async_MakeRequestsToolExceptionresearchsix	text_typecompute_exceptionsArgumentErrorAsyncRequestsry  rY  r   OperationErrorserrorscore_exceptions
MultiErrorParseselfLinkr   statusPrintr   r  r4   r   )r   r   r   r   r   r  r  e"invalid_machine_type_message_regexerrors_to_collect	responsesrerroperation_refsr  operation_refs                   r   Run
Create.Run  s2   %%$$$($F$F22'+'L'L &&t,))$/$$T*66t<++D1++D144T:99$?..'E'EG **4+<+<+>?F]]N&&O"224PM
=A$"2"29"="=++
56 6
 ##D$1!$4$<$<$1!$4$9$9>$3=H ;; **844 ,,XIIAw%c	  !7!7

!CD  &&'899BKL)Q&&,,QZZ8)NLJJ $ % (+='I#	jjCJJ


!7!7!9; < (J JJ @ AH%% dkG %% 	M 	+ 997q9IJJ"00mmA**+ + 		( Ms    M 3.OO/A OOr   N)<__name__
__module____qualname____firstlineno____doc__r   r   rB  r/  r   r  rC  rE  r  r;  _deprecate_maintenance_policyrF  rD  _enable_pd_interfacer   r   r   ra  r   r   rm  r   r   r   r0  r   r   r   r   r1  r   r   rs  rG  rH  rQ  r   r   r   r   r   r   r   r   r   r   r   r>  classmethodr   r   r   r  r  __static_attributes__r   r   r   r   r     sQ    9 ,/#"'-2* "'#' #(,%" $!%""'+$+/((,%'+$ )-&%*"',$#)-&&+#$!$)!$(!(-%#( &+#5 5n FP
Lr   r   c                       \ rS rSrSrSrSrSrSrSr	Sr
SrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,Sr-Sr.Sr/Sr0Sr1Sr2S r3\4S 5       r5Sr6g)	
CreateBetai6  r   TFc                     UR                  S5      (       d  gU R                  R                  X5      nUR                  5       $ r   r   r   s       r   r    CreateBeta.GetSourceMachineImagei  r   r   c                     [        U40 SU R                  _SU R                  _SU R                  _SU R                  _SU R
                  _SU R                  _SU R                  _SU R                  _S	U R                  _S
U R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                   _SU R"                  _SU R$                  _SU R&                  _SU R(                  _SU R*                  _SU R,                  _SU R.                  _SU R0                  _SU R2                  _SU R4                  _6  [6        R8                  " 5       U l        U R:                  R=                  U5        [6        R>                  " 5       U l         U R@                  R=                  U5        [6        RB                  " U5        [6        RD                  " U[F        RH                  RJ                  5        [6        RL                  " U[N        RP                  5        [6        RR                  " UU RT                  U RV                  U RX                  S9  [6        RZ                  " U5        [6        R\                  " U5        [6        R^                  " U5        [6        R`                  " U5        [6        Rb                  " U5        [6        Rd                  " USS9  [f        Rh                  " U5        g )Nr   r   r   r"   r!   r(   r   r   r   r   r*   r   r   r+   r   r7   r   r-   r   r%   r,   r&   r   r   r.   r   r   Tr   )5r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r>  r?   r   r   rn   r   r   r   r   r   r   BETAr   r   COMPUTE_BETA_API_VERSIONr   r   r   r   "AddPostKeyRevocationActionTypeArgsr   r   r   r   r   r   AddPartnerMetadataArgsr   s     r   r   CreateBeta.Argsy  s   -- ## 11	
 "88 !66 !66 ,/+R+R !$ < < !66 "%!>!> %($D$D ,/+R+R  #:: ..  -0,T,T!" *-)N)N#$ #&"@"@%& 22'(  #::)*  44+, 00-. (+'J'J/0 (+'J'J12 ,/+R+R34 '*&H&H56 *-)N)N7< 	557     ,,V4 / B B DC((066v>))&$2C2C2H2HI11..0..*-	+	+.1	/	/..0 66v>226:++F3--f544V<.. 11&9r   r   N)7r  r  r  r  r  r   r   rB  r/  r   r  rC  rE  r  r;  r  rF  rD  r   r   r   ra  r   r   rm  r   r   r   r0  r   r   r   r   r   r   rs  rG  rH  rQ  r   r   r   r   r   r   r   r   r   r   r   r>  r   r  r   r  r   r   r   r  r  6  s0   8,/#"'-1*"'#' #(,%" $!%""'+$+/((,% )-&%*"',$")-&&*##!$(!$(!(-%#( &+#  8: 8:r   r  c                       \ rS rSrSrSrSrSrSrSr	Sr
SrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,Sr-Sr.Sr/Sr0Sr1Sr2Sr3\4S 5       r5Sr6g)CreateAlphai  r   Tc                    [        U40 SU R                  _SU R                  _SU R                  _SU R                  _SU R
                  _SU R                  _SU R                  _SU R                  _S	U R                  _S
U R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                   _SU R"                  _SU R$                  _SU R&                  _SU R(                  _SU R*                  _SU R,                  _SU R.                  _SU R0                  _SU R2                  _SU R4                  _SU R6                  _SU R8                  _SU R:                  _SU R<                  _6  [>        R@                  " 5       [B        l"        [B        RD                  RG                  U5        [>        RH                  " 5       [B        l%        [B        RJ                  RG                  U5        [>        RL                  " U5        [>        RN                  " U[P        RR                  RT                  5        [>        RV                  " USS 9  [>        RX                  " U5        [>        RZ                  " UU R\                  U R^                  U R`                  S!9  [>        Rb                  " U5        [>        Rd                  " U[f        Rh                  5        [>        Rj                  " U5        [>        Rl                  " U5        [>        Rn                  " U5        [>        Rp                  " U5        [>        Rr                  " U5        [>        Rt                  " U5        [>        Rv                  " U5        [>        Rx                  " U5        [>        Rz                  " USS"9  [|        R~                  " U5        g )#Nr   r   r   r   r   r   r"   r!   r(   r   r   r*   r   r   r   r   r+   r   r   r7   r,   r   r-   r   r%   r&   r   r   r.   r   Tr3   r   r   )@r   r   r   r  r   rC  rE  r   r   r   r   r   r   r   r   r   r   r   rG  r   r   r   r   r   r   r   r   r   r   r   r>  r?   r   r  r   rn   r   r   r   r   r   r   ALPHAAddPublicDnsArgsAddLocalNvdimmArgsr   r   r   r   r  r   r   COMPUTE_ALPHA_API_VERSIONAddStableFleetArgsAddSecureTagsArgsr   r   AddIPv6AddressAlphaArgsAddIPv6PrefixLengthAlphaArgsr   r   r   r   r  r   s     r   r   CreateAlpha.Args  sn    --  ##  &)%F%F	 
 11  77  **  "88  !66  !66  ,/+R+R  !$ < <  %($D$D  !66  "%!>!>   ,/+R+R! "  #::# $ ..% & ),(L(L' ( -0,T,T) * *-)N)N+ , 00- . #&"@"@/ 0 221 2  #::3 4  445 6 (+'J'J7 8 (+'J'J9 : ,/+R+R; < '*&H&H= > *-)N)N? F 	557 ( ((44V<(7(J(J(LK$$$00866v>))&$2C2C2I2IJ$$Vd;&&v...*-	+	+.1	/	/..0 66v>11//1&&v.%%f-++F3226:++F3008--f544V<.. 11&9r   r   N)7r  r  r  r  r  r   r   rB  r/  r   r  rC  rE  r  r;  r  rF  rD  r  r   r   r   ra  r   r   rm  r   r   r   r0  r   r   r   r   r   r   rs  rG  rH  rQ  r   r   r   r   r   r   r   r   r   r   r   r>  r  r   r  r   r   r   r  r    s1   8,/#"&-1*"&#' #(,%! $!%"!'+$+/((,% )-&%)"'+$")-&&*## $(!$(!(,%#' &*#C: C:r   r  )FFFTFFFTFFFFFFTFFFFFFFTFFFFFFF);r  
__future__r   r   r   r  googlecloudsdk.api_lib.computer   r   r   r	   r
   r   r   /googlecloudsdk.api_lib.compute.instances.creater*  )googlecloudsdk.api_lib.compute.operationsr   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer   r  r   r   r,  r   ,googlecloudsdk.command_lib.compute.instancesr?   4googlecloudsdk.command_lib.compute.resource_policiesre   r   rz  /googlecloudsdk.command_lib.compute.sole_tenancyrg   $googlecloudsdk.command_lib.util.apisr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer  r   r  	six.movesr   DETAILED_HELPr   UniverseCompatibleReleaseTracksr   r   CreateCommandr   r  r  r  r  detailed_helpr   r   r   <module>r     s   & &  ' 	 7 5 9 4 9 A 0 Q < ( . 9 O 4 F @ Q [ Y W : < = # 
 		+` !&',! %"'+ $)(-%*# #(#(',"'%*?z9z D%%(()TT T * Tn D%%**+{: {: ,{:| D%%++,w:* w: -w:t % r   