Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/con 22061 billing mechanism for network usage #526

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
post:
summary: "Get Cluster Monthly Aggregated Network Client Data Consumption"
description: |
Provides Network Client monthly usage distribute by charge plan: POC, FREE or PAID.
operationId: "oceanK8sAggregatedNetworkClientDataConsumption"
tags:
- "Ocean AWS"
parameters:
- $ref: "../../../../commons/parameters/accountId.yaml"
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: "../schemas/networkDataConsumptionRequest.yaml"

responses:
200:
$ref: "../responses/networkDataConsumptionResponse.yaml"
400:
description: "Bad Request"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
description: Ocean Monthly Aggregated Network Client Data Consumption Response
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/k8s/networkClient/monthlyDataConsumption"
method:
example: "POST"
response:
type: object
properties:
items:
type: array
items:
$ref: "../schemas/networkDataConsumption.yaml"
kind:
example: "ocean:k8s:networkClient:monthlyDataConsumption"
76 changes: 76 additions & 0 deletions api/services/ocean/aws/schemas/networkDataConsumption.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
type: object
properties:
result:
type: object
properties:
totalForDuration:
type: object
properties:
startTime:
type: string
example: 2023-08-01T00:00:00.000Z
description: >
Beginning date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
endTime:
type: string
example: 2023-10-01T00:00:00.000Z
description: >
End date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
summary:
type: object
properties:
totalConsumption:
type: number
example: 650.123
description: The total data consumption of the network client in a given time range
pocConsumption:
type: number
example: 300
description: The total data consumption of the network client in the POC period, if the given time range include POC time.
freeConsumption:
type: number
example: 100
description: The total data consumption the network client got as free tier and will not be charged for it.
paidConsumption:
type: number
example: 250.123
description: The total data consumption the network client will be charged for.
detailedConsumptions:
type: array
items:
type: object
properties:
startTime:
type: string
example: 2023-08-01T00:00:00.000Z
description: >
Beginning date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
endTime:
type: string
example: 2023-09-01T00:00:00.000Z
description: >
Beginning date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
totalConsumption:
type: number
example: 350.123
description: The total data consumption of the network client in the given month.
maxConsumptionForFreeTier:
type: number
example: 100
description: The max number of first free data consumption in GB of the network client in the given month.
plans:
type: object
properties:
pocConsumption:
type: number
description: The total data consumption of the network client in the POC period, if the given time range include POC time.
example: 300
freeConsumption:
type: number
description: The total data consumption the network client got as free tier and will not be charged for it.
example: 100
paidConsumption:
type: number
description: The total data consumption the network client will be charged for.
example: 250.123
description: The distribution of the data consumption by charge plan in the given month.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
type: object
required:
- oceanId
- months
properties:
oceanId:
type: string
example: "o-12345"
description: >
Ocean cluster identifier.
months:
type: array
example: ["02/2023", "03/2023", "04/2023"]
items:
type: string
description: >
An array of months to get the aggregated network client data consumption.
2 changes: 2 additions & 0 deletions api/spot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ paths:
$ref: services/ocean/aws/paths/cluster-aggregated-costs.yaml
/ocean/aws/k8s/cluster/{oceanClusterId}/aggregatedCosts/summary:
$ref: services/ocean/aws/paths/cluster-aggregated-costs-summary.yaml
/ocean/k8s/networkClient/monthlyDataConsumption:
$ref: services/ocean/aws/paths/cluster-aggregated-network-data-consumption.yaml
/ocean/aws/k8s/launchSpec:
$ref: services/ocean/aws/paths/clusters-launchSpec.yaml
/ocean/aws/k8s/launchSpec/{oceanLaunchSpecId}:
Expand Down
Loading