Update references from Path() to the appropriate segment use

This commit is contained in:
Clayton Coleman
2014-12-26 15:06:25 -05:00
parent afedbba3fc
commit e355f54eda
20 changed files with 258 additions and 111 deletions

View File

@@ -55,14 +55,14 @@ func (c *nodes) resourceName() string {
// Create creates a new minion.
func (c *nodes) Create(minion *api.Node) (*api.Node, error) {
result := &api.Node{}
err := c.r.Post().Path(c.resourceName()).Body(minion).Do().Into(result)
err := c.r.Post().Resource(c.resourceName()).Body(minion).Do().Into(result)
return result, err
}
// List lists all the nodes in the cluster.
func (c *nodes) List() (*api.NodeList, error) {
result := &api.NodeList{}
err := c.r.Get().Path(c.resourceName()).Do().Into(result)
err := c.r.Get().Resource(c.resourceName()).Do().Into(result)
return result, err
}
@@ -73,11 +73,11 @@ func (c *nodes) Get(name string) (*api.Node, error) {
}
result := &api.Node{}
err := c.r.Get().Path(c.resourceName()).Path(name).Do().Into(result)
err := c.r.Get().Resource(c.resourceName()).Name(name).Do().Into(result)
return result, err
}
// Delete deletes an existing minion.
func (c *nodes) Delete(name string) error {
return c.r.Delete().Path(c.resourceName()).Path(name).Do().Error()
return c.r.Delete().Resource(c.resourceName()).Name(name).Do().Error()
}