http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiLiveTest.java ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiLiveTest.java b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiLiveTest.java new file mode 100644 index 0000000..cb0a6b4 --- /dev/null +++ b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiLiveTest.java @@ -0,0 +1,215 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jclouds.profitbricks.rest.features; + +import com.google.common.base.Predicate; +import java.util.List; +import org.apache.jclouds.profitbricks.rest.domain.DataCenter; +import org.apache.jclouds.profitbricks.rest.domain.Image; +import org.apache.jclouds.profitbricks.rest.domain.Server; +import org.apache.jclouds.profitbricks.rest.domain.State; +import org.apache.jclouds.profitbricks.rest.domain.Volume; +import org.apache.jclouds.profitbricks.rest.ids.ServerRef; +import org.apache.jclouds.profitbricks.rest.internal.BaseProfitBricksLiveTest; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +@Test(groups = "live", testName = "ServerApiLiveTest") +public class ServerApiLiveTest extends BaseProfitBricksLiveTest { + + DataCenter dataCenter; + Server testServer; + Image attachedCdrom; + Volume attachedVolume; + + @BeforeClass + public void setupTest() { + dataCenter = createDataCenter(); + } + + @AfterClass(alwaysRun = true) + public void teardownTest() { + if (dataCenter != null) + deleteDataCenter(dataCenter.id()); + } + + @Test + public void testCreateServer() { + assertNotNull(dataCenter); + + testServer = serverApi().createServer( + Server.Request.creatingBuilder() + .dataCenterId(dataCenter.id()) + .name("jclouds-node") + .cores(1) + .ram(1024) + .build()); + + assertNotNull(testServer); + assertEquals(testServer.properties().name(), "jclouds-node"); + assertNodeRunning(ServerRef.create(dataCenter.id(), testServer.id())); + } + + + @Test(dependsOnMethods = "testCreateServer") + public void testGetServer() { + Server server = serverApi().getServer(dataCenter.id(), testServer.id()); + + assertNotNull(server); + assertEquals(server.id(), testServer.id()); + } + + @Test(dependsOnMethods = "testCreateServer") + public void testList() { + List<Server> servers = serverApi().getList(dataCenter.id()); + + assertNotNull(servers); + assertFalse(servers.isEmpty()); + assertEquals(servers.size(), 1); + } + + @Test(dependsOnMethods = "testGetServer") + public void testUpdateServer() { + assertDataCenterAvailable(dataCenter); + + api.serverApi().updateServer( + Server.Request.updatingBuilder() + .id(testServer.id()) + .dataCenterId(testServer.dataCenterId()) + .name("apache-node") + .ram(1024 * 2) + .cores(2) + .build()); + + assertDataCenterAvailable(dataCenter); + + assertNodeAvailable(ServerRef.create(dataCenter.id(), testServer.id())); + assertNodeRunning(ServerRef.create(dataCenter.id(), testServer.id())); + + Server server = serverApi().getServer(dataCenter.id(), testServer.id()); + + assertEquals(server.properties().name(), "apache-node"); + } + + @Test(dependsOnMethods = "testUpdateServer") + public void testStopServer() { + serverApi().stopServer(testServer.dataCenterId(), testServer.id()); + assertNodeSuspended(ServerRef.create(dataCenter.id(), testServer.id())); + + Server server = serverApi().getServer(testServer.dataCenterId(), testServer.id()); + assertEquals(server.properties().vmState(), Server.Status.SHUTOFF); + } + + @Test(dependsOnMethods = "testStopServer") + public void testStartServer() { + serverApi().startServer(testServer.dataCenterId(), testServer.id()); + assertNodeRunning(ServerRef.create(dataCenter.id(), testServer.id())); + + Server server = serverApi().getServer(testServer.dataCenterId(), testServer.id()); + assertEquals(server.properties().vmState(), Server.Status.RUNNING); + } + + @Test(dependsOnMethods = "testStartServer") + public void testRebootServer() { + serverApi().rebootServer(testServer.dataCenterId(), testServer.id()); + assertNodeRunning(ServerRef.create(dataCenter.id(), testServer.id())); + + Server server = serverApi().getServer(testServer.dataCenterId(), testServer.id()); + assertEquals(server.properties().vmState(), Server.Status.RUNNING); + } + + @Test(dependsOnMethods = "testRebootServer") + public void testListVolumes() { + List<Volume> volumes = serverApi().listAttachedVolumes(testServer.dataCenterId(), testServer.id()); + assertTrue(volumes.isEmpty()); + } + + @Test(dependsOnMethods = "testListVolumes") + public void testListCdroms() { + List<Image> images = serverApi().listAttachedCdroms(testServer.dataCenterId(), testServer.id()); + assertTrue(images.isEmpty()); + } + + @Test(dependsOnMethods = "testListCdroms") + public void testAttachCdrom() { + attachedCdrom = serverApi().attachCdrom( + Server.Request.attachCdromBuilder() + .dataCenterId(testServer.dataCenterId()) + .serverId(testServer.id()) + .imageId("7cb4b3a3-50c3-11e5-b789-52540066fee9") + .build() + ); + assertEquals(attachedCdrom.properties().name(), "ubuntu-14.04.3-server-amd64.iso"); + assertCdromAvailable(testServer, attachedCdrom.id()); + + List<Image> images = serverApi().listAttachedCdroms(testServer.dataCenterId(), testServer.id()); + assertEquals(images.size(), 1); + } + + @Test(dependsOnMethods = "testAttachCdrom") + public void testRetrieveAttachedCdrom() { + Image cdrom = serverApi().getCdrom(testServer.dataCenterId(), testServer.id(), attachedCdrom.id()); + assertEquals(cdrom.id(), attachedCdrom.id()); + } + + @Test(dependsOnMethods = "testRetrieveAttachedCdrom") + public void testDetachCdrom() { + serverApi().detachCdrom(testServer.dataCenterId(), testServer.id(), attachedCdrom.id()); + assertCdromRemoved(testServer, attachedCdrom.id()); + } + + @Test(dependsOnMethods = "testDetachCdrom") + public void testDeleteServer() { + serverApi().deleteServer(testServer.dataCenterId(), testServer.id()); + assertNodeRemoved(ServerRef.create(dataCenter.id(), testServer.id())); + } + + private ServerApi serverApi() { + return api.serverApi(); + } + + private void assertCdromAvailable(Server server, String cdRomId) { + assertRandom(new Predicate<String>() { + @Override + public boolean apply(String args) { + String[] params = args.split(","); + Image cdrom = serverApi().getCdrom(params[0], params[1], params[2]); + + if (cdrom == null || cdrom.metadata() == null) + return false; + + return cdrom.metadata().state() == State.AVAILABLE; + } + }, complexId(server.dataCenterId(), server.id(), cdRomId)); + } + + private void assertCdromRemoved(Server server, String cdRomId) { + assertRandom(new Predicate<String>() { + @Override + public boolean apply(String args) { + String[] params = args.split(","); + return serverApi().getCdrom(params[0], params[1], params[2]) == null; + } + }, complexId(server.dataCenterId(), server.id(), cdRomId)); + } + +}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiMockTest.java ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiMockTest.java b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiMockTest.java new file mode 100644 index 0000000..13e867e --- /dev/null +++ b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/features/ServerApiMockTest.java @@ -0,0 +1,322 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jclouds.profitbricks.rest.features; + +import com.squareup.okhttp.mockwebserver.MockResponse; +import java.util.List; +import org.apache.jclouds.profitbricks.rest.domain.Image; +import org.apache.jclouds.profitbricks.rest.domain.Server; +import org.apache.jclouds.profitbricks.rest.domain.Volume; +import org.apache.jclouds.profitbricks.rest.domain.options.DepthOptions; +import org.apache.jclouds.profitbricks.rest.internal.BaseProfitBricksApiMockTest; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; +import org.testng.annotations.Test; + +@Test(groups = "unit", testName = "ServerApiMockTest", singleThreaded = true) +public class ServerApiMockTest extends BaseProfitBricksApiMockTest { + + @Test + public void testGetList() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/list.json")) + ); + + List<Server> list = serverApi().getList("datacenter-id"); + + assertNotNull(list); + assertEquals(list.size(), 5); + assertEquals(list.get(0).properties().name(), "docker001"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/datacenters/datacenter-id/servers"); + } + + @Test + public void testGetListWithDepth() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/list-depth-5.json")) + ); + + List<Server> list = serverApi().getList("datacenter-id", new DepthOptions().depth(5)); + + assertNotNull(list); + assertEquals(list.size(), 4); + assertEquals(list.get(0).properties().name(), "kube-lb"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/datacenters/datacenter-id/servers?depth=5"); + } + + @Test + public void testGetListWith404() throws InterruptedException { + server.enqueue(new MockResponse().setResponseCode(404)); + List<Server> list = serverApi().getList("datacenter-id", new DepthOptions().depth(1)); + assertTrue(list.isEmpty()); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/datacenters/datacenter-id/servers?depth=1"); + } + + @Test + public void testGetServer() throws InterruptedException { + MockResponse response = new MockResponse(); + response.setBody(stringFromResource("/server/get.json")); + response.setHeader("Content-Type", "application/vnd.profitbricks.resource+json"); + + server.enqueue(response); + + Server server = serverApi().getServer("datacenter-id", "some-id"); + + assertNotNull(server); + assertEquals(server.properties().name(), "docker001"); + + assertEquals(this.server.getRequestCount(), 1); + assertSent(this.server, "GET", "/datacenters/datacenter-id/servers/some-id"); + } + + @Test + public void testGetServerWithDepth() throws InterruptedException { + MockResponse response = new MockResponse(); + response.setBody(stringFromResource("/server/get-depth-5.json")); + response.setHeader("Content-Type", "application/vnd.profitbricks.resource+json"); + + server.enqueue(response); + + Server server = serverApi().getServer("datacenter-id", "some-id", new DepthOptions().depth(5)); + + assertNotNull(server); + assertEquals(server.properties().name(), "kube-lb"); + + assertEquals(this.server.getRequestCount(), 1); + assertSent(this.server, "GET", "/datacenters/datacenter-id/servers/some-id?depth=5"); + } + + public void testGetServerWith404() throws InterruptedException { + server.enqueue(response404()); + + Server server = serverApi().getServer("datacenter-id", "some-id"); + + assertEquals(server, null); + + assertEquals(this.server.getRequestCount(), 1); + assertSent(this.server, "GET", "/datacenters/datacenter-id/servers/some-id"); + } + + @Test + public void testCreate() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/get.json")) + ); + + Server server = serverApi().createServer( + Server.Request.creatingBuilder() + .dataCenterId("datacenter-id") + .name("jclouds-node") + .cores(1) + .ram(1024) + .build()); + + assertNotNull(server); + assertNotNull(server.id()); + + assertEquals(this.server.getRequestCount(), 1); + assertSent(this.server, "POST", "/rest/datacenters/datacenter-id/servers", + "{\"properties\": {\"name\": \"jclouds-node\", \"cores\": 1, \"ram\": 1024}}" + ); + } + + @Test + public void testUpdate() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/datacenter/get.json")) + ); + + api.serverApi().updateServer( + Server.Request.updatingBuilder() + .id("some-id") + .dataCenterId("datacenter-id") + .name("apache-node") + .ram(1024 * 2) + .cores(2) + .build()); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "PATCH", "/rest/datacenters/datacenter-id/servers/some-id", "{\"name\": \"apache-node\", \"ram\": 2048, \"cores\": 2}"); + } + + @Test + public void testDelete() throws InterruptedException { + server.enqueue(response204()); + + serverApi().deleteServer("datacenter-id", "some-id"); + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/datacenters/datacenter-id/servers/some-id"); + } + + @Test + public void testDeleteWith404() throws InterruptedException { + server.enqueue(response404()); + + serverApi().deleteServer("datacenter-id", "some-id"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/datacenters/datacenter-id/servers/some-id"); + } + + @Test + public void testStopServer() throws InterruptedException { + server.enqueue(response204()); + serverApi().stopServer("datacenter-id", "some-id"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/datacenters/datacenter-id/servers/some-id/stop"); + } + + @Test + public void testStartServer() throws InterruptedException { + server.enqueue(response204()); + serverApi().startServer("datacenter-id", "some-id"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/datacenters/datacenter-id/servers/some-id/start"); + } + + @Test + public void testRebootServer() throws InterruptedException { + server.enqueue(response204()); + serverApi().rebootServer("datacenter-id", "some-id"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/datacenters/datacenter-id/servers/some-id/reboot"); + } + + @Test + public void testListVolumes() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/volumes.json")) + ); + + List<Volume> volumes = serverApi().listAttachedVolumes("datacenter-id", "some-id"); + assertEquals(volumes.size(), 2); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/datacenters/datacenter-id/servers/some-id/volumes"); + } + + @Test + public void testAttachVolume() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/volume.json")) + ); + + Volume volume = serverApi().attachVolume(Server.Request.attachVolumeBuilder() + .dataCenterId("datacenter-id") + .serverId("server-id") + .imageId("image-id") + .build() + ); + + assertEquals(volume.properties().name(), "Storage"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/rest/datacenters/datacenter-id/servers/server-id/volumes", "{\"id\": \"image-id\"}"); + } + + @Test + public void testGetVolume() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/volume.json")) + ); + + Volume volume = serverApi().getVolume("datacenter-id", "server-id", "volume-id"); + + assertEquals(volume.properties().name(), "Storage"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/datacenters/datacenter-id/servers/server-id/volumes/volume-id"); + } + + @Test + public void testDetachVolume() throws InterruptedException { + server.enqueue(response204()); + + serverApi().detachVolume("datacenter-id", "server-id", "image-id"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/datacenters/datacenter-id/servers/server-id/volumes/image-id"); + } + + @Test + public void testListCdroms() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/cdroms.json")) + ); + + List<Image> cdroms = serverApi().listAttachedCdroms("datacenter-id", "some-id"); + assertEquals(cdroms.size(), 1); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/datacenters/datacenter-id/servers/some-id/cdroms"); + } + + @Test + public void testAttachCdrom() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/image.json")) + ); + serverApi().attachCdrom(Server.Request.attachCdromBuilder() + .dataCenterId("datacenter-id") + .serverId("server-id") + .imageId("image-id") + .build() + ); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "POST", "/rest/datacenters/datacenter-id/servers/server-id/cdroms", "{\"id\": \"image-id\"}"); + } + + @Test + public void testGetCdrom() throws InterruptedException { + server.enqueue( + new MockResponse().setBody(stringFromResource("/server/cdrom.json")) + ); + + Image cdrom = serverApi().getCdrom("datacenter-id", "server-id", "cdrom-id"); + + assertEquals(cdrom.properties().name(), "ubuntu-15.10-server-amd64.iso"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "GET", "/datacenters/datacenter-id/servers/server-id/cdroms/cdrom-id"); + } + + @Test + public void testDettachCdrom() throws InterruptedException { + server.enqueue(response204()); + + serverApi().detachCdrom("datacenter-id", "server-id", "image-id"); + + assertEquals(server.getRequestCount(), 1); + assertSent(server, "DELETE", "/datacenters/datacenter-id/servers/server-id/cdroms/image-id"); + } + + + private ServerApi serverApi() { + return api.serverApi(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksApiMockTest.java ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksApiMockTest.java b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksApiMockTest.java index 4007be6..58cad1f 100644 --- a/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksApiMockTest.java +++ b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksApiMockTest.java @@ -81,6 +81,10 @@ public class BaseProfitBricksApiMockTest { protected String url(String path) { return server.getUrl(path).toString(); } + + protected MockResponse response204() { + return new MockResponse().setStatus("HTTP/1.1 204 No Content"); + } protected MockResponse response404() { return new MockResponse().setStatus("HTTP/1.1 404 Not Found"); http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksLiveTest.java ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksLiveTest.java b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksLiveTest.java index 3894788..7ebb32e 100644 --- a/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksLiveTest.java +++ b/profitbricks-rest/src/test/java/org/apache/jclouds/profitbricks/rest/internal/BaseProfitBricksLiveTest.java @@ -16,16 +16,133 @@ */ package org.apache.jclouds.profitbricks.rest.internal; +import com.google.common.base.Joiner; +import com.google.common.base.Predicate; +import com.google.inject.Injector; +import com.google.inject.Key; +import com.google.inject.Module; +import com.google.inject.TypeLiteral; +import com.google.inject.name.Names; +import java.util.Properties; +import java.util.concurrent.TimeUnit; import org.apache.jclouds.profitbricks.rest.ProfitBricksApi; +import org.apache.jclouds.profitbricks.rest.util.ApiPredicatesModule.ComputeConstants; +import static org.apache.jclouds.profitbricks.rest.config.ProfitBricksComputeProperties.POLL_PREDICATE_DATACENTER; +import static org.apache.jclouds.profitbricks.rest.config.ProfitBricksComputeProperties.TIMEOUT_NODE_RUNNING; +import static org.apache.jclouds.profitbricks.rest.config.ProfitBricksComputeProperties.TIMEOUT_NODE_SUSPENDED; +import org.apache.jclouds.profitbricks.rest.domain.DataCenter; import org.apache.jclouds.profitbricks.rest.domain.Location; +import org.apache.jclouds.profitbricks.rest.domain.Server; +import org.apache.jclouds.profitbricks.rest.domain.State; +import org.apache.jclouds.profitbricks.rest.ids.ServerRef; import org.jclouds.apis.BaseApiLiveTest; +import org.jclouds.util.Predicates2; +import static org.testng.Assert.assertTrue; public class BaseProfitBricksLiveTest extends BaseApiLiveTest<ProfitBricksApi> { - public static final Location TestLocation = Location.US_LAS; + public static final Location TestLocation = Location.US_LASDEV; + + private Predicate<String> dataCenterAvailable; + private Predicate<ServerRef> serverRunning; + private Predicate<ServerRef> serverSuspended; + private Predicate<ServerRef> serverAvailable; + private Predicate<ServerRef> serverRemoved; + + ComputeConstants computeConstants; public BaseProfitBricksLiveTest() { - provider = "profitbricks-rest"; + provider = "profitbricks-rest"; + } + + @Override + protected ProfitBricksApi create(Properties props, Iterable<Module> modules) { + + Injector injector = newBuilder().modules(modules).overrides(props).buildInjector(); + + computeConstants = injector.getInstance(ComputeConstants.class); + + dataCenterAvailable = injector.getInstance( + Key.get(new TypeLiteral<Predicate<String>>() {}, Names.named(POLL_PREDICATE_DATACENTER)) + ); + + serverRunning = injector.getInstance( + Key.get(new TypeLiteral<Predicate<ServerRef>>() {}, Names.named(TIMEOUT_NODE_RUNNING)) + ); + + serverSuspended = injector.getInstance( + Key.get(new TypeLiteral<Predicate<ServerRef>>() {}, Names.named(TIMEOUT_NODE_SUSPENDED)) + ); + + ComputeConstants c = computeConstants; + + Predicate<ServerRef> serverAvailableCheck = new Predicate<ServerRef>() { + @Override + public boolean apply(ServerRef serverRef) { + Server server = api.serverApi().getServer(serverRef.dataCenterId(), serverRef.serverId()); + + if (server == null || server.metadata().state() == null) + return false; + + return server.metadata().state() == State.AVAILABLE; + } + }; + + serverAvailable = Predicates2.retry(serverAvailableCheck, c.pollTimeout(), c.pollPeriod(), c.pollMaxPeriod(), TimeUnit.SECONDS); + + Predicate<ServerRef> serverRemovedPredicate = new Predicate<ServerRef>() { + @Override + public boolean apply(ServerRef serverRef) { + return api.serverApi().getServer(serverRef.dataCenterId(), serverRef.serverId()) == null; + } + }; + + serverRemoved = Predicates2.retry(serverRemovedPredicate, c.pollTimeout(), c.pollPeriod(), c.pollMaxPeriod(), TimeUnit.SECONDS); + + return injector.getInstance(ProfitBricksApi.class); + } + + protected void assertRandom(Predicate<String> check, String arguments) { + ComputeConstants c = computeConstants; + Predicate<String> checkPoll = Predicates2.retry(check, c.pollTimeout(), c.pollPeriod(), c.pollMaxPeriod(), TimeUnit.SECONDS); + assertTrue(checkPoll.apply(arguments), "Random check failed in the configured timeout"); + } + + protected void assertDataCenterAvailable(DataCenter dataCenter) { + assertDataCenterAvailable(dataCenter.id()); + } + + protected void assertDataCenterAvailable(String dataCenterId) { + assertTrue(dataCenterAvailable.apply(dataCenterId), + String.format("Datacenter %s wasn't available in the configured timeout", dataCenterId)); + } + + protected void assertNodeRunning(ServerRef serverRef) { + assertTrue(serverRunning.apply(serverRef), String.format("Server %s did not start in the configured timeout", serverRef)); + } + + protected void assertNodeSuspended(ServerRef serverRef) { + assertTrue(serverSuspended.apply(serverRef), String.format("Server %s did not stop in the configured timeout", serverRef)); + } + + protected void assertNodeRemoved(ServerRef serverRef) { + assertTrue(serverRemoved.apply(serverRef), String.format("Server %s was not removed in the configured timeout", serverRef)); + } + + protected void assertNodeAvailable(ServerRef serverRef) { + assertTrue(serverAvailable.apply(serverRef), String.format("Server %s is not available", serverRef)); + } + + protected DataCenter createDataCenter() { + return api.dataCenterApi().create("test-data-center", "example description", TestLocation.value()); + } + + protected void deleteDataCenter(String id) { + api.dataCenterApi().delete(id); + } + + protected String complexId(String ... ids) { + return Joiner.on(",").join(ids); } } http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/resources/server/cdrom.json ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/resources/server/cdrom.json b/profitbricks-rest/src/test/resources/server/cdrom.json new file mode 100644 index 0000000..cc050af --- /dev/null +++ b/profitbricks-rest/src/test/resources/server/cdrom.json @@ -0,0 +1,32 @@ +{ + "id": "daf36f00-9815-11e5-b6a2-52540066fee9", + "type": "image", + "href": "https://api.profitbricks.com/rest/images/daf36f00-9815-11e5-b6a2-52540066fee9", + "metadata": { + "createdDate": "2015-12-01T10:25:33Z", + "createdBy": "System", + "etag": "76ede5da4cd7ae5ab8a1287d810c3e00", + "lastModifiedDate": "2015-12-01T10:25:33Z", + "lastModifiedBy": "System", + "state": "AVAILABLE" + }, + "properties": { + "name": "ubuntu-15.10-server-amd64.iso", + "description": null, + "location": "us/lasdev", + "size": 0.62, + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "licenceType": "LINUX", + "imageType": "CDROM", + "public": true + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/resources/server/cdroms.json ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/resources/server/cdroms.json b/profitbricks-rest/src/test/resources/server/cdroms.json new file mode 100644 index 0000000..feb9d55 --- /dev/null +++ b/profitbricks-rest/src/test/resources/server/cdroms.json @@ -0,0 +1,39 @@ +{ + "id": "3fe81ccd-2550-4aa5-89f5-bdec6f89f401/cdroms", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/88250731-e201-4334-87e2-e4626d494355/servers/3fe81ccd-2550-4aa5-89f5-bdec6f89f401/cdroms", + "items": [ + { + "id": "daf36f00-9815-11e5-b6a2-52540066fee9", + "type": "image", + "href": "https://api.profitbricks.com/rest/images/daf36f00-9815-11e5-b6a2-52540066fee9", + "metadata": { + "createdDate": "2015-12-01T10:25:33Z", + "createdBy": "System", + "etag": "76ede5da4cd7ae5ab8a1287d810c3e00", + "lastModifiedDate": "2015-12-01T10:25:33Z", + "lastModifiedBy": "System", + "state": "AVAILABLE" + }, + "properties": { + "name": "ubuntu-15.10-server-amd64.iso", + "description": null, + "location": "us/lasdev", + "size": 0.62, + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "licenceType": "LINUX", + "imageType": "CDROM", + "public": true + } + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/resources/server/get-depth-5.json ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/resources/server/get-depth-5.json b/profitbricks-rest/src/test/resources/server/get-depth-5.json new file mode 100644 index 0000000..dd6190f --- /dev/null +++ b/profitbricks-rest/src/test/resources/server/get-depth-5.json @@ -0,0 +1,171 @@ +{ + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e", + "type": "server", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e", + "metadata": { + "createdDate": "2015-05-21T12:40:23Z", + "createdBy": "[email protected]", + "etag": "1041e8e699bc4e6285ec0cd41574276a", + "lastModifiedDate": "2015-06-01T11:50:07Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-lb", + "cores": 1, + "ram": 2048, + "availabilityZone": "AUTO", + "vmState": "RUNNING", + "bootCdrom": null, + "bootVolume": { + "id": "18fec1fc-3b09-4b5c-8abe-062901e10082", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/18fec1fc-3b09-4b5c-8abe-062901e10082", + "metadata": { + "createdDate": "2015-05-21T12:40:23Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-lb Storage", + "type": "HDD", + "size": 10, + "image": "709e641e-efa8-11e4-9660-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + }, + "entities": { + "cdroms": { + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e/cdroms", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/cdroms", + "items": [] + }, + "volumes": { + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e/volumes", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/volumes", + "items": [ + { + "id": "18fec1fc-3b09-4b5c-8abe-062901e10082", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/18fec1fc-3b09-4b5c-8abe-062901e10082", + "metadata": { + "createdDate": "2015-05-21T12:40:23Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-lb Storage", + "type": "HDD", + "size": 10, + "image": "709e641e-efa8-11e4-9660-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + ] + }, + "nics": { + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e/nics", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics", + "items": [ + { + "id": "83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b", + "metadata": { + "createdDate": "2015-06-01T11:50:07Z", + "createdBy": "[email protected]", + "etag": "7074b84fab742d875bb59eaa2bb2605d", + "lastModifiedDate": "2015-08-19T10:58:31Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:89:56:2a:05", + "ips": [ + "162.254.26.148" + ], + "dhcp": false, + "lan": 1, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b/firewallrules", + "items": [] + } + } + }, + { + "id": "a64ac7e0-bf07-43de-8cc1-76ce357ca5b3", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/a64ac7e0-bf07-43de-8cc1-76ce357ca5b3", + "metadata": { + "createdDate": "2015-06-01T11:50:07Z", + "createdBy": "[email protected]", + "etag": "d0848fc15084a83b6be3d8cd00ae9ced", + "lastModifiedDate": "2015-06-02T11:36:18Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:97:8c:50:c4", + "ips": [ + "10.11.50.13" + ], + "dhcp": true, + "lan": 2, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "a64ac7e0-bf07-43de-8cc1-76ce357ca5b3/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/a64ac7e0-bf07-43de-8cc1-76ce357ca5b3/firewallrules", + "items": [] + } + } + } + ] + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/resources/server/get.json ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/resources/server/get.json b/profitbricks-rest/src/test/resources/server/get.json new file mode 100644 index 0000000..c747294 --- /dev/null +++ b/profitbricks-rest/src/test/resources/server/get.json @@ -0,0 +1,173 @@ +{ + "id": "364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2", + "type": "server", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/servers/364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2", + "metadata": { + "createdDate": "2014-10-20T21:20:46Z", + "createdBy": "[email protected]", + "etag": "0018832d7a7ba455db74ac41ae9f11fe", + "lastModifiedDate": "2015-03-18T21:31:10Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "docker001", + "cores": 1, + "ram": 1024, + "availabilityZone": "AUTO", + "vmState": "RUNNING", + "bootCdrom": null, + "bootVolume": { + "id": "c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1", + "metadata": { + "createdDate": "2014-10-20T21:20:46Z", + "createdBy": "[email protected]", + "etag": "7a539b539d8ca9e08c5ac5e63c9c4c8f", + "lastModifiedDate": "2014-10-20T21:20:46Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "Storage", + "type": "HDD", + "size": 50, + "image": "4f363db0-4955-11e4-b362-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + }, + "entities": { + "cdroms": { + "id": "364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/cdroms", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/servers/364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/cdroms", + "items": [] + }, + "volumes": { + "id": "364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/volumes", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/servers/364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/volumes", + "items": [ + { + "id": "c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1", + "metadata": { + "createdDate": "2014-10-20T21:20:46Z", + "createdBy": "[email protected]", + "etag": "7a539b539d8ca9e08c5ac5e63c9c4c8f", + "lastModifiedDate": "2014-10-20T21:20:46Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "Storage", + "type": "HDD", + "size": 50, + "image": "4f363db0-4955-11e4-b362-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + }, + { + "id": "5c4d37ca-d620-4546-8b24-f92e3c608c2c", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/volumes/5c4d37ca-d620-4546-8b24-f92e3c608c2c", + "metadata": { + "createdDate": "2015-03-18T21:31:10Z", + "createdBy": "[email protected]", + "etag": "0018832d7a7ba455db74ac41ae9f11fe", + "lastModifiedDate": "2015-03-18T21:31:10Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "Docker Registry Volume", + "type": "HDD", + "size": 50, + "image": null, + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "OTHER", + "cpuHotPlug": false, + "cpuHotUnplug": false, + "ramHotPlug": false, + "ramHotUnplug": false, + "nicHotPlug": false, + "nicHotUnplug": false, + "discVirtioHotPlug": false, + "discVirtioHotUnplug": false, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 2 + } + } + ] + }, + "nics": { + "id": "364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/nics", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/servers/364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/nics", + "items": [ + { + "id": "01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/servers/364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/nics/01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d", + "metadata": { + "createdDate": "2015-02-09T22:46:38Z", + "createdBy": "[email protected]", + "etag": "b4854a82738079d2c7f43b5324bd92e3", + "lastModifiedDate": "2015-02-09T22:46:38Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:94:9e:f4:a9", + "ips": [ + "208.94.39.76" + ], + "dhcp": true, + "lan": 1, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/b0ac144e-e294-415f-ba39-6737d5a9d419/servers/364f0f1c-7384-462b-8f0c-cfc4c3f6e2b2/nics/01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d/firewallrules", + "items": [] + } + } + } + ] + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/resources/server/image.json ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/resources/server/image.json b/profitbricks-rest/src/test/resources/server/image.json new file mode 100644 index 0000000..db657b2 --- /dev/null +++ b/profitbricks-rest/src/test/resources/server/image.json @@ -0,0 +1,32 @@ +{ + "id" : "7cb4b3a3-50c3-11e5-b789-52540066fee9", + "type" : "image", + "href" : "https://api.profitbricks.com/rest/images/7cb4b3a3-50c3-11e5-b789-52540066fee9", + "metadata" : { + "createdDate" : "2015-09-01T16:07:04Z", + "createdBy" : "System", + "etag" : "2f1436803e9632b6d43eac5d21c04616", + "lastModifiedDate" : "2015-11-11T13:54:02Z", + "lastModifiedBy" : "System", + "state" : "BUSY" + }, + "properties" : { + "name" : "ubuntu-14.04.3-server-amd64.iso", + "description" : null, + "location" : "us/lasdev", + "size" : 0.57, + "cpuHotPlug" : true, + "cpuHotUnplug" : false, + "ramHotPlug" : true, + "ramHotUnplug" : false, + "nicHotPlug" : true, + "nicHotUnplug" : true, + "discVirtioHotPlug" : true, + "discVirtioHotUnplug" : true, + "discScsiHotPlug" : false, + "discScsiHotUnplug" : false, + "licenceType" : "LINUX", + "imageType" : "CDROM", + "public" : true + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/cfb4311f/profitbricks-rest/src/test/resources/server/list-depth-5.json ---------------------------------------------------------------------- diff --git a/profitbricks-rest/src/test/resources/server/list-depth-5.json b/profitbricks-rest/src/test/resources/server/list-depth-5.json new file mode 100644 index 0000000..f97f95b --- /dev/null +++ b/profitbricks-rest/src/test/resources/server/list-depth-5.json @@ -0,0 +1,660 @@ +{ + "id": "825dee89-659a-492f-89b3-2ad5be27edee/servers", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers", + "items": [ + { + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e", + "type": "server", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e", + "metadata": { + "createdDate": "2015-05-21T12:40:23Z", + "createdBy": "[email protected]", + "etag": "1041e8e699bc4e6285ec0cd41574276a", + "lastModifiedDate": "2015-06-01T11:50:07Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-lb", + "cores": 1, + "ram": 2048, + "availabilityZone": "AUTO", + "vmState": "RUNNING", + "bootCdrom": null, + "bootVolume": { + "id": "18fec1fc-3b09-4b5c-8abe-062901e10082", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/18fec1fc-3b09-4b5c-8abe-062901e10082", + "metadata": { + "createdDate": "2015-05-21T12:40:23Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-lb Storage", + "type": "HDD", + "size": 10, + "image": "709e641e-efa8-11e4-9660-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + }, + "entities": { + "cdroms": { + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e/cdroms", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/cdroms", + "items": [] + }, + "volumes": { + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e/volumes", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/volumes", + "items": [ + { + "id": "18fec1fc-3b09-4b5c-8abe-062901e10082", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/18fec1fc-3b09-4b5c-8abe-062901e10082", + "metadata": { + "createdDate": "2015-05-21T12:40:23Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-lb Storage", + "type": "HDD", + "size": 10, + "image": "709e641e-efa8-11e4-9660-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + ] + }, + "nics": { + "id": "5d950ac6-15f5-449f-8705-5b4b6830a45e/nics", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics", + "items": [ + { + "id": "83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b", + "metadata": { + "createdDate": "2015-06-01T11:50:07Z", + "createdBy": "[email protected]", + "etag": "7074b84fab742d875bb59eaa2bb2605d", + "lastModifiedDate": "2015-08-19T10:58:31Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:89:56:2a:05", + "ips": [ + "162.254.26.148" + ], + "dhcp": false, + "lan": 1, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/83af87bc-ab6c-43cc-84a2-3b3dd8c5f86b/firewallrules", + "items": [] + } + } + }, + { + "id": "a64ac7e0-bf07-43de-8cc1-76ce357ca5b3", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/a64ac7e0-bf07-43de-8cc1-76ce357ca5b3", + "metadata": { + "createdDate": "2015-06-01T11:50:07Z", + "createdBy": "[email protected]", + "etag": "d0848fc15084a83b6be3d8cd00ae9ced", + "lastModifiedDate": "2015-06-02T11:36:18Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:97:8c:50:c4", + "ips": [ + "10.11.50.13" + ], + "dhcp": true, + "lan": 2, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "a64ac7e0-bf07-43de-8cc1-76ce357ca5b3/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/5d950ac6-15f5-449f-8705-5b4b6830a45e/nics/a64ac7e0-bf07-43de-8cc1-76ce357ca5b3/firewallrules", + "items": [] + } + } + } + ] + } + } + }, + { + "id": "8e17ce13-653a-41a9-8351-ee0824727f8a", + "type": "server", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a", + "metadata": { + "createdDate": "2015-03-24T07:42:38Z", + "createdBy": "[email protected]", + "etag": "6f84200be98632ca73ab8fbe935afcb9", + "lastModifiedDate": "2016-01-06T14:59:42Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-minion1", + "cores": 1, + "ram": 4096, + "availabilityZone": "AUTO", + "vmState": "RUNNING", + "bootCdrom": null, + "bootVolume": { + "id": "93993d01-8fa3-451b-85e4-19ec09cb0a8a", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/93993d01-8fa3-451b-85e4-19ec09cb0a8a", + "metadata": { + "createdDate": "2015-03-24T07:42:38Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-minion1 Storage", + "type": "HDD", + "size": 40, + "image": "51743512-bfba-11e4-850c-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + }, + "entities": { + "cdroms": { + "id": "8e17ce13-653a-41a9-8351-ee0824727f8a/cdroms", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a/cdroms", + "items": [] + }, + "volumes": { + "id": "8e17ce13-653a-41a9-8351-ee0824727f8a/volumes", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a/volumes", + "items": [ + { + "id": "93993d01-8fa3-451b-85e4-19ec09cb0a8a", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/93993d01-8fa3-451b-85e4-19ec09cb0a8a", + "metadata": { + "createdDate": "2015-03-24T07:42:38Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-minion1 Storage", + "type": "HDD", + "size": 40, + "image": "51743512-bfba-11e4-850c-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + ] + }, + "nics": { + "id": "8e17ce13-653a-41a9-8351-ee0824727f8a/nics", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a/nics", + "items": [ + { + "id": "41fae5fa-8353-4d04-8ded-32e9bbe129c6", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a/nics/41fae5fa-8353-4d04-8ded-32e9bbe129c6", + "metadata": { + "createdDate": "2015-03-24T07:42:38Z", + "createdBy": "[email protected]", + "etag": "57fa9a23cc713676561ec7c7bc27ebaa", + "lastModifiedDate": "2015-03-24T07:42:38Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:e2:af:6a:ba", + "ips": [ + "208.94.39.108" + ], + "dhcp": true, + "lan": 1, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "41fae5fa-8353-4d04-8ded-32e9bbe129c6/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a/nics/41fae5fa-8353-4d04-8ded-32e9bbe129c6/firewallrules", + "items": [] + } + } + }, + { + "id": "875b3b46-b21d-4fab-8ef0-0a0f47411a45", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a/nics/875b3b46-b21d-4fab-8ef0-0a0f47411a45", + "metadata": { + "createdDate": "2015-03-24T07:42:38Z", + "createdBy": "[email protected]", + "etag": "57fa9a23cc713676561ec7c7bc27ebaa", + "lastModifiedDate": "2015-03-24T07:42:38Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:3b:68:08:d6", + "ips": [ + "10.11.50.11" + ], + "dhcp": true, + "lan": 2, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "875b3b46-b21d-4fab-8ef0-0a0f47411a45/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/8e17ce13-653a-41a9-8351-ee0824727f8a/nics/875b3b46-b21d-4fab-8ef0-0a0f47411a45/firewallrules", + "items": [] + } + } + } + ] + } + } + }, + { + "id": "82d87fa8-4b6d-40fd-8ad5-6fc75a465090", + "type": "server", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/82d87fa8-4b6d-40fd-8ad5-6fc75a465090", + "metadata": { + "createdDate": "2015-03-20T06:38:22Z", + "createdBy": "[email protected]", + "etag": "6f84200be98632ca73ab8fbe935afcb9", + "lastModifiedDate": "2016-01-06T14:59:42Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-master", + "cores": 1, + "ram": 4096, + "availabilityZone": "AUTO", + "vmState": "RUNNING", + "bootCdrom": null, + "bootVolume": { + "id": "153af519-3941-49d8-85c5-d3daa866f646", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/153af519-3941-49d8-85c5-d3daa866f646", + "metadata": { + "createdDate": "2015-03-20T06:38:22Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-master Storage", + "type": "HDD", + "size": 40, + "image": "51743512-bfba-11e4-850c-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "OTHER", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": false, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + }, + "entities": { + "cdroms": { + "id": "82d87fa8-4b6d-40fd-8ad5-6fc75a465090/cdroms", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/82d87fa8-4b6d-40fd-8ad5-6fc75a465090/cdroms", + "items": [] + }, + "volumes": { + "id": "82d87fa8-4b6d-40fd-8ad5-6fc75a465090/volumes", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/82d87fa8-4b6d-40fd-8ad5-6fc75a465090/volumes", + "items": [ + { + "id": "153af519-3941-49d8-85c5-d3daa866f646", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/153af519-3941-49d8-85c5-d3daa866f646", + "metadata": { + "createdDate": "2015-03-20T06:38:22Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-master Storage", + "type": "HDD", + "size": 40, + "image": "51743512-bfba-11e4-850c-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "OTHER", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": false, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + ] + }, + "nics": { + "id": "82d87fa8-4b6d-40fd-8ad5-6fc75a465090/nics", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/82d87fa8-4b6d-40fd-8ad5-6fc75a465090/nics", + "items": [ + { + "id": "3853b29d-fa67-484a-81c0-bb1be5636815", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/82d87fa8-4b6d-40fd-8ad5-6fc75a465090/nics/3853b29d-fa67-484a-81c0-bb1be5636815", + "metadata": { + "createdDate": "2015-03-20T06:38:22Z", + "createdBy": "[email protected]", + "etag": "8a8c6c3bcfe9e1ac9dc7c3089faed6ce", + "lastModifiedDate": "2015-08-23T22:07:57Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:09:3f:e9:cc", + "ips": [ + "10.11.50.10" + ], + "dhcp": true, + "lan": 2, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "3853b29d-fa67-484a-81c0-bb1be5636815/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/82d87fa8-4b6d-40fd-8ad5-6fc75a465090/nics/3853b29d-fa67-484a-81c0-bb1be5636815/firewallrules", + "items": [] + } + } + } + ] + } + } + }, + { + "id": "a0c6b7bb-55cb-4f3e-8b75-b81201e00b43", + "type": "server", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43", + "metadata": { + "createdDate": "2015-03-20T05:29:20Z", + "createdBy": "[email protected]", + "etag": "3a4f74d95783d779dc172e7fe99c2cdd", + "lastModifiedDate": "2016-01-06T14:59:42Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-minion2", + "cores": 1, + "ram": 4096, + "availabilityZone": "AUTO", + "vmState": "RUNNING", + "bootCdrom": null, + "bootVolume": { + "id": "74d638e3-c433-4a50-800e-bae74ffed4b7", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/74d638e3-c433-4a50-800e-bae74ffed4b7", + "metadata": { + "createdDate": "2015-03-20T05:29:20Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-minion2 Storage", + "type": "HDD", + "size": 40, + "image": "51743512-bfba-11e4-850c-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + }, + "entities": { + "cdroms": { + "id": "a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/cdroms", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/cdroms", + "items": [] + }, + "volumes": { + "id": "a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/volumes", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/volumes", + "items": [ + { + "id": "74d638e3-c433-4a50-800e-bae74ffed4b7", + "type": "volume", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/volumes/74d638e3-c433-4a50-800e-bae74ffed4b7", + "metadata": { + "createdDate": "2015-03-20T05:29:20Z", + "createdBy": "[email protected]", + "etag": "f873fbcb66b1635ee53c30994498dbb3", + "lastModifiedDate": "2015-06-01T10:22:33Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": "kube-minion2 Storage", + "type": "HDD", + "size": 40, + "image": "51743512-bfba-11e4-850c-52540066fee9", + "imagePassword": null, + "bus": "VIRTIO", + "licenceType": "LINUX", + "cpuHotPlug": true, + "cpuHotUnplug": false, + "ramHotPlug": true, + "ramHotUnplug": false, + "nicHotPlug": true, + "nicHotUnplug": true, + "discVirtioHotPlug": true, + "discVirtioHotUnplug": true, + "discScsiHotPlug": false, + "discScsiHotUnplug": false, + "deviceNumber": 1 + } + } + ] + }, + "nics": { + "id": "a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/nics", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/nics", + "items": [ + { + "id": "23fd95a7-b7d0-4023-8546-42c6daa52692", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/nics/23fd95a7-b7d0-4023-8546-42c6daa52692", + "metadata": { + "createdDate": "2015-03-20T05:29:20Z", + "createdBy": "[email protected]", + "etag": "e85914b679fd0861851f6ae4cbc6f706", + "lastModifiedDate": "2015-03-20T06:52:26Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:d9:de:3b:5f", + "ips": [ + "10.11.50.12" + ], + "dhcp": true, + "lan": 2, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "23fd95a7-b7d0-4023-8546-42c6daa52692/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/nics/23fd95a7-b7d0-4023-8546-42c6daa52692/firewallrules", + "items": [] + } + } + }, + { + "id": "55bae478-b702-43da-8671-754b5ce7ba3e", + "type": "nic", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/nics/55bae478-b702-43da-8671-754b5ce7ba3e", + "metadata": { + "createdDate": "2015-03-20T05:29:20Z", + "createdBy": "[email protected]", + "etag": "424306ca838e1f915542b97f4578511b", + "lastModifiedDate": "2015-03-20T05:44:37Z", + "lastModifiedBy": "[email protected]", + "state": "AVAILABLE" + }, + "properties": { + "name": null, + "mac": "02:01:40:62:9e:d6", + "ips": [ + "192.96.159.213" + ], + "dhcp": true, + "lan": 1, + "firewallActive": false + }, + "entities": { + "firewallrules": { + "id": "55bae478-b702-43da-8671-754b5ce7ba3e/firewallrules", + "type": "collection", + "href": "https://api.profitbricks.com/rest/datacenters/825dee89-659a-492f-89b3-2ad5be27edee/servers/a0c6b7bb-55cb-4f3e-8b75-b81201e00b43/nics/55bae478-b702-43da-8671-754b5ce7ba3e/firewallrules", + "items": [] + } + } + } + ] + } + } + } + ] +} \ No newline at end of file
