actionfault

set_fault

Set fault injection on the virtual service identified by `name`

Activity as code

Below are the details and signature of the activity Python module.

Typeaction
Modulechaosistio.fault.actions
Nameset_fault
Returnmapping

Usage

JSON

{
  "name": "set-fault",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosistio.fault.actions",
    "func": "set_fault",
    "arguments": {
      "virtual_service_name": "",
      "routes": [],
      "fault": {}
    }
  }
}

YAML

name: set-fault
provider:
  arguments:
    fault: {}
    routes: []
    virtual_service_name: ""
  func: set_fault
  module: chaosistio.fault.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
virtual_service_namestringYesVirtual Service NameName of the target virtual service
faultmappingYesFaultDefinition of the fault to inject
nsstring“default”NoNamespace
versionstring“networking.istio.io/v1alpha3”NoVersionIstio fault injection version

The fault argument must be the object passed as the spec property of a virtual service resource.

If a fault already exists, it is updated with the new specification.

See https://istio.io/docs/reference/config/istio.networking.v1alpha3/#HTTPFaultInjection

Signature

def set_fault(virtual_service_name: str,
              routes: List[Dict[str, str]],
              fault: Dict[str, Any],
              ns: str = 'default',
              version: str = 'networking.istio.io/v1alpha3',
              configuration: Dict[str, Dict[str, str]] = None,
              secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass