Google Cloud
inject_traffic_delay
Add/set delay for a percentage of requests going through a url map on a given path
Add/set HTTP status codes for a percentage of requests going through a url map on a given path
Below are the details and signature of the activity Python module.
Type | action |
Module | chaosgcp.lb.actions |
Name | inject_traffic_faults |
Return | mapping |
Usage
JSON
{
"name": "inject-traffic-faults",
"type": "action",
"provider": {
"type": "python",
"module": "chaosgcp.lb.actions",
"func": "inject_traffic_faults",
"arguments": {
"url_map": "",
"target_name": "",
"target_path": ""
}
}
}
YAML
name: inject-traffic-faults
provider:
arguments:
target_name: ''
target_path: ''
url_map: ''
func: inject_traffic_faults
module: chaosgcp.lb.actions
type: python
type: action
Arguments
Name | Type | Default | Required | Title | Description |
---|---|---|---|---|---|
url_map | string | Yes | URL Map Name | Name of the URL map to add the fault to | |
target_name | string | Yes | Path Matcher Name | Name of the patch matcher to add the fault to | |
target_path | string | Yes | Path | Path to impact with the fault. Must already exist in the path matcher definition | |
impacted_percentage | float | 50.0 | No | Percentage of Impacted Requests | Volume of requests to impact with the fault |
http_status | integer | 400 | No | HTTP Status Code | HTTP status code to set on requests |
This does not work with classic load balancer. Note also the fault may take a couple of minutes to propagated through GCP infrastructure and may not be immediatly on.
Signature
def inject_traffic_faults(
url_map: str,
target_name: str,
target_path: str,
impacted_percentage: float = 50.0,
http_status: int = 400,
configuration: Dict[str, Dict[str, str]] = None,
secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
pass