예제 #1
0
// RemoveJobs is used by flynn-host to delete jobs from the cluster state. It
// does not actually kill jobs running on hosts, and must not be used by
// clients.
func (c *Client) RemoveJobs(jobIDs []string) error {
	if c := c.local(); c != nil {
		return c.RemoveJobs(jobIDs)
	}
	client, err := c.RPCClient()
	if err != nil {
		return err
	}
	return client.Call("Cluster.RemoveJobs", jobIDs, &struct{}{})
}
예제 #2
0
// AddJobs requests the addition of more jobs to the cluster.
func (c *Client) AddJobs(req *host.AddJobsReq) (*host.AddJobsRes, error) {
	if c := c.local(); c != nil {
		return c.AddJobs(req)
	}
	client, err := c.RPCClient()
	if err != nil {
		return nil, err
	}
	var res host.AddJobsRes
	return &res, client.Call("Cluster.AddJobs", req, &res)
}
예제 #3
0
// ListHosts returns a map of host ids to host structures containing metadata
// and job lists.
func (c *Client) ListHosts() (map[string]host.Host, error) {
	if c := c.local(); c != nil {
		return c.ListHosts()
	}
	client, err := c.RPCClient()
	if err != nil {
		return nil, err
	}
	var state map[string]host.Host
	return state, client.Call("Cluster.ListHosts", struct{}{}, &state)
}