Testkube Agent /test-sources operations
Testkube API (1.0.0)
Download OpenAPI specification:Download
Testkube provides a Kubernetes-native framework for test definition, execution and results
List test sources
List test sources available in cluster
query Parameters
| selector | string  Labels to filter by  | 
Responses
Response samples
- 200
 - 400
 - 502
 
[- {
- "name": "testsource1",
 - "namespace": "testkube",
 - "labels": {
- "property1": "string",
 - "property2": "string"
 
}, - "type": "string",
 - "repository": {
- "type": "git",
 - "branch": "main",
 - "commit": "b928cbb7186944ab9275937ec1ac3d3738ca2e1d",
 - "path": "test/perf",
 - "username": "string",
 - "token": "string",
 - "usernameSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "tokenSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "certificateSecret": "string",
 - "workingDir": "/",
 - "authType": "basic"
 
}, - "data": "string",
 
} 
]Create new test source
Create new test source based on variables passed in request
Request Body schema: required
test source request body data
| name | string  test source name  | 
| namespace | string  test source namespace  | 
object  test source labels  | |
| type | string  Enum: "string" "file-uri" "git-file" "git-dir" "git"   type of sources a runner can get data from. string: String content (e.g. Postman JSON file). file-uri: content stored on the webserver. git-file: the file stored in the Git repo in the given repository.path field (Deprecated: use git instead). git-dir: the entire git repo or git subdirectory depending on the repository.path field (Testkube does a shadow clone and sparse checkout to limit IOs in the case of monorepos). (Deprecated: use git instead). git: automatically provisions either a file, directory or whole git repository depending on the repository.path field.  | 
object (Repository)   repository representation for tests in git repositories  | |
| data | string  test content data as string  | 
| uri | string  test content  | 
Responses
Request samples
- Payload
 
{- "name": "testsource1",
 - "namespace": "testkube",
 - "labels": {
- "property1": "string",
 - "property2": "string"
 
}, - "type": "string",
 - "repository": {
- "type": "git",
 - "branch": "main",
 - "commit": "b928cbb7186944ab9275937ec1ac3d3738ca2e1d",
 - "path": "test/perf",
 - "username": "string",
 - "token": "string",
 - "usernameSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "tokenSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "certificateSecret": "string",
 - "workingDir": "/",
 - "authType": "basic"
 
}, - "data": "string",
 
}Response samples
- 201
 - 400
 - 502
 
{- "name": "testsource1",
 - "namespace": "testkube",
 - "labels": {
- "property1": "string",
 - "property2": "string"
 
}, - "type": "string",
 - "repository": {
- "type": "git",
 - "branch": "main",
 - "commit": "b928cbb7186944ab9275937ec1ac3d3738ca2e1d",
 - "path": "test/perf",
 - "username": "string",
 - "token": "string",
 - "usernameSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "tokenSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "certificateSecret": "string",
 - "workingDir": "/",
 - "authType": "basic"
 
}, - "data": "string",
 
}Process test source batch (create, update, delete)
Process test source batch based on variables passed in request
Request Body schema: application/jsonrequired
test source batch request body data
required  | Array of objects (TestSourceUpsertRequest)    | ||||||||||||||
 Array  
  | |||||||||||||||
Responses
Request samples
- Payload
 
{- "batch": [
- {
- "name": "testsource1",
 - "namespace": "testkube",
 - "labels": {
- "property1": "string",
 - "property2": "string"
 
}, - "type": "string",
 - "repository": {
- "type": "git",
 - "branch": "main",
 - "commit": "b928cbb7186944ab9275937ec1ac3d3738ca2e1d",
 - "path": "test/perf",
 - "username": "string",
 - "token": "string",
 - "usernameSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "tokenSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "certificateSecret": "string",
 - "workingDir": "/",
 - "authType": "basic"
 
}, - "data": "string",
 
} 
] 
}Response samples
- 200
 - 400
 - 502
 
{- "created": [
- "name1",
 - "name2",
 - "name3"
 
], - "updated": [
- "name4",
 - "name5",
 - "name6"
 
], - "deleted": [
- "name7",
 - "name8",
 - "name9"
 
] 
}Update test source
Update test source based on test content or git based data
path Parameters
| id required  | string  unique id of the object  | 
Request Body schema: required
test source body
| name | string  test source name  | 
| namespace | string  test source namespace  | 
object  test source labels  | |
| type | string  Enum: "string" "file-uri" "git-file" "git-dir" "git"   type of sources a runner can get data from. string: String content (e.g. Postman JSON file). file-uri: content stored on the webserver. git-file: the file stored in the Git repo in the given repository.path field (Deprecated: use git instead). git-dir: the entire git repo or git subdirectory depending on the repository.path field (Testkube does a shadow clone and sparse checkout to limit IOs in the case of monorepos). (Deprecated: use git instead). git: automatically provisions either a file, directory or whole git repository depending on the repository.path field.  | 
object (Repository)   repository representation for tests in git repositories  | |
| data | string  test content data as string  | 
| uri | string  test content  | 
Responses
Request samples
- Payload
 
{- "name": "testsource1",
 - "namespace": "testkube",
 - "labels": {
- "property1": "string",
 - "property2": "string"
 
}, - "type": "string",
 - "repository": {
- "type": "git",
 - "branch": "main",
 - "commit": "b928cbb7186944ab9275937ec1ac3d3738ca2e1d",
 - "path": "test/perf",
 - "username": "string",
 - "token": "string",
 - "usernameSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "tokenSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "certificateSecret": "string",
 - "workingDir": "/",
 - "authType": "basic"
 
}, - "data": "string",
 
}Response samples
- 200
 - 400
 - 404
 - 502
 
{- "name": "testsource1",
 - "namespace": "testkube",
 - "labels": {
- "property1": "string",
 - "property2": "string"
 
}, - "type": "string",
 - "repository": {
- "type": "git",
 - "branch": "main",
 - "commit": "b928cbb7186944ab9275937ec1ac3d3738ca2e1d",
 - "path": "test/perf",
 - "username": "string",
 - "token": "string",
 - "usernameSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "tokenSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "certificateSecret": "string",
 - "workingDir": "/",
 - "authType": "basic"
 
}, - "data": "string",
 
}Delete test source
Deletes test source by its name
path Parameters
| id required  | string  unique id of the object  | 
Responses
Response samples
- 502
 
[- {
- "title": "Invalid test name",
 - "status": 500,
 - "detail": "Your test name can't contain forbidden characters like \"}}}\" passed",
 
} 
]Get test source data
Returns test sources data
path Parameters
| id required  | string  unique id of the object  | 
Responses
Response samples
- 200
 - 400
 - 404
 - 500
 - 502
 
{- "name": "testsource1",
 - "namespace": "testkube",
 - "labels": {
- "property1": "string",
 - "property2": "string"
 
}, - "type": "string",
 - "repository": {
- "type": "git",
 - "branch": "main",
 - "commit": "b928cbb7186944ab9275937ec1ac3d3738ca2e1d",
 - "path": "test/perf",
 - "username": "string",
 - "token": "string",
 - "usernameSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "tokenSecret": {
- "namespace": "string",
 - "name": "string",
 - "key": "string"
 
}, - "certificateSecret": "string",
 - "workingDir": "/",
 - "authType": "basic"
 
}, - "data": "string",
 
}