Skip to content

Commit ec09619

Browse files
authored
Update OpenAPI spec for resource manager APIs (#2369)
* Update OpenAPI spec for resource manager APIs * Fix OpenAPI definitions * Updating makefile doc * Fixing typo
1 parent e0f422b commit ec09619

File tree

2 files changed

+25
-111
lines changed

2 files changed

+25
-111
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ help: Makefile ## show list of commands
3232
@echo ""
3333
@awk 'BEGIN {FS = ":.*?## "} /[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
3434

35+
view-open-api: ## Run SwaggerUI locally to see OpenAPI documentation
36+
@echo "Running SwaggerUI..."
37+
@echo "Open http://localhost:9002 after the message 'Configuration complete; ready for start up'"
38+
@echo ""
39+
@docker run --rm -p 9002:8080 -v $(shell pwd)/api:/api -e SWAGGER_JSON=/api/openapi.yaml swaggerapi/swagger-ui
40+
3541
.PHONY: run build build-go build-web build-docker
3642
run: build-docker ## build and run tracetest using docker compose
3743
docker compose up

api/openapi.yaml

Lines changed: 19 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ paths:
877877
type: array
878878
items:
879879
$ref: "./testEvents.yaml#/components/schemas/TestRunEvent"
880+
880881
# Environments
881882
/environments:
882883
get:
@@ -1186,87 +1187,6 @@ paths:
11861187
description: "problem updating configuration"
11871188

11881189
# Polling Profile
1189-
/pollingprofile:
1190-
get:
1191-
tags:
1192-
- resource-api
1193-
summary: "List Polling Profiles"
1194-
description: "List polling profiles used on Tracetest to configure how to fetch traces in a test."
1195-
operationId: listPollingProfiles
1196-
parameters:
1197-
- in: query
1198-
name: take
1199-
description: "Indicates the maximum number of polling profiles that can be returned on this call."
1200-
schema:
1201-
type: integer
1202-
default: 20
1203-
- in: query
1204-
name: skip
1205-
description: "Indicates how many polling profiles will be skipped when paginating."
1206-
schema:
1207-
type: integer
1208-
default: 0
1209-
- in: query
1210-
name: sortBy
1211-
description: "Indicates the sort field for on which all polling profiles will be sorted."
1212-
schema:
1213-
type: string
1214-
enum: [id, name, strategy]
1215-
- in: query
1216-
name: sortDirection
1217-
description: "Indicates the sort direction for the polling profiles (ascending or descending)."
1218-
schema:
1219-
type: string
1220-
enum: [asc, desc]
1221-
responses:
1222-
200:
1223-
description: successful operation
1224-
content:
1225-
application/json:
1226-
schema:
1227-
type: object
1228-
properties:
1229-
count:
1230-
type: integer
1231-
items:
1232-
type: array
1233-
items:
1234-
$ref: "./config.yaml#/components/schemas/PollingProfile"
1235-
text/yaml:
1236-
schema:
1237-
type: array
1238-
items:
1239-
$ref: "./config.yaml#/components/schemas/PollingProfile"
1240-
400:
1241-
description: "invalid query for polling profiles, some data was sent in incorrect format."
1242-
500:
1243-
description: "problem listing polling profile"
1244-
post:
1245-
tags:
1246-
- resource-api
1247-
summary: "Create a Polling Profile"
1248-
description: "Create a polling profile used on Tracetest to configure how to fetch traces in a test."
1249-
operationId: createPollingProfile
1250-
requestBody:
1251-
content:
1252-
application/json:
1253-
schema:
1254-
$ref: "./config.yaml#/components/schemas/PollingProfile"
1255-
text/yaml:
1256-
schema:
1257-
$ref: "./config.yaml#/components/schemas/PollingProfile"
1258-
responses:
1259-
201:
1260-
description: successful operation
1261-
content:
1262-
application/json:
1263-
schema:
1264-
$ref: "./config.yaml#/components/schemas/PollingProfile"
1265-
text/yaml:
1266-
schema:
1267-
$ref: "./config.yaml#/components/schemas/PollingProfile"
1268-
500:
1269-
description: "problem creating a polling profile"
12701190
/pollingprofile/{pollingProfileId}:
12711191
get:
12721192
tags:
@@ -1277,7 +1197,7 @@ paths:
12771197
schema:
12781198
type: string
12791199
required: true
1280-
description: "ID of a polling profile used on Tracetest to configure how to fetch traces in a test."
1200+
description: "ID of a polling profile used on Tracetest to configure how to fetch traces in a test. It should be set as 'current'."
12811201
summary: "Get Polling Profile"
12821202
description: "Get a polling profile used on Tracetest to configure how to fetch traces in a test."
12831203
operationId: getPollingProfile
@@ -1304,7 +1224,7 @@ paths:
13041224
schema:
13051225
type: string
13061226
required: true
1307-
description: "ID of a polling profile used on Tracetest to configure how to fetch traces in a test."
1227+
description: "ID of a polling profile used on Tracetest to configure how to fetch traces in a test. It should be set as 'current'."
13081228
summary: "Update a Polling Profile"
13091229
description: "Update a polling profile used on Tracetest to configure how to fetch traces in a test."
13101230
operationId: updatePollingProfile
@@ -1332,28 +1252,6 @@ paths:
13321252
description: "polling profile not found"
13331253
500:
13341254
description: "problem updating a polling profile"
1335-
delete:
1336-
tags:
1337-
- resource-api
1338-
parameters:
1339-
- in: path
1340-
name: pollingProfileId
1341-
schema:
1342-
type: string
1343-
required: true
1344-
description: "ID of a polling profile used on Tracetest to configure how to fetch traces in a test."
1345-
summary: "Delete a Polling Profile"
1346-
description: "Delete a polling profile used on Tracetest to configure how to fetch traces in a test."
1347-
operationId: deletePollingProfile
1348-
responses:
1349-
204:
1350-
description: successful operation
1351-
400:
1352-
description: "invalid polling profile, some data was sent in incorrect format."
1353-
404:
1354-
description: "polling profile not found"
1355-
500:
1356-
description: "problem deleting a polling profile"
13571255

13581256
# Demo
13591257
/demo:
@@ -1394,14 +1292,24 @@ paths:
13941292
content:
13951293
application/json:
13961294
schema:
1397-
type: array
1398-
items:
1399-
$ref: "./config.yaml#/components/schemas/Demo"
1295+
type: object
1296+
properties:
1297+
count:
1298+
type: integer
1299+
items:
1300+
type: array
1301+
items:
1302+
$ref: "./config.yaml#/components/schemas/Demo"
14001303
text/yaml:
14011304
schema:
1402-
type: array
1403-
items:
1404-
$ref: "./config.yaml#/components/schemas/Demo"
1305+
type: object
1306+
properties:
1307+
count:
1308+
type: integer
1309+
items:
1310+
type: array
1311+
items:
1312+
$ref: "./config.yaml#/components/schemas/Demo"
14051313
400:
14061314
description: "invalid query for demos, some data was sent in incorrect format."
14071315
500:

0 commit comments

Comments
 (0)