Skip to content

Commit

Permalink
Add daily cost data
Browse files Browse the repository at this point in the history
  • Loading branch information
samdoran committed Apr 26, 2024
1 parent 1c2bfc7 commit 5d90954
Showing 1 changed file with 63 additions and 7 deletions.
70 changes: 63 additions & 7 deletions koku/api/report/ocp/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def get(self, request, **kwargs):
"units": "GB",
},
"data_transfer_in": {
"value": 2.789192834,
"value": 12.82510775,
"units": "GB",
},
"data_transfer_out": {
"value": 0.8909818101,
"value": 8.080656137,
"units": "GB",
},
"infrastructure": {
Expand All @@ -90,18 +90,18 @@ def get(self, request, **kwargs):
"total": {"value": 0.0, "units": "USD"},
},
"cost": {
"raw": {"value": 1945.51192915, "units": "USD"},
"raw": {"value": 4863.77982288, "units": "USD"},
"markup": {"value": 0.0, "units": "USD"},
"usage": {"value": 0.0, "units": "USD"},
"total": {"value": 1945.51192915, "units": "USD"},
"total": {"value": 4863.77982288, "units": "USD"},
},
},
"data": [
{
"date": "2024-03-06",
"date": "2024-03-31",
"values": [
{
"date": "2024-03-06",
"date": "2024-03-31",
"data_transfer_in": {
"value": 3.6801746441,
"units": "GB",
Expand All @@ -114,9 +114,65 @@ def get(self, request, **kwargs):
"clusters": ["Test OCP on AWS"],
"source_uuid": "6795d5e6-951c-4382-a8d3-390515d7ec3d",
"region": "us-east-1",
"infrastructure": {
"raw": {"value": 1945.51192915, "units": "USD"},
"markup": {"value": 0.0, "units": "USD"},
"usage": {"value": 0.0, "units": "USD"},
"total": {"value": 1945.5119291598, "units": "USD"},
},
"supplementary": {
"raw": {"value": 0.0, "units": "USD"},
"markup": {"value": 0.0, "units": "USD"},
"usage": {"value": 0.0, "units": "USD"},
"total": {"value": 0.0, "units": "USD"},
},
"cost": {
"raw": {"value": 1945.51192915, "units": "USD"},
"markup": {"value": 0.0, "units": "USD"},
"usage": {"value": 0.0, "units": "USD"},
"total": {"value": 1945.51192915, "units": "USD"},
},
},
],
},
{
"date": "2024-04-01",
"values": [
{
"date": "2024-04-01",
"data_transfer_in": {
"value": 9.1449331092,
"units": "GB",
},
"data_transfer_out": {
"value": 5.3939814929,
"units": "GB",
},
"resource_id": "i-727f8dc9c567f1552",
"clusters": ["Test OCP on AWS"],
"source_uuid": "6795d5e6-951c-4382-a8d3-390515d7ec3d",
"region": "us-east-1",
"infrastructure": {
"raw": {"value": 2918.26789372, "units": "USD"},
"markup": {"value": 0.0, "units": "USD"},
"usage": {"value": 0.0, "units": "USD"},
"total": {"value": 2918.26789372, "units": "USD"},
},
"supplementary": {
"raw": {"value": 0.0, "units": "USD"},
"markup": {"value": 0.0, "units": "USD"},
"usage": {"value": 0.0, "units": "USD"},
"total": {"value": 0.0, "units": "USD"},
},
"cost": {
"raw": {"value": 2918.267893725, "units": "USD"},
"markup": {"value": 0.0, "units": "USD"},
"usage": {"value": 0.0, "units": "USD"},
"total": {"value": 2918.267893725, "units": "USD"},
},
}
],
}
},
],
}
paginator = ReportPagination()
Expand Down

0 comments on commit 5d90954

Please sign in to comment.