Adding Route model and APIs



> On Sep 24, 2014, at 9:42 AM, Maciej Szulik <notifications@github.com> wrote:
> 
> In pkg/client/client.go:
> 
> > +}
> > +
> > +// DeleteRoute takes the name of the route, and returns an error if one occurs
> > +func (c *Client) DeleteRoute(name string) error {
> > +	return c.Delete().Path("routes").Path(name).Do().Error()
> > +}
> > +
> > +// CreateRoute takes the representation of a route.  Returns the server's representation of the route, and an error, if it occurs
> > +func (c *Client) CreateRoute(route *routeapi.Route) (result *routeapi.Route, err error) {
> > +	err = c.Post().Path("routes").Body(route).Do().Into(result)
> > +	return
> > +}
> > +
> > +// UpdateRoute takes the representation of a route to update.  Returns the server's representation of the route, and an error, if it occurs
> > +func (c *Client) UpdateRoute(route *routeapi.Route) (result *routeapi.Route, err error) {
> > +	if route.ResourceVersion == 0 {
> Why doing this validation here? Shouldn't that move to either validation.go or rest.go. I don't think we want to support validation in multiple places.
> 
This isn't really a validation - it's the client checking that the user isn't providing a new resource instead of one that already existed.  It's more of an upstream choice here

> —
> Reply to this email directly or view it on GitHub.