I had written this up, but it didn't get published because I switched to git. https://codereview.appspot.com/102920048/diff/20001/environs/configstore/interface.go File environs/configstore/interface.go (right): https://codereview.appspot.com/102920048/diff/20001/environs/configstore/interface.go#newcode25 environs/configstore/interface.go:25: EnvironUUID string On 2014/06/02 10:08:17, rog wrote: > Why is this not an environ tag, to match the tag in api.Info ? This is driven primarily from William's strong desire that "tags are in the API, but don't bleed into the rest of the system". Specifically, in the .jenv file we store "user" but and not "tag", though api.Info does have a Tag field and not a User field. So it generally is: a) raw UUID on disk and in state b) Tag when passed around the API structures. I'm considering changing the URL to be /ENVTAG/api instead of /ENVUUID/api. I'm letting that simmer a bit before I make a final decision. https://codereview.appspot.com/102920048/diff/20001/state/api/apiclient.go File state/api/apiclient.go (right): https://codereview.appspot.com/102920048/diff/20001/state/api/apiclient.go#newcode151 state/api/apiclient.go:151: environUUID = envUUID On 2014/06/02 10:08:17, rog wrote: > why not just use environ tag throughout? as mentioned before, this follows the same pattern we use for User vs Tag, etc. https://codereview.appspot.com/102920048/diff/20001/state/api/export_test.go File state/api/export_test.go (right): https://codereview.appspot.com/102920048/diff/20001/state/api/export_test.go#newcode10 state/api/export_test.go:10: SetupWebsocket = setupWebsocket On 2014/06/02 10:08:17, rog wrote: > s/Setup/SetUp/ > ? Done. https://codereview.appspot.com/102920048/diff/20001/state/apiserver/apiserver.go File state/apiserver/apiserver.go (right): https://codereview.appspot.com/102920048/diff/20001/state/apiserver/apiserver.go#newcode210 state/apiserver/apiserver.go:210: handleAll(mux, "/", http.HandlerFunc(srv.apiHandler)) On 2014/06/02 10:08:18, rog wrote: > Can we please deprecate the behaviour that addressing any undefined url gives us > the API? It was always unintentional, and now I believe it's actively harmful. > It should be pretty simple to do - just write a handler that 404's any path > that's not /, and register it to /. For compatibility, we still have to serve the API at /. I believe bmizerany actually does 404 things that aren't at /, but we can write some tests to be clear about it. https://codereview.appspot.com/102920048/diff/20001/state/apiserver/apiserver.go#newcode256 state/apiserver/apiserver.go:256: env, err := srv.state.Environment() On 2014/06/02 10:08:18, rog wrote: > Rather than add an extra mongo round trip to every http request, we could store > the UUID in the server. Done. https://codereview.appspot.com/102920048/diff/20001/state/apiserver/common/errors.go File state/apiserver/common/errors.go (right): https://codereview.appspot.com/102920048/diff/20001/state/apiserver/common/errors.go#newcode50 state/apiserver/common/errors.go:50: ErrInvalidEnviron = stderrors.New("invalid environment requested") On 2014/06/02 10:08:18, rog wrote: > ErrUnknownEnviron = "unknown environment" ? I was actually pretty dissatisfied with the static error, so I went ahead and turned it into a typed error of UnknownEnviron, so that we can pass around the UUID we didn't understand, so we can report it back to the user. https://codereview.appspot.com/102920048/diff/20001/state/apiserver/httphandler.go File state/apiserver/httphandler.go (right): https://codereview.appspot.com/102920048/diff/20001/state/apiserver/httphandler.go#newcode69 state/apiserver/httphandler.go:69: if envUUID != "" { On 2014/06/02 10:08:18, rog wrote: > if envUUID == "" { > return nil > } > to save indentation? Done. https://codereview.appspot.com/102920048/