diff --git a/openstack/block_storage/v2/volume.py b/openstack/block_storage/v2/volume.py index ca66cdcce..0233bc7f4 100644 --- a/openstack/block_storage/v2/volume.py +++ b/openstack/block_storage/v2/volume.py @@ -39,6 +39,8 @@ class Volume(resource.Resource, metadata.MetadataMixin): consistency_group_id = resource.Body("consistencygroup_id") #: The timestamp of this volume creation. created_at = resource.Body("created_at") + #: The date and time when the resource was updated. + updated_at = resource.Body("updated_at") #: The volume description. description = resource.Body("description") #: Extended replication status on this volume. diff --git a/openstack/block_storage/v3/volume.py b/openstack/block_storage/v3/volume.py index c6814d2be..034198b64 100644 --- a/openstack/block_storage/v3/volume.py +++ b/openstack/block_storage/v3/volume.py @@ -42,6 +42,8 @@ class Volume(resource.Resource, metadata.MetadataMixin): consistency_group_id = resource.Body("consistencygroup_id") #: The timestamp of this volume creation. created_at = resource.Body("created_at") + #: The date and time when the resource was updated. + updated_at = resource.Body("updated_at") #: The volume description. description = resource.Body("description") #: Extended replication status on this volume. diff --git a/openstack/tests/fakes.py b/openstack/tests/fakes.py index 541055b7d..a035895f1 100644 --- a/openstack/tests/fakes.py +++ b/openstack/tests/fakes.py @@ -360,6 +360,7 @@ class FakeVolume: self.volume_type = 'type:volume' self.availability_zone = 'az1' self.created_at = '1900-01-01 12:34:56' + self.updated_at = None self.source_volid = '12345' self.metadata = {} diff --git a/openstack/tests/unit/block_storage/v2/test_volume.py b/openstack/tests/unit/block_storage/v2/test_volume.py index 59c61eca8..a411f98ac 100644 --- a/openstack/tests/unit/block_storage/v2/test_volume.py +++ b/openstack/tests/unit/block_storage/v2/test_volume.py @@ -34,6 +34,7 @@ VOLUME = { "availability_zone": "nova", "bootable": "false", "created_at": "2015-03-09T12:14:57.233772", + "updated_at": None, "description": "something", "volume_type": "some_type", "snapshot_id": "93c2e2aa-7744-4fd6-a31a-80c4726b08d7", @@ -91,6 +92,7 @@ class TestVolume(base.TestCase): self.assertEqual(VOLUME["availability_zone"], sot.availability_zone) self.assertFalse(sot.is_bootable) self.assertEqual(VOLUME["created_at"], sot.created_at) + self.assertEqual(VOLUME["updated_at"], sot.updated_at) self.assertEqual(VOLUME["description"], sot.description) self.assertEqual(VOLUME["volume_type"], sot.volume_type) self.assertEqual(VOLUME["snapshot_id"], sot.snapshot_id) diff --git a/openstack/tests/unit/block_storage/v3/test_volume.py b/openstack/tests/unit/block_storage/v3/test_volume.py index 71b6d4916..f7acfe55b 100644 --- a/openstack/tests/unit/block_storage/v3/test_volume.py +++ b/openstack/tests/unit/block_storage/v3/test_volume.py @@ -35,6 +35,7 @@ VOLUME = { "availability_zone": "nova", "bootable": "false", "created_at": "2015-03-09T12:14:57.233772", + "updated_at": None, "description": "something", "volume_type": "some_type", "snapshot_id": "93c2e2aa-7744-4fd6-a31a-80c4726b08d7", @@ -94,6 +95,7 @@ class TestVolume(base.TestCase): self.assertEqual(VOLUME["availability_zone"], sot.availability_zone) self.assertFalse(sot.is_bootable) self.assertEqual(VOLUME["created_at"], sot.created_at) + self.assertEqual(VOLUME["updated_at"], sot.updated_at) self.assertEqual(VOLUME["description"], sot.description) self.assertEqual(VOLUME["volume_type"], sot.volume_type) self.assertEqual(VOLUME["snapshot_id"], sot.snapshot_id) diff --git a/releasenotes/notes/vol-updated_at-274c3a2bb94c8939.yaml b/releasenotes/notes/vol-updated_at-274c3a2bb94c8939.yaml new file mode 100644 index 000000000..e23371458 --- /dev/null +++ b/releasenotes/notes/vol-updated_at-274c3a2bb94c8939.yaml @@ -0,0 +1,3 @@ +--- +features: + - Added support for the updated_at attribute for volume objects.