diff --git a/linode_api4/objects/volume.py b/linode_api4/objects/volume.py index cda9932ab..012115715 100644 --- a/linode_api4/objects/volume.py +++ b/linode_api4/objects/volume.py @@ -52,6 +52,7 @@ class Volume(Base): "hardware_type": Property(), "linode_label": Property(), "encryption": Property(), + "io_ready": Property(), } def attach(self, to_linode, config=None): diff --git a/test/fixtures/volumes.json b/test/fixtures/volumes.json index 2e8c86338..af2436061 100644 --- a/test/fixtures/volumes.json +++ b/test/fixtures/volumes.json @@ -12,7 +12,8 @@ "tags": ["something"], "filesystem_path": "this/is/a/file/path", "hardware_type": "hdd", - "linode_label": null + "linode_label": null, + "io_ready": true }, { "id": 2, @@ -26,7 +27,8 @@ "tags": [], "filesystem_path": "this/is/a/file/path", "hardware_type": "nvme", - "linode_label": null + "linode_label": null, + "io_ready": true }, { "id": 3, @@ -40,7 +42,8 @@ "tags": ["attached"], "filesystem_path": "this/is/a/file/path", "hardware_type": "nvme", - "linode_label": "some_label" + "linode_label": "some_label", + "io_ready": true }, { "id": 4, @@ -55,7 +58,8 @@ "filesystem_path": "this/is/a/file/path", "hardware_type": "hdd", "linode_label": null, - "encryption": "enabled" + "encryption": "enabled", + "io_ready": false } ], "results": 4, diff --git a/test/integration/models/volume/test_volume.py b/test/integration/models/volume/test_volume.py index 94765f701..1b18a3e2f 100644 --- a/test/integration/models/volume/test_volume.py +++ b/test/integration/models/volume/test_volume.py @@ -77,6 +77,7 @@ def test_get_volume(test_linode_client, test_volume): volume = test_linode_client.load(Volume, test_volume.id) assert volume.id == test_volume.id + assert isinstance(volume.io_ready, bool) def test_get_volume_with_encryption( diff --git a/test/unit/linode_client_test.py b/test/unit/linode_client_test.py index c17be6006..07b6602e5 100644 --- a/test/unit/linode_client_test.py +++ b/test/unit/linode_client_test.py @@ -177,6 +177,8 @@ def test_get_volumes(self): self.assertEqual(v[1].linode_label, None) self.assertEqual(v[2].filesystem_path, "this/is/a/file/path") self.assertEqual(v[2].hardware_type, "nvme") + self.assertEqual(v[0].io_ready, True) + self.assertEqual(v[3].io_ready, False) assert v[0].tags == ["something"] assert v[1].tags == [] diff --git a/test/unit/objects/volume_test.py b/test/unit/objects/volume_test.py index 1344c2b94..573315fe8 100644 --- a/test/unit/objects/volume_test.py +++ b/test/unit/objects/volume_test.py @@ -30,9 +30,11 @@ def test_get_volume(self): self.assertEqual(volume.filesystem_path, "this/is/a/file/path") self.assertEqual(volume.hardware_type, "hdd") self.assertEqual(volume.linode_label, None) + self.assertEqual(volume.io_ready, True) def test_get_volume_with_encryption(self): volume = Volume(self.client, 4) + self.assertEqual(volume.io_ready, False) self.assertEqual(volume.encryption, "enabled") def test_update_volume_tags(self):