func (wh *WorkflowHandler) UpdateDomain(
	ctx context.Context,
	updateRequest *types.UpdateDomainRequest,
) (resp *types.UpdateDomainResponse, retError error) {
	defer log.CapturePanic(wh.GetLogger(), &retError)

	scope, sw := wh.startRequestProfile(ctx, metrics.FrontendUpdateDomainScope)
	defer sw.Stop()

	if wh.isShuttingDown() {
		return nil, errShuttingDown
	}

	if err := wh.versionChecker.ClientSupported(ctx, wh.config.EnableClientVersionCheck()); err != nil {
		return nil, wh.error(err, scope)
	}

	if updateRequest == nil {
		return nil, errRequestNotSet
	}

	// don't require permission for failover request
	if !isFailoverRequest(updateRequest) {
		if err := checkPermission(wh.config, updateRequest.SecurityToken); err != nil {
			return nil, err
		}
	} else {
		// reject the failover if the cluster is in lockdown
		if err := checkFailOverPermission(wh.config, updateRequest.Name); err != nil {
			return nil, err
		}
	}

	if isGraceFailoverRequest(updateRequest) {
		if err := wh.checkOngoingFailover(
			ctx,
			&updateRequest.Name,
		); err != nil {
			return nil, err
		}
	}

	if updateRequest.GetName() == "" {
		return nil, errDomainNotSet
	}
	// TODO: call remote clusters to verify domain data
	resp, err := wh.domainHandler.UpdateDomain(ctx, updateRequest)
	if err != nil {
		return resp, wh.error(err, scope)
	}
	return resp, err
}
// UpdateDomain is used to update the information and configuration for a registered domain.
UpdateDomain is used to update the information and configuration for a registered domain.
// UpdateDomain is used to update the information and configuration for a registered domain .
func (wh *WorkflowHandler) UpdateDomain(
	ctx context.Context,
	updateRequest *types.UpdateDomainRequest,
) (resp *types.UpdateDomainResponse, retError error) {
	defer log.CapturePanic(wh.GetLogger(), &retError)
	scope, sw := wh.startRequestProfile(ctx, metrics.FrontendUpdateDomainScope)
	defer sw.Stop()
	if wh.isShuttingDown() {
		return nil, errShuttingDown
	}
	if err := wh.versionChecker.ClientSupported(ctx, wh.config.EnableClientVersionCheck()); err != nil {
		return nil, wh.error(err, scope)
	}
	if updateRequest == nil {
		return nil, errRequestNotSet
	}
	if !isFailoverRequest(updateRequest) {
		if err := checkPermission(wh.config, updateRequest.SecurityToken); err != nil {
			return nil, err
		}
	} else {
		if err := checkFailOverPermission(wh.config, updateRequest.Name); err != nil {
			return nil, err
		}
	}
	if isGraceFailoverRequest(updateRequest) {
		if err := wh.checkOngoingFailover(
			ctx,
			&updateRequest.Name,
		); err != nil {
			return nil, err
		}
	}
	if updateRequest.GetName() == "" {
		return nil, errDomainNotSet
	}
	resp, err := wh.domainHandler.UpdateDomain(ctx, updateRequest)
	if err != nil {
		return resp, wh.error(err, scope)
	}
	return resp, err
}
func ( wh * WorkflowHandler ) UpdateDomain ( ctx context . Context , updateRequest * types . UpdateDomainRequest , ) ( resp * types . UpdateDomainResponse , retError error ) { defer log . CapturePanic ( wh . GetLogger ( ) , & retError ) scope , sw := wh . startRequestProfile ( ctx , metrics . FrontendUpdateDomainScope ) defer sw . Stop ( ) if wh . isShuttingDown ( ) { return nil , errShuttingDown } if err := wh . versionChecker . ClientSupported ( ctx , wh . config . EnableClientVersionCheck ( ) ) ; err != nil { return nil , wh . error ( err , scope ) } if updateRequest == nil { return nil , errRequestNotSet } if ! isFailoverRequest ( updateRequest ) { if err := checkPermission ( wh . config , updateRequest . SecurityToken ) ; err != nil { return nil , err } } else { if err := checkFailOverPermission ( wh . config , updateRequest . Name ) ; err != nil { return nil , err } } if isGraceFailoverRequest ( updateRequest ) { if err := wh . checkOngoingFailover ( ctx , & updateRequest . Name , ) ; err != nil { return nil , err } } if updateRequest . GetName ( ) == " " { return nil , errDomainNotSet } resp , err := wh . domainHandler . UpdateDomain ( ctx , updateRequest ) if err != nil { return resp , wh . error ( err , scope ) } return resp , err }
UpdateDomain is used to update the information and configuration for a registered domain.
UpdateDomain is used to update the information and configuration for a registered domain .
// don't require permission for failover request // reject the failover if the cluster is in lockdown // TODO: call remote clusters to verify domain data