Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-13 Thread Ignasi Barrera
Thanks @andreaturli! Let's squash and merge the PR! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/221#issuecomment-156463798

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-13 Thread Andrea Turli
Closed #221. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/221#event-463732998

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-12 Thread Ignasi Barrera
> + ), > + > ImmutableMap.of("39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867", > + Network.Details.create( > + > "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda", > //endpointId > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-12 Thread Ignasi Barrera
Just one missing assertion in the mock test! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/221#issuecomment-156247260

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Andrea Turli
> + assertNotNull(network); > + assertNotNull(network.id()); > + > + } > + > + @Test(dependsOnMethods = "testCreateNetwork") > + public void testGetNetwork() { > + network = api().inspectNetwork(network.id()); > + assertNotNull(network); > + } > + > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Andrea Turli
> + container = api.getContainerApi().inspectContainer(container.id()); > + } > + > + @AfterClass > + protected void tearDown() { > + if (container != null) { > + api.getContainerApi().stopContainer(container.id()); > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Andrea Turli
> + > + try { > + api.removeNetwork(networkId); > + assertSent(server, "DELETE", "/networks/" + networkId); > + > + } finally { > + server.shutdown(); > + } > + } > + > + public void testConnectContainerToNetwork() throws Exception { > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Andrea Turli
>} > >public Builder fromNetworkSettings(NetworkSettings in) { > return > this.ipAddress(in.ipAddress()).ipPrefixLen(in.ipPrefixLen()).gateway(in.gateway()).bridge(in.bridge()) > - .portMapping(in.portMapping()).ports(in.ports()); > + >

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Ignasi Barrera
> + > + try { > + api.removeNetwork(networkId); > + assertSent(server, "DELETE", "/networks/" + networkId); > + > + } finally { > + server.shutdown(); > + } > + } > + > + public void testConnectContainerToNetwork() throws Exception { > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Ignasi Barrera
> + container = api.getContainerApi().inspectContainer(container.id()); > + } > + > + @AfterClass > + protected void tearDown() { > + if (container != null) { > + api.getContainerApi().stopContainer(container.id()); > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Andrea Turli
> + public void testGetNetwork() { > + network = api().inspectNetwork(network.id()); > + assertNotNull(network); > + } > + > + @Test(dependsOnMethods = "testGetNetwork") > + public void testAttachContainerToNetwork() { > + api().connectContainerToNetwork(network.id(),

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-11 Thread Andrea Turli
Thanks @nacx I think I'm done now, I hope :) --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/221#issuecomment-155814158

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Andrea Turli
unfortunately the failure is not related to this PR but to https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/927/org.apache.jclouds.labs$jdbc/ --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/221#issuecomment-155475255

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Andrea Turli
Using the following versions ``` $ docker version Client: Version: 1.9.0 API version: 1.21 Go version: go1.4.3 Git commit: 76d6bc9 Built:Tue Nov 3 19:20:09 UTC 2015 OS/Arch: darwin/amd64 Server: Version: 1.9.0 API version: 1.21 Go version: go1.4.3 Git

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
> +package org.jclouds.docker.domain; > + > +import static org.jclouds.docker.internal.NullSafeCopies.copyOf; > +import java.util.List; > +import java.util.Map; > + > +import org.jclouds.javax.annotation.Nullable; > +import org.jclouds.json.SerializedNames; > + > +import

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
> + CreateImageOptions options = > CreateImageOptions.Builder.fromImage(ALPINE_IMAGE_TAG); > + InputStream createImageStream = > api.getImageApi().createImage(options); > + consumeStream(createImageStream); > + } > + image =

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
> + container = api.getContainerApi().inspectContainer(container.id()); > + } > + > + @AfterClass > + protected void tearDown() { > + if (container != null) { > + api.getContainerApi().stopContainer(container.id()); > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
Nice job updating the model to the latest version @andreaturli. Thanks! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/221#issuecomment-155574738

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
> + public void testGetNetwork() { > + network = api().inspectNetwork(network.id()); > + assertNotNull(network); > + } > + > + @Test(dependsOnMethods = "testGetNetwork") > + public void testAttachContainerToNetwork() { > + api().connectContainerToNetwork(network.id(),

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
> + @Named("networks:list") > + @GET > + @Fallback(EmptyListOnNotFoundOr404.class) > + List listNetworks(); > + > + /** > +* @param network the network’s configuration (@see BindToJsonPayload) > +* @return a new network > +*/ > + @Named("network:create") > + @POST > +

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
>} > >public Builder fromNetworkSettings(NetworkSettings in) { > return > this.ipAddress(in.ipAddress()).ipPrefixLen(in.ipPrefixLen()).gateway(in.gateway()).bridge(in.bridge()) > - .portMapping(in.portMapping()).ports(in.ports()); > + >

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
> + } > + > + @Test(dependsOnMethods = "testGetNetwork") > + public void testAttachContainerToNetwork() { > + api().connectContainerToNetwork(network.id(), container.id()); > + Container foundContainer = > api.getContainerApi().inspectContainer(container.id()); > + >

Re: [jclouds-labs] add docker NetworkAPI (#221)

2015-11-10 Thread Ignasi Barrera
> + > + try { > + api.removeNetwork(networkId); > + assertSent(server, "DELETE", "/networks/" + networkId); > + > + } finally { > + server.shutdown(); > + } > + } > + > + public void testConnectContainerToNetwork() throws Exception { > +