Esempio n. 1
0
func depsRequest(taskID string, requested []core.RequestedMetric, plugins []core.SubscribedPlugin, configTree *cdata.ConfigDataTree) *rpc.SubscribeDepsRequest {
	req := &rpc.SubscribeDepsRequest{
		Requested: common.RequestedToMetric(requested),
		Plugins:   common.ToSubPluginsMsg(plugins),
		TaskId:    taskID,
	}
	return req
}
Esempio n. 2
0
func (c ControlProxy) ValidateDeps(mts []core.RequestedMetric, plugins []core.SubscribedPlugin, _ *cdata.ConfigDataTree) []serror.SnapError {
	// The configDataTree is kept so that we can match the interface provided by control
	// we do not need it here though since the configDataTree is only used for metrics
	// and we do not allow remote collection.
	req := &rpc.ValidateDepsRequest{
		Metrics: common.RequestedToMetric(mts),
		Plugins: common.ToSubPluginsMsg(plugins),
	}
	reply, err := c.Client.ValidateDeps(getContext(), req)
	if err != nil {
		return []serror.SnapError{serror.New(err)}
	}
	serrs := common.ConvertSnapErrors(reply.Errors)
	return serrs
}