Skip to content

Commit bb7eb63

Browse files
authored
feat(cockpit): add monthly usage (scaleway#1399)
1 parent c7df88e commit bb7eb63

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

scaleway-async/scaleway_async/cockpit/v1/marshalling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ def unmarshal_DataSource(data: Any) -> DataSource:
184184
else:
185185
args["updated_at"] = None
186186

187+
field = data.get("current_month_usage", None)
188+
if field is not None:
189+
args["current_month_usage"] = field
190+
else:
191+
args["current_month_usage"] = 0
192+
187193
return DataSource(**args)
188194

189195

scaleway-async/scaleway_async/cockpit/v1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ class DataSource:
349349
Date the data source was last updated.
350350
"""
351351

352+
current_month_usage: Optional[int] = 0
353+
"""
354+
Usage of the month in bytes.
355+
"""
356+
352357

353358
@dataclass
354359
class GrafanaProductDashboard:

scaleway/scaleway/cockpit/v1/marshalling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ def unmarshal_DataSource(data: Any) -> DataSource:
184184
else:
185185
args["updated_at"] = None
186186

187+
field = data.get("current_month_usage", None)
188+
if field is not None:
189+
args["current_month_usage"] = field
190+
else:
191+
args["current_month_usage"] = 0
192+
187193
return DataSource(**args)
188194

189195

scaleway/scaleway/cockpit/v1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ class DataSource:
349349
Date the data source was last updated.
350350
"""
351351

352+
current_month_usage: Optional[int] = 0
353+
"""
354+
Usage of the month in bytes.
355+
"""
356+
352357

353358
@dataclass
354359
class GrafanaProductDashboard:

0 commit comments

Comments
 (0)