~frankban/juju-core/trial

Viewing all changes in revision 1722.

  • Committer: Tarmac
  • Author(s): John Arbash Meinel
  • Date: 2013-08-28 11:20:26 UTC
  • mfrom: (1712.2.8 cli-api-get)
  • Revision ID: tarmac-20130828112026-iec131w9pmmeol02
[r=jameinel] cmd/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://codereview.appspot.com/12744053/

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: