diff --git a/caso/extract/openstack/cinder.py b/caso/extract/openstack/cinder.py index 034794a..ebed051 100644 --- a/caso/extract/openstack/cinder.py +++ b/caso/extract/openstack/cinder.py @@ -66,6 +66,7 @@ def _build_record(self, volume, extract_from, extract_to): active_duration=active_duration, measure_time=measure_time, start_time=vol_created, + volume_creation=int(dateutil.parser.parse(vol_start).timestamp()), capacity=volume.size, user_dn=user, ) diff --git a/caso/record.py b/caso/record.py index 2ca04ff..cd78c14 100644 --- a/caso/record.py +++ b/caso/record.py @@ -345,6 +345,7 @@ class StorageRecord(_BaseRecord): attached_to: typing.Optional[str] measure_time: datetime.datetime start_time: datetime.datetime + volume_creation: int storage_type: typing.Optional[str] = "Block Storage (cinder)" @@ -410,6 +411,7 @@ def map_fields(field: str) -> str: "attached_duration": "AttachedDuration", "cloud_type": "CloudType", "compute_service": "CloudComputeService", + "volume_creation": "VolumeCreationTime", } return d.get(field, field) diff --git a/requirements.txt b/requirements.txt index 4667ee5..17182ad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,4 +20,4 @@ python-neutronclient>=6.7.0 # Apache-2.0 keystoneauth1>=3.4.0 # Apache-2.0 stevedore -pydantic +pydantic==1.10.7