diff --git a/generate/swagger.json b/generate/swagger.json index c5a6a16..fd805cd 100644 --- a/generate/swagger.json +++ b/generate/swagger.json @@ -1,36 +1,6 @@ { "basePath": "/api/v2", "definitions": { - "CapturePointDiffSummary": { - "properties": { - "additions": { - "type": "integer" - }, - "capturedBy": { - "$ref": "#/definitions/trafficmodels.By" - }, - "captures": { - "type": "integer" - }, - "maxRelevance": { - "description": "MaxRelevance indicates a score in 0..1 of the maximally relevant diff\noperation, or 1.0 if either the baseline or target are missing.", - "type": "number" - }, - "removals": { - "type": "integer" - }, - "replacements": { - "type": "integer" - }, - "top": { - "items": { - "$ref": "#/definitions/TrafficDiffPairedDiff" - }, - "type": "array" - } - }, - "type": "object" - }, "Cluster": { "properties": { "createdAt": { @@ -351,6 +321,20 @@ }, "type": "object" }, + "Source": { + "properties": { + "id": { + "type": "string" + }, + "requestName": { + "type": "string" + }, + "scriptRef": { + "$ref": "#/definitions/capturemeta.ScriptRef" + } + }, + "type": "object" + }, "Test": { "properties": { "createdAt": { @@ -545,26 +529,22 @@ "type": "integer" }, "capturePoints": { - "type": "integer" + "items": { + "$ref": "#/definitions/trafficmodels.By" + }, + "type": "array" }, "captures": { "type": "integer" }, "green": { - "items": { - "$ref": "#/definitions/CapturePointDiffSummary" - }, - "type": "array" + "$ref": "#/definitions/TrafficDiffSummary" }, "maxRelevance": { - "description": "MaxRelevance indicates a score in 0..1 of the maximally relevant\ndiff of captures.", "type": "number" }, "red": { - "items": { - "$ref": "#/definitions/CapturePointDiffSummary" - }, - "type": "array" + "$ref": "#/definitions/TrafficDiffSummary" }, "removals": { "type": "integer" @@ -573,21 +553,24 @@ "type": "integer" }, "yellow": { - "items": { - "$ref": "#/definitions/CapturePointDiffSummary" - }, - "type": "array" + "$ref": "#/definitions/TrafficDiffSummary" } }, "type": "object" }, "TrafficDiffPairedDiff": { "properties": { + "id": { + "type": "string" + }, "request": { "$ref": "#/definitions/RequestDiff" }, "response": { "$ref": "#/definitions/ResponseDiff" + }, + "source": { + "$ref": "#/definitions/Source" } }, "type": "object" @@ -623,6 +606,26 @@ }, "type": "object" }, + "TrafficDiffSummary": { + "properties": { + "additions": { + "type": "integer" + }, + "captures": { + "type": "integer" + }, + "maxRelevance": { + "type": "number" + }, + "removals": { + "type": "integer" + }, + "replacements": { + "type": "integer" + } + }, + "type": "object" + }, "capture.Message": { "properties": { "body": {}, @@ -684,6 +687,27 @@ }, "type": "object" }, + "capturemeta.ScriptRef": { + "properties": { + "callNum": { + "description": "call number", + "type": "integer" + }, + "col": { + "description": "1-based column (rune) number; 0 if column unknown", + "type": "integer" + }, + "file": { + "description": "filename", + "type": "string" + }, + "line": { + "description": "1-based line number; 0 if line unknown", + "type": "integer" + } + }, + "type": "object" + }, "cluster.Operator": { "properties": { "version": { @@ -1031,59 +1055,6 @@ }, "type": "object" }, - "local": { - "properties": { - "from": { - "$ref": "#/definitions/local.From" - }, - "mappings": { - "items": { - "$ref": "#/definitions/local.PortMapping" - }, - "type": "array" - }, - "name": { - "type": "string" - } - }, - "type": "object" - }, - "local.From": { - "properties": { - "kind": { - "description": "Kind of entity that we want to route to. One of (Service or Deployment or Rollout).", - "example": "Deployment", - "type": "string" - }, - "name": { - "description": "Name of the entity within the Kubernetes cluster.", - "example": "my-frontend", - "type": "string" - }, - "namespace": { - "description": "Namespace within which the entity lives in the Kubernetes cluster.", - "example": "default", - "type": "string" - } - }, - "required": [ - "kind", - "name", - "namespace" - ], - "type": "object" - }, - "local.PortMapping": { - "properties": { - "port": { - "type": "integer" - }, - "toLocal": { - "type": "string" - } - }, - "type": "object" - }, "resourceplugin.Runner": { "properties": { "image": { @@ -1696,17 +1667,6 @@ "description": "Labels are used to specify metadata associated with the sandbox as key-value pairs.", "type": "object" }, - "local": { - "description": "Local Workloads", - "items": { - "$ref": "#/definitions/local" - }, - "type": "array" - }, - "localMachineID": { - "description": "Identifier of the machine from where a sandbox containing local workloads\nwas created or is intended to be ran", - "type": "string" - }, "resources": { "description": "Resources specifies each required resource to spin up the sandbox", "items": { @@ -4877,6 +4837,95 @@ "TestExecutions" ] } + }, + "/orgs/{orgName}/tests/{testName}/executions/{executionName}/traffic-diff-findings": { + "get": { + "consumes": [ + "application/json" + ], + "description": "Get the findings view of the traffic diff of a test execution", + "operationId": "test-execution-traffic-diff-findings", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Test Name", + "in": "path", + "name": "testName", + "required": true, + "type": "string" + }, + { + "description": "Test Execution Name", + "in": "path", + "name": "executionName", + "required": true, + "type": "string" + }, + { + "description": "Context", + "in": "query", + "name": "diffContext", + "type": "string" + }, + { + "description": "Category", + "in": "query", + "name": "category", + "type": "string" + }, + { + "description": "Max Findings", + "in": "query", + "name": "maxFindings", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TrafficDiffResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "502": { + "description": "Bad Gateway", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "Get the findings view of the traffic diff of a test execution", + "tags": [ + "TestExecutions" + ] + } } }, "securityDefinitions": {