Skip to content

Commit 2c0aee6

Browse files
committed
Features and trace sampling in api3
1 parent 4c113c6 commit 2c0aee6

File tree

16 files changed

+732
-178
lines changed

16 files changed

+732
-178
lines changed

api/client/models/api_clarity_feature_enum.go

Lines changed: 14 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/server/models/api_clarity_feature_enum.go

Lines changed: 14 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/server/restapi/embedded_spec.go

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -332,22 +332,6 @@ definitions:
332332
- ALERT_WARN
333333
- ALERT_CRITICAL
334334

335-
APIClarityFeatureEnum:
336-
description: 'APIClarity Feature Name'
337-
type: string
338-
enum:
339-
- TraceAnalyzer
340-
- fuzzer
341-
- bfla
342-
343-
APIClarityFeatureOperationEnum:
344-
description: 'APIClarity Feature Operation Enum'
345-
type: string
346-
enum: &APIClarityFeatureOperationEnum
347-
- REMOVE
348-
- SET
349-
- ADD
350-
351335
ModuleAlert:
352336
type: 'object'
353337
properties:
@@ -380,8 +364,24 @@ definitions:
380364
type: string
381365
required:
382366
- featureName
383-
384-
367+
APIClarityFeatureEnum:
368+
description: 'APIClarity Feature Name'
369+
type: string
370+
enum:
371+
- specreconstructor
372+
- specdiffs
373+
- traceanalyzer
374+
- bfla
375+
- differ
376+
- fuzzer
377+
378+
APIClarityFeatureOperationEnum:
379+
description: 'APIClarity Feature Operation Enum'
380+
type: string
381+
enum: &APIClarityFeatureOperationEnum
382+
- REMOVE
383+
- SET
384+
- ADD
385385

386386
paths:
387387
/apiEvents:

api3/core/openapi.yaml

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,41 @@ info:
33
version: 1.0.0
44
title: APIClarity APIs
55
paths:
6+
/features:
7+
get:
8+
summary: Get the list of APIClarity features
9+
responses:
10+
"200":
11+
description: Success
12+
content:
13+
application/json:
14+
schema:
15+
$ref: "#/components/schemas/APIClarityFeatureList"
16+
put:
17+
summary: Manipulates hosts to trace per feature
18+
parameters:
19+
- name: operation
20+
description: Operation to perform on the hosts to trace
21+
in: query
22+
required: true
23+
schema:
24+
$ref: "#/components/schemas/APIClarityFeatureOperationEnum"
25+
requestBody:
26+
content:
27+
application/json:
28+
schema:
29+
$ref: "#/components/schemas/APIClarityFeatureList"
30+
required: true
31+
responses:
32+
"200":
33+
description: Success
34+
content:
35+
application/json:
36+
schema:
37+
$ref: "../common/openapi.yaml#/components/schemas/SuccessResponse"
38+
default:
39+
$ref: "#/components/responses/UnknownError"
40+
641
/apiEvents:
742
get:
843
summary: Get API events
@@ -772,6 +807,42 @@ components:
772807
application/json:
773808
schema:
774809
$ref: "../common/openapi.yaml#/components/schemas/ApiResponse"
775-
schemas: {}
810+
schemas:
811+
APIClarityFeatureList:
812+
type: 'object'
813+
properties:
814+
features:
815+
type: array
816+
items:
817+
$ref: '#/components/schemas/APIClarityFeature'
818+
APIClarityFeature:
819+
type: 'object'
820+
properties:
821+
featureName:
822+
$ref: '#/components/schemas/APIClarityFeatureEnum'
823+
featureDescription:
824+
description: "Short human readable description of the feature"
825+
type: string
826+
hostsToTrace:
827+
type: array
828+
items:
829+
type: string
830+
required:
831+
- featureName
832+
833+
APIClarityFeatureEnum:
834+
description: 'APIClarity Feature Name'
835+
type: string
836+
enum:
837+
- specreconstructor
838+
- specdiffs
839+
840+
APIClarityFeatureOperationEnum:
841+
description: 'APIClarity Feature Operation Enum'
842+
type: string
843+
enum:
844+
- REMOVE
845+
- SET
846+
- ADD
776847

777848

api3/global/openapi.gen.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,44 @@ components:
342342
$ref: ../common/openapi.yaml#/components/schemas/ApiResponse
343343
description: unknown error
344344
schemas:
345+
APIClarityFeature:
346+
properties:
347+
featureDescription:
348+
description: Short human readable description of the feature
349+
type: string
350+
featureName:
351+
$ref: '#/components/schemas/APIClarityFeatureEnum'
352+
hostsToTrace:
353+
items:
354+
type: string
355+
type: array
356+
required:
357+
- featureName
358+
type: object
359+
APIClarityFeatureEnum:
360+
description: APIClarity Feature Name
361+
enum:
362+
- specreconstructor
363+
- specdiffs
364+
- fuzzer
365+
- traceanalyzer
366+
- bfla
367+
- differ
368+
type: string
369+
APIClarityFeatureList:
370+
properties:
371+
features:
372+
items:
373+
$ref: '#/components/schemas/APIClarityFeature'
374+
type: array
375+
type: object
376+
APIClarityFeatureOperationEnum:
377+
description: APIClarity Feature Operation Enum
378+
enum:
379+
- REMOVE
380+
- SET
381+
- ADD
382+
type: string
345383
APIDiffs:
346384
properties:
347385
apiInfo:
@@ -1403,6 +1441,40 @@ paths:
14031441
default:
14041442
$ref: '#/components/responses/UnknownError'
14051443
summary: Get most used APIs
1444+
/features:
1445+
get:
1446+
responses:
1447+
"200":
1448+
content:
1449+
application/json:
1450+
schema:
1451+
$ref: '#/components/schemas/APIClarityFeatureList'
1452+
description: Success
1453+
summary: Get the list of APIClarity features
1454+
put:
1455+
parameters:
1456+
- description: Operation to perform on the hosts to trace
1457+
in: query
1458+
name: operation
1459+
required: true
1460+
schema:
1461+
$ref: '#/components/schemas/APIClarityFeatureOperationEnum'
1462+
requestBody:
1463+
content:
1464+
application/json:
1465+
schema:
1466+
$ref: '#/components/schemas/APIClarityFeatureList'
1467+
required: true
1468+
responses:
1469+
"200":
1470+
content:
1471+
application/json:
1472+
schema:
1473+
$ref: ../common/openapi.yaml#/components/schemas/SuccessResponse
1474+
description: Success
1475+
default:
1476+
$ref: '#/components/responses/UnknownError'
1477+
summary: Manipulates hosts to trace per feature
14061478
/modules/bfla/apiFindings/{apiID}:
14071479
get:
14081480
description: Asks for findings of an APIClarity module, and API. Implemented

0 commit comments

Comments
 (0)