You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2017/01/24 09:45:47 UTC
[2/3] jclouds-labs git commit: Add remaining features to support the
abstraction
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/java/org/jclouds/packet/features/SshKeyApiLiveTest.java
----------------------------------------------------------------------
diff --git a/packet/src/test/java/org/jclouds/packet/features/SshKeyApiLiveTest.java b/packet/src/test/java/org/jclouds/packet/features/SshKeyApiLiveTest.java
new file mode 100644
index 0000000..3ef4387
--- /dev/null
+++ b/packet/src/test/java/org/jclouds/packet/features/SshKeyApiLiveTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.jclouds.packet.features;
+
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.jclouds.packet.compute.internal.BasePacketApiLiveTest;
+import org.jclouds.packet.domain.SshKey;
+import org.jclouds.ssh.SshKeys;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
+import static org.jclouds.packet.domain.options.ListOptions.Builder.page;
+import static org.testng.Assert.assertTrue;
+import static org.testng.util.Strings.isNullOrEmpty;
+
+@Test(groups = "live", testName = "SshKeyApiLiveTest")
+public class SshKeyApiLiveTest extends BasePacketApiLiveTest {
+
+ private SshKey sshKey;
+
+ public void testCreate() {
+ Map<String, String> keyPair = SshKeys.generate();
+ sshKey = api.sshKeyApi().create(prefix + "-sshkey-livetest", keyPair.get("public"));
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testGet() {
+ api.sshKeyApi().get(sshKey.id());
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testList() {
+ final AtomicInteger found = new AtomicInteger(0);
+ assertTrue(Iterables.all(api().list().concat(), new Predicate<SshKey>() {
+ @Override
+ public boolean apply(SshKey input) {
+ found.incrementAndGet();
+ return !isNullOrEmpty(input.id());
+ }
+ }), "All ssh keys must have the 'id' field populated");
+ assertTrue(found.get() > 0, "Expected some ssh keys to be returned");
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testListOnePage() {
+ final AtomicInteger found = new AtomicInteger(0);
+ assertTrue(api().list(page(1).perPage(5)).allMatch(new Predicate<SshKey>() {
+ @Override
+ public boolean apply(SshKey input) {
+ found.incrementAndGet();
+ return !isNullOrEmpty(input.id());
+ }
+ }), "All ssh keys must have the 'id' field populated");
+ assertTrue(found.get() > 0, "Expected some ssh keys to be returned");
+ }
+
+ @Test(dependsOnMethods = "testList", alwaysRun = true)
+ public void testDelete() throws InterruptedException {
+ api.sshKeyApi().delete(sshKey.id());
+ }
+
+ private SshKeyApi api() {
+ return api.sshKeyApi();
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/java/org/jclouds/packet/features/SshKeyApiMockTest.java
----------------------------------------------------------------------
diff --git a/packet/src/test/java/org/jclouds/packet/features/SshKeyApiMockTest.java b/packet/src/test/java/org/jclouds/packet/features/SshKeyApiMockTest.java
new file mode 100644
index 0000000..3bb1969
--- /dev/null
+++ b/packet/src/test/java/org/jclouds/packet/features/SshKeyApiMockTest.java
@@ -0,0 +1,134 @@
+/*
+ * 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.jclouds.packet.features;
+
+import org.jclouds.packet.compute.internal.BasePacketApiMockTest;
+import org.jclouds.packet.domain.SshKey;
+import org.testng.annotations.Test;
+
+import static com.google.common.collect.Iterables.isEmpty;
+import static com.google.common.collect.Iterables.size;
+import static org.jclouds.packet.domain.options.ListOptions.Builder.page;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+@Test(groups = "unit", testName = "SshKeyApiMockTest", singleThreaded = true)
+public class SshKeyApiMockTest extends BasePacketApiMockTest {
+
+ public void testListSshKeys() throws InterruptedException {
+ server.enqueue(jsonResponse("/sshKeys-first.json"));
+ server.enqueue(jsonResponse("/sshKeys-last.json"));
+
+ Iterable<SshKey> sshkeys = api.sshKeyApi().list().concat();
+
+ assertEquals(size(sshkeys), 8); // Force the PagedIterable to advance
+ assertEquals(server.getRequestCount(), 2);
+
+ assertSent(server, "GET", "/ssh-keys");
+ assertSent(server, "GET", "/ssh-keys?page=2");
+ }
+
+ public void testListSshKeysReturns404() throws InterruptedException {
+ server.enqueue(response404());
+
+ Iterable<SshKey> sshkeys = api.sshKeyApi().list().concat();
+
+ assertTrue(isEmpty(sshkeys));
+
+ assertEquals(server.getRequestCount(), 1);
+ assertSent(server, "GET", "/ssh-keys");
+ }
+
+ public void testListSshKeysWithOptions() throws InterruptedException {
+ server.enqueue(jsonResponse("/sshKeys-first.json"));
+
+ Iterable<SshKey> actions = api.sshKeyApi().list(page(1).perPage(5));
+
+ assertEquals(size(actions), 5);
+ assertEquals(server.getRequestCount(), 1);
+
+ assertSent(server, "GET", "/ssh-keys?page=1&per_page=5");
+ }
+
+ public void testListSshKeysWithOptionsReturns404() throws InterruptedException {
+ server.enqueue(response404());
+
+ Iterable<SshKey> actions = api.sshKeyApi().list(page(1).perPage(5));
+
+ assertTrue(isEmpty(actions));
+
+ assertEquals(server.getRequestCount(), 1);
+ assertSent(server, "GET", "/ssh-keys?page=1&per_page=5");
+ }
+
+ public void testGetSshKey() throws InterruptedException {
+ server.enqueue(jsonResponse("/ssh-key.json"));
+
+ SshKey sshKey = api.sshKeyApi().get("1");
+
+ assertEquals(sshKey, objectFromResource("/ssh-key.json", SshKey.class));
+
+ assertEquals(server.getRequestCount(), 1);
+ assertSent(server, "GET", "/ssh-keys/1");
+ }
+
+ public void testGetSshKeyReturns404() throws InterruptedException {
+ server.enqueue(response404());
+
+ SshKey sshKey = api.sshKeyApi().get("1");
+
+ assertNull(sshKey);
+
+ assertEquals(server.getRequestCount(), 1);
+ assertSent(server, "GET", "/ssh-keys/1");
+ }
+
+ public void testCreateSshKey() throws InterruptedException {
+ server.enqueue(jsonResponse("/ssh-key-create-res.json"));
+
+ SshKey sshKey = api.sshKeyApi().create(
+ "jclouds-ssh-key-livetest",
+ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdgcoNzH4hCc0j3b4MuG503L/J54uyFvwCAOu8vSsYuLpJ4AEyEOv+T0SfdF605fK6GYXA16Rxk3lrPt7mfKGNtXR0Ripbv7Zc6PvCRorwgj/cjh/45miozjrkXAiHD1GFZycfbi4YsoWAqZj7W4mwtctmhrYM0FPdya2XoRpVy89N+A5Xo4Xtd6EZn6JGEKQM5+kF2aL3ggy0od/DqjuEVYwZoyTe1RgUTXZSU/Woh7WMhsRHbqd3eYz4s6ac8n8IJPGKtUaQeqUtH7OK6NRYXVypUrkqNlwdNYZAwrjXg/x5T3D+bo11LENASRt9OJ2OkmRSTqRxBeDkhnVauWK/"
+ );
+
+ assertEquals(sshKey, objectFromResource("/ssh-key-create-res.json", SshKey.class));
+
+ assertEquals(server.getRequestCount(), 1);
+ assertSent(server, "POST", "/ssh-keys", stringFromResource("/ssh-key-create-req.json"));
+ }
+
+ public void testDeleteSshKey() throws InterruptedException {
+ server.enqueue(response204());
+
+ api.sshKeyApi().delete("1");
+
+ assertEquals(server.getRequestCount(), 1);
+ assertSent(server, "DELETE", "/ssh-keys/1");
+ }
+
+ public void testDeleteSshKeyReturns404() throws InterruptedException {
+ server.enqueue(response404());
+
+ api.sshKeyApi().delete("1");
+
+ assertEquals(server.getRequestCount(), 1);
+ assertSent(server, "DELETE", "/ssh-keys/1");
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/java/org/jclouds/packet/functions/HrefToListOptionsTest.java
----------------------------------------------------------------------
diff --git a/packet/src/test/java/org/jclouds/packet/functions/HrefToListOptionsTest.java b/packet/src/test/java/org/jclouds/packet/functions/HrefToListOptionsTest.java
new file mode 100644
index 0000000..1fecb29
--- /dev/null
+++ b/packet/src/test/java/org/jclouds/packet/functions/HrefToListOptionsTest.java
@@ -0,0 +1,57 @@
+/*
+ * 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.jclouds.packet.functions;
+
+import org.jclouds.packet.domain.Href;
+import org.jclouds.packet.domain.options.ListOptions;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.Multimap;
+
+import static com.google.common.collect.Iterables.getOnlyElement;
+import static org.jclouds.packet.domain.options.ListOptions.PAGE_PARAM;
+import static org.jclouds.packet.domain.options.ListOptions.PER_PAGE_PARAM;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+
+@Test(groups = "unit", testName = "HrefToListOptionsTest")
+public class HrefToListOptionsTest {
+
+ public void testNoOptions() {
+ HrefToListOptions function = new HrefToListOptions();
+
+ ListOptions options = function.apply(Href.create("https://api.packet.net/projects"));
+ assertNotNull(options);
+
+ Multimap<String, String> params = options.buildQueryParameters();
+ assertFalse(params.containsKey(PAGE_PARAM));
+ assertFalse(params.containsKey(PER_PAGE_PARAM));
+ }
+
+ public void testWithOptions() {
+ HrefToListOptions function = new HrefToListOptions();
+
+ ListOptions options = function.apply(Href.create("https://api.packet.net/projects?page=2&per_page=5"));
+ assertNotNull(options);
+
+ Multimap<String, String> params = options.buildQueryParameters();
+ assertEquals(getOnlyElement(params.get(PAGE_PARAM)), "2");
+ assertEquals(getOnlyElement(params.get(PER_PAGE_PARAM)), "5");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/java/org/jclouds/packet/functions/LinkToListOptionsTest.java
----------------------------------------------------------------------
diff --git a/packet/src/test/java/org/jclouds/packet/functions/LinkToListOptionsTest.java b/packet/src/test/java/org/jclouds/packet/functions/LinkToListOptionsTest.java
deleted file mode 100644
index 15262e8..0000000
--- a/packet/src/test/java/org/jclouds/packet/functions/LinkToListOptionsTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.jclouds.packet.functions;
-
-import org.jclouds.packet.domain.Href;
-import org.jclouds.packet.domain.options.ListOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.Multimap;
-
-import static com.google.common.collect.Iterables.getOnlyElement;
-import static org.jclouds.packet.domain.options.ListOptions.PAGE_PARAM;
-import static org.jclouds.packet.domain.options.ListOptions.PER_PAGE_PARAM;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-
-@Test(groups = "unit", testName = "LinkToListOptionsTest")
-public class LinkToListOptionsTest {
-
- public void testNoOptions() {
- LinkToListOptions function = new LinkToListOptions();
-
- ListOptions options = function.apply(Href.create("https://api.packet.net/projects"));
- assertNotNull(options);
-
- Multimap<String, String> params = options.buildQueryParameters();
- assertFalse(params.containsKey(PAGE_PARAM));
- assertFalse(params.containsKey(PER_PAGE_PARAM));
- }
-
- public void testWithOptions() {
- LinkToListOptions function = new LinkToListOptions();
-
- ListOptions options = function.apply(Href.create("https://api.packet.net/projects?page=2&per_page=5"));
- assertNotNull(options);
-
- Multimap<String, String> params = options.buildQueryParameters();
- assertEquals(getOnlyElement(params.get(PAGE_PARAM)), "2");
- assertEquals(getOnlyElement(params.get(PER_PAGE_PARAM)), "5");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/device-create-req.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/device-create-req.json b/packet/src/test/resources/device-create-req.json
new file mode 100644
index 0000000..78e5ea5
--- /dev/null
+++ b/packet/src/test/resources/device-create-req.json
@@ -0,0 +1,11 @@
+{
+ "hostname": "jclouds-device-livetest",
+ "plan": "baremetal_0",
+ "billing_cycle": "hourly",
+ "facility": "ewr1",
+ "features": {},
+ "operating_system": "ubuntu_16_04",
+ "locked": false,
+ "userdata": "",
+ "tags": []
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/device-create-res.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/device-create-res.json b/packet/src/test/resources/device-create-res.json
new file mode 100644
index 0000000..7a5986f
--- /dev/null
+++ b/packet/src/test/resources/device-create-res.json
@@ -0,0 +1,211 @@
+{
+ "id": "3238ce59-fe02-4b9b-92c1-915ef4f3fb9e",
+ "short_id": "3238ce59",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "queued",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.3238ce59",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-20T14:15:28Z",
+ "updated_at": "2017-01-20T14:15:29Z",
+ "provisioning_percentage": 10.0,
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/da5d6c21-2e8c-43ac-820f-ff41bd4e6ebc"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [],
+ "provisioning_events": [
+ {
+ "id": "32a4da09-37dd-446b-99ef-9f64c1eb0097",
+ "type": "provisioning.101",
+ "body": "Provisioning started",
+ "created_at": "2017-01-20T14:15:29Z",
+ "relationships": [
+ {
+ "href": "#5062a5fe-19ea-4b41-864c-e5f4dcb02fa0"
+ }
+ ],
+ "interpolated": "Provisioning started",
+ "href": "/events/32a4da09-37dd-446b-99ef-9f64c1eb0097"
+ },
+ {
+ "id": null,
+ "type": "provisioning.102",
+ "body": "Network configured",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Network configured"
+ },
+ {
+ "id": null,
+ "type": "provisioning.103",
+ "body": "Configuration written, restarting device",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Configuration written, restarting device"
+ },
+ {
+ "id": null,
+ "type": "provisioning.104",
+ "body": "Connected to magic install system",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Connected to magic install system"
+ },
+ {
+ "id": null,
+ "type": "provisioning.105",
+ "body": "Server partitions created",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Server partitions created"
+ },
+ {
+ "id": null,
+ "type": "provisioning.106",
+ "body": "Operating system packages installed",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Operating system packages installed"
+ },
+ {
+ "id": null,
+ "type": "provisioning.107",
+ "body": "Server networking interfaces configured",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Server networking interfaces configured"
+ },
+ {
+ "id": null,
+ "type": "provisioning.108",
+ "body": "Cloud-init packages installed and configured",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Cloud-init packages installed and configured"
+ },
+ {
+ "id": null,
+ "type": "provisioning.109",
+ "body": "Installation finished, rebooting server",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Installation finished, rebooting server"
+ },
+ {
+ "id": null,
+ "type": "provisioning.109",
+ "body": "Installation finished, rebooting server",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Installation finished, rebooting server"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "$n4hwka3!i",
+ "href": "/devices/3238ce59-fe02-4b9b-92c1-915ef4f3fb9e"
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/device.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/device.json b/packet/src/test/resources/device.json
new file mode 100644
index 0000000..b4daa39
--- /dev/null
+++ b/packet/src/test/resources/device.json
@@ -0,0 +1,278 @@
+{
+ "id": "98e22032-579e-4c04-bb12-05cc6a3864c8",
+ "short_id": "98e22032",
+ "hostname": "test",
+ "description": null,
+ "state": "provisioning",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.98e22032",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-03T09:47:59Z",
+ "updated_at": "2017-01-03T09:50:13Z",
+ "provisioning_percentage": 50,
+ "operating_system": {
+ "id": "68bad60d-f5a7-45c2-ad09-573edaad3a3c",
+ "slug": "centos_7",
+ "name": "Centos 7",
+ "distro": "centos",
+ "version": "7",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/bba63e41-b12c-493a-81d4-e52f50f247ed"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "5d0262c7-1727-411c-94c4-9e6f15490dd3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-03T09:47:59Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "assigned_to": {
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+ },
+ "network": "147.75.106.80",
+ "address": "147.75.106.81",
+ "gateway": "147.75.106.80",
+ "href": "/ips/5d0262c7-1727-411c-94c4-9e6f15490dd3"
+ },
+ {
+ "id": "f7d0e65c-eb3b-42bd-af9b-ad3a736d8d43",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-03T09:47:59Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "assigned_to": {
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/f7d0e65c-eb3b-42bd-af9b-ad3a736d8d43"
+ },
+ {
+ "id": "a3d00b4e-d74f-4ac2-8bc9-91065d815b41",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-03T09:47:59Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "assigned_to": {
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/a3d00b4e-d74f-4ac2-8bc9-91065d815b41"
+ }
+ ],
+ "provisioning_events": [
+ {
+ "id": "bd62123b-afed-4e54-b1b9-89e219ba9cf0",
+ "type": "provisioning.101",
+ "body": "Provisioning started",
+ "created_at": "2017-01-03T09:47:59Z",
+ "relationships": [
+ {
+ "href": "#81909921-255e-413c-883a-c58d14c801ae"
+ }
+ ],
+ "interpolated": "Provisioning started",
+ "href": "/events/bd62123b-afed-4e54-b1b9-89e219ba9cf0"
+ },
+ {
+ "id": "14b4a9e6-be90-40ee-be48-b272f855e39c",
+ "type": "provisioning.102",
+ "body": "Network configured with addresses 147.75.106.81, 2604:1380:2:9800::1, and 10.99.214.1",
+ "created_at": "2017-01-03T09:48:46Z",
+ "relationships": [
+ {
+ "href": "#28588657-b8bf-44a1-98d3-27f8e04b660a"
+ }
+ ],
+ "interpolated": "Network configured with addresses 147.75.106.81, 2604:1380:2:9800::1, and 10.99.214.1",
+ "href": "/events/14b4a9e6-be90-40ee-be48-b272f855e39c"
+ },
+ {
+ "id": "57e3cadb-f9aa-4c73-be54-3c83e6cf462e",
+ "type": "provisioning.103",
+ "body": "Configuration written, restarting device",
+ "created_at": "2017-01-03T09:48:57Z",
+ "relationships": [
+ {
+ "href": "#25a7e807-f4aa-4f36-83cd-8347baeb26bc"
+ }
+ ],
+ "interpolated": "Configuration written, restarting device",
+ "href": "/events/57e3cadb-f9aa-4c73-be54-3c83e6cf462e"
+ },
+ {
+ "id": "b8322996-f57e-4c87-96cc-a16f33a0c305",
+ "type": "provisioning.104",
+ "body": "Connected to magic install system",
+ "created_at": "2017-01-03T09:50:13Z",
+ "relationships": [
+ {
+ "href": "#a4825d20-f7f2-426a-88db-38696bd3dfd6"
+ }
+ ],
+ "interpolated": "Connected to magic install system",
+ "href": "/events/b8322996-f57e-4c87-96cc-a16f33a0c305"
+ },
+ {
+ "id": "f00a00a9-7c59-420d-bdcf-2c0993303cf6",
+ "type": "provisioning.105",
+ "body": "Server partitions created",
+ "created_at": "2017-01-03T09:50:13Z",
+ "relationships": [
+ {
+ "href": "#6140659b-5e3d-4686-be8f-8879b6d3e27f"
+ }
+ ],
+ "interpolated": "Server partitions created",
+ "href": "/events/f00a00a9-7c59-420d-bdcf-2c0993303cf6"
+ },
+ {
+ "id": null,
+ "type": "provisioning.106",
+ "body": "Operating system packages installed",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Operating system packages installed"
+ },
+ {
+ "id": null,
+ "type": "provisioning.107",
+ "body": "Server networking interfaces configured",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Server networking interfaces configured"
+ },
+ {
+ "id": null,
+ "type": "provisioning.108",
+ "body": "Cloud-init packages installed and configured",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Cloud-init packages installed and configured"
+ },
+ {
+ "id": null,
+ "type": "provisioning.109",
+ "body": "Installation finished, rebooting server",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Installation finished, rebooting server"
+ },
+ {
+ "id": null,
+ "type": "provisioning.109",
+ "body": "Installation finished, rebooting server",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Installation finished, rebooting server"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": ",q4*a8(eny",
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/devices-first.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/devices-first.json b/packet/src/test/resources/devices-first.json
new file mode 100644
index 0000000..514c0eb
--- /dev/null
+++ b/packet/src/test/resources/devices-first.json
@@ -0,0 +1,910 @@
+{
+ "devices": [
+ {
+ "id": "5bd27259-8b71-48f7-879d-c4e695cb2f31",
+ "short_id": "5bd27259",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "active",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.5bd27259",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-18T17:12:29Z",
+ "updated_at": "2017-01-18T17:16:29Z",
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/cf9db551-ec79-4c16-a776-97cdbcb3cec4"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "cbff502b-12ca-4986-b683-2cb4e119ae40",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "147.75.197.54",
+ "address": "147.75.197.55",
+ "gateway": "147.75.197.54",
+ "href": "/ips/cbff502b-12ca-4986-b683-2cb4e119ae40"
+ },
+ {
+ "id": "d5cec621-18c1-4e02-8f71-8dd46370c3e5",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/d5cec621-18c1-4e02-8f71-8dd46370c3e5"
+ },
+ {
+ "id": "6d206311-1f88-454d-9cf2-afca79f51fa3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/6d206311-1f88-454d-9cf2-afca79f51fa3"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "soaz0#a=cd",
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ {
+ "id": "5bd27259-8b71-48f7-879d-c4e695cb2f32",
+ "short_id": "5bd27259",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "active",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.5bd27259",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-18T17:12:29Z",
+ "updated_at": "2017-01-18T17:16:29Z",
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/cf9db551-ec79-4c16-a776-97cdbcb3cec4"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "cbff502b-12ca-4986-b683-2cb4e119ae40",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "147.75.197.54",
+ "address": "147.75.197.55",
+ "gateway": "147.75.197.54",
+ "href": "/ips/cbff502b-12ca-4986-b683-2cb4e119ae40"
+ },
+ {
+ "id": "d5cec621-18c1-4e02-8f71-8dd46370c3e5",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/d5cec621-18c1-4e02-8f71-8dd46370c3e5"
+ },
+ {
+ "id": "6d206311-1f88-454d-9cf2-afca79f51fa3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/6d206311-1f88-454d-9cf2-afca79f51fa3"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "soaz0#a=cd",
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ {
+ "id": "5bd27259-8b71-48f7-879d-c4e695cb2f33",
+ "short_id": "5bd27259",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "active",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.5bd27259",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-18T17:12:29Z",
+ "updated_at": "2017-01-18T17:16:29Z",
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/cf9db551-ec79-4c16-a776-97cdbcb3cec4"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "cbff502b-12ca-4986-b683-2cb4e119ae40",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "147.75.197.54",
+ "address": "147.75.197.55",
+ "gateway": "147.75.197.54",
+ "href": "/ips/cbff502b-12ca-4986-b683-2cb4e119ae40"
+ },
+ {
+ "id": "d5cec621-18c1-4e02-8f71-8dd46370c3e5",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/d5cec621-18c1-4e02-8f71-8dd46370c3e5"
+ },
+ {
+ "id": "6d206311-1f88-454d-9cf2-afca79f51fa3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/6d206311-1f88-454d-9cf2-afca79f51fa3"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "soaz0#a=cd",
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ {
+ "id": "5bd27259-8b71-48f7-879d-c4e695cb2f34",
+ "short_id": "5bd27259",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "active",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.5bd27259",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-18T17:12:29Z",
+ "updated_at": "2017-01-18T17:16:29Z",
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/cf9db551-ec79-4c16-a776-97cdbcb3cec4"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "cbff502b-12ca-4986-b683-2cb4e119ae40",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "147.75.197.54",
+ "address": "147.75.197.55",
+ "gateway": "147.75.197.54",
+ "href": "/ips/cbff502b-12ca-4986-b683-2cb4e119ae40"
+ },
+ {
+ "id": "d5cec621-18c1-4e02-8f71-8dd46370c3e5",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/d5cec621-18c1-4e02-8f71-8dd46370c3e5"
+ },
+ {
+ "id": "6d206311-1f88-454d-9cf2-afca79f51fa3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/6d206311-1f88-454d-9cf2-afca79f51fa3"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "soaz0#a=cd",
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ {
+ "id": "5bd27259-8b71-48f7-879d-c4e695cb2f35",
+ "short_id": "5bd27259",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "active",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.5bd27259",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-18T17:12:29Z",
+ "updated_at": "2017-01-18T17:16:29Z",
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/cf9db551-ec79-4c16-a776-97cdbcb3cec4"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "cbff502b-12ca-4986-b683-2cb4e119ae40",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "147.75.197.54",
+ "address": "147.75.197.55",
+ "gateway": "147.75.197.54",
+ "href": "/ips/cbff502b-12ca-4986-b683-2cb4e119ae40"
+ },
+ {
+ "id": "d5cec621-18c1-4e02-8f71-8dd46370c3e5",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/d5cec621-18c1-4e02-8f71-8dd46370c3e5"
+ },
+ {
+ "id": "6d206311-1f88-454d-9cf2-afca79f51fa3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/6d206311-1f88-454d-9cf2-afca79f51fa3"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "soaz0#a=cd",
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ }
+ ],
+ "meta": {
+ "first": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=1"
+ },
+ "previous": null,
+ "self": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=1"
+ },
+ "next": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=2"
+ },
+ "last": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=2"
+ },
+ "total": 7
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/devices-last.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/devices-last.json b/packet/src/test/resources/devices-last.json
new file mode 100644
index 0000000..55ef2f0
--- /dev/null
+++ b/packet/src/test/resources/devices-last.json
@@ -0,0 +1,376 @@
+{
+ "devices": [
+ {
+ "id": "5bd27259-8b71-48f7-879d-c4e695cb2f36",
+ "short_id": "5bd27259",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "active",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.5bd27259",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-18T17:12:29Z",
+ "updated_at": "2017-01-18T17:16:29Z",
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/cf9db551-ec79-4c16-a776-97cdbcb3cec4"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "cbff502b-12ca-4986-b683-2cb4e119ae40",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "147.75.197.54",
+ "address": "147.75.197.55",
+ "gateway": "147.75.197.54",
+ "href": "/ips/cbff502b-12ca-4986-b683-2cb4e119ae40"
+ },
+ {
+ "id": "d5cec621-18c1-4e02-8f71-8dd46370c3e5",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/d5cec621-18c1-4e02-8f71-8dd46370c3e5"
+ },
+ {
+ "id": "6d206311-1f88-454d-9cf2-afca79f51fa3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/6d206311-1f88-454d-9cf2-afca79f51fa3"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "soaz0#a=cd",
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ {
+ "id": "5bd27259-8b71-48f7-879d-c4e695cb2f37",
+ "short_id": "5bd27259",
+ "hostname": "andrea-device-livetest",
+ "description": null,
+ "state": "active",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.5bd27259",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-18T17:12:29Z",
+ "updated_at": "2017-01-18T17:16:29Z",
+ "operating_system": {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3",
+ "baremetal_hua"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/f82b69d7-8c7e-4a38-9283-ecdbcaba56aa"
+ },
+ {
+ "href": "/ssh-keys/cf9db551-ec79-4c16-a776-97cdbcb3cec4"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "cbff502b-12ca-4986-b683-2cb4e119ae40",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "147.75.197.54",
+ "address": "147.75.197.55",
+ "gateway": "147.75.197.54",
+ "href": "/ips/cbff502b-12ca-4986-b683-2cb4e119ae40"
+ },
+ {
+ "id": "d5cec621-18c1-4e02-8f71-8dd46370c3e5",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/d5cec621-18c1-4e02-8f71-8dd46370c3e5"
+ },
+ {
+ "id": "6d206311-1f88-454d-9cf2-afca79f51fa3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-18T17:12:30Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "enabled": true,
+ "assigned_to": {
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/6d206311-1f88-454d-9cf2-afca79f51fa3"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": "soaz0#a=cd",
+ "href": "/devices/5bd27259-8b71-48f7-879d-c4e695cb2f31"
+ }
+ ],
+ "meta": {
+ "first": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=1"
+ },
+ "previous": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=1"
+ },
+ "self": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=2"
+ },
+ "next": null,
+ "last": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54/devices?page=2"
+ },
+ "total": 7
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/devices.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/devices.json b/packet/src/test/resources/devices.json
new file mode 100644
index 0000000..b9fbade
--- /dev/null
+++ b/packet/src/test/resources/devices.json
@@ -0,0 +1,282 @@
+{
+ "devices": [
+ {
+ "id": "98e22032-579e-4c04-bb12-05cc6a3864c8",
+ "short_id": "98e22032",
+ "hostname": "test",
+ "description": null,
+ "state": "provisioning",
+ "tags": [],
+ "billing_cycle": "hourly",
+ "user": "root",
+ "iqn": "iqn.2017-01.net.packet:device.98e22032",
+ "locked": false,
+ "bonding_mode": 5,
+ "created_at": "2017-01-03T09:47:59Z",
+ "updated_at": "2017-01-03T09:50:13Z",
+ "provisioning_percentage": 50,
+ "operating_system": {
+ "id": "68bad60d-f5a7-45c2-ad09-573edaad3a3c",
+ "slug": "centos_7",
+ "name": "Centos 7",
+ "distro": "centos",
+ "version": "7",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ "facility": {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ "project": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "ssh_keys": [
+ {
+ "href": "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
+ },
+ {
+ "href": "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
+ },
+ {
+ "href": "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
+ },
+ {
+ "href": "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
+ },
+ {
+ "href": "/ssh-keys/bba63e41-b12c-493a-81d4-e52f50f247ed"
+ }
+ ],
+ "project_lite": {
+ "href": "/projects/93907f48-adfe-43ed-ad89-0e6e83721a54"
+ },
+ "volumes": [],
+ "ip_addresses": [
+ {
+ "id": "5d0262c7-1727-411c-94c4-9e6f15490dd3",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-03T09:47:59Z",
+ "public": true,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "assigned_to": {
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+ },
+ "network": "147.75.106.80",
+ "address": "147.75.106.81",
+ "gateway": "147.75.106.80",
+ "href": "/ips/5d0262c7-1727-411c-94c4-9e6f15490dd3"
+ },
+ {
+ "id": "f7d0e65c-eb3b-42bd-af9b-ad3a736d8d43",
+ "address_family": 6,
+ "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe",
+ "created_at": "2017-01-03T09:47:59Z",
+ "public": true,
+ "cidr": 127,
+ "management": true,
+ "manageable": true,
+ "assigned_to": {
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+ },
+ "network": "2604:1380:2:9800::",
+ "address": "2604:1380:2:9800::1",
+ "gateway": "2604:1380:2:9800::",
+ "href": "/ips/f7d0e65c-eb3b-42bd-af9b-ad3a736d8d43"
+ },
+ {
+ "id": "a3d00b4e-d74f-4ac2-8bc9-91065d815b41",
+ "address_family": 4,
+ "netmask": "255.255.255.254",
+ "created_at": "2017-01-03T09:47:59Z",
+ "public": false,
+ "cidr": 31,
+ "management": true,
+ "manageable": true,
+ "assigned_to": {
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+ },
+ "network": "10.99.214.0",
+ "address": "10.99.214.1",
+ "gateway": "10.99.214.0",
+ "href": "/ips/a3d00b4e-d74f-4ac2-8bc9-91065d815b41"
+ }
+ ],
+ "provisioning_events": [
+ {
+ "id": "bd62123b-afed-4e54-b1b9-89e219ba9cf0",
+ "type": "provisioning.101",
+ "body": "Provisioning started",
+ "created_at": "2017-01-03T09:47:59Z",
+ "relationships": [
+ {
+ "href": "#81909921-255e-413c-883a-c58d14c801ae"
+ }
+ ],
+ "interpolated": "Provisioning started",
+ "href": "/events/bd62123b-afed-4e54-b1b9-89e219ba9cf0"
+ },
+ {
+ "id": "14b4a9e6-be90-40ee-be48-b272f855e39c",
+ "type": "provisioning.102",
+ "body": "Network configured with addresses 147.75.106.81, 2604:1380:2:9800::1, and 10.99.214.1",
+ "created_at": "2017-01-03T09:48:46Z",
+ "relationships": [
+ {
+ "href": "#28588657-b8bf-44a1-98d3-27f8e04b660a"
+ }
+ ],
+ "interpolated": "Network configured with addresses 147.75.106.81, 2604:1380:2:9800::1, and 10.99.214.1",
+ "href": "/events/14b4a9e6-be90-40ee-be48-b272f855e39c"
+ },
+ {
+ "id": "57e3cadb-f9aa-4c73-be54-3c83e6cf462e",
+ "type": "provisioning.103",
+ "body": "Configuration written, restarting device",
+ "created_at": "2017-01-03T09:48:57Z",
+ "relationships": [
+ {
+ "href": "#25a7e807-f4aa-4f36-83cd-8347baeb26bc"
+ }
+ ],
+ "interpolated": "Configuration written, restarting device",
+ "href": "/events/57e3cadb-f9aa-4c73-be54-3c83e6cf462e"
+ },
+ {
+ "id": "b8322996-f57e-4c87-96cc-a16f33a0c305",
+ "type": "provisioning.104",
+ "body": "Connected to magic install system",
+ "created_at": "2017-01-03T09:50:13Z",
+ "relationships": [
+ {
+ "href": "#a4825d20-f7f2-426a-88db-38696bd3dfd6"
+ }
+ ],
+ "interpolated": "Connected to magic install system",
+ "href": "/events/b8322996-f57e-4c87-96cc-a16f33a0c305"
+ },
+ {
+ "id": "f00a00a9-7c59-420d-bdcf-2c0993303cf6",
+ "type": "provisioning.105",
+ "body": "Server partitions created",
+ "created_at": "2017-01-03T09:50:13Z",
+ "relationships": [
+ {
+ "href": "#6140659b-5e3d-4686-be8f-8879b6d3e27f"
+ }
+ ],
+ "interpolated": "Server partitions created",
+ "href": "/events/f00a00a9-7c59-420d-bdcf-2c0993303cf6"
+ },
+ {
+ "id": null,
+ "type": "provisioning.106",
+ "body": "Operating system packages installed",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Operating system packages installed"
+ },
+ {
+ "id": null,
+ "type": "provisioning.107",
+ "body": "Server networking interfaces configured",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Server networking interfaces configured"
+ },
+ {
+ "id": null,
+ "type": "provisioning.108",
+ "body": "Cloud-init packages installed and configured",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Cloud-init packages installed and configured"
+ },
+ {
+ "id": null,
+ "type": "provisioning.109",
+ "body": "Installation finished, rebooting server",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Installation finished, rebooting server"
+ },
+ {
+ "id": null,
+ "type": "provisioning.109",
+ "body": "Installation finished, rebooting server",
+ "created_at": null,
+ "relationships": [],
+ "interpolated": "Installation finished, rebooting server"
+ }
+ ],
+ "plan": {
+ "id": "e69c0169-4726-46ea-98f1-939c9e8a3607",
+ "slug": "baremetal_0",
+ "name": "Type 0",
+ "description": "Our Type 0 configuration is a general use \"cloud killer\" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.",
+ "line": "baremetal",
+ "specs": {
+ "cpus": [
+ {
+ "count": 1,
+ "type": "Intel Atom C2550 @ 2.4Ghz"
+ }
+ ],
+ "memory": {
+ "total": "8GB"
+ },
+ "drives": [
+ {
+ "count": 1,
+ "size": "80GB",
+ "type": "SSD"
+ }
+ ],
+ "nics": [
+ {
+ "count": 2,
+ "type": "1Gbps"
+ }
+ ],
+ "features": {
+ "raid": false,
+ "txt": true
+ }
+ },
+ "available_in": [
+ {
+ "href": "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
+ },
+ {
+ "href": "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
+ },
+ {
+ "href": "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
+ },
+ {
+ "href": "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
+ }
+ ],
+ "pricing": {
+ "hour": 0.05
+ }
+ },
+ "userdata": "",
+ "root_password": ",q4*a8(eny",
+ "href": "/devices/98e22032-579e-4c04-bb12-05cc6a3864c8"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/facilities-first.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/facilities-first.json b/packet/src/test/resources/facilities-first.json
new file mode 100644
index 0000000..5decf9a
--- /dev/null
+++ b/packet/src/test/resources/facilities-first.json
@@ -0,0 +1,39 @@
+{
+ "facilities": [
+ {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ {
+ "id": "8e6470b3-b75e-47d1-bb93-45b225750975",
+ "name": "Amsterdam, NL",
+ "code": "ams1",
+ "features": [
+ "storage"
+ ],
+ "address": null
+ }
+ ],
+ "meta": {
+ "first": {
+ "href": "/facilities?page=1"
+ },
+ "previous": null,
+ "self": {
+ "href": "/facilities?page=1"
+ },
+ "next": {
+ "href": "/facilities?page=2"
+ },
+ "last": {
+ "href": "/facilities?page=2"
+ },
+ "total": 3
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/facilities-last.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/facilities-last.json b/packet/src/test/resources/facilities-last.json
new file mode 100644
index 0000000..f5e6d1c
--- /dev/null
+++ b/packet/src/test/resources/facilities-last.json
@@ -0,0 +1,27 @@
+{
+ "facilities": [
+ {
+ "id": "2b70eb8f-fa18-47c0-aba7-222a842362fd",
+ "name": "Sunnyvale, CA",
+ "code": "sjc1",
+ "features": [],
+ "address": null
+ }
+ ],
+ "meta": {
+ "first": {
+ "href": "/facilities?page=1"
+ },
+ "previous": {
+ "href": "/facilities?page=1"
+ },
+ "self": {
+ "href": "/facilities?page=2"
+ },
+ "next": null,
+ "last": {
+ "href": "/facilities?page=2"
+ },
+ "total": 3
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/facilities.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/facilities.json b/packet/src/test/resources/facilities.json
new file mode 100644
index 0000000..ed6ab4f
--- /dev/null
+++ b/packet/src/test/resources/facilities.json
@@ -0,0 +1,30 @@
+{
+ "facilities": [
+ {
+ "id": "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
+ "name": "Parsippany, NJ",
+ "code": "ewr1",
+ "features": [
+ "baremetal",
+ "storage"
+ ],
+ "address": null
+ },
+ {
+ "id": "8e6470b3-b75e-47d1-bb93-45b225750975",
+ "name": "Amsterdam, NL",
+ "code": "ams1",
+ "features": [
+ "storage"
+ ],
+ "address": null
+ },
+ {
+ "id": "2b70eb8f-fa18-47c0-aba7-222a842362fd",
+ "name": "Sunnyvale, CA",
+ "code": "sjc1",
+ "features": [],
+ "address": null
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/operatingSystems-first.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/operatingSystems-first.json b/packet/src/test/resources/operatingSystems-first.json
new file mode 100644
index 0000000..1438108
--- /dev/null
+++ b/packet/src/test/resources/operatingSystems-first.json
@@ -0,0 +1,96 @@
+{
+ "operating_systems": [
+ {
+ "id": "06e21644-a769-11e6-80f5-76304dec7eb7",
+ "slug": "alpine_3",
+ "name": "Alpine 3",
+ "distro": "alpine",
+ "version": "3",
+ "provisionable_on": []
+ },
+ {
+ "id": "06e21978-a769-11e6-80f5-76304dec7eb7",
+ "slug": "centos_6",
+ "name": "CentOS 6",
+ "distro": "centos",
+ "version": "6",
+ "provisionable_on": []
+ },
+ {
+ "id": "68bad60d-f5a7-45c2-ad09-573edaad3a3c",
+ "slug": "centos_7",
+ "name": "Centos 7",
+ "distro": "centos",
+ "version": "7",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "06e21ce8-a769-11e6-80f5-76304dec7eb7",
+ "slug": "coreos_alpha",
+ "name": "CoreOS Alpha",
+ "distro": "coreos",
+ "version": "alpha",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "6345f310-0bb0-4b59-b051-954fed05183a",
+ "slug": "coreos_beta",
+ "name": "CoreOS Beta",
+ "distro": "coreos",
+ "version": "beta",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "d61c3912-8422-4daf-835e-854efa0062e4",
+ "slug": "coreos_stable",
+ "name": "CoreOS Stable",
+ "distro": "coreos",
+ "version": "stable",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "06e21e78-a769-11e6-80f5-76304dec7eb7",
+ "slug": "debian_7",
+ "name": "Debian 7",
+ "distro": "debian",
+ "version": "7",
+ "provisionable_on": []
+ }
+ ],
+ "meta": {
+ "first": {
+ "href": "/operating-systems?page=1"
+ },
+ "previous": null,
+ "self": {
+ "href": "/operating-systems?page=1"
+ },
+ "next": {
+ "href": "/operating-systems?page=2"
+ },
+ "last": {
+ "href": "/operating-systems?page=2"
+ },
+ "total": 14
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/f749c88e/packet/src/test/resources/operatingSystems-last.json
----------------------------------------------------------------------
diff --git a/packet/src/test/resources/operatingSystems-last.json b/packet/src/test/resources/operatingSystems-last.json
new file mode 100644
index 0000000..2c3c8e3
--- /dev/null
+++ b/packet/src/test/resources/operatingSystems-last.json
@@ -0,0 +1,106 @@
+{
+ "operating_systems": [
+ {
+ "id": "88239019-abc7-41e8-9a4d-cd334da97ff1",
+ "slug": "debian_8",
+ "name": "Debian 8",
+ "distro": "debian",
+ "version": "8",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "06e21ffe-a769-11e6-80f5-76304dec7eb7",
+ "slug": "deprovision",
+ "name": "Deprovision",
+ "distro": "centos",
+ "version": "",
+ "provisionable_on": []
+ },
+ {
+ "id": "06e22198-a769-11e6-80f5-76304dec7eb7",
+ "slug": "freebsd_10_3",
+ "name": "FreeBSD 10.3",
+ "distro": "freebsd",
+ "version": "10.3",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "06e22328-a769-11e6-80f5-76304dec7eb7",
+ "slug": "rancher",
+ "name": "RancherOS",
+ "distro": "rancher",
+ "version": "latest",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "06e224b8-a769-11e6-80f5-76304dec7eb7",
+ "slug": "ubuntu_14_04",
+ "name": "Ubuntu 14.04 LTS",
+ "distro": "ubuntu",
+ "version": "14.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "1b9b78e3-de68-466e-ba00-f2123e89c112",
+ "slug": "ubuntu_16_04",
+ "name": "Ubuntu 16.04 LTS",
+ "distro": "ubuntu",
+ "version": "16.04",
+ "provisionable_on": [
+ "baremetal_0",
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_2a",
+ "baremetal_3"
+ ]
+ },
+ {
+ "id": "06e22972-a769-11e6-80f5-76304dec7eb7",
+ "slug": "windows_2012_rc2",
+ "name": "Windows 2012 RC2",
+ "distro": "windows",
+ "version": "2012 RC2",
+ "provisionable_on": [
+ "baremetal_1",
+ "baremetal_2",
+ "baremetal_3"
+ ]
+ }
+ ],
+ "meta": {
+ "first": {
+ "href": "/operating-systems?page=1"
+ },
+ "previous": {
+ "href": "/operating-systems?page=1"
+ },
+ "self": {
+ "href": "/operating-systems?page=2"
+ },
+ "next": null,
+ "last": {
+ "href": "/operating-systems?page=2"
+ },
+ "total": 14
+ }
+}