예제 #1
0
파일: client.go 프로젝트: mhilton/juju
// EnvironmentGet implements the server-side part of the
// get-environment CLI command.
func (c *Client) EnvironmentGet() (params.EnvironmentConfigResults, error) {
	result := params.EnvironmentConfigResults{}
	// Get the existing environment config from the state.
	config, err := c.api.state.EnvironConfig()
	if err != nil {
		return result, err
	}
	result.Config = config.AllAttrs()
	return result, nil
}
예제 #2
0
파일: controller.go 프로젝트: imoapps/juju
// EnvironmentConfig returns the environment config for the controller
// environment.  For information on the current environment, use
// client.EnvironmentGet
func (s *ControllerAPI) EnvironmentConfig() (params.EnvironmentConfigResults, error) {
	result := params.EnvironmentConfigResults{}

	stateServerEnv, err := s.state.ControllerEnvironment()
	if err != nil {
		return result, errors.Trace(err)
	}

	config, err := stateServerEnv.Config()
	if err != nil {
		return result, errors.Trace(err)
	}

	result.Config = config.AllAttrs()
	return result, nil
}