k6
run_script
Runs an arbitrary k6 script
Probe an endpoint to make sure it responds to an http request with the expected HTTP status code
Below are the details and signature of the activity Python module.
Type | probe |
Module | chaosk6.probes |
Name | http |
Return | boolean |
Usage
JSON
{
"name": "http",
"type": "probe",
"provider": {
"type": "python",
"module": "chaosk6.probes",
"func": "http",
"arguments": {
"endpoint": ""
}
}
}
YAML
name: http
provider:
arguments:
endpoint: ""
func: http
module: chaosk6.probes
type: python
type: probe
Arguments
Name | Type | Default | Required | Title | Description |
---|---|---|---|---|---|
endpoint | string | Yes | Endpoint | Target endpoint | |
method | string | “GET” | No | Method | HTTP method to apply |
status | integer | 200 | No | Status | Expected HTTP status code |
body | string | "" | No | Body | HTTP request body to send |
headers | mapping | null | No | Headers | HTTP request headers |
vus | integer | 1 | No | VUs | Number of virtual users |
duration | string | "" | No | Duration | How long to run the test for |
debug | boolean | false | No | Debug | Run the test with the debug flag set |
timeout | integer | 1 | No | Timeout | HTTP requests timeout |
Depending on the endpoint and your payload, this action might be destructive. Use with caution.
Signature
def http(endpoint: str,
method: str = 'GET',
status: int = 200,
body: str = '',
headers: dict = {},
vus: int = 1,
duration: str = '',
debug: bool = False,
timeout: int = 1) -> bool:
pass