func NewInit(cfg *config.Config, ami ami.AMI) (*Initialize, error) {
	ops, err := cfg.Init.Cloud.HTTP.ToClientOptions()
	if err != nil {
		return nil, err
	}
	init := &Initialize{
		cfg:   cfg,
		sig:   make(chan bool, 1),
		http:  http.NewClient(ops),
		attrs: map[string]string{},
		ami:   ami,
		log:   log.With(log.Any("core", "Initialize")),
	}
	init.batch = &batch{
		name:         cfg.Init.Batch.Name,
		namespace:    cfg.Init.Batch.Namespace,
		securityType: cfg.Init.Batch.SecurityType,
		securityKey:  cfg.Init.Batch.SecurityKey,
	}
	for _, a := range cfg.Init.ActivateConfig.Attributes {
		init.attrs[a.Name] = a.Value
	}
	init.Start()
	return init, nil
}
// NewInit to activate, success add node info
NewInit to activate, success add node info
// NewInit to activate success add node info
func NewInit(cfg *config.Config, ami ami.AMI) (*Initialize, error) {
	ops, err := cfg.Init.Cloud.HTTP.ToClientOptions()
	if err != nil {
		return nil, err
	}
	init := &Initialize{
		cfg:   cfg,
		sig:   make(chan bool, 1),
		http:  http.NewClient(ops),
		attrs: map[string]string{},
		ami:   ami,
		log:   log.With(log.Any("core", "Initialize")),
	}
	init.batch = &batch{
		name:         cfg.Init.Batch.Name,
		namespace:    cfg.Init.Batch.Namespace,
		securityType: cfg.Init.Batch.SecurityType,
		securityKey:  cfg.Init.Batch.SecurityKey,
	}
	for _, a := range cfg.Init.ActivateConfig.Attributes {
		init.attrs[a.Name] = a.Value
	}
	init.Start()
	return init, nil
}
func NewInit ( cfg * config . Config , ami ami . AMI ) ( * Initialize , error ) { ops , err := cfg . Init . Cloud . HTTP . ToClientOptions ( ) if err != nil { return nil , err } init := & Initialize { cfg : cfg , sig : make ( chan bool , 1 ) , http : http . NewClient ( ops ) , attrs : map [ string ] string { } , ami : ami , log : log . With ( log . Any ( " " , " " ) ) , } init . batch = & batch { name : cfg . Init . Batch . Name , namespace : cfg . Init . Batch . Namespace , securityType : cfg . Init . Batch . SecurityType , securityKey : cfg . Init . Batch . SecurityKey , } for _ , a := range cfg . Init . ActivateConfig . Attributes { init . attrs [ a . Name ] = a . Value } init . Start ( ) return init , nil }
NewInit to activate, success add node info
NewInit to activate success add node info