
    
                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ d
ddZ e
j                   e
j"                  j$                         G d de
j&                               Zy)z#'vmware clusters describe' command.    )absolute_import)division)unicode_literals)ClustersClient)NodeTypesClient)base)flags)resource_projectorzx
          Display data associated with a VMware Engine cluster, such as its node count, node type, and status.
        a  
          To describe a cluster called `my-cluster` in private cloud `my-private-cloud` and zone `us-west2-a`, run:

            $ {command} my-cluster --location=us-west2-a --project=my-project --private-cloud=my-private-cloud

            Or:

            $ {command} my-cluster --private-cloud=my-private-cloud

           In the second example, the project and location are taken from gcloud properties core/project and compute/zone.
    )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)Describez.Describe a Google Cloud VMware Engine cluster.c                 2    t        j                  | d       y)z Register flags for this command.T)
positionalN)r	   AddClusterArgToParser)parsers    6lib/surface/vmware/private_clouds/clusters/describe.pyArgszDescribe.Args5   s     
48    c                    |j                   j                  j                         }|j                         j                         }t	               }t               }t        j                  |j                  |            }|j                  |      }|D ci c]  }|j                  | }	}d\  }
}}}|d   j                         D ]  \  }}||	vr|	|   }|d   }|j                  d      xs d}|xs |j                  xs d}|j                  r|j                  |j                  z  nd}|
|j                  xs d|z  z  }
||j                   xs d|z  z  }|||z  |z  z  }|||z  z  } |
|d<   ||d<   ||d<   ||d	<   |S c c}w )
N)r   r   r   r   nodeTypeConfigs	nodeCountcustomCoreCountr   clusterMemoryGbclusterStorageGbclusterVirtualCpuCountclusterCoreCount)CONCEPTSclusterParseParentr   r   r
   MakeSerializableGetList
nodeTypeIditemsgettotalCoreCountvirtualCpuCountmemoryGb
diskSizeGb)selfargsr   locationclusters_clientnode_types_clientexisting_cluster
node_types	node_typeid_to_node_typecluster_memorycluster_storagecluster_vcpucluster_coresnode_type_idnode_type_config
node_countcustom_core_countcores_count
vcpu_ratios                       r   RunzDescribe.Run:   s   mm##))+G~~&&(H$&O'))::G$ #''1J9C9CI	i'   DN@NO\=*:+eg+&& 
_	,!,/i#K0j*../@AFQ%F)A)AFQk %% 
#
#y'?'?
?  ++0qJ>>n)..3!zAAokJ.;;l{Z//m%+& +9&'+:'(1=-.+8'(9s   E<N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r?    r   r   r   r   /   s!    6-9 9&r   r   N)rC   
__future__r   r   r   &googlecloudsdk.api_lib.vmware.clustersr   'googlecloudsdk.api_lib.vmware.nodetypesr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer	   googlecloudsdk.core.resourcer
   rD   ReleaseTracksReleaseTrackGADescribeCommandr   rG   r   r   <module>rR      sm    * &  ' A C ( 3 ;	
	( D%%(()0t## 0 *0r   