当前位置: 首页>>代码示例>>Golang>>正文


Golang Config.ControllerUUID方法代码示例

本文整理汇总了Golang中github.com/juju/juju/environs/config.Config.ControllerUUID方法的典型用法代码示例。如果您正苦于以下问题:Golang Config.ControllerUUID方法的具体用法?Golang Config.ControllerUUID怎么用?Golang Config.ControllerUUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/juju/juju/environs/config.Config的用法示例。


在下文中一共展示了Config.ControllerUUID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: InstanceTags

// InstanceTags returns the minimum set of tags that should be set on a
// machine instance, if the provider supports them.
func InstanceTags(cfg *config.Config, jobs []multiwatcher.MachineJob) map[string]string {
	instanceTags := tags.ResourceTags(
		names.NewModelTag(cfg.UUID()),
		names.NewModelTag(cfg.ControllerUUID()),
		cfg,
	)
	if multiwatcher.AnyJobNeedsState(jobs...) {
		instanceTags[tags.JujuIsController] = "true"
	}
	return instanceTags
}
开发者ID:makyo,项目名称:juju,代码行数:13,代码来源:instancecfg.go

示例2: storageTags

// storageTags returns the tags that should be set on a volume or filesystem,
// if the provider supports them.
func storageTags(
	storageInstance state.StorageInstance,
	cfg *config.Config,
) (map[string]string, error) {
	storageTags := tags.ResourceTags(
		names.NewModelTag(cfg.UUID()),
		names.NewModelTag(cfg.ControllerUUID()),
		cfg,
	)
	if storageInstance != nil {
		storageTags[tags.JujuStorageInstance] = storageInstance.Tag().Id()
		storageTags[tags.JujuStorageOwner] = storageInstance.Owner().Id()
	}
	return storageTags, nil
}
开发者ID:makyo,项目名称:juju,代码行数:17,代码来源:storage.go

示例3: Open

func (p *environProvider) Open(cfg *config.Config) (environs.Environ, error) {
	p.mu.Lock()
	defer p.mu.Unlock()
	ecfg, err := p.newConfig(cfg)
	if err != nil {
		return nil, err
	}
	if _, ok := p.state[cfg.ControllerUUID()]; !ok {
		return nil, errNotPrepared
	}
	env := &environ{
		name:         ecfg.Name(),
		ecfgUnlocked: ecfg,
	}
	if err := env.checkBroken("Open"); err != nil {
		return nil, err
	}
	return env, nil
}
开发者ID:xushiwei,项目名称:juju,代码行数:19,代码来源:environs.go

示例4: controllerValues

func controllerValues(config *config.Config) map[string]interface{} {
	result := make(map[string]interface{})

	result["state-port"] = config.StatePort()
	result["api-port"] = config.APIPort()
	result["controller-uuid"] = config.ControllerUUID()
	// We ignore the second bool param from the CACert check as if there
	// wasn't a CACert, there is no way we'd be importing a new model
	// into the controller
	result["ca-cert"], _ = config.CACert()
	return result
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:12,代码来源:migration.go


注:本文中的github.com/juju/juju/environs/config.Config.ControllerUUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。