
                          n    d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddlm
Z
 d	Zd
 Zd Zd Zy)z0Instances utilities for `gcloud redis` commands.    )absolute_import)division)unicode_literalsN)encoding)
properties)	resourcesz$^projects/(.*)/global/networks/(.*)$c                    t        j                  t        |       r| S t        j                  j
                  j                  j                         }t        j                  j                  d||       }|j                         S )Nzcompute.networks)projectnetwork)researchNETWORK_REGEXr   VALUEScorer
   	GetOrFailr   REGISTRYCreateRelativeName)r   r
   network_refs      =lib/googlecloudsdk/command_lib/redis/instances_create_util.pyParseInstanceNetworkArgr      sf    YY}g&N""**446'""))'7 * <+		!	!	##    c                 Z    t        j                  | |j                  j                  d      S )NT)
sort_items)r   DictToAdditionalPropertyMessageInstanceLabelsValue)labelsmessagess     r   PackageInstanceLabelsr    )   s(    		1	1h++
> >r   c                 l    |j                  d      r|S |j                  dk(  rd|j                  _        |S )z%Hook to update default replica count.replica_countzread-replicas-enabled   )IsSpecifiedread_replicas_modeinstancereplicaCount)unused_instance_refargspost_requests      r   AddDefaultReplicaCountr+   .   s9    	o&	 77)*L&	r   )__doc__
__future__r   r   r   r   apitools.base.pyr   googlecloudsdk.corer   r   r   r   r    r+    r   r   <module>r1      s3    7 &  ' 	 % * )6$>
r   