
    !                         S 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	\
5      r " S
 S\
5      r " S S\R                  5      rg)z"Cloud vmware Privateclouds client.    )
list_pager)clusters)networks)util)	arg_utils)Errorc                   (   ^  \ rS rSrU 4S jrSrU =r$ )SecondaryZoneNotProvidedError   c                 ,   > [         [        U ]  S5        g )NzRFAILED_PRECONDITION: Secondary Zone value is required for Stretched Private Cloud.)superr
   __init__self	__class__s    2lib/googlecloudsdk/api_lib/vmware/privateclouds.pyr   &SecondaryZoneNotProvidedError.__init__       	
'7	     __name__
__module____qualname____firstlineno__r   __static_attributes____classcell__r   s   @r   r
   r
           r   r
   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )PreferredZoneNotProvidedError#   c                 ,   > [         [        U ]  S5        g )NzRFAILED_PRECONDITION: Preferred Zone value is required for Stretched Private Cloud.)r   r!   r   r   s    r   r   &PreferredZoneNotProvidedError.__init__%   r   r   r   r   r   s   @r   r!   r!   #   r   r   r!   c                      ^  \ rS rSrSrU 4S jrS r     SS jrS rS r	SS jr
S	 rS
 rS rS rS rS rS rS rSS jrSS jrS rS rSrU =r$ )PrivateCloudsClient,   z"cloud vmware privateclouds client.c                    > [         [        U ]  5         U R                  R                  U l        [        R                  " 5       U l        [        R                  " 5       U l        g N)r   r&   r   client projects_locations_privateCloudsservicer   NetworksClientnetworks_clientr   ClustersClientcluster_clientr   s    r   r   PrivateCloudsClient.__init__/   sD    	
t-/;;??DL#224D"113Dr   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      nU$ Nname)messages4VmwareengineProjectsLocationsPrivateCloudsGetRequestRelativeNamer,   Get)r   resourcerequestresponses       r   r9   PrivateCloudsClient.Get5   sF    JJ&&( 	K 	
  ||(HOr   c                    UR                  5       R                  5       nUR                  5       R                  5       R                  5       nUR                  5       nU R                  R	                  US9nU R                  U5      Ul        U R                  R                  X5      n/ nU(       a)  U Vs/ s H  nU R                  R                  US9PM     nnU R                  R                  UUR                  US9nU R                  R                  US9n[        R                  " U R                  R                  R                  U R                  R                   U5      Ul        UR                  U R                  R                  R$                  R&                  L a@  U	(       d
  [)        5       eU(       d
  [+        5       eU R                  R-                  XS9Ul        [        R0                  " U R                  R2                  U R                  R4                  U R                  R6                  U
5      Ul        UUl        UUl        U R                  R?                  UUUS9nU R@                  RC                  U5      $ s  snf )N)description)ipCidrRange)managementCidrvmwareEngineNetworkserviceSubnets)	clusterId)preferredLocationsecondaryLocation)parentprivateCloudIdprivateCloud)"Parentr8   Namer6   PrivateCloudGetPrivateCloudTypetyper.   GetByIDSubnetNetworkConfigr5   ManagementClusterr   #ConstructNodeParameterConfigMessageNodeTypeConfigsValueNodeTypeConfignodeTypeConfigsTypeValueValuesEnum	STRETCHEDr!   r
   StretchedClusterConfigstretchedClusterConfig#ConstructAutoscalingSettingsMessageAutoscalingSettingsAutoscalingPolicy
ThresholdsautoscalingSettingsmanagementClusternetworkConfig7VmwareengineProjectsLocationsPrivateCloudsCreateRequestr,   Create)r   r:   
cluster_idnodes_configsnetwork_cidrvmware_engine_network_idprivate_cloud_typer?   secondary_zonepreferred_zoneautoscaling_settingsservice_subnetrG   projectprivate_cloud_idprivate_cloudvennew_subnetscidrnetwork_configmanagement_clusterr;   s                         r   rc   PrivateCloudsClient.Create?   s1    __++-Foo&&(--/G}}MM..;.GM112DEM



&
&w
ICK=K=KT$--

4

0^   ]]00#" 1 N
 88:8N00MM++@@MM((	
 & 	==%%99CC	D +--+--
--
.
. . /  / 	00MM--MM++MM$$ 		
 * '9M#"0MMM+& 	N 	
  <<w''_s   2#I9c                     U R                  U5      n/ nX#l        UR                  S5        U R                  R	                  UUR                  5       SR                  U5      S9nU R                  R                  U5      $ )Nr?   ,)rI   r5   
updateMask)	r9   r?   appendr6   6VmwareengineProjectsLocationsPrivateCloudsPatchRequestr8   joinr,   Patch)r   r:   r?   ro   update_maskr;   s         r   UpdatePrivateCloudsClient.Update   sx    HHX&MK +}%LL&&&(xx, 	M 	
  <<g&&r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ r3   )r6   9VmwareengineProjectsLocationsPrivateCloudsUndeleteRequestr8   r,   Undeleter   r:   r;   s      r   UnDeletePrivateCloudsClient.UnDelete   sB    OO&&( 	P 	
 
 <<  ))r   c                     U R                   R                  U R                  R                  UR	                  5       US95      $ )N)r5   
delayHours)r,   Deleter6   7VmwareengineProjectsLocationsPrivateCloudsDeleteRequestr8   )r   r:   delay_hourss      r   r   PrivateCloudsClient.Delete   s?    <<MM&&([ 	N 	
 r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ r3   )r6   HVmwareengineProjectsLocationsPrivateCloudsPrivateCloudDeletionNowRequestr8   r,   PrivateCloudDeletionNowr   s      r   	DeleteNowPrivateCloudsClient.DeleteNow   sB    ^^&&( 	_ 	
 
 <<//88r   c                     UR                  5       nU R                  R                  US9n[        R                  " U R
                  USSS9$ )N)rG   pageSizeprivateClouds)batch_size_attributefield)r8   r6   5VmwareengineProjectsLocationsPrivateCloudsListRequestr   YieldFromListr,   )r   location_resourcelocationr;   s       r   ListPrivateCloudsClient.List   sU     --/HKK 	L 	
 
 ##'	 r   c                     U R                   R                  UR                  5       S-   S9nU R                  R	                  U5      $ )N/dnsForwardingr4   )r6   AVmwareengineProjectsLocationsPrivateCloudsGetDnsForwardingRequestr8   r,   GetDnsForwardingr   s      r   r   $PrivateCloudsClient.GetDnsForwarding   sE    mm]]""$'77 ^ G <<((11r   c                     U R                  U5      nU R                  R                  US9nSnU R                  R                  UR	                  5       S-   UUS9nU R
                  R                  U5      $ )N)forwardingRulesr   r   )r5   dnsForwardingrx   )_ParseRulesr6   DnsForwardingDVmwareengineProjectsLocationsPrivateCloudsUpdateDnsForwardingRequestr8   r,   UpdateDnsForwarding)r   r:   
args_rulesrulesdns_forwardingr}   r;   s          r   r   'PrivateCloudsClient.UpdateDnsForwarding   sw    Z(E]]000GN#Kmm``""$'77$ a G
 <<++G44r   c                 N    U Vs/ s H  o R                  U5      PM     sn$ s  snf r)   )
_ParseRule)r   r   rules      r   r   PrivateCloudsClient._ParseRules   s!    .89jdOOD!j999s   "c                 B    U R                   R                  US   US   S9$ )Ndomainzname-servers)r   nameServers)r6   ForwardingRule)r   r   s     r   r   PrivateCloudsClient._ParseRule   s,    ==''H~4+? (  r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ N)rI   )r6   CVmwareengineProjectsLocationsPrivateCloudsShowNsxCredentialsRequestr8   r,   ShowNsxCredentialsr   s      r   GetNsxCredentials%PrivateCloudsClient.GetNsxCredentials   s?    mm__**, ` G <<**733r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ r   )r6   DVmwareengineProjectsLocationsPrivateCloudsResetNsxCredentialsRequestr8   r,   ResetNsxCredentialsr   s      r   r   'PrivateCloudsClient.ResetNsxCredentials   s?    mm``**, a G <<++G44r   c                     U R                   R                  UR                  5       US9nU R                  R	                  U5      $ )N)rI   username)r6   GVmwareengineProjectsLocationsPrivateCloudsShowVcenterCredentialsRequestr8   r,   ShowVcenterCredentials)r   r:   r   r;   s       r   GetVcenterCredentials)PrivateCloudsClient.GetVcenterCredentials   sA    mmcc**,x d G <<..w77r   c                     U R                   R                  5       nX#l        U R                   R                  UR	                  5       US9nU R
                  R                  U5      $ )N)rI   resetVcenterCredentialsRequest)r6   ResetVcenterCredentialsRequestr   HVmwareengineProjectsLocationsPrivateCloudsResetVcenterCredentialsRequestr8   r,   ResetVcenterCredentials)r   r:   r   vcenterr;   s        r   r   +PrivateCloudsClient.ResetVcenterCredentials   sZ    mm::<Gmmdd**,'. e G <<//88r   c                     [         R                  " SSU R                  R                  R                  S9R                  [         R                  " U5      5      nU$ )NrN   STANDARD)arg_namedefaultmessage_enum)r   ChoiceEnumMapperr6   rL   rW   GetEnumForChoiceEnumNameToChoice)r   rh   	type_enums      r   rM   'PrivateCloudsClient.GetPrivateCloudType   sO    **]]//CC y112DEF	 
 r   c                 r    U R                   R                  U5       H  nUR                  (       d  M  Us  $    g r)   )r0   r   
management)r   r:   clusters      r   GetManagementCluster(PrivateCloudsClient.GetManagementCluster   s.    &&++H5				 6r   )r0   r.   r,   )NNNNNr)   )r   r   r   r   __doc__r   r9   rc   r~   r   r   r   r   r   r   r   r   r   r   r   r   rM   r   r   r   r   s   @r   r&   r&   ,   sx    *4$ E(N'*92	5:
4589 r   r&   N)r   apitools.base.pyr   googlecloudsdk.api_lib.vmwarer   r   r   $googlecloudsdk.command_lib.util.apisr   googlecloudsdk.core.exceptionsr   r
   r!   VmwareClientBaser&   r   r   r   <module>r      sJ    ) ( 2 2 . : 0E E L$// Lr   