
    "                         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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.    )absolute_import)division)unicode_literals)
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__2   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   r<   PrivateCloudsClient.Get8   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)"Parentr;   Namer9   PrivateCloudGetPrivateCloudTypetyper1   GetByIDSubnetNetworkConfigr8   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_typerB   secondary_zonepreferred_zoneautoscaling_settingsservice_subnetrJ   projectprivate_cloud_idprivate_cloudvennew_subnetscidrnetwork_configmanagement_clusterr>   s                         r   rf   PrivateCloudsClient.CreateB   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      $ )NrB   ,)rL   r8   
updateMask)	r<   rB   appendr9   6VmwareengineProjectsLocationsPrivateCloudsPatchRequestr;   joinr/   Patch)r   r=   rB   rr   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      $ r6   )r9   9VmwareengineProjectsLocationsPrivateCloudsUndeleteRequestr;   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)r8   
delayHours)r/   Deleter9   7VmwareengineProjectsLocationsPrivateCloudsDeleteRequestr;   )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      $ r6   )r9   HVmwareengineProjectsLocationsPrivateCloudsPrivateCloudDeletionNowRequestr;   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)rJ   pageSizeprivateClouds)batch_size_attributefield)r;   r9   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/dnsForwardingr7   )r9   AVmwareengineProjectsLocationsPrivateCloudsGetDnsForwardingRequestr;   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   )r8   dnsForwardingr{   )_ParseRulesr9   DnsForwardingDVmwareengineProjectsLocationsPrivateCloudsUpdateDnsForwardingRequestr;   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)r9   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)rL   )r9   CVmwareengineProjectsLocationsPrivateCloudsShowNsxCredentialsRequestr;   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   )r9   DVmwareengineProjectsLocationsPrivateCloudsResetNsxCredentialsRequestr;   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)rL   username)r9   GVmwareengineProjectsLocationsPrivateCloudsShowVcenterCredentialsRequestr;   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)rL   resetVcenterCredentialsRequest)r9   ResetVcenterCredentialsRequestr   HVmwareengineProjectsLocationsPrivateCloudsResetVcenterCredentialsRequestr;   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$ )NrQ   STANDARD)arg_namedefaultmessage_enum)r
   ChoiceEnumMapperr9   rO   rZ   GetEnumForChoiceEnumNameToChoice)r   rk   	type_enums      r   rP   '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,   )r3   r   
management)r   r=   clusters      r   GetManagementCluster(PrivateCloudsClient.GetManagementCluster   s.    &&++H5				 6r   )r3   r1   r/   )NNNNNr,   )r   r   r   r   __doc__r   r<   rf   r   r   r   r   r   r   r   r   r   r   r   r   r   rP   r   r   r    r!   s   @r   r)   r)   /   sx    *4$ E(N'*92	5:
4589 r   r)   N)r   
__future__r   r   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      sQ    ) &  ' ' 2 2 . : 0E E L$// Lr   