
                         d   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 ej                   ej                  ej                  j                          G d dej"                                      Zej                   ej                  ej                  j&                         G d	 d
e                    Zy)(Create a Cloud NetApp Volume Quota Rule.    )client)base)flags)labels_util)logc                   \    e Zd ZdZej
                  j                  ZdddZe	d        Z
d Zy)Creater   z=          Create a Cloud NetApp Volume Quota Rule.
          a            The following command creates a default `user` Quota Rule named NAME using the required arguments:

              $ {command} NAME --location=us-central1 --volume=vol1 --type=DEFAULT_USER_QUOTA --disk-limit-mib=200


          The following command creates a default `group` Quota Rule named NAME using the required arguments:

              $ {command} NAME --location=us-central1 --volume=vol1 --type=DEFAULT_GROUP_QUOTA --disk-limit-mib=200


          The following command creates an individual user Quota Rule named NAME for user with UID '100' using the required arguments:

              $ {command} NAME --location=us-central1 --volume=vol1 --type=INDIVIDUAL_USER_QUOTA --target=100 --disk-limit-mib=200


          The following command creates an individual group Quota Rule named NAME for group with GID '1001' using the required arguments:

              $ {command} NAME --location=us-central1 --volume=vol1 --type=INDIVIDUAL_GROUP_QUOTA --target=1001 --disk-limit-mib=200

          )DESCRIPTIONEXAMPLESc                 .    t        j                  |        y )N)quota_rules_flagsAddQuotaRuleCreateArgs)parsers    0lib/surface/netapp/volumes/quota_rules/create.pyArgszCreate.Args<   s    ,,V4    c                 4   |j                   j                  j                         }|j                   j                  j                         j	                         }t        j                  | j                        }t        j                  |j                  |j                        }t        j                  ||j                  j                  j                        }|j!                  |j	                         ||j"                  |j$                  |j&                  |      }|j)                  |||j*                  |      }|j*                  rWdj-                  | j/                         j0                        }	t2        j4                  j7                  dj-                  |	             |S )z?Create a Cloud NetApp Volume Quota Rule in the current project.)namequota_rule_typetargetdisk_limit_mibdescriptionlabelsz)gcloud {} netapp volumes quota-rules listzHCheck the status of the new quota rule by listing all quota rules:
$ {} )CONCEPTS
quota_ruleParsevolumeRelativeNamequota_rules_clientQuotaRulesClient_RELEASE_TRACKr   GetQuotaRuleTypeEnumFromArgtypemessagesr   ParseCreateArgs	QuotaRuleLabelsValueParseQuotaRuleConfigr   r   r   CreateQuotaRuleasync_formatReleaseTrackprefixr   statusPrint)
selfargsquota_rule_ref
volume_refr   r   r   r   resultcommands
             r   Runz
Create.Run@   sJ   ]]--335N%%++-::<J001D1DEF'CC		6??O ((foo''33F ,,((*'{{**$$ - J ##
DKKF {{;BB




$
$g 
jj&/ Mr   N)__name__
__module____qualname____doc__r   r-   GAr"   detailed_helpstaticmethodr   r7    r   r   r
   r
      sB     1$$''.	-6 5 5"r   r
   c                   <    e Zd ZdZej
                  j                  Zy)
CreateBetar   N)r8   r9   r:   r;   r   r-   BETAr"   r?   r   r   rA   rA   e   s     1$$)).r   rA   N)r;   1googlecloudsdk.api_lib.netapp.volumes.quota_rulesr   r    googlecloudsdk.callioper   5googlecloudsdk.command_lib.netapp.volumes.quota_rulesr   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksr-   r<   CreateCommandr
   rB   rA   r?   r   r   <module>rK      s     / Z ( \ < # D%%(()FT F * FR D%%**+* * , *r   