actionSQL

trigger_failover

Causes a high-availability Cloud SQL instance to failover

Activity as code

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

Typeaction
Modulechaosgcp.sql.actions
Nametrigger_failover
Returnmapping

Usage

JSON

{
  "name": "trigger-failover",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosgcp.sql.actions",
    "func": "trigger_failover",
    "arguments": {
      "instance_id": ""
    }
  }
}

YAML

name: trigger-failover
provider:
  arguments:
    instance_id: ""
  func: trigger_failover
  module: chaosgcp.sql.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
instance_idstringYesInstance IDCloud SQL instance identifier to failover
wait_until_completebooleantrueNoWait Until CompleteWait until operation has completed
settings_versionintegernullNoVersionCurrent settings version of the instance

See https://cloud.google.com/sql/docs/postgres/admin-api/v1beta4/instances/failover

Signature

def trigger_failover(
        instance_id: str,
        wait_until_complete: bool = True,
        settings_version: int = None,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass