charm-mysql-innodb-cluster/src/actions.yaml

127 lines
4.8 KiB
YAML

mysqldump:
description: |
MySQL dump of databases. Action will return mysqldump-file location of the
requested backup in the results. If the databases parameter is unset all
databases will be dumped. If the databases parameter is set only the
databases specified will be dumped.
params:
basedir:
type: string
default: "/var/backups/mysql"
description: The base directory for backups
databases:
description: |
Comma delimited database names to dump. If left unset, all databases
will be dumped.
gtid-purged-mode:
type: string
default: "COMMENTED"
description: |
This option sets the GTID_PURGED variable when dumping the database. Valid values
for this setting are: AUTO, ON, OFF or COMMENTED.
If the mysql dump is meant to be restored on a different cluster, this option must
be set to OFF. MySQL InnoDB cluster group replication takes care of the GTID. Overwriting
if during the restore, will cause the secondary units to fail during replication and drop
out of the cluster.
restore-mysqldump:
description: |
Restore a MySQL dump of database(s).
WARNING This is a desctructive action. It may overwrite existing database(s) data.
params:
dump-file:
type: string
description: Path to the mysqldump file.
cluster-status:
description: |
JSON dump of the cluster schema and status. This action can be used to
determine the RW and RO instances.
params:
extended:
type: integer
default: 0
description: |
Level of information to report back, valid values between 0 and 3 inclusive
reboot-cluster-from-complete-outage:
description: |
In the case of a complete outage, reboot the cluster from this instance's
GTID superset.
cluster-rescan:
description: |
Clean up cluster metadata by rescanning the cluster.
See https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-working-with-cluster.html#rescan-cluster
rejoin-instance:
params:
address:
type: string
description: Address of the instance to rejoin to the cluster
required:
- address
description: |
Rejoin an instance to the cluster. *Note* This action must be run on an
instance that is a functioning member of the cluster. For example, after a
complete outage the unit which ran reboot-cluster-from-complete-outage.
remove-instance:
params:
address:
type: string
description: Address of the instance to be removed from the cluster
force:
type: boolean
default: False
description: Remove the instance even if it is unreachable.
required:
- address
description: |
Remove an instance from the cluster. *Note* This action must be run on an
instance that is a functioning member of the cluster preferrably the the
juju leader to guarantee charm related flags are cleared.
add-instance:
params:
address:
type: string
description: Address of the instance to add to the cluster
required:
- address
description: |
Configure and add an instance to the cluster. *Note* This action must be
run on an instance that is a functioning member of the cluster.
set-cluster-option:
params:
key:
type: string
description: Option name
value:
type: string
description: Option value
description: |
Set an option on the cluster.
update-unit-acls:
description: |
This action should only be needed if a unit was added to the cluster on a
new subnet. In this case *group_replication_ip_allowlist* need updating to
include the subnet. Run *add-instance* to add in the new unit once this
action succesfully completes.
WARNING When this action is run, group replication is stopped, the acls
updated and the group replication is started again. Group replication
should be running after this action has completed.
rotate-service-user-password:
description: |
Rotate the specified mysql user's password. The current password is
replaced with a randomly generated password. The password is changed on the
relation to the user's units. This may result in a control plane outage for
the duration of the password changing process.
params:
service-user:
type: string
description: |
The username of the mysql service as specified in
list-service-usernames. Do NOT use this to change keystone service
user passwords; the keystone charm has an action to change services
related to keystone.
list-service-usernames:
description: |
List the usernames of the passwords that have been provided on the
shared-db and router-db relations. The service username passed to
'rotate-service-user-password' needs to be on this list.