Descriptioncmd/juju/get: Use the API
Change "juju get" to call api.Client().ServiceGet() instead of
statecmd.ServiceGet(). Then I moved all the tests and implementation
over to state/apiserver/client/get*
I actually kept the code out of client.go because as we move things,
that file will get *huge* if all API calls end up in one file. It also
meant that the test for get.go end up in get_test.go which is nice and
straightforward.
The tests are just moving the existing tests (and changing the suite)
except for one change which I want to highlight. ServiceGet over the API
is returning float64(0) for skill-level, when the direct state call was
returning int64(0). I'm guessing that YAML and BSON are preserving the
int64 type, while JSON is not. (It is also possible that it was just
preserving the content in memory and returning it again, and if it
actually did a full DB round trip it would have lost the type.) Anyway,
I'm guessing we aren't strict with types, otherwise we'd have to change
our JSON api to send type information for all entries in a
map[]interface{}. But I did want us to be clear that type changing was
happening.
https://code.launchpad.net/~jameinel/juju-core/cli-api-get/+merge/182176
Requires: https://code.launchpad.net/~jameinel/juju-core/new-api-conn/+merge/182098
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : cmd/juju/get: Use the API #Patch Set 3 : cmd/juju/get: Use the API #Patch Set 4 : cmd/juju/get: Use the API #
MessagesTotal messages: 5
|