Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3147)

Issue 12744053: cmd/juju/get: Use the API

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by jameinel
Modified:
10 years, 8 months ago
Reviewers:
mp+182176, fwereade
Visibility:
Public.

Description

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://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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -69 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/get.go View 2 chunks +4 lines, -10 lines 0 comments Download
M state/apiserver/client/client.go View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M state/apiserver/client/client_test.go View 1 chunk +0 lines, -18 lines 0 comments Download
M state/apiserver/client/get.go View 1 2 2 chunks +5 lines, -12 lines 0 comments Download
M state/apiserver/client/get_test.go View 1 2 3 4 chunks +69 lines, -24 lines 0 comments Download

Messages

Total messages: 5
jameinel
Please take a look.
10 years, 8 months ago (2013-08-26 17:48:41 UTC) #1
jameinel
Please take a look.
10 years, 8 months ago (2013-08-26 17:59:59 UTC) #2
jameinel
Please take a look.
10 years, 8 months ago (2013-08-28 07:20:07 UTC) #3
jameinel
Please take a look.
10 years, 8 months ago (2013-08-28 08:14:37 UTC) #4
fwereade
10 years, 8 months ago (2013-08-28 11:00:30 UTC) #5
LGTM, thanks for the test.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b