Adding Route model and APIs



> On Sep 23, 2014, at 7:27 PM, Abhishek Gupta <notifications@github.com> wrote:
> 
> In pkg/route/registry/etcd/etcd.go:
> 
> > +	return etcderr.InterpretUpdateError(err, "route", route.ID)
> > +}
> > +
> > +// DeleteRoute deletes a Route specified by its ID.
> > +func (registry *Etcd) DeleteRoute(routeID string) error {
> > +	key := makeRouteKey(routeID)
> > +	err := registry.Delete(key, true)
> > +	return etcderr.InterpretDeleteError(err, "route", routeID)
> > +}
> > +
> > +// WatchRoutes begins watching for new, changed, or deleted route configurations.
> > +func (registry *Etcd) WatchRoutes(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
> > +	if !label.Empty() {
> > +		return nil, fmt.Errorf("label selectors are not supported on routes yet")
> > +	}
> > +	if value, found := field.RequiresExactMatch("ID"); found {
> Alias most likely will be unique, but that is just because its a DNS/alias and can only point to a single thing.
> 
Unique across what?  Project?  Router?  Entire project?  What controls where it's unique?
> However, I would not like to use it as an ID since it could have port/path components within it and would make it difficult to access the resource using REST APIs.
> 
If the resource was called Alias, I'd agree this field should be Name.  However, as it's a route (which I'd like to see the godoc articulate what a route should and shouldn't be), it's not the name of the route, and so we should specifically identify what it is.  When name changes upstream, what you've described above is definitely not a name, so we should probably anticipate that.  It's probably Hostname.
> —
> Reply to this email directly or view it on GitHub.