in src/sfctl/custom_chaos.py [0:0]
def start(client, time_to_run="4294967295", max_cluster_stabilization=60, #pylint: disable=too-many-arguments,too-many-locals,missing-docstring
max_concurrent_faults=1, disable_move_replica_faults=False,
wait_time_between_faults=20,
wait_time_between_iterations=30,
warning_as_error=False,
max_percent_unhealthy_nodes=0,
max_percent_unhealthy_apps=0,
app_type_health_policy_map=None,
context=None,
chaos_target_filter=None,
timeout=60):
from azure.servicefabric.models import ChaosParameters, ClusterHealthPolicy
from sfctl.custom_health import parse_app_health_map
context = parse_chaos_context(context)
health_map = parse_app_health_map(app_type_health_policy_map)
health_policy = ClusterHealthPolicy(
consider_warning_as_error=warning_as_error,
max_percent_unhealthy_nodes=max_percent_unhealthy_nodes,
max_percent_unhealthy_applications=max_percent_unhealthy_apps,
application_type_health_policy_map=health_map)
target_filter = parse_chaos_target_filter(chaos_target_filter)
#pylint: disable=too-many-arguments
chaos_params = ChaosParameters(
time_to_run_in_seconds=time_to_run,
max_cluster_stabilization_timeout_in_seconds=max_cluster_stabilization,
max_concurrent_faults=max_concurrent_faults,
enable_move_replica_faults=not disable_move_replica_faults,
wait_time_between_faults_in_seconds=wait_time_between_faults,
wait_time_between_iterations_in_seconds=wait_time_between_iterations,
cluster_health_policy=health_policy,
context=context,
chaos_target_filter=target_filter)
#pylint: enable=too-many-arguments
client.start_chaos(chaos_params, timeout)