#compdef _sdb-admin sdb-admin


function _sdb-admin {
  local -a commands

  _arguments -C \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-h --help)'{-h,--help}'[Help for sdb-admin]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]' \
    "1: :->cmnds" \
    "*::arg:->args"

  case $state in
  cmnds)
    commands=(
      "add-aggregator:Add the node as a child aggregator to the cluster"
      "add-leaf:Add the node as a leaf to the cluster"
      "bootstrap-aggregator:Bootstrap the node as a Master Aggregator in the cluster"
      "change-root-password:Change the root password for a node on a host"
      "configure-monitoring:Configure monitoring"
      "create-backup:Create full or split partitions backup for one or more databases to a specified repository"
      "create-node:Create a SingleStoreDB node on a specific host"
      "delete-backup:Delete full and split backups"
      "delete-node:Delete a node on a specific host"
      "describe-node:Get a property of a node"
      "disable-nodes-autostart:Disable the use of systemd for restarting all nodes on specified hosts at startup"
      "dump:Generates a sequence of SQL statements that can be executed to reproduce the objects defined in the cluster"
      "enable-high-availability:Enable high availability"
      "enable-http-api:Enable the HTTP API"
      "enable-nodes-autostart:Use systemd to restart all nodes on the specified hosts on startup"
      "enable-systemd-client:Enable systemd to manage node state using the 'sdb-systemd-client' script"
      "env:Display the Toolbox runtime environment"
      "help:Help about any command"
      "list-backups:List backups"
      "list-nodes:List the nodes in the cluster"
      "optimize:Recommends best practices and optimizes the cluster for maximum performance"
      "put-file:Upload a file to the specified hosts"
      "query:A convenience wrapper for executing arbitrary SQL queries on a node"
      "register-node:Register an existing node on a specific host so it can be managed by \`sdb-admin\` and \`memsqlctl\`"
      "remove-aggregator:Remove an aggregator from the cluster"
      "remove-leaf:Remove the leaf from the cluster"
      "restart-node:Restart one or all nodes on a host"
      "restore-backup:Restore one or more full and split backups to the cluster"
      "set-license:Set the license on a node"
      "show-aggregators:Query the Master Aggregator for its aggregators"
      "show-cluster:Query the Master Aggregator (or any node in the cluster if the Master Aggregator is not available) for all child aggregator and leaf nodes in the cluster"
      "show-leaves:Query the Master Aggregator for its leaves"
      "show-license:Show the license on a node"
      "snapshot-database:Take a snapshot of a single database, the list of selected databases, or all databases"
      "start-monitoring:Start monitoring"
      "start-monitoring-kube:Start monitoring for a Kubernetes (kube) cluster"
      "start-node:Start one or all nodes on a host"
      "state:Display the Toolbox State File contents"
      "stop-monitoring:The 'stop-monitoring' command stops a pipeline if one exists"
      "stop-node:Stop one or all nodes on a host"
      "summarize-backups:Print summary information for full and split backups grouped by \`group-by\` flag"
      "sync-ldap:Sync LDAP users and groups"
      "unregister-node:Unregister a node on a specific host"
      "update-config:Update configuration for one or all nodes in the cluster"
      "update-node-base-install-dir:Move the base install directory of the node and update the corresponding engine variables: datadir, plancachedir, tracelogsdir, auditlogsdir"
      "validate-backup:Verify that one or more full or split backups are correct"
      "version:Display the Toolbox version"
    )
    _describe "command" commands
    ;;
  esac

  case "$words[1]" in
  add-aggregator)
    _sdb-admin_add-aggregator
    ;;
  add-leaf)
    _sdb-admin_add-leaf
    ;;
  bootstrap-aggregator)
    _sdb-admin_bootstrap-aggregator
    ;;
  change-root-password)
    _sdb-admin_change-root-password
    ;;
  configure-monitoring)
    _sdb-admin_configure-monitoring
    ;;
  create-backup)
    _sdb-admin_create-backup
    ;;
  create-node)
    _sdb-admin_create-node
    ;;
  delete-backup)
    _sdb-admin_delete-backup
    ;;
  delete-node)
    _sdb-admin_delete-node
    ;;
  describe-node)
    _sdb-admin_describe-node
    ;;
  disable-nodes-autostart)
    _sdb-admin_disable-nodes-autostart
    ;;
  dump)
    _sdb-admin_dump
    ;;
  enable-high-availability)
    _sdb-admin_enable-high-availability
    ;;
  enable-http-api)
    _sdb-admin_enable-http-api
    ;;
  enable-nodes-autostart)
    _sdb-admin_enable-nodes-autostart
    ;;
  enable-systemd-client)
    _sdb-admin_enable-systemd-client
    ;;
  env)
    _sdb-admin_env
    ;;
  help)
    _sdb-admin_help
    ;;
  list-backups)
    _sdb-admin_list-backups
    ;;
  list-nodes)
    _sdb-admin_list-nodes
    ;;
  optimize)
    _sdb-admin_optimize
    ;;
  put-file)
    _sdb-admin_put-file
    ;;
  query)
    _sdb-admin_query
    ;;
  register-node)
    _sdb-admin_register-node
    ;;
  remove-aggregator)
    _sdb-admin_remove-aggregator
    ;;
  remove-leaf)
    _sdb-admin_remove-leaf
    ;;
  restart-node)
    _sdb-admin_restart-node
    ;;
  restore-backup)
    _sdb-admin_restore-backup
    ;;
  set-license)
    _sdb-admin_set-license
    ;;
  show-aggregators)
    _sdb-admin_show-aggregators
    ;;
  show-cluster)
    _sdb-admin_show-cluster
    ;;
  show-leaves)
    _sdb-admin_show-leaves
    ;;
  show-license)
    _sdb-admin_show-license
    ;;
  snapshot-database)
    _sdb-admin_snapshot-database
    ;;
  start-monitoring)
    _sdb-admin_start-monitoring
    ;;
  start-monitoring-kube)
    _sdb-admin_start-monitoring-kube
    ;;
  start-node)
    _sdb-admin_start-node
    ;;
  state)
    _sdb-admin_state
    ;;
  stop-monitoring)
    _sdb-admin_stop-monitoring
    ;;
  stop-node)
    _sdb-admin_stop-node
    ;;
  summarize-backups)
    _sdb-admin_summarize-backups
    ;;
  sync-ldap)
    _sdb-admin_sync-ldap
    ;;
  unregister-node)
    _sdb-admin_unregister-node
    ;;
  update-config)
    _sdb-admin_update-config
    ;;
  update-node-base-install-dir)
    _sdb-admin_update-node-base-install-dir
    ;;
  validate-backup)
    _sdb-admin_validate-backup
    ;;
  version)
    _sdb-admin_version
    ;;
  esac
}

function _sdb-admin_add-aggregator {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for add-aggregator]' \
    '--host[The cluster-addressable hostname for the aggregator]:' \
    '--memsql-id[The node ID of the node to be added as an aggregator]:' \
    '(-p --password)'{-p,--password}'[The database user'\''s password. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell.
If a password is not specified on the command line, Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password]:' \
    '--port[The cluster-addressable port for the aggregator]:' \
    '--role[The role that an aggregator will be assigned when added. This option identifies whether the added aggregator will be a candidate for Master Aggregator failover. Possible roles are voting_member and follower. The default value is follower.]:' \
    '--skip-validate-env[Skip environment validation]' \
    '--user[The database user]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_add-leaf {
  _arguments \
    '--availability-group[The availability group to assign to the leaf]:' \
    '(-h --help)'{-h,--help}'[Help for add-leaf]' \
    '--host[The cluster-addressable hostname for the leaf node]:' \
    '--memsql-id[The node ID of the node to be added as a leaf node]:' \
    '(-p --password)'{-p,--password}'[The database user'\''s password. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell.
If a password is not specified on the command line, Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password]:' \
    '--port[The cluster-addressable port for the leaf node]:' \
    '--skip-validate-env[Skip environment validation]' \
    '--user[The database user]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_bootstrap-aggregator {
  _arguments \
    '--force[Skip the check for an existing master and bootstrap the node]' \
    '(-h --help)'{-h,--help}'[Help for bootstrap-aggregator]' \
    '--license[The license to apply to the node before bootstrapping]:' \
    '--memsql-id[The node ID of the node to bootstrap as an aggregator node]:' \
    '--skip-feature-flags-enabling[Skip automated enabling feature flags for the SingleStoreDB version 9.1 and above (ADVANCED)]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_change-root-password {
  _arguments \
    '(-a --all)'{-a,--all}'[Change the database root password of all nodes in the cluster]' \
    '--fix-secure-key[Reset the secure key]' \
    '(-h --help)'{-h,--help}'[Help for change-root-password]' \
    '--memsql-id[The node ID of the node on which to change the root password]:' \
    '--password[The new database root password for the node. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_configure-monitoring {
  _arguments \
    '(-p --exporter-password)'{-p,--exporter-password}'[The password for the user that will start the memsql_exporter on the Source cluster. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell]:' \
    '(-P --exporter-port)'{-P,--exporter-port}'[Port where memsql_exporter is run (on the Source cluster)]:' \
    '--exporter-ssl-cert[Path to the certificate the exporter will use for SSL connections. This path must exist on the host where the exporter is running]:' \
    '--exporter-ssl-key[Path to the public-private key pair file the exporter will use for SSL connections. This path must exist on the host where the exporter is running]:' \
    '--exporter-ssl-passphrase[Passphrase for encrypted exporter-ssl-key]:' \
    '--exporter-use-https[Whether to start the exporter in HTTPS mode. Requires --exporter-ssl-cert and --exporter-ssl-key to be set]' \
    '(-u --exporter-user)'{-u,--exporter-user}'[The database user on the Source cluster that will start the memsql_exporter (should have at least SHOW METADATA permission)]:' \
    '(-h --help)'{-h,--help}'[Help for configure-monitoring]' \
    '--stop-exporter[Stop the memsql_exporter process]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_create-backup {
  _arguments \
    '--backup-suffix[Suffix of incremental backup names. The suffix identifies each logical incremental backup and should be the same for the initial and the differential versions of an incremental backup]:' \
    '--backup-type[Type of the backup]:' \
    '(-h --help)'{-h,--help}'[Help for create-backup]' \
    '--include[Backup all databases matching GLOB (e.g. "*", "foo*", "*bar")]:' \
    '--multipart-chunk-size-mb[Multipart chunk size in MB. This option is only applicable for S3-compatible repositories]:' \
    '--no-region[Do not use region-specific endpoints for S3-compatible repositories]' \
    '(-r --repository)'{-r,--repository}'[Path to the repository in the URL format. See https://docs.singlestore.com/toolbox-redir/memsql-backup-repository for examples]:' \
    '*--tags[Comma-separated list of tags to add to the backup]:' \
    '--timeout[Maximum time to wait for backup to be created (e.g., 30s, 10m, 1.5h); defaults to 24 hours]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_create-node {
  _arguments \
    '--aggregator-role[The role that an aggregator will be assigned when added. This option identifies whether the added aggregator will be a candidate for Master Aggregator failover. Possible roles are voting_member and follower. The default value is follower.]:' \
    '--allow-ipv6[Allow the node to use IPv6]' \
    '--auditlogsdir[Absolute path to the auditlogs dir on the target host]:' \
    '--availability-group[Availability group to assign to the leaf node]:' \
    '--base-install-dir[Absolute path to the base install directory on the target host]:' \
    '--bind-address[The bind address]:' \
    '--datadir[Absolute path to the data dir on the target host]:' \
    '--disable-auto-restart[Disable automatic restarting of memsqld on error]' \
    '--force-master[Force-assigns the role of master, even if a master exists]' \
    '(-h --help)'{-h,--help}'[Help for create-node]' \
    '--host[Where to create the node]:' \
    '--license[License to apply to the master node]:' \
    '--memsql-config[Absolute path to the node config file path on the target host]:' \
    '--no-start[Do not start the node]' \
    '(-p --password)'{-p,--password}'[The database user'\''s password. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell.
If a password is not specified on the command line and --no-start is not set, Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password]:' \
    '--plancachedir[Absolute path to the plancache dir on the target host]:' \
    '(-P --port)'{-P,--port}'[The port]:' \
    '--role[Role that a node will be assigned when created. Possible roles are LEAF, AGGREGATOR, and MASTER]:' \
    '--set-configs[Set configuration variables for the node. Only those variables that can be set on startup are permitted. For example: --set-configs http_api=ON,max_connection_threads=200 (ADVANCED)]:' \
    '--skip-feature-flags-enabling[Skip automated enabling feature flags for the SingleStoreDB version 9.1 and above (ADVANCED)]' \
    '--ssl-fips-mode[Whether the node operates in OpenSSL/FIPS mode]:' \
    '--tracelogsdir[Absolute path to the tracelogs dir on the target host]:' \
    '--user[The database user for setting a role]:' \
    '--user-password[The database user'\''s password for setting the role. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_delete-backup {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for delete-backup]' \
    '--no-region[Do not use region-specific endpoints for S3-compatible repositories]' \
    '(-r --repository)'{-r,--repository}'[Path to the repository in the URL format. See https://docs.singlestore.com/toolbox-redir/memsql-backup-repository for examples]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_delete-node {
  _arguments \
    '(-a --all)'{-a,--all}'[Delete all nodes in the cluster]' \
    '(-h --help)'{-h,--help}'[Help for delete-node]' \
    '--memsql-id[The node ID of the node to delete]:' \
    '--skip-remove[Skip removing the leaves and aggregators]' \
    '--stop[Stop each node before deletion]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_describe-node {
  _arguments \
    '(-a --all)'{-a,--all}'[Describe all nodes in the cluster]' \
    '(-h --help)'{-h,--help}'[Help for describe-node]' \
    '--memsql-id[The node ID of the node to describe]:' \
    '--property[Only output the value of this property]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_disable-nodes-autostart {
  _arguments \
    '--all[Disable starting nodes on all hosts in the cluster on startup]' \
    '--force[Ignore unavailable hosts if any]' \
    '(-h --help)'{-h,--help}'[Help for disable-nodes-autostart]' \
    '*--host[Specify the host(s) where nodes need not be started on startup]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_dump {
  _arguments \
    '--databases[Only run for specified databases]:' \
    '--exclude[Exclude the specified objects]:' \
    '(-h --help)'{-h,--help}'[Help for dump]' \
    '--host[The cluster-addressable hostname for the node]:' \
    '--only[Only dump specified objects]:' \
    '--output-path[Write the dump file to this path]:' \
    '(-p --password)'{-p,--password}'[The database user'\''s password. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell.
If a password is not specified on the command line and user is not "root", Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password]:' \
    '--port[The cluster-addressable port for the node]:' \
    '--ssl[Use SSL to connect to SingleStore]' \
    '--ssl-ca[The path to the CA file to use when the SQL user connects to SingleStore via SSL. If this option is not specified, the default CA file will be used]:' \
    '--user[The database user]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_enable-high-availability {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for enable-high-availability]' \
    '--load-balanced[Change the leaf_failover_fanout mode to load_balanced]' \
    '--precheck-only[Check if High Availability can be enabled on the connected cluster]' \
    '--skip-colocate-check[Do not check whether the colocation of a leaf pair is necessary]' \
    '--skip-disk-check[Do not check that each leaf node'\''s host has at least half of its disk space free]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_enable-http-api {
  _arguments \
    '--all-aggregators[Enable the HTTP API on all aggregator nodes in the cluster, including the Master Aggregator]' \
    '(-h --help)'{-h,--help}'[Help for enable-http-api]' \
    '*--node-id[Node IDs for nodes on which to enable the HTTP API]:' \
    '(-p --password)'{-p,--password}'[The database user'\''s password. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell.
	If a password is not specified on the command line and the database user is not '\''root'\'', Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
	If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password]:' \
    '--pool-capacity[Limits the impact of the HTTP server on the database by limiting the maximum number of connections per user]:' \
    '--pool-max-idle[The maximum number of connections in each pool that can be open at a time]:' \
    '(-P --port)'{-P,--port}'[The port to use for the API endpoint]:' \
    '--ssl[To use the HTTPS endpoint, nodes must be configured for SSL and have valid '\''ssl_cert'\'' and '\''ssl_key'\'' values set]' \
    '--user[The database user]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_enable-nodes-autostart {
  _arguments \
    '--all[Start all nodes in the cluster on system startup]' \
    '--create-service-only[Create the '\''memsql.service'\'' file on specified hosts without enabling the service]' \
    '--force[Ignore hosts that are not available and the associated copying errors]' \
    '(-h --help)'{-h,--help}'[Help for enable-nodes-autostart]' \
    '*--host[Specify which host'\''s nodes to restart on system startup]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_enable-systemd-client {
  _arguments \
    '--all[Manage all nodes in the cluster via systemd]' \
    '--force[Ignore hosts that are not available and the associated copying errors]' \
    '(-h --help)'{-h,--help}'[Help for enable-systemd-client]' \
    '*--host[Specify the host(s) on which to manage their nodes via systemd]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_env {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for env]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_help {
  _arguments \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_list-backups {
  _arguments \
    '--after[Select backups created after the specified TIME. TIME should be in the ISO 8601 format or a duration relative to the current time ('\''2006-01-02T15:04:05-0700'\'', '\''2006-01-02'\'', '\''-3h30m'\''). Time zone is optional but recommended. If TIME is specified without the time zone, a local time zone will be used]:' \
    '--all[Select all backups, not compatible with other selection flags]' \
    '--backup-name[Select backup by a name. Can be provided multiple times]:' \
    '--before[Select backups created before the specified TIME. TIME should be in the ISO 8601 format or a duration relative to the current time ('\''2006-01-02T15:04:05-0700'\'', '\''2006-01-02'\'', '\''-3h30m'\''). Time zone is optional but recommended. If TIME is specified without the time zone, a local time zone will be used]:' \
    '--cluster-id[Select backups with the specified cluster id. This flag can be provided multiple times]:' \
    '--cluster-name[Select backups with the specified cluster name. This flag can be provided multiple times]:' \
    '--database[Select backups for the specified database(s). This flag can be provided multiple times]:' \
    '(-h --help)'{-h,--help}'[Help for list-backups]' \
    '(-l --latest)'{-l,--latest}'[Select only the latest backups for each <cluster id>, <database name>]' \
    '--no-cache[Forces reads directly from the repositories, bypassing the cache. The cache will be updated]' \
    '--no-region[Do not use region-specific endpoints for S3-compatible repositories]' \
    '(-q --quiet)'{-q,--quiet}'[Only display backup names]' \
    '(-r --repository)'{-r,--repository}'[Path to the repository in the URL format. See https://docs.singlestore.com/toolbox-redir/memsql-backup-repository for examples]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_list-nodes {
  _arguments \
    '--availability-group[Filter for online leaf nodes in the provided availability group]:' \
    '(-h --help)'{-h,--help}'[Help for list-nodes]' \
    '(-p --process-state)'{-p,--process-state}'[Filter the nodes using this process state]:' \
    '(-q --quiet)'{-q,--quiet}'[Only output nodes with matching node IDs]' \
    '(-r --role)'{-r,--role}'[Filter the nodes using this role]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_optimize {
  _arguments \
    '--bind-to-l3[Bind leaf nodes to L3 cache indices]' \
    '(-h --help)'{-h,--help}'[Help for optimize]' \
    '--memory-percentage[The percentage of memory on each host to use for SingleStore]:' \
    '--no-numa[Do not change NUMA settings on any nodes]' \
    '--no-partition-change[Do not change partitions on leaves]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_put-file {
  _arguments \
    '--all[Copy the file to all hosts in the cluster]' \
    '--force[Ignore unavailable hosts and overwrite target-path files if they exist. Use this flag with caution, as any overwritten file will not be recoverable]' \
    '(-h --help)'{-h,--help}'[Help for put-file]' \
    '*--host[Specify host(s) to upload the file to]:' \
    '(-s --source-path)'{-s,--source-path}'[Specify the file to send]:' \
    '(-t --target-path)'{-t,--target-path}'[Specify the absolute path of the destination, including the filename (e.g. /tmp/file.txt)]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_query {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for query]' \
    '--host[The cluster-addressable hostname for the node]:' \
    '--max-column-width[The maximum width of a column in a query result. The supplied value cannot be less than 60. To disable the limitation, set the value to 0]:' \
    '--memsql-id[The node ID of the node to query]:' \
    '(-p --password)'{-p,--password}'[The database user'\''s password. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell.
If a password is not specified on the command line and user is not "root", Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password]:' \
    '--port[The cluster-addressable port for the node]:' \
    '--row-timeout[Maximum time to wait for each row in the result (e.g., 30s, 10m, 1.5h); defaults to 1 minute]:' \
    '--sql[The SQL query to run]:' \
    '--ssl[Use SSL to connect to SingleStore]' \
    '--ssl-ca[The path to the CA file to use when the SQL user connects to SingleStore via SSL. If this option is not specified, the default CA file will be used]:' \
    '--user[The database user]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_register-node {
  _arguments \
    '--auditlogsdir[Path to the auditlogsdir of the node, if not already specified in the node config file)]:' \
    '--datadir[Path to the datadir of the node, if not already specified in the node config file]:' \
    '--force[Skip safety checks that require the node be online (e.g., if the password is correct). Use this flag to register an offline node]' \
    '(-h --help)'{-h,--help}'[Help for register-node]' \
    '--host[Host of the node to be registered]:' \
    '--memsql-config[Path to the node config file path of the node]:' \
    '(-p --password)'{-p,--password}'[The current database root password for the node. If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell.
If a password is not specified on the command line, Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password]:' \
    '--pid-file[Path to the current pid file of the node, if not already specified in the node config file]:' \
    '--plancachedir[Path to the plancachedir of the node, if not already specified in the node config file]:' \
    '(-P --port)'{-P,--port}'[The node'\''s current port, if not already specified in the node config file]:' \
    '--ssl-fips-mode[Whether the node operates in OpenSSL/FIPS mode]:' \
    '--tracelogsdir[Path to the tracelogsdir of the node, if not already specified in the node config file]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_remove-aggregator {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for remove-aggregator]' \
    '--host[The cluster-addressable hostname for the aggregator]:' \
    '--memsql-id[The memsql-id to remove]:' \
    '--port[The cluster-addressable port for the aggregator]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_remove-leaf {
  _arguments \
    '--force[Disable automatic rebalance]' \
    '(-h --help)'{-h,--help}'[Help for remove-leaf]' \
    '--host[The cluster-addressable hostname for the leaf node]:' \
    '--memsql-id[The node ID of the leaf node to be removed]:' \
    '--port[The cluster-addressable port for the leaf node]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_restart-node {
  _arguments \
    '(-a --all)'{-a,--all}'[Restart all nodes on the host]' \
    '--disable-auto-restart[Disable automatic restart of memsqld on error]' \
    '--force[Skip restarting nodes on unavailable hosts and ignore nodes which do not appear in \`sdb-admin list-nodes\`]' \
    '(-h --help)'{-h,--help}'[Help for restart-node]' \
    '--memsql-id[The node ID of the node]:' \
    '--online[Perform a rolling restart of the cluster. The workload will continue to run during the restart]' \
    '--skip-system-warnings[Skip warnings about system configurations and limits]' \
    '--snapshot[Take a snapshot]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_restore-backup {
  _arguments \
    '--database-prefix[Add the specified prefix to each database name created during restoration]:' \
    '--database-suffix[Add the specified suffix to each database name created during restoration]:' \
    '--full-checksum[Perform a full CRC32C check on each backup before restoring]' \
    '(-h --help)'{-h,--help}'[Help for restore-backup]' \
    '--incr-backup-id[Restore a specific version of incremental backup]:' \
    '--multipart-chunk-size-mb[Multipart chunk size in MB. This option is only applicable for S3-compatible repositories]:' \
    '--no-region[Do not use region-specific endpoints for S3-compatible repositories]' \
    '--rename-to[Rename a database while it is restored. The flag is only applicable when restoring a single backup]:' \
    '(-r --repository)'{-r,--repository}'[Path to the repository in the URL format. See https://docs.singlestore.com/toolbox-redir/memsql-backup-repository for examples]:' \
    '--skip-validation[Skip backup validation before restoring]' \
    '--timeout[The maximum wait time for restoring a backup (e.g., 30s, 10m, 1.5h); defaults to 24 hours]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_set-license {
  _arguments \
    '(-f --file-path)'{-f,--file-path}'[The path to the text file with the license]:' \
    '(-h --help)'{-h,--help}'[Help for set-license]' \
    '--license[The license to be applied]:' \
    '--memsql-id[The node ID of the node on which to set the license]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_show-aggregators {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for show-aggregators]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_show-cluster {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for show-cluster]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_show-leaves {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for show-leaves]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_show-license {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for show-license]' \
    '--memsql-id[The node ID of the node from which to show the license]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_snapshot-database {
  _arguments \
    '(-a --all)'{-a,--all}'[Snapshot all databases in the cluster]' \
    '*--database-names[Take a snapshot of a single database name, or multiple database names separated by a comma]:' \
    '(-h --help)'{-h,--help}'[Help for snapshot-database]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_start-monitoring {
  _arguments \
    '--batch-interval[Time interval between data collections in milliseconds]:' \
    '--collect-event-traces[Collect event traces. Event tracing has to be enabled on the Source cluster]' \
    '--database-name[Monitoring database name]:' \
    '--disable-sample-queries[Disables queries sampling]' \
    '--exporter-host[Host where memsql_exporter is run (on the Source cluster)]:' \
    '--exporter-port[Port where memsql_exporter is run (on the Source cluster)]:' \
    '(-h --help)'{-h,--help}'[Help for start-monitoring]' \
    '--high-cardinality-metrics[Collect high cardinality metrics. It is recommended to set --batch-interval to at least 60000 if high-cardinality-metrics is enabled]' \
    '--monitoring-version[Version of the cluster running monitoring]:' \
    '--password[The database user'\''s password for connecting to SingleStore (on the Metrics cluster). If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell]:' \
    '--purge-frequency[Time between purges of expired monitoring data for a specific Source cluster]:' \
    '--purge-log-retention-period[Period of time to retain purge log entries (ADVANCED)]:' \
    '--retention-period[Period of time to retain monitoring data for a specific Source cluster]:' \
    '--ssl-ca[Path to the CA certificate to use with HTTPS. When specified, pipelines will attempt to connect to the exporter via HTTPS. The certificate must exist on all hosts that contain a leaf node]:' \
    '--ssl-capath[Path to the directory that contains the CA certificates to use with HTTPS. When specified, pipelines will attempt to connect to the exporter on the Source cluster via HTTPS. The directory must exist on all hosts that contain a leaf node]:' \
    '--user[The database user for connecting to SingleStore (on the Metrics cluster)]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_start-monitoring-kube {
  _arguments \
    '--batch-interval[Time interval between data collections in milliseconds]:' \
    '--cluster-name[The specific cluster name of the Metrics cluster]:' \
    '--collect-event-traces[Collect event traces. Event tracing has to be enabled on the Source cluster]' \
    '--config-file[The kubeconfig file path. Leave blank if the path is stored in the KUBECONFIG env variable or in the ~/.kube/config file (ADVANCED)]:' \
    '--container[The name of the container in which to run the command. If not specified, the default container will be used (ADVANCED)]:' \
    '--context[The specific context to switch to when a kubeconfig has multiple contexts (ADVANCED)]:' \
    '--database-name[Monitoring database name]:' \
    '--disable-sample-queries[Disables queries sampling]' \
    '--exporter-host[Host where memsql_exporter is run (on the Source cluster)]:' \
    '--exporter-port[Port where memsql_exporter is run (on the Source cluster)]:' \
    '(-h --help)'{-h,--help}'[Help for start-monitoring-kube]' \
    '--high-cardinality-metrics[Collect high cardinality metrics. It is recommended to set --batch-interval to at least 60000 if high-cardinality-metrics is enabled]' \
    '--monitoring-version[Version of the cluster running monitoring]:' \
    '--namespace[The Kubernetes namespace containing the Master Aggregator node of the Metrics cluster]:' \
    '--password[The database user'\''s password for connecting to SingleStore (on the Metrics cluster). If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell]:' \
    '--purge-frequency[Time between purges of expired monitoring data for a specific Source cluster]:' \
    '--purge-log-retention-period[Period of time to retain purge log entries (ADVANCED)]:' \
    '--retention-period[Period of time to retain monitoring data for a specific Source cluster]:' \
    '--ssl-ca[Path to the CA certificate to use with HTTPS. When specified, pipelines will attempt to connect to the exporter via HTTPS. The certificate must exist on all hosts that contain a leaf node]:' \
    '--ssl-capath[Path to the directory that contains the CA certificates to use with HTTPS. When specified, pipelines will attempt to connect to the exporter on the Source cluster via HTTPS. The directory must exist on all hosts that contain a leaf node]:' \
    '--user[The database user for connecting to SingleStore (on the Metrics cluster)]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_start-node {
  _arguments \
    '(-a --all)'{-a,--all}'[Start all nodes in the cluster]' \
    '--disable-auto-restart[Disable automatic restart of memsqld on error]' \
    '--force[Skip restarting nodes on unavailable hosts]' \
    '(-h --help)'{-h,--help}'[Help for start-node]' \
    '--memsql-id[The node ID of the node to start]:' \
    '(-r --role)'{-r,--role}'[Filter the nodes using this role]:' \
    '--skip-system-warnings[Skip warnings about system configurations and limits]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_state {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for state]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_stop-monitoring {
  _arguments \
    '--database-name[Monitoring database name]:' \
    '--exporter-host[Host where memsql_exporter is run (on the Source cluster)]:' \
    '--exporter-port[Port where memsql_exporter is run (on the Source cluster)]:' \
    '(-h --help)'{-h,--help}'[Help for stop-monitoring]' \
    '--password[The database user'\''s password for connecting to SingleStore (on the Metrics cluster). If a password is specified on the command line, it must not contain an unescaped '\''$'\'' character as it will be replaced by the shell]:' \
    '--user[The database user for connecting to SingleStore (on the Metrics cluster)]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_stop-node {
  _arguments \
    '(-a --all)'{-a,--all}'[Stop all nodes in the cluster]' \
    '--force[Skip stopping nodes on unavailable hosts and ignore those nodes that do not appear in \`sdb-admin list-nodes\`]' \
    '(-h --help)'{-h,--help}'[Help for stop-node]' \
    '--memsql-id[The node ID of the node to stop]:' \
    '(-r --role)'{-r,--role}'[Filter the nodes using this role]:' \
    '--snapshot[Take a snapshot]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_summarize-backups {
  _arguments \
    '--after[Select backups created after the specified TIME. TIME should be in the ISO 8601 format or a duration relative to the current time ('\''2006-01-02T15:04:05-0700'\'', '\''2006-01-02'\'', '\''-3h30m'\''). Time zone is optional but recommended. If TIME is specified without the time zone, a local time zone will be used]:' \
    '--before[Select backups created before the specified TIME. TIME should be in the ISO 8601 format or a duration relative to the current time ('\''2006-01-02T15:04:05-0700'\'', '\''2006-01-02'\'', '\''-3h30m'\''). Time zone is optional but recommended. If TIME is specified without the time zone, a local time zone will be used]:' \
    '--cluster-id[Select backups with the specified cluster id. This flag can be provided multiple times]:' \
    '--cluster-name[Select backups with the specified cluster name. This flag can be provided multiple times]:' \
    '--database[Select backups for the specified database(s). This flag can be provided multiple times]:' \
    '(-h --help)'{-h,--help}'[Help for summarize-backups]' \
    '--no-cache[Forces reads directly from the repositories, bypassing the cache. The cache will be updated]' \
    '--no-region[Do not use region-specific endpoints for S3-compatible repositories]' \
    '(-r --repository)'{-r,--repository}'[Path to the repository in the URL format. See https://docs.singlestore.com/toolbox-redir/memsql-backup-repository for examples]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_sync-ldap {
  _arguments \
    '--auth-method[Authentication method for new SingleStore users. This value will be used if a user'\''s group does not have any additional configs specified explicitly for the group with the --groups option]:' \
    '--bind-credentials[Credentials of the LDAP user]:' \
    '--bind-user[The user name DN to log into LDAP (e.g. cn=admin,dc=example,dc=org)]:' \
    '--ca-paths[The path(s) to the TLS root CA file. The default root certificate(s) will be used if no value(s) are provided]:' \
    '--config-file[The path to the configuration file (e.g. ../ldap-sync-config.yaml)]:' \
    '--dial-with-tls-config[Dial with TLS config]' \
    '--drop-unmanaged-memsql-users[Drop users created in SingleStore but no longer found in LDAP]' \
    '*--exclude-ldap-users[LDAP user name(s) to exclude from syncing, separated by commas (e.g. jdoe,jsmith)]:' \
    '--exclude-ldap-users-file[The filename, including path, that contains the LDAP usernames to exclude from syncing, one per line (e.g. ../exclude-ldap-users.txt)]:' \
    '*--exclude-ldap-users-to-lower[LDAP user name(s) to exclude from syncing to lowercase, separated by commas (e.g. JDoe,JSmith)]:' \
    '--failed-login-attempts-limit[Maximum failed login attempts for new SingleStore users. This value will be used if a user'\''s group does not have any additional configs specified explicitly for the group with the --groups option]:' \
    '--group-attribute[The field name for an LDAP group name (ADVANCED)]:' \
    '--group-members-attribute[The field name for an LDAP group'\''s users (ADVANCED)]:' \
    '--group-object-class[The objectClass name to match against an LDAP group (ADVANCED)]:' \
    '--groups[User group name(s) to sync, separated by commas. Additional config options (e.g., resource-pool, auth-method) can be provided in square brackets. (e.g. Medical\[resource-pool=high-performance,auth-method=PAM\],Engineering)]:' \
    '(-h --help)'{-h,--help}'[Help for sync-ldap]' \
    '--host[The cluster-addressable hostname for the node]:' \
    '--insecure-skip-verify[Disable TLS certificate verification (may be used with self-signed certificates for testing purposes)]' \
    '--kerberos-realm[Service principal name domain for Kerberos (ADVANCED)]:' \
    '--ldap-users-to-lower[Sync LDAP usernames to lowercase SQL usernames]' \
    '--pam-auth-service[Service name for PAM. This value will be used if a user'\''s group does not have additional configs specified explicitly for the group with the --groups option]:' \
    '--password[SQL password for connecting to SingleStore]:' \
    '--password-lock-time[Failed login lockout time in seconds for new SingleStore users. This value will be used if a user'\''s group does not have any additional configs specified explicitly for the group with the --groups option]:' \
    '--port[The cluster-addressable port for the node]:' \
    '--query-filter[LDAP filter to narrow search results]:' \
    '--require-ssl[Enable the \`REQUIRE SSL\` for the synced users. This value will be used if a user'\''s group does not have any additional configs specified explicitly for the group with the --groups option]' \
    '--resource-pool[Resource pool name for new SingleStore users. This value will be used if a user'\''s group does not have any additional configs specified explicitly for the group with the --groups option]:' \
    '--saml-user-domain-attribute[The field name for an LDAP user'\''s SAML domain suffix. Only applies to the SAML authentication method (ADVANCED)]:' \
    '--schema[LDAP schema which defines the structure of user and group entries]:' \
    '--search-base[Search base path for the LDAP search object (e.g. dc=example,dc=org)]:' \
    '--show-detail[Show syncing details on users and groups]' \
    '--ssl[Allow the SQL user to connect to SingleStore via SSL]' \
    '--ssl-ca[The path to the CA file to use when the SQL user connects to SingleStore via SSL. If this option is not specified, the default CA file will be used]:' \
    '--start-tls[Issue StartTLS (Transport Layer Security) extended operation]' \
    '*--uris[URI(s) of the LDAP server(s), separated by commas (e.g. ldap://172.17.0.2)]:' \
    '--user[SQL user for connecting to SingleStore]:' \
    '--user-attribute[The field name for an LDAP username (ADVANCED)]:' \
    '--user-member-of-attribute[The field name for an LDAP user'\''s groups (ADVANCED)]:' \
    '--user-object-class[The objectClass name to match against an LDAP user (ADVANCED)]:' \
    '--user-principal-name-attribute[The field name for an LDAP user'\''s Kerberos/SAML principal name. Only applies to Kerberos and SAML authentication methods (ADVANCED)]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_unregister-node {
  _arguments \
    '(-a --all)'{-a,--all}'[Unregister all nodes in the cluster]' \
    '--all-on-host[Unregister all nodes on a specific host]:' \
    '(-h --help)'{-h,--help}'[Help for unregister-node]' \
    '--memsql-id[The node ID of the node to unregister]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_update-config {
  _arguments \
    '(-a --all)'{-a,--all}'[Update all nodes in the cluster]' \
    '(-h --help)'{-h,--help}'[Help for update-config]' \
    '--key[The configuration key to update]:' \
    '--memsql-id[The node ID of the node on which to update the configuration]:' \
    '--reset[Reset the key to the default value (formerly --delete)]' \
    '--role[Update only nodes with the given role. Possible roles are LEAF, AGGREGATOR, and MASTER]:' \
    '--set-global[Execute the associated SET GLOBAL statement]' \
    '--value[The value to set for the key]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_update-node-base-install-dir {
  _arguments \
    '--disable-auto-restart[Disable automatic restart of memsqld on error during node startup]' \
    '--force[Overwrite the folder contents if the target base directory exists]' \
    '(-h --help)'{-h,--help}'[Help for update-node-base-install-dir]' \
    '--memsql-id[The ID of the node to update the base directory]:' \
    '--rename-to[The name for the base directory for the selected node]:' \
    '--target-path[Specify the absolute path to place the node base directory. Do not include the '\''basedir'\'' name at the end of the path]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_validate-backup {
  _arguments \
    '--full-checksum[Do a full CRC32C check on each backup]' \
    '(-h --help)'{-h,--help}'[Help for validate-backup]' \
    '--incr-backup-id[Validate a specific version of incremental backup]:' \
    '--no-region[Do not use region-specific endpoints for S3-compatible repositories]' \
    '(-r --repository)'{-r,--repository}'[Path to the repository in the URL format. See https://docs.singlestore.com/toolbox-redir/memsql-backup-repository for examples]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-admin_version {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for version]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-control-persist[Enable SSH ControlPersist and set it to the specified duration in seconds]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

