Skip to content

Commit

Permalink
Adding ocean spark cluster spark core hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnar Páll authored and arnarpall committed Oct 10, 2023
1 parent 637a2e1 commit 92f3bf9
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
33 changes: 33 additions & 0 deletions api/services/ocean/spark/paths/clusterSparkCoreHours.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
summary: Ocean Spark

get:
summary: "Cluster Spark Core Hours"
description: >
Gets the number of core hours applications have consumed.
operationId: "OceanSparkClusterSparkCoreHours"
tags:
- "Ocean Spark"
parameters:
- $ref: "../../../../commons/parameters/nonRequiredAccountId.yaml"
- name: clusterId
in: query
required: false
schema:
type: array
items:
"$ref": "../schemas/oceanSparkClusterId.yaml"
- in: query
name: period
required: false
example: "2021-11"
description: >
The month to query from.
schema:
format: date-time
type: string

responses:
200:
$ref: "../responses/sparkCoreHours.yaml"
400:
description: "Bad Request"
17 changes: 17 additions & 0 deletions api/services/ocean/spark/responses/sparkCoreHours.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: Number of spark core hours consumed by cluster
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
response:
type: object
description: >
response body
properties:
items:
type: array
items:
$ref: "../schemas/oceanSparkClusterSparkCoreHours.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
required:
- id
- coreHours
description: >
Object that holds a pair of ocean cluster id and core hours that this cluster has consumed.
properties:
id:
$ref: "oceanSparkClusterId.yaml"
coreHours:
type: number
description: >
Number of core hours that the cluster has consumed.
example: 99
2 changes: 2 additions & 0 deletions api/spot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,8 @@ paths:
$ref: services/ocean/spark/paths/clusters.yaml
/ocean/spark/cluster/{clusterId}:
$ref: services/ocean/spark/paths/cluster.yaml
/ocean/spark/cluster/sparkCoreHours:
$ref: services/ocean/spark/paths/clusterSparkCoreHours.yaml
/ocean/spark/cluster/{clusterId}/appCompletionTrend:
$ref: services/ocean/spark/paths/clusterAppCompletionTrend.yaml
/ocean/spark/cluster/{clusterId}/appLoadHistory:
Expand Down

0 comments on commit 92f3bf9

Please sign in to comment.