func (wh *WorkflowHandler) RegisterDomain(ctx context.Context, registerRequest *types.RegisterDomainRequest) (retError error) {
	defer log.CapturePanic(wh.GetLogger(), &retError)

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

	if wh.isShuttingDown() {
		return errShuttingDown
	}

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

	if registerRequest == nil {
		return errRequestNotSet
	}

	if registerRequest.GetWorkflowExecutionRetentionPeriodInDays() > int32(wh.config.domainConfig.MaxRetentionDays()) {
		return errInvalidRetention
	}

	if err := checkPermission(wh.config, registerRequest.SecurityToken); err != nil {
		return err
	}

	if err := checkRequiredDomainDataKVs(wh.config.domainConfig.RequiredDomainDataKeys(), registerRequest.GetData()); err != nil {
		return err
	}

	if registerRequest.GetName() == "" {
		return errDomainNotSet
	}

	err := wh.domainHandler.RegisterDomain(ctx, registerRequest)
	if err != nil {
		return wh.error(err, scope)
	}
	return nil
}
// RegisterDomain creates a new domain which can be used as a container for all resources.  Domain is a top level
// entity within Cadence, used as a container for all resources like workflow executions, tasklists, etc.  Domain
// acts as a sandbox and provides isolation for all resources within the domain.  All resources belongs to exactly one
// domain.
RegisterDomain creates a new domain which can be used as a container for all resources.  Domain is a top level
entity within Cadence, used as a container for all resources like workflow executions, tasklists, etc.  Domain
acts as a sandbox and provides isolation for all resources within the domain.  All resources belongs to exactly one
domain.
// RegisterDomain creates a new domain which can be used as a container for all resources . Domain is a top level // entity within Cadence used as a container for all resources like workflow executions tasklists etc . Domain // acts as a sandbox and provides isolation for all resources within the domain . All resources belongs to exactly one // domain .
func (wh *WorkflowHandler) RegisterDomain(ctx context.Context, registerRequest *types.RegisterDomainRequest) (retError error) {
	defer log.CapturePanic(wh.GetLogger(), &retError)
	scope, sw := wh.startRequestProfile(ctx, metrics.FrontendRegisterDomainScope)
	defer sw.Stop()
	if wh.isShuttingDown() {
		return errShuttingDown
	}
	if err := wh.versionChecker.ClientSupported(ctx, wh.config.EnableClientVersionCheck()); err != nil {
		return wh.error(err, scope)
	}
	if registerRequest == nil {
		return errRequestNotSet
	}
	if registerRequest.GetWorkflowExecutionRetentionPeriodInDays() > int32(wh.config.domainConfig.MaxRetentionDays()) {
		return errInvalidRetention
	}
	if err := checkPermission(wh.config, registerRequest.SecurityToken); err != nil {
		return err
	}
	if err := checkRequiredDomainDataKVs(wh.config.domainConfig.RequiredDomainDataKeys(), registerRequest.GetData()); err != nil {
		return err
	}
	if registerRequest.GetName() == "" {
		return errDomainNotSet
	}
	err := wh.domainHandler.RegisterDomain(ctx, registerRequest)
	if err != nil {
		return wh.error(err, scope)
	}
	return nil
}
func ( wh * WorkflowHandler ) RegisterDomain ( ctx context . Context , registerRequest * types . RegisterDomainRequest ) ( retError error ) { defer log . CapturePanic ( wh . GetLogger ( ) , & retError ) scope , sw := wh . startRequestProfile ( ctx , metrics . FrontendRegisterDomainScope ) defer sw . Stop ( ) if wh . isShuttingDown ( ) { return errShuttingDown } if err := wh . versionChecker . ClientSupported ( ctx , wh . config . EnableClientVersionCheck ( ) ) ; err != nil { return wh . error ( err , scope ) } if registerRequest == nil { return errRequestNotSet } if registerRequest . GetWorkflowExecutionRetentionPeriodInDays ( ) > int32 ( wh . config . domainConfig . MaxRetentionDays ( ) ) { return errInvalidRetention } if err := checkPermission ( wh . config , registerRequest . SecurityToken ) ; err != nil { return err } if err := checkRequiredDomainDataKVs ( wh . config . domainConfig . RequiredDomainDataKeys ( ) , registerRequest . GetData ( ) ) ; err != nil { return err } if registerRequest . GetName ( ) == " " { return errDomainNotSet } err := wh . domainHandler . RegisterDomain ( ctx , registerRequest ) if err != nil { return wh . error ( err , scope ) } return nil }
RegisterDomain creates a new domain which can be used as a container for all resources.
RegisterDomain creates a new domain which can be used as a container for all resources .