
                             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KJr  SSKJr  \R"                   " S S\R$                  5      5       rg)z5`gcloud domains registrations configure dns` command.    )absolute_import)division)unicode_literals)registrations)base)dns_util)flags)resource_args)util)
exceptions)logc                   .    \ rS rSrSr\S 5       rS rSrg)ConfigureDNS   aW  Configure DNS settings of a Cloud Domains registration.

Configure DNS settings of a Cloud Domains registration.

In most cases, this command is used for changing the authoritative name
servers and DNSSEC options for the given domain. However, advanced options
like glue records are available.

## EXAMPLES

To start an interactive flow to configure DNS settings for ``example.com'',
run:

  $ {command} example.com

To use Cloud DNS managed-zone ``example-zone'' for ``example.com'', run:

  $ {command} example.com --cloud-dns-zone=example-zone

DNSSEC will not be enabled as it may not be safe to enable it (e.g. when the
Cloud DNS managed-zone was signed less than 24h ago).

To use a signed Cloud DNS managed-zone ``example-zone'' for ``example.com''
and enable DNSSEC, run:

  $ {command} example.com --cloud-dns-zone=example-zone --no-disable-dnssec

To change DNS settings for ``example.com'' according to information from a
YAML file ``dns_settings.yaml'', run:

  $ {command} example.com --dns-settings-from-file=dns_settings.yaml

To disable DNSSEC, run:

  $ {command} example.com --disable-dnssec

c                     [         R                  " U S5        [        R                  " U 5        [        R                  " U S5        [        R
                  " U 5        g )Nzto configure DNS settings forzconfigure DNS settings of the)r
   AddRegistrationResourceArgr	   $AddConfigureDNSSettingsFlagsToParserAddValidateOnlyFlagToParserAddAsyncFlagToParser)parsers    2lib/surface/domains/registrations/configure/dns.pyArgsConfigureDNS.ArgsG   sC    ,,V-LN	..v6	%%f.MN	v&    c                 (   [         R                  " U5      n[         R                  " U5      n[        R                  " UR
                  5      Ul        UR                  R
                  R                  5       nUR                  S5      nU(       a'  UR                  (       a  [        R                  " S5      eUR                  U5      n[        R                  " X&5        [        R                  R                   nU(       a,  UR"                  (       a  [        R                  R$                  nO2U(       a+  UR"                  (       d  [        R                  R&                  n[        R(                  " UUR*                  UR,                  UR.                  UR                  UR0                  UUR2                  S9u  pUc1  [        R4                  " UUR0                  UUR2                  S9u  pUc  g UR2                  R6                  (       a0  U	R8                  (       d  [:        R<                  R?                  S5        [        R@                  " UR2                  5      n
[        R@                  " U5      nU	R*                  =(       a&    [        RB                  " UR2                  U5      (       + nU
(       d  U(       aC  U(       a<  [:        RD                  " S5        URF                  (       d  [        RH                  " 5         URK                  UUU	URL                  S9nURL                  (       a!  [:        R<                  R?                  S5        U$ [        RN                  " X-URP                  5      n[:        RR                  " URU                  5       SURP                  5        U$ )	Ndisable_dnsseczgargument --disable-dnssec: At most one of --dns-settings-from-file | --disable-dnssec can be specified.)dnssec_updatedns_settingsz_Glue records will not be cleared. If you want to clear them, use --dns-settings-from-file flag.zName servers should not be changed if DS records are present or added. Disable DNSSEC first and wait 24 hours before you change name servers. Otherwise your domain may stop serving.)validate_onlyzKThe command will not have any effect because validate-only flag is present.registration)+r   GetApiVersionFromArgsRegistrationsClientr   NormalizeResourceNamer    CONCEPTSParseIsSpecifieddns_settings_from_filer   ErrorGetAssertRegistrationOperationalr   DNSSECUpdate	NO_CHANGEr   DISABLEENABLEParseDNSSettingsname_serverscloud_dns_zoneuse_google_domains_dnsregistrationsIddnsSettingsPromptForNameServersglueRecordsglue_recordsr   statusPrintDnssecEnabledNameServersEquivalentwarningunsafe_dns_updatePromptForUnsafeDnsUpdater   r   WaitForOperationasync_UpdatedResourceName)selfargsapi_versionclientregistration_refdnssec_flag_providedr    r   r   update_maskds_records_presentnew_ds_recordsname_servers_changedresponses                 r   RunConfigureDNS.RunO   s   55d;K..{;F2243D3DED}}11779++,<= ; ;JK K ::./L&&{A))33M 3 3++33m	d&9&9++22m ( 9 9####((#!--	!L "*"?"?


*
*%#//	#l 
	++K4L4L	jj5
 "//0H0HI++L9N   	
..$$l
 
  	n2F	kk 2 3 ##))+""((	 # *H 	jj 8 9
 O &&{dkkJh	*//1>4;;OOr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rN   __static_attributes__rP   r   r   r   r      s"    $L ' 'Lr   r   N)rU   
__future__r   r   r   googlecloudsdk.api_lib.domainsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.domainsr   r	   r
   r   googlecloudsdk.corer   r   DefaultUniverseOnlyUpdateCommandr   rP   r   r   <module>r_      sU    < &  ' 8 ( 7 4 < 3 * # {4%% { {r   