-
Notifications
You must be signed in to change notification settings - Fork 3
/
api.yaml
233 lines (226 loc) · 5.21 KB
/
api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
---
swagger: '2.0'
info:
version: '0.0.2'
title: Cost, Energy and Resource Consumption Modeling Engines API specification
description: RESTful API specification for the ElasTest Cost Modeling service
contact:
name: Manu Perez
email: [email protected]
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
host: elastest.cost.modeling
basePath: /api
schemes:
- "http"
- "https"
consumes:
- application/json
produces:
- application/text
- application/json
paths:
/:
get:
description: list of supported api calls
produces:
- application/json
responses:
200:
description: OK
default:
description: Unexpected Error
schema:
$ref: "#/definitions/UnexpectedError"
/costmodel:
post:
description: Creates a new Cost Model.
produces:
- application/json
parameters:
-
in: body
name: body
description: Details about the Cost Model to be created.
required: true
schema:
$ref: "#/definitions/CostModelDefinition"
responses:
201:
description: OK
# description: Created
# schema:
# $ref: "#/definitions/CreateCostModelOutput"
default:
description: Unexpexted error
schema:
$ref: "#/definitions/UnexpectedError"
get:
description: Get details about a given Cost Model.
produces:
- application/json
responses:
200:
description: OK
schema:
$ref: "#/definitions/CostModelDefinition"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/UnexpectedError"
/deletecostModel:
post:
description: Deletes a given Cost Model.
produces:
- application/json
parameters:
-
in: body
name: body
description: Cost Model Id to be deleted
schema:
$ref: "#/definitions/DeleteCostModel"
responses:
200:
description: OK
# schema:
# $ref: "#/definitions/DeleteCostModel"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/UnexpectedError"
/estimate:
post:
description: Get a cost estimate of a Test Job running on a given Cost Model.
produces:
- application/json
parameters:
-
in: body
name: body
description: Test Id and Cost Model Id
schema:
$ref: "#/definitions/EstimateBody"
responses:
200:
description: OK
schema:
$ref: "#/definitions/EstimateCostModelOutput"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/UnexpectedError"
# /status/{SuTId}:
# get:
# description: Get the current status of a running System under Test.
# produces:
# - application/json
# responses:
# 200:
# description: OK
# schema:
# $ref: "#/definitions/Status"
# default:
# description: Unexpected Error
# schema:
# $ref: "#/definitions/UnexpectedError"
# /cost/{SuTId}:
# get:
# description: Get the final cost of a finished Test on a System under Test.
# produces:
# - application/json
# responses:
# 200:
# description: OK
# schema:
# $ref: "#/definitions/Cost"
# default:
# description: Unexpected Error
# schema:
# $ref: "#/definitions/UnexpectedError"
definitions:
UnexpectedError:
type: object
properties:
Error:
type: string
EstimateCostModelOutput:
type: object
properties:
testId:
type: string
costModelId:
type: string
estimatedCost:
type: double
unit:
type: string
CostModelDefinition:
type: object
properties:
name:
type: string
type:
type: string
fix_cost:
type: array
items:
$ref: "#/definitions/FixCost"
var_rate:
type: array
items:
$ref: "#/definitions/VarRate"
components:
type: array
items:
$ref: "#/definitions/Component"
description:
type: string
EstimateBody:
type: object
properties:
tJobDefinition:
type: string
tJobCostModel:
type: string
FixCost:
type: object
properties:
fix_costX:
type: double
VarRate:
type: object
properties:
var_rateX:
type: double
Component:
type: object
properties:
componentX:
type: string
DeleteCostModel:
type: object
properties:
costModelId:
type: string
status:
type: string
# CreateCostModelOutput:
# type: object
# properties:
# ModelId:
# type: string
# Status:
# type: object
# properties:
# SuT:
# type: string
# startTime:
# type: int64
# Cost:
# type: double
# Unit:
# type: string
# Status:
# type: string