Ejemplo n.º 1
0
// ModelStatus returns a summary of the environment.
func (c *ControllerAPI) ModelStatus(req params.Entities) (params.ModelStatusResults, error) {
	envs := req.Entities
	results := params.ModelStatusResults{}
	status := make([]params.ModelStatus, len(envs))
	for i, env := range envs {
		envStatus, err := c.environStatus(env.Tag)
		if err != nil {
			return results, errors.Trace(err)
		}
		status[i] = envStatus
	}
	results.Results = status
	return results, nil
}
Ejemplo n.º 2
0
// ModelStatus returns a summary of the model.
func (c *ModelStatusAPI) ModelStatus(req params.Entities) (params.ModelStatusResults, error) {
	models := req.Entities
	results := params.ModelStatusResults{}

	status := make([]params.ModelStatus, len(models))
	for i, model := range models {
		modelStatus, err := c.modelStatus(model.Tag)
		if err != nil {
			return results, errors.Trace(err)
		}
		status[i] = modelStatus
	}
	results.Results = status
	return results, nil
}