Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller.AllocateMachine #15

Merged
merged 9 commits into from
Apr 3, 2016
Merged

Conversation

howbazaar
Copy link
Contributor

This branch adds the first of the POST methods, AllocateMachine. This meant there was a bit of churn around the testing http server to handle posts as well as gets, and to read the post form.

I also added a bunch of error types. I'd like all errors returned out of the new interfaces to be one of those errors. I have started by updating the machine and boot-resources parsing methods, but the others can be done as I touch the files again.

Added a helper method to get the ServerError, as it was being used in a bunch of tests.

Updated client_test.go to import gocheck with the "gc" name.

The post API call has been tested interactively with my test maas program. Yay dry run.

Go vet was complaining about Id saying it should be ID, and Cpu to be CPU, so I've updated those.

Also added a helper type to add url values only if they were non-zero.

@@ -36,7 +37,7 @@ func (*bootResourceSuite) TestReadBootResources(c *gc.C) {

func (*bootResourceSuite) TestLowVersion(c *gc.C) {
_, err := readBootResources(version.MustParse("1.9.0"), parseJSON(c, bootResourcesResponse))
c.Assert(err.Error(), gc.Equals, `no boot resource read func for version 1.9.0`)
c.Assert(err, jc.Satisfies, IsUnsupportedVersionError)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't care about the error text here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping it as the error text is good to be human readable and understandable.

@mjs
Copy link

mjs commented Apr 3, 2016

Lots of great stuff. LGTM.

@howbazaar
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Contributor

jujubot commented Apr 3, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi

@jujubot jujubot merged commit d840214 into juju:master Apr 3, 2016
jujubot added a commit that referenced this pull request Apr 3, 2016
Filter machines

Based on unlanded PR #15
jujubot added a commit that referenced this pull request Apr 3, 2016
Add ReleaseMachines method to the Controller.

Based on unlanded PR #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants