diff --git a/generate/swagger.json b/generate/swagger.json index 56ff826..63ff476 100644 --- a/generate/swagger.json +++ b/generate/swagger.json @@ -263,6 +263,107 @@ }, "type": "object" }, + "Test": { + "properties": { + "createdAt": { + "type": "string" + }, + "spec": { + "$ref": "#/definitions/tests.Spec" + }, + "status": { + "$ref": "#/definitions/tests.Status" + }, + "updatedAt": { + "type": "string" + } + }, + "type": "object" + }, + "TestExecution": { + "properties": { + "canceledAt": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "name": { + "type": "string" + }, + "results": { + "$ref": "#/definitions/testexecutions.Results" + }, + "spec": { + "$ref": "#/definitions/testexecutions.Spec" + }, + "status": { + "$ref": "#/definitions/testexecutions.Status" + } + }, + "type": "object" + }, + "capture.Message": { + "properties": { + "body": {}, + "finishedAt": { + "type": "string" + }, + "headers": { + "$ref": "#/definitions/capture.Values" + }, + "startedAt": { + "type": "string" + } + }, + "type": "object" + }, + "capture.Request": { + "properties": { + "host": { + "type": "string" + }, + "message": { + "$ref": "#/definitions/capture.Message" + }, + "method": { + "type": "string" + }, + "proto": { + "type": "string" + }, + "query": { + "$ref": "#/definitions/capture.Values" + }, + "uri": { + "type": "string" + } + }, + "type": "object" + }, + "capture.Response": { + "properties": { + "error": { + "type": "string" + }, + "message": { + "$ref": "#/definitions/capture.Message" + }, + "proto": { + "type": "string" + }, + "statusCode": { + "type": "integer" + } + }, + "type": "object" + }, + "capture.Values": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, "cluster.Operator": { "properties": { "version": { @@ -610,59 +711,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": { @@ -1275,17 +1323,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": { @@ -1315,122 +1352,694 @@ } }, "type": "object" - } - }, - "host": "api.signadot.com", - "info": { - "contact": {}, - "description": "API for Signadot Sandboxes", - "title": "Signadot API", - "version": "2.0" - }, - "paths": { - "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}": { - "get": { - "consumes": [ - "application/json" - ], - "description": "List all artifacts for a given job attempt.", - "operationId": "list-job-attempt-artifacts", - "parameters": [ - { - "description": "Signadot Org Name", - "in": "path", - "name": "orgName", - "required": true, - "type": "string", - "x-example": "my-company" - }, - { - "description": "Job Name", - "in": "path", - "name": "jobName", - "required": true, - "type": "string" - }, - { - "description": "Job Attempt ID", - "in": "path", - "name": "jobAttempt", - "required": true, - "type": "integer" - }, - { - "description": "Filter by artifact space, one of 'user' or 'system' (by default there is no filter)", - "enum": [ - "user", - "system" - ], - "in": "query", - "name": "space", - "type": "string" - } - ], - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "items": { - "$ref": "#/definitions/JobArtifact" - }, - "type": "array" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + }, + "testexecutions.AutoDiff": { + "properties": { + "enabled": { + "description": "Enabled = true, requires the definition of a valid routing context", + "type": "boolean" + } + }, + "type": "object" + }, + "testexecutions.CanceledState": { + "properties": { + "canceledBy": { + "type": "string" }, - "security": [ - { - "ApiKeyAuth": [] - } - ], - "summary": "List job attempt artifacts", - "tags": [ - "Artifacts" - ] - } + "message": { + "type": "string" + } + }, + "type": "object" }, - "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}/objects/": { - "get": { - "consumes": [ - "application/json" - ], - "description": "Get info about a job attempt artifact", - "operationId": "info-job-attempt-artifact", - "parameters": [ - { - "description": "Signadot Org Name", - "in": "path", - "name": "orgName", - "required": true, - "type": "string", - "x-example": "my-company" - }, + "testexecutions.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/trafficmodels.PairedDiff" + }, + "type": "array" + } + }, + "type": "object" + }, + "testexecutions.ExecutionContext": { + "properties": { + "autoDiff": { + "$ref": "#/definitions/testexecutions.AutoDiff" + }, + "clusterName": { + "type": "string" + }, + "routing": { + "$ref": "#/definitions/job.RoutingContext" + } + }, + "type": "object" + }, + "testexecutions.ExecutionTemplate": { + "properties": { + "autoDiff": { + "$ref": "#/definitions/testexecutions.AutoDiff" + }, + "clusterName": { + "type": "string" + } + }, + "type": "object" + }, + "testexecutions.FailedState": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "testexecutions.QueryResult": { + "properties": { + "cursor": { + "type": "string" + }, + "execution": { + "$ref": "#/definitions/TestExecution" + } + }, + "type": "object" + }, + "testexecutions.Results": { + "properties": { + "trafficDiff": { + "$ref": "#/definitions/testexecutions.TrafficDiff" + } + }, + "type": "object" + }, + "testexecutions.Spec": { + "properties": { + "executionContext": { + "$ref": "#/definitions/testexecutions.ExecutionContext" + }, + "testName": { + "type": "string" + } + }, + "type": "object" + }, + "testexecutions.State": { + "properties": { + "canceled": { + "$ref": "#/definitions/testexecutions.CanceledState" + }, + "failed": { + "$ref": "#/definitions/testexecutions.FailedState" + } + }, + "type": "object" + }, + "testexecutions.Status": { + "properties": { + "baselineJobName": { + "type": "string" + }, + "finalState": { + "$ref": "#/definitions/testexecutions.State" + }, + "phase": { + "type": "string" + }, + "targetJobName": { + "type": "string" + }, + "triggeredBy": { + "$ref": "#/definitions/testexecutions.TriggeredBy" + } + }, + "type": "object" + }, + "testexecutions.TrafficDiff": { + "properties": { + "additions": { + "type": "integer" + }, + "capturePoints": { + "type": "integer" + }, + "captures": { + "type": "integer" + }, + "green": { + "items": { + "$ref": "#/definitions/testexecutions.CapturePointDiffSummary" + }, + "type": "array" + }, + "maxRelevance": { + "description": "MaxRelevance indicates a score in 0..1 of the maximally relevant\ndiff of captures.", + "type": "number" + }, + "red": { + "items": { + "$ref": "#/definitions/testexecutions.CapturePointDiffSummary" + }, + "type": "array" + }, + "removals": { + "type": "integer" + }, + "replacements": { + "type": "integer" + }, + "yellow": { + "items": { + "$ref": "#/definitions/testexecutions.CapturePointDiffSummary" + }, + "type": "array" + } + }, + "type": "object" + }, + "testexecutions.TriggeredBy": { + "properties": { + "sandboxName": { + "type": "string" + }, + "triggerID": { + "type": "string" + } + }, + "type": "object" + }, + "tests.Spec": { + "properties": { + "name": { + "type": "string" + }, + "script": { + "type": "string" + }, + "triggers": { + "items": { + "$ref": "#/definitions/tests.Trigger" + }, + "type": "array" + } + }, + "type": "object" + }, + "tests.Status": { + "type": "object" + }, + "tests.Trigger": { + "properties": { + "executionTemplate": { + "$ref": "#/definitions/testexecutions.ExecutionTemplate" + }, + "id": { + "type": "string" + }, + "sandboxOf": { + "$ref": "#/definitions/sandbox.ForkOf" + } + }, + "type": "object" + }, + "trafficmodels.By": { + "properties": { + "direction": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + } + }, + "type": "object" + }, + "trafficmodels.DiffOp": { + "properties": { + "classification": { + "$ref": "#/definitions/trafficmodels.DiffOpClassification" + }, + "oldValue": {}, + "op": { + "type": "string" + }, + "path": { + "type": "string" + }, + "value": {} + }, + "type": "object" + }, + "trafficmodels.DiffOpClassification": { + "properties": { + "noise": { + "type": "number" + } + }, + "type": "object" + }, + "trafficmodels.DiffPointResult": { + "properties": { + "by": { + "$ref": "#/definitions/trafficmodels.By" + }, + "diffs": { + "items": { + "$ref": "#/definitions/trafficmodels.PairedDiff" + }, + "type": "array" + } + }, + "type": "object" + }, + "trafficmodels.DiffResult": { + "properties": { + "baseline": { + "type": "string" + }, + "results": { + "items": { + "$ref": "#/definitions/trafficmodels.DiffPointResult" + }, + "type": "array" + }, + "target": { + "type": "string" + } + }, + "type": "object" + }, + "trafficmodels.PairedDiff": { + "properties": { + "request": { + "$ref": "#/definitions/trafficmodels.RequestDiff" + }, + "response": { + "$ref": "#/definitions/trafficmodels.ResponseDiff" + } + }, + "type": "object" + }, + "trafficmodels.RequestDiff": { + "properties": { + "baseline": { + "$ref": "#/definitions/capture.Request" + }, + "diffOps": { + "items": { + "$ref": "#/definitions/trafficmodels.DiffOp" + }, + "type": "array" + }, + "target": { + "$ref": "#/definitions/capture.Request" + } + }, + "type": "object" + }, + "trafficmodels.ResponseDiff": { + "properties": { + "baseline": { + "$ref": "#/definitions/capture.Response" + }, + "diffOps": { + "items": { + "$ref": "#/definitions/trafficmodels.DiffOp" + }, + "type": "array" + }, + "target": { + "$ref": "#/definitions/capture.Response" + } + }, + "type": "object" + } + }, + "host": "api.signadot.com", + "info": { + "contact": {}, + "description": "API for Signadot Sandboxes", + "title": "Signadot API", + "version": "2.0" + }, + "paths": { + "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}": { + "get": { + "consumes": [ + "application/json" + ], + "description": "List all artifacts for a given job attempt.", + "operationId": "list-job-attempt-artifacts", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Job Name", + "in": "path", + "name": "jobName", + "required": true, + "type": "string" + }, + { + "description": "Job Attempt ID", + "in": "path", + "name": "jobAttempt", + "required": true, + "type": "integer" + }, + { + "description": "Filter by artifact space, one of 'user' or 'system' (by default there is no filter)", + "enum": [ + "user", + "system" + ], + "in": "query", + "name": "space", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/JobArtifact" + }, + "type": "array" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "List job attempt artifacts", + "tags": [ + "Artifacts" + ] + } + }, + "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}/objects/": { + "get": { + "consumes": [ + "application/json" + ], + "description": "Get info about a job attempt artifact", + "operationId": "info-job-attempt-artifact", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Job Name", + "in": "path", + "name": "jobName", + "required": true, + "type": "string" + }, + { + "description": "Job Attempt ID", + "in": "path", + "name": "jobAttempt", + "required": true, + "type": "integer" + }, + { + "description": "Artifact Path", + "in": "query", + "name": "path", + "required": true, + "type": "string" + }, + { + "description": "Artifact space, one of 'user' or 'system' (by default 'user')", + "enum": [ + "user", + "system" + ], + "in": "query", + "name": "space", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/JobArtifactInfo" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "Job attempt artifact info", + "tags": [ + "Artifacts" + ] + } + }, + "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}/objects/download": { + "get": { + "consumes": [ + "application/json" + ], + "description": "Downloads an artifact for a given job attempt.", + "operationId": "download-job-attempt-artifact", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Job Name", + "in": "path", + "name": "jobName", + "required": true, + "type": "string" + }, + { + "description": "Job Attempt ID", + "in": "path", + "name": "jobAttempt", + "required": true, + "type": "integer" + }, + { + "description": "Artifact Path", + "in": "query", + "name": "path", + "required": true, + "type": "string" + }, + { + "description": "Artifact space, one of 'user' or 'system' (by default 'user')", + "enum": [ + "user", + "system" + ], + "in": "query", + "name": "space", + "type": "string" + }, + { + "description": "Downloads the specified byte range of the artifact. Retrieving multiple ranges of data per request is not supported", + "in": "header", + "name": "Range", + "type": "string" + } + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "Artifact successfully downloaded", + "headers": { + "signadot-artifact-checksumSHA256": { + "description": "A base64-encoded, 256-bit SHA-256 digest of the artifact", + "type": "string" + }, + "signadot-artifact-last-modified": { + "description": "Date and time when the artifact was last modified", + "type": "string" + }, + "signadot-artifact-metadata": { + "description": "A json-encoded, map of the artifact metadata", + "type": "string" + } + }, + "schema": { + "type": "file" + } + }, + "206": { + "description": "Artifact range successfully downloaded", + "headers": { + "signadot-artifact-last-modified": { + "description": "Date and time when the artifact was last modified", + "type": "string" + }, + "signadot-artifact-metadata": { + "description": "A json-encoded, map of the artifact metadata", + "type": "string" + } + }, + "schema": { + "type": "file" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "Download job attempt artifact", + "tags": [ + "Artifacts" + ] + } + }, + "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}/objects/upload": { + "post": { + "consumes": [ + "multipart/form-data" + ], + "description": "Uploads an artifact for a given job attempt.", + "operationId": "upload-job-attempt-artifact", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, { "description": "Job Name", "in": "path", @@ -1461,6 +2070,224 @@ "in": "query", "name": "space", "type": "string" + }, + { + "description": "Job Execution ID", + "in": "formData", + "name": "jobExecution", + "type": "integer" + }, + { + "description": "A base64-encoded, 256-bit SHA-256 digest of the artifact", + "in": "formData", + "name": "checksumSHA256", + "type": "string" + }, + { + "description": "A json-encoded, map of metadata to store with the artifact", + "in": "formData", + "name": "metadata", + "type": "string" + }, + { + "description": "Artifact File", + "in": "formData", + "name": "artifact", + "required": true, + "type": "file" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/EmptyResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "413": { + "description": "Request Entity Too Large", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "Upload job attempt artifact", + "tags": [ + "Artifacts" + ] + } + }, + "/orgs/{orgName}/clusters/": { + "get": { + "consumes": [ + "application/json" + ], + "description": "List clusters.", + "operationId": "list-clusters", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/Cluster" + }, + "type": "array" + } + }, + "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": "List clusters", + "tags": [ + "Cluster" + ] + } + }, + "/orgs/{orgName}/clusters/{clusterName}/": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "Remove a Kubernetes cluster from Signadot.", + "operationId": "remove-cluster", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Cluster Name", + "in": "path", + "name": "clusterName", + "required": true, + "type": "string", + "x-example": "my-cluster" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/EmptyResponse" + } + }, + "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": "Remove a cluster", + "tags": [ + "Cluster" + ] + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "Get a cluster.", + "operationId": "get-cluster", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Cluster Name", + "in": "path", + "name": "clusterName", + "required": true, + "type": "string" } ], "produces": [ @@ -1470,7 +2297,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/JobArtifactInfo" + "$ref": "#/definitions/Cluster" } }, "400": { @@ -1485,14 +2312,8 @@ "$ref": "#/definitions/ErrorResponse" } }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", + "502": { + "description": "Bad Gateway", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -1503,19 +2324,17 @@ "ApiKeyAuth": [] } ], - "summary": "Job attempt artifact info", + "summary": "Get a cluster", "tags": [ - "Artifacts" + "Cluster" ] - } - }, - "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}/objects/download": { - "get": { + }, + "put": { "consumes": [ "application/json" ], - "description": "Downloads an artifact for a given job attempt.", - "operationId": "download-job-attempt-artifact", + "description": "Add a Kubernetes cluster to Signadot.", + "operationId": "add-cluster", "parameters": [ { "description": "Signadot Org Name", @@ -1526,81 +2345,22 @@ "x-example": "my-company" }, { - "description": "Job Name", - "in": "path", - "name": "jobName", - "required": true, - "type": "string" - }, - { - "description": "Job Attempt ID", + "description": "Cluster Name", "in": "path", - "name": "jobAttempt", - "required": true, - "type": "integer" - }, - { - "description": "Artifact Path", - "in": "query", - "name": "path", + "name": "clusterName", "required": true, - "type": "string" - }, - { - "description": "Artifact space, one of 'user' or 'system' (by default 'user')", - "enum": [ - "user", - "system" - ], - "in": "query", - "name": "space", - "type": "string" - }, - { - "description": "Downloads the specified byte range of the artifact. Retrieving multiple ranges of data per request is not supported", - "in": "header", - "name": "Range", - "type": "string" + "type": "string", + "x-example": "my-cluster" } ], "produces": [ - "*/*" + "application/json" ], "responses": { "200": { - "description": "Artifact successfully downloaded", - "headers": { - "signadot-artifact-checksumSHA256": { - "description": "A base64-encoded, 256-bit SHA-256 digest of the artifact", - "type": "string" - }, - "signadot-artifact-last-modified": { - "description": "Date and time when the artifact was last modified", - "type": "string" - }, - "signadot-artifact-metadata": { - "description": "A json-encoded, map of the artifact metadata", - "type": "string" - } - }, - "schema": { - "type": "file" - } - }, - "206": { - "description": "Artifact range successfully downloaded", - "headers": { - "signadot-artifact-last-modified": { - "description": "Date and time when the artifact was last modified", - "type": "string" - }, - "signadot-artifact-metadata": { - "description": "A json-encoded, map of the artifact metadata", - "type": "string" - } - }, + "description": "OK", "schema": { - "type": "file" + "$ref": "#/definitions/Cluster" } }, "400": { @@ -1615,16 +2375,162 @@ "$ref": "#/definitions/ErrorResponse" } }, - "404": { - "description": "Not Found", + "502": { + "description": "Bad Gateway", "schema": { "$ref": "#/definitions/ErrorResponse" } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "Add a cluster", + "tags": [ + "Cluster" + ] + } + }, + "/orgs/{orgName}/clusters/{clusterName}/tokens": { + "post": { + "consumes": [ + "application/json" + ], + "description": "Create a new token for connecting a cluster.", + "operationId": "create-cluster-token", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Cluster Name", + "in": "path", + "name": "clusterName", + "required": true, + "type": "string", + "x-example": "my-new-cluster" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ClusterToken" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "Create cluster token", + "tags": [ + "Cluster" + ] + } + }, + "/orgs/{orgName}/clusters/{clusterName}/tokens/": { + "get": { + "consumes": [ + "application/json" + ], + "description": "List the cluster tokens associated with a cluster.", + "operationId": "list-cluster-tokens", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" }, - "500": { - "description": "Internal Server Error", + { + "description": "Cluster Name", + "in": "path", + "name": "clusterName", + "required": true, + "type": "string", + "x-example": "my-new-cluster" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/ClusterToken" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "List cluster tokens", + "tags": [ + "Cluster" + ] + } + }, + "/orgs/{orgName}/clusters/{clusterName}/tokens/{tokenId}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "Delete a cluster token associated with a cluster.", + "operationId": "delete-cluster-token", + "parameters": [ + { + "description": "Signadot Org Name", + "in": "path", + "name": "orgName", + "required": true, + "type": "string", + "x-example": "my-company" + }, + { + "description": "Cluster Name", + "in": "path", + "name": "clusterName", + "required": true, + "type": "string", + "x-example": "my-new-cluster" + }, + { + "description": "Token Id", + "in": "path", + "name": "tokenId", + "required": true, + "type": "string", + "x-example": "kq6mtksk7mn5" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/EmptyResponse" } } }, @@ -1633,19 +2539,17 @@ "ApiKeyAuth": [] } ], - "summary": "Download job attempt artifact", + "summary": "Delete cluster token", "tags": [ - "Artifacts" + "Cluster" ] - } - }, - "/orgs/{orgName}/artifacts/jobs/{jobName}/attempts/{jobAttempt}/objects/upload": { - "post": { + }, + "get": { "consumes": [ - "multipart/form-data" + "application/json" ], - "description": "Uploads an artifact for a given job attempt.", - "operationId": "upload-job-attempt-artifact", + "description": "Get a cluster token associated with a cluster.", + "operationId": "get-cluster-token", "parameters": [ { "description": "Signadot Org Name", @@ -1656,60 +2560,20 @@ "x-example": "my-company" }, { - "description": "Job Name", + "description": "Cluster Name", "in": "path", - "name": "jobName", + "name": "clusterName", "required": true, - "type": "string" + "type": "string", + "x-example": "my-new-cluster" }, { - "description": "Job Attempt ID", + "description": "Token Id", "in": "path", - "name": "jobAttempt", - "required": true, - "type": "integer" - }, - { - "description": "Artifact Path", - "in": "query", - "name": "path", - "required": true, - "type": "string" - }, - { - "description": "Artifact space, one of 'user' or 'system' (by default 'user')", - "enum": [ - "user", - "system" - ], - "in": "query", - "name": "space", - "type": "string" - }, - { - "description": "Job Execution ID", - "in": "formData", - "name": "jobExecution", - "type": "integer" - }, - { - "description": "A base64-encoded, 256-bit SHA-256 digest of the artifact", - "in": "formData", - "name": "checksumSHA256", - "type": "string" - }, - { - "description": "A json-encoded, map of metadata to store with the artifact", - "in": "formData", - "name": "metadata", - "type": "string" - }, - { - "description": "Artifact File", - "in": "formData", - "name": "artifact", + "name": "tokenId", "required": true, - "type": "file" + "type": "string", + "x-example": "kq6mtksk7mn5" } ], "produces": [ @@ -1719,31 +2583,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/EmptyResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "413": { - "description": "Request Entity Too Large", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/ClusterToken" } } }, @@ -1752,19 +2592,19 @@ "ApiKeyAuth": [] } ], - "summary": "Upload job attempt artifact", + "summary": "Get a cluster token", "tags": [ - "Artifacts" + "Cluster" ] } }, - "/orgs/{orgName}/clusters/": { + "/orgs/{orgName}/jobs": { "get": { "consumes": [ "application/json" ], - "description": "List clusters.", - "operationId": "list-clusters", + "description": "List Jobs", + "operationId": "list-jobs", "parameters": [ { "description": "Signadot Org Name", @@ -1783,7 +2623,7 @@ "description": "OK", "schema": { "items": { - "$ref": "#/definitions/Cluster" + "$ref": "#/definitions/Job" }, "type": "array" } @@ -1812,19 +2652,17 @@ "ApiKeyAuth": [] } ], - "summary": "List clusters", + "summary": "List Jobs", "tags": [ - "Cluster" + "Jobs" ] - } - }, - "/orgs/{orgName}/clusters/{clusterName}/": { - "delete": { + }, + "post": { "consumes": [ "application/json" ], - "description": "Remove a Kubernetes cluster from Signadot.", - "operationId": "remove-cluster", + "description": "Creates a job with the provided parameters.", + "operationId": "create-job", "parameters": [ { "description": "Signadot Org Name", @@ -1835,12 +2673,13 @@ "x-example": "my-company" }, { - "description": "Cluster Name", - "in": "path", - "name": "clusterName", + "description": "Request to create a job", + "in": "body", + "name": "data", "required": true, - "type": "string", - "x-example": "my-cluster" + "schema": { + "$ref": "#/definitions/Job" + } } ], "produces": [ @@ -1850,7 +2689,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/EmptyResponse" + "$ref": "#/definitions/Job" } }, "400": { @@ -1877,17 +2716,19 @@ "ApiKeyAuth": [] } ], - "summary": "Remove a cluster", + "summary": "Create a job", "tags": [ - "Cluster" + "Jobs" ] - }, - "get": { + } + }, + "/orgs/{orgName}/jobs/{jobName}": { + "delete": { "consumes": [ "application/json" ], - "description": "Get a cluster.", - "operationId": "get-cluster", + "description": "Delete a given job.", + "operationId": "delete-job", "parameters": [ { "description": "Signadot Org Name", @@ -1898,11 +2739,12 @@ "x-example": "my-company" }, { - "description": "Cluster Name", + "description": "Job Name", "in": "path", - "name": "clusterName", + "name": "jobName", "required": true, - "type": "string" + "type": "string", + "x-example": "job-xyz" } ], "produces": [ @@ -1912,7 +2754,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Cluster" + "$ref": "#/definitions/EmptyResponse" } }, "400": { @@ -1939,17 +2781,17 @@ "ApiKeyAuth": [] } ], - "summary": "Get a cluster", + "summary": "Delete a job", "tags": [ - "Cluster" + "Jobs" ] }, - "put": { + "get": { "consumes": [ "application/json" ], - "description": "Add a Kubernetes cluster to Signadot.", - "operationId": "add-cluster", + "description": "Fetch the details about a given job.", + "operationId": "get-job", "parameters": [ { "description": "Signadot Org Name", @@ -1960,12 +2802,12 @@ "x-example": "my-company" }, { - "description": "Cluster Name", + "description": "Job Name", "in": "path", - "name": "clusterName", + "name": "jobName", "required": true, "type": "string", - "x-example": "my-cluster" + "x-example": "job-xyz" } ], "produces": [ @@ -1975,7 +2817,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Cluster" + "$ref": "#/definitions/Job" } }, "400": { @@ -2002,19 +2844,19 @@ "ApiKeyAuth": [] } ], - "summary": "Add a cluster", + "summary": "Get a job", "tags": [ - "Cluster" + "Jobs" ] } }, - "/orgs/{orgName}/clusters/{clusterName}/tokens": { - "post": { + "/orgs/{orgName}/jobs/{jobName}/attempts/{jobAttempt}/logs/stream": { + "get": { "consumes": [ "application/json" ], - "description": "Create a new token for connecting a cluster.", - "operationId": "create-cluster-token", + "description": "Stream logs for a given job attempt.", + "operationId": "stream-job-attempt-logs", "parameters": [ { "description": "Signadot Org Name", @@ -2025,22 +2867,68 @@ "x-example": "my-company" }, { - "description": "Cluster Name", + "description": "Job Name", "in": "path", - "name": "clusterName", + "name": "jobName", "required": true, - "type": "string", - "x-example": "my-new-cluster" + "type": "string" + }, + { + "description": "Job Attempt ID", + "in": "path", + "name": "jobAttempt", + "required": true, + "type": "integer" + }, + { + "description": "Stream type (stdout or stderr)", + "enum": [ + "stdout", + "stderr" + ], + "in": "query", + "name": "type", + "type": "string" + }, + { + "description": "If set, the number of lines from the end of the logs to show", + "in": "query", + "name": "tailLines", + "type": "integer" + }, + { + "description": "If set, resume logs stream from the given cursor", + "in": "query", + "name": "cursor", + "type": "string" } ], "produces": [ - "application/json" + "text/event-stream" ], "responses": { "200": { - "description": "OK", + "description": "Log lines stream", "schema": { - "$ref": "#/definitions/ClusterToken" + "type": "file" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -2049,19 +2937,19 @@ "ApiKeyAuth": [] } ], - "summary": "Create cluster token", + "summary": "Stream job attempt logs", "tags": [ - "Cluster" + "JobLogs" ] } }, - "/orgs/{orgName}/clusters/{clusterName}/tokens/": { - "get": { + "/orgs/{orgName}/jobs/{jobName}/cancel": { + "put": { "consumes": [ "application/json" ], - "description": "List the cluster tokens associated with a cluster.", - "operationId": "list-cluster-tokens", + "description": "Cancel a given job.", + "operationId": "cancel-job", "parameters": [ { "description": "Signadot Org Name", @@ -2072,12 +2960,12 @@ "x-example": "my-company" }, { - "description": "Cluster Name", + "description": "Job Name", "in": "path", - "name": "clusterName", + "name": "jobName", "required": true, "type": "string", - "x-example": "my-new-cluster" + "x-example": "job-xyz" } ], "produces": [ @@ -2087,10 +2975,25 @@ "200": { "description": "OK", "schema": { - "items": { - "$ref": "#/definitions/ClusterToken" - }, - "type": "array" + "$ref": "#/definitions/Job" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "502": { + "description": "Bad Gateway", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -2099,19 +3002,19 @@ "ApiKeyAuth": [] } ], - "summary": "List cluster tokens", + "summary": "Cancel a job", "tags": [ - "Cluster" + "Jobs" ] } }, - "/orgs/{orgName}/clusters/{clusterName}/tokens/{tokenId}": { - "delete": { + "/orgs/{orgName}/resource-plugins": { + "get": { "consumes": [ "application/json" ], - "description": "Delete a cluster token associated with a cluster.", - "operationId": "delete-cluster-token", + "description": "List all resource plugins under the specified Signadot org.", + "operationId": "list-resource-plugins", "parameters": [ { "description": "Signadot Org Name", @@ -2120,22 +3023,6 @@ "required": true, "type": "string", "x-example": "my-company" - }, - { - "description": "Cluster Name", - "in": "path", - "name": "clusterName", - "required": true, - "type": "string", - "x-example": "my-new-cluster" - }, - { - "description": "Token Id", - "in": "path", - "name": "tokenId", - "required": true, - "type": "string", - "x-example": "kq6mtksk7mn5" } ], "produces": [ @@ -2145,7 +3032,28 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/EmptyResponse" + "items": { + "$ref": "#/definitions/ResourcePlugin" + }, + "type": "array" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "502": { + "description": "Bad Gateway", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -2154,17 +3062,19 @@ "ApiKeyAuth": [] } ], - "summary": "Delete cluster token", + "summary": "List resource plugins", "tags": [ - "Cluster" + "ResourcePlugins" ] - }, - "get": { + } + }, + "/orgs/{orgName}/resource-plugins/{pluginName}": { + "delete": { "consumes": [ "application/json" ], - "description": "Get a cluster token associated with a cluster.", - "operationId": "get-cluster-token", + "description": "Delete the resource plugin by name", + "operationId": "delete-resource-plugin", "parameters": [ { "description": "Signadot Org Name", @@ -2175,20 +3085,12 @@ "x-example": "my-company" }, { - "description": "Cluster Name", - "in": "path", - "name": "clusterName", - "required": true, - "type": "string", - "x-example": "my-new-cluster" - }, - { - "description": "Token Id", + "description": "Resource plugin name", "in": "path", - "name": "tokenId", + "name": "pluginName", "required": true, "type": "string", - "x-example": "kq6mtksk7mn5" + "x-example": "mariadb-plugin" } ], "produces": [ @@ -2198,7 +3100,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/ClusterToken" + "$ref": "#/definitions/EmptyResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "502": { + "description": "Bad Gateway", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -2207,19 +3127,17 @@ "ApiKeyAuth": [] } ], - "summary": "Get a cluster token", + "summary": "Delete a resource plugin", "tags": [ - "Cluster" + "ResourcePlugins" ] - } - }, - "/orgs/{orgName}/jobs": { + }, "get": { "consumes": [ "application/json" ], - "description": "List Jobs", - "operationId": "list-jobs", + "description": "Get the specified resource plugin by name", + "operationId": "get-resource-plugin", "parameters": [ { "description": "Signadot Org Name", @@ -2228,6 +3146,14 @@ "required": true, "type": "string", "x-example": "my-company" + }, + { + "description": "Resource plugin name", + "in": "path", + "name": "pluginName", + "required": true, + "type": "string", + "x-example": "mariadb-plugin" } ], "produces": [ @@ -2237,10 +3163,7 @@ "200": { "description": "OK", "schema": { - "items": { - "$ref": "#/definitions/Job" - }, - "type": "array" + "$ref": "#/definitions/ResourcePlugin" } }, "400": { @@ -2267,17 +3190,17 @@ "ApiKeyAuth": [] } ], - "summary": "List Jobs", + "summary": "Get the requested resource plugin", "tags": [ - "Jobs" + "ResourcePlugins" ] }, - "post": { + "put": { "consumes": [ "application/json" ], - "description": "Creates a job with the provided parameters.", - "operationId": "create-job", + "description": "Apply a resource plugin. Updates are not supported at this time.", + "operationId": "apply-resource-plugin", "parameters": [ { "description": "Signadot Org Name", @@ -2288,12 +3211,20 @@ "x-example": "my-company" }, { - "description": "Request to create a job", + "description": "Resource plugin name", + "in": "path", + "name": "pluginName", + "required": true, + "type": "string", + "x-example": "mariadb-plugin" + }, + { + "description": "Request to create or update a resource plugin", "in": "body", "name": "data", "required": true, "schema": { - "$ref": "#/definitions/Job" + "$ref": "#/definitions/ResourcePlugin" } } ], @@ -2304,7 +3235,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Job" + "$ref": "#/definitions/EmptyResponse" } }, "400": { @@ -2331,19 +3262,19 @@ "ApiKeyAuth": [] } ], - "summary": "Create a job", + "summary": "Apply a resource plugin", "tags": [ - "Jobs" + "ResourcePlugins" ] } }, - "/orgs/{orgName}/jobs/{jobName}": { - "delete": { + "/orgs/{orgName}/routegroups": { + "get": { "consumes": [ "application/json" ], - "description": "Delete a given job.", - "operationId": "delete-job", + "description": "List all routegroups under the specified Signadot org.", + "operationId": "list-routegroups", "parameters": [ { "description": "Signadot Org Name", @@ -2352,14 +3283,6 @@ "required": true, "type": "string", "x-example": "my-company" - }, - { - "description": "Job Name", - "in": "path", - "name": "jobName", - "required": true, - "type": "string", - "x-example": "job-xyz" } ], "produces": [ @@ -2369,7 +3292,10 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/EmptyResponse" + "items": { + "$ref": "#/definitions/RouteGroup" + }, + "type": "array" } }, "400": { @@ -2396,17 +3322,19 @@ "ApiKeyAuth": [] } ], - "summary": "Delete a job", + "summary": "List routegroups", "tags": [ - "Jobs" + "RouteGroups" ] - }, - "get": { + } + }, + "/orgs/{orgName}/routegroups/{routegroupName}": { + "delete": { "consumes": [ "application/json" ], - "description": "Fetch the details about a given job.", - "operationId": "get-job", + "description": "Delete a given routegroup.", + "operationId": "delete-routegroup", "parameters": [ { "description": "Signadot Org Name", @@ -2417,12 +3345,12 @@ "x-example": "my-company" }, { - "description": "Job Name", + "description": "RouteGroup Name", "in": "path", - "name": "jobName", + "name": "routegroupName", "required": true, "type": "string", - "x-example": "job-xyz" + "x-example": "my-routegroup" } ], "produces": [ @@ -2432,7 +3360,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Job" + "$ref": "#/definitions/EmptyResponse" } }, "400": { @@ -2459,73 +3387,43 @@ "ApiKeyAuth": [] } ], - "summary": "Get a job", + "summary": "Delete a routegroup", "tags": [ - "Jobs" + "RouteGroups" ] - } - }, - "/orgs/{orgName}/jobs/{jobName}/attempts/{jobAttempt}/logs/stream": { + }, "get": { "consumes": [ "application/json" ], - "description": "Stream logs for a given job attempt.", - "operationId": "stream-job-attempt-logs", + "description": "Fetch the details about a given routegroup.", + "operationId": "get-routegroup", "parameters": [ { "description": "Signadot Org Name", "in": "path", "name": "orgName", "required": true, - "type": "string", - "x-example": "my-company" - }, - { - "description": "Job Name", - "in": "path", - "name": "jobName", - "required": true, - "type": "string" + "type": "string", + "x-example": "my-company" }, { - "description": "Job Attempt ID", + "description": "RouteGroup Name", "in": "path", - "name": "jobAttempt", + "name": "routegroupName", "required": true, - "type": "integer" - }, - { - "description": "Stream type (stdout or stderr)", - "enum": [ - "stdout", - "stderr" - ], - "in": "query", - "name": "type", - "type": "string" - }, - { - "description": "If set, the number of lines from the end of the logs to show", - "in": "query", - "name": "tailLines", - "type": "integer" - }, - { - "description": "If set, resume logs stream from the given cursor", - "in": "query", - "name": "cursor", - "type": "string" + "type": "string", + "x-example": "my-routegroup" } ], "produces": [ - "text/event-stream" + "application/json" ], "responses": { "200": { - "description": "Log lines stream", + "description": "OK", "schema": { - "type": "file" + "$ref": "#/definitions/RouteGroup" } }, "400": { @@ -2540,8 +3438,8 @@ "$ref": "#/definitions/ErrorResponse" } }, - "404": { - "description": "Not Found", + "502": { + "description": "Bad Gateway", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -2552,19 +3450,17 @@ "ApiKeyAuth": [] } ], - "summary": "Stream job attempt logs", + "summary": "Get a routegroup", "tags": [ - "JobLogs" + "RouteGroups" ] - } - }, - "/orgs/{orgName}/jobs/{jobName}/cancel": { + }, "put": { "consumes": [ "application/json" ], - "description": "Cancel a given job.", - "operationId": "cancel-job", + "description": "Creates or updates a routegroup with the provided parameters.", + "operationId": "apply-routegroup", "parameters": [ { "description": "Signadot Org Name", @@ -2575,12 +3471,21 @@ "x-example": "my-company" }, { - "description": "Job Name", + "description": "RouteGroup Name", "in": "path", - "name": "jobName", + "name": "routegroupName", "required": true, "type": "string", - "x-example": "job-xyz" + "x-example": "my-routegroup" + }, + { + "description": "Request to create or update routegroup", + "in": "body", + "name": "data", + "required": true, + "schema": { + "$ref": "#/definitions/RouteGroup" + } } ], "produces": [ @@ -2590,7 +3495,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Job" + "$ref": "#/definitions/RouteGroup" } }, "400": { @@ -2617,19 +3522,19 @@ "ApiKeyAuth": [] } ], - "summary": "Cancel a job", + "summary": "Create or update a routegroup", "tags": [ - "Jobs" + "RouteGroups" ] } }, - "/orgs/{orgName}/resource-plugins": { + "/orgs/{orgName}/runnergroups": { "get": { "consumes": [ "application/json" ], - "description": "List all resource plugins under the specified Signadot org.", - "operationId": "list-resource-plugins", + "description": "List RunnerGroups", + "operationId": "list-runnergroup", "parameters": [ { "description": "Signadot Org Name", @@ -2648,7 +3553,7 @@ "description": "OK", "schema": { "items": { - "$ref": "#/definitions/ResourcePlugin" + "$ref": "#/definitions/JobRunnerGroup" }, "type": "array" } @@ -2677,19 +3582,19 @@ "ApiKeyAuth": [] } ], - "summary": "List resource plugins", + "summary": "List RunnerGroups", "tags": [ - "ResourcePlugins" + "RunnerGroups" ] } }, - "/orgs/{orgName}/resource-plugins/{pluginName}": { + "/orgs/{orgName}/runnergroups/{runnergroupName}": { "delete": { "consumes": [ "application/json" ], - "description": "Delete the resource plugin by name", - "operationId": "delete-resource-plugin", + "description": "Delete a given runnergroup.", + "operationId": "delete-runnergroup", "parameters": [ { "description": "Signadot Org Name", @@ -2700,12 +3605,12 @@ "x-example": "my-company" }, { - "description": "Resource plugin name", + "description": "RunnerGroup Name", "in": "path", - "name": "pluginName", + "name": "runnergroupName", "required": true, "type": "string", - "x-example": "mariadb-plugin" + "x-example": "my-runnergroup" } ], "produces": [ @@ -2742,17 +3647,17 @@ "ApiKeyAuth": [] } ], - "summary": "Delete a resource plugin", + "summary": "Delete a runnergroup", "tags": [ - "ResourcePlugins" + "RunnerGroups" ] }, "get": { "consumes": [ "application/json" ], - "description": "Get the specified resource plugin by name", - "operationId": "get-resource-plugin", + "description": "Fetch the details about a given runnergroup.", + "operationId": "get-runnergroup", "parameters": [ { "description": "Signadot Org Name", @@ -2763,12 +3668,12 @@ "x-example": "my-company" }, { - "description": "Resource plugin name", + "description": "RunnerGroup Name", "in": "path", - "name": "pluginName", + "name": "runnergroupName", "required": true, "type": "string", - "x-example": "mariadb-plugin" + "x-example": "my-runnergroup" } ], "produces": [ @@ -2778,7 +3683,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/ResourcePlugin" + "$ref": "#/definitions/JobRunnerGroup" } }, "400": { @@ -2805,17 +3710,17 @@ "ApiKeyAuth": [] } ], - "summary": "Get the requested resource plugin", + "summary": "Get a runnergroup", "tags": [ - "ResourcePlugins" + "RunnerGroups" ] }, "put": { "consumes": [ "application/json" ], - "description": "Apply a resource plugin. Updates are not supported at this time.", - "operationId": "apply-resource-plugin", + "description": "Creates or updates a runnergroup with the provided parameters.", + "operationId": "apply-runnergroup", "parameters": [ { "description": "Signadot Org Name", @@ -2826,20 +3731,20 @@ "x-example": "my-company" }, { - "description": "Resource plugin name", + "description": "RunnerGroup Name", "in": "path", - "name": "pluginName", + "name": "runnergroupName", "required": true, "type": "string", - "x-example": "mariadb-plugin" + "x-example": "my-runnergroup" }, { - "description": "Request to create or update a resource plugin", + "description": "Request to create or update runnergroup", "in": "body", "name": "data", "required": true, "schema": { - "$ref": "#/definitions/ResourcePlugin" + "$ref": "#/definitions/JobRunnerGroup" } } ], @@ -2850,7 +3755,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/EmptyResponse" + "$ref": "#/definitions/JobRunnerGroup" } }, "400": { @@ -2877,19 +3782,19 @@ "ApiKeyAuth": [] } ], - "summary": "Apply a resource plugin", + "summary": "Create or update a runnergroup", "tags": [ - "ResourcePlugins" + "RunnerGroups" ] } }, - "/orgs/{orgName}/routegroups": { + "/orgs/{orgName}/sandboxes": { "get": { "consumes": [ "application/json" ], - "description": "List all routegroups under the specified Signadot org.", - "operationId": "list-routegroups", + "description": "List all sandboxes under the specified Signadot org.", + "operationId": "list-sandboxes", "parameters": [ { "description": "Signadot Org Name", @@ -2908,7 +3813,7 @@ "description": "OK", "schema": { "items": { - "$ref": "#/definitions/RouteGroup" + "$ref": "#/definitions/Sandbox" }, "type": "array" } @@ -2937,19 +3842,19 @@ "ApiKeyAuth": [] } ], - "summary": "List routegroups", + "summary": "List sandboxes", "tags": [ - "RouteGroups" + "Sandboxes" ] } }, - "/orgs/{orgName}/routegroups/{routegroupName}": { + "/orgs/{orgName}/sandboxes/{sandboxName}": { "delete": { "consumes": [ "application/json" ], - "description": "Delete a given routegroup.", - "operationId": "delete-routegroup", + "description": "Delete a given sandbox.", + "operationId": "delete-sandbox", "parameters": [ { "description": "Signadot Org Name", @@ -2960,12 +3865,18 @@ "x-example": "my-company" }, { - "description": "RouteGroup Name", + "description": "Sandbox Name", "in": "path", - "name": "routegroupName", + "name": "sandboxName", "required": true, "type": "string", - "x-example": "my-routegroup" + "x-example": "my-sandbox" + }, + { + "description": "force", + "in": "query", + "name": "force", + "type": "boolean" } ], "produces": [ @@ -3002,17 +3913,17 @@ "ApiKeyAuth": [] } ], - "summary": "Delete a routegroup", + "summary": "Delete a sandbox", "tags": [ - "RouteGroups" + "Sandboxes" ] }, "get": { "consumes": [ "application/json" ], - "description": "Fetch the details about a given routegroup.", - "operationId": "get-routegroup", + "description": "Fetch the details about a given sandbox.", + "operationId": "get-sandbox", "parameters": [ { "description": "Signadot Org Name", @@ -3023,12 +3934,12 @@ "x-example": "my-company" }, { - "description": "RouteGroup Name", + "description": "Sandbox Name", "in": "path", - "name": "routegroupName", + "name": "sandboxName", "required": true, "type": "string", - "x-example": "my-routegroup" + "x-example": "my-sandbox" } ], "produces": [ @@ -3038,7 +3949,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/RouteGroup" + "$ref": "#/definitions/Sandbox" } }, "400": { @@ -3065,17 +3976,17 @@ "ApiKeyAuth": [] } ], - "summary": "Get a routegroup", + "summary": "Get a sandbox", "tags": [ - "RouteGroups" + "Sandboxes" ] }, "put": { "consumes": [ "application/json" ], - "description": "Creates or updates a routegroup with the provided parameters.", - "operationId": "apply-routegroup", + "description": "Creates or updates a sandbox with the provided parameters.", + "operationId": "apply-sandbox", "parameters": [ { "description": "Signadot Org Name", @@ -3086,21 +3997,78 @@ "x-example": "my-company" }, { - "description": "RouteGroup Name", + "description": "Sandbox Name", + "in": "path", + "name": "sandboxName", + "required": true, + "type": "string", + "x-example": "my-sandbox" + }, + { + "description": "Request to create sandbox", + "in": "body", + "name": "data", + "required": true, + "schema": { + "$ref": "#/definitions/Sandbox" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Sandbox" + } + }, + "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": "Create or update a sandbox", + "tags": [ + "Sandboxes" + ] + } + }, + "/orgs/{orgName}/tests": { + "get": { + "consumes": [ + "application/json" + ], + "description": "List Tests", + "operationId": "list-tests", + "parameters": [ + { + "description": "Signadot Org Name", "in": "path", - "name": "routegroupName", + "name": "orgName", "required": true, "type": "string", - "x-example": "my-routegroup" - }, - { - "description": "Request to create or update routegroup", - "in": "body", - "name": "data", - "required": true, - "schema": { - "$ref": "#/definitions/RouteGroup" - } + "x-example": "my-company" } ], "produces": [ @@ -3110,7 +4078,10 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/RouteGroup" + "items": { + "$ref": "#/definitions/Test" + }, + "type": "array" } }, "400": { @@ -3137,27 +4108,118 @@ "ApiKeyAuth": [] } ], - "summary": "Create or update a routegroup", + "summary": "List Tests", "tags": [ - "RouteGroups" + "Tests" ] } }, - "/orgs/{orgName}/runnergroups": { + "/orgs/{orgName}/tests/executions/": { "get": { "consumes": [ "application/json" ], - "description": "List RunnerGroups", - "operationId": "list-runnergroup", + "description": "Query test executions based on different criteria", + "operationId": "query-test-executions", "parameters": [ { - "description": "Signadot Org Name", + "description": "Signadot Org name", "in": "path", "name": "orgName", "required": true, "type": "string", "x-example": "my-company" + }, + { + "description": "Target sandbox name", + "in": "query", + "name": "targetSandboxName", + "type": "string" + }, + { + "description": "Target route group name", + "in": "query", + "name": "targetRouteGroupName", + "type": "string" + }, + { + "description": "Revision of the target routing context", + "in": "query", + "name": "targetRevision", + "type": "string" + }, + { + "description": "Cluster name", + "in": "query", + "name": "clusterName", + "type": "string" + }, + { + "description": "Test name", + "in": "query", + "name": "testName", + "type": "string" + }, + { + "description": "Trigger name", + "in": "query", + "name": "triggerName", + "type": "string" + }, + { + "description": "Trigger workload in JSON format", + "in": "query", + "name": "triggerWorkload", + "type": "string" + }, + { + "description": "Test execution phase", + "in": "query", + "name": "executionPhase", + "type": "string" + }, + { + "description": "Filter results starting from this time", + "in": "query", + "name": "from", + "type": "string" + }, + { + "description": "Filter results until this time", + "in": "query", + "name": "to", + "type": "string" + }, + { + "description": "Group results by entity (so far, only triggers is supported)", + "enum": [ + "trigger" + ], + "in": "query", + "name": "groupBy", + "type": "string" + }, + { + "description": "Sorting direction", + "enum": [ + "asc", + "desc" + ], + "in": "query", + "name": "orderDir", + "type": "string" + }, + { + "description": "Number of rows to be included in the response", + "in": "query", + "name": "pageSize", + "type": "string" + }, + { + "description": "Start sending results from this cursor", + "in": "query", + "name": "cursor", + "type": "string" } ], "produces": [ @@ -3168,7 +4230,7 @@ "description": "OK", "schema": { "items": { - "$ref": "#/definitions/JobRunnerGroup" + "$ref": "#/definitions/testexecutions.QueryResult" }, "type": "array" } @@ -3197,19 +4259,19 @@ "ApiKeyAuth": [] } ], - "summary": "List RunnerGroups", + "summary": "Query Test Executions", "tags": [ - "RunnerGroups" + "TestExecutions" ] } }, - "/orgs/{orgName}/runnergroups/{runnergroupName}": { + "/orgs/{orgName}/tests/{testName}": { "delete": { "consumes": [ "application/json" ], - "description": "Delete a given runnergroup.", - "operationId": "delete-runnergroup", + "description": "Delete a given test.", + "operationId": "delete-test", "parameters": [ { "description": "Signadot Org Name", @@ -3220,12 +4282,12 @@ "x-example": "my-company" }, { - "description": "RunnerGroup Name", + "description": "Test Name", "in": "path", - "name": "runnergroupName", + "name": "testName", "required": true, "type": "string", - "x-example": "my-runnergroup" + "x-example": "job-xyz" } ], "produces": [ @@ -3262,17 +4324,17 @@ "ApiKeyAuth": [] } ], - "summary": "Delete a runnergroup", + "summary": "Delete a test", "tags": [ - "RunnerGroups" + "Tests" ] }, "get": { "consumes": [ "application/json" ], - "description": "Fetch the details about a given runnergroup.", - "operationId": "get-runnergroup", + "description": "Fetch the details about a given test.", + "operationId": "get-test", "parameters": [ { "description": "Signadot Org Name", @@ -3283,12 +4345,11 @@ "x-example": "my-company" }, { - "description": "RunnerGroup Name", + "description": "Test Name", "in": "path", - "name": "runnergroupName", + "name": "testName", "required": true, - "type": "string", - "x-example": "my-runnergroup" + "type": "string" } ], "produces": [ @@ -3298,7 +4359,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/JobRunnerGroup" + "$ref": "#/definitions/Test" } }, "400": { @@ -3325,17 +4386,17 @@ "ApiKeyAuth": [] } ], - "summary": "Get a runnergroup", + "summary": "Get a test", "tags": [ - "RunnerGroups" + "Tests" ] }, "put": { "consumes": [ "application/json" ], - "description": "Creates or updates a runnergroup with the provided parameters.", - "operationId": "apply-runnergroup", + "description": "Creates or updates a test with the provided parameters.", + "operationId": "apply-test", "parameters": [ { "description": "Signadot Org Name", @@ -3346,20 +4407,19 @@ "x-example": "my-company" }, { - "description": "RunnerGroup Name", + "description": "Test Name", "in": "path", - "name": "runnergroupName", + "name": "testName", "required": true, - "type": "string", - "x-example": "my-runnergroup" + "type": "string" }, { - "description": "Request to create or update runnergroup", + "description": "Test Spec", "in": "body", "name": "data", "required": true, "schema": { - "$ref": "#/definitions/JobRunnerGroup" + "$ref": "#/definitions/tests.Spec" } } ], @@ -3370,7 +4430,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/JobRunnerGroup" + "$ref": "#/definitions/Test" } }, "400": { @@ -3397,19 +4457,19 @@ "ApiKeyAuth": [] } ], - "summary": "Create or update a runnergroup", + "summary": "Create or update a Test", "tags": [ - "RunnerGroups" + "Tests" ] } }, - "/orgs/{orgName}/sandboxes": { + "/orgs/{orgName}/tests/{testName}/executions/": { "get": { "consumes": [ "application/json" ], - "description": "List all sandboxes under the specified Signadot org.", - "operationId": "list-sandboxes", + "description": "List test executions for a given test", + "operationId": "list-test-executions", "parameters": [ { "description": "Signadot Org Name", @@ -3418,6 +4478,13 @@ "required": true, "type": "string", "x-example": "my-company" + }, + { + "description": "Test name", + "in": "path", + "name": "testName", + "required": true, + "type": "string" } ], "produces": [ @@ -3428,7 +4495,7 @@ "description": "OK", "schema": { "items": { - "$ref": "#/definitions/Sandbox" + "$ref": "#/definitions/TestExecution" }, "type": "array" } @@ -3457,19 +4524,17 @@ "ApiKeyAuth": [] } ], - "summary": "List sandboxes", + "summary": "List Test Executions", "tags": [ - "Sandboxes" + "TestExecutions" ] - } - }, - "/orgs/{orgName}/sandboxes/{sandboxName}": { - "delete": { + }, + "post": { "consumes": [ "application/json" ], - "description": "Delete a given sandbox.", - "operationId": "delete-sandbox", + "description": "Creates a test with the provided parameters.", + "operationId": "create-test-execution", "parameters": [ { "description": "Signadot Org Name", @@ -3480,18 +4545,20 @@ "x-example": "my-company" }, { - "description": "Sandbox Name", + "description": "Test name", "in": "path", - "name": "sandboxName", + "name": "testName", "required": true, - "type": "string", - "x-example": "my-sandbox" + "type": "string" }, { - "description": "force", - "in": "query", - "name": "force", - "type": "boolean" + "description": "Request to create a test execution", + "in": "body", + "name": "data", + "required": true, + "schema": { + "$ref": "#/definitions/testexecutions.Spec" + } } ], "produces": [ @@ -3501,7 +4568,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/EmptyResponse" + "$ref": "#/definitions/TestExecution" } }, "400": { @@ -3528,17 +4595,19 @@ "ApiKeyAuth": [] } ], - "summary": "Delete a sandbox", + "summary": "Create a Test Execution", "tags": [ - "Sandboxes" + "TestExecutions" ] - }, + } + }, + "/orgs/{orgName}/tests/{testName}/executions/{executionName}": { "get": { "consumes": [ "application/json" ], - "description": "Fetch the details about a given sandbox.", - "operationId": "get-sandbox", + "description": "Fetch the details about a given test execution.", + "operationId": "get-test-execution", "parameters": [ { "description": "Signadot Org Name", @@ -3549,12 +4618,18 @@ "x-example": "my-company" }, { - "description": "Sandbox Name", + "description": "Test Name", "in": "path", - "name": "sandboxName", + "name": "testName", "required": true, - "type": "string", - "x-example": "my-sandbox" + "type": "string" + }, + { + "description": "Test Execution Name", + "in": "path", + "name": "executionName", + "required": true, + "type": "string" } ], "produces": [ @@ -3564,7 +4639,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Sandbox" + "$ref": "#/definitions/TestExecution" } }, "400": { @@ -3591,17 +4666,19 @@ "ApiKeyAuth": [] } ], - "summary": "Get a sandbox", + "summary": "Get a test execution", "tags": [ - "Sandboxes" + "TestExecutions" ] - }, - "put": { + } + }, + "/orgs/{orgName}/tests/{testName}/executions/{executionName}/cancel": { + "post": { "consumes": [ "application/json" ], - "description": "Creates or updates a sandbox with the provided parameters.", - "operationId": "apply-sandbox", + "description": "Cancel a given test execution.", + "operationId": "cancel-test-execution", "parameters": [ { "description": "Signadot Org Name", @@ -3612,21 +4689,89 @@ "x-example": "my-company" }, { - "description": "Sandbox Name", + "description": "Test Name", "in": "path", - "name": "sandboxName", + "name": "testName", "required": true, - "type": "string", - "x-example": "my-sandbox" + "type": "string" }, { - "description": "Request to create sandbox", - "in": "body", - "name": "data", + "description": "Test Execution Name", + "in": "path", + "name": "executionName", "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", "schema": { - "$ref": "#/definitions/Sandbox" + "$ref": "#/definitions/EmptyResponse" + } + }, + "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": "Cancel a test execution", + "tags": [ + "TestExecutions" + ] + } + }, + "/orgs/{orgName}/tests/{testName}/executions/{executionName}/traffic-diff": { + "get": { + "consumes": [ + "application/json" + ], + "description": "Get the full traffic diff of a test execution", + "operationId": "test-execution-traffic-diff", + "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" } ], "produces": [ @@ -3636,7 +4781,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Sandbox" + "$ref": "#/definitions/trafficmodels.DiffResult" } }, "400": { @@ -3663,9 +4808,9 @@ "ApiKeyAuth": [] } ], - "summary": "Create or update a sandbox", + "summary": "Get the full traffic diff of a test execution", "tags": [ - "Sandboxes" + "TestExecutions" ] } } @@ -3678,4 +4823,4 @@ } }, "swagger": "2.0" -} +} \ No newline at end of file