GoogleCloudAPIStorage#
- class phalanx.storage.google_cloud_api.GoogleCloudAPIStorage(region, project, labels=None)#
Bases:
objectRun commands against the Google Cloud API in a region and project.
Anything that uses this should assume all authentication has already been done and that the Google Cloud Python SDK can find whatever it needs to send authenticated requests.
If you’re running locally,
gcloud auth application-default loginshould work.- Parameters:
Methods Summary
create_backup(backup_plan)Create a GKE backup from the given backup plan.
create_backup_plan(source_cluster)Create a backup plan to backup everything in source_cluster.
create_pvc_restore(restore_plan, backup)Create a PVC-only restore for a GKE cluster.
create_restore_plan(backup_plan, ...)Create a restore plan.
delete_backup(backup)Delete a backup, including all associated volume resources.
delete_backup_plan(backup_plan)Delete a backup plan.
delete_restore(restore)Delete a restore and all of its associated VolumeRestores.
delete_restore_plan(restore_plan)Delete a restore plan.
get_cluster(cluster)Get details about a GKE cluster.
get_firewall_rule(name)Get information about a Google Cloud firewall rule.
list_backup_plans(filter_exp)Get backup plans with a specific label value.
list_backups(backup_plan, filter_exp)Get backups with from a backup plan, filtered by filter_exp.
list_restore_plans(filter_exp)Get restore plans with a specific label value.
list_restores(restore_plan, filter_exp)Get restores from a specific restore plan, filtered with filter_exp.
List all of the provisioned static IP addresses.
wait_for_backup(backup_name[, interval, ...])Wait for a GKE backup to complete.
wait_for_restore(restore_name[, interval, ...])Wait for a GKE restore to complete.
Methods Documentation
- create_backup(backup_plan)#
Create a GKE backup from the given backup plan.
- create_backup_plan(source_cluster)#
Create a backup plan to backup everything in source_cluster.
Volume data for PVs attached to PVCs is backed up.
- create_pvc_restore(restore_plan, backup)#
Create a PVC-only restore for a GKE cluster.
This will restore PVCs, the data from their backing PVs, and StorageClasses.
- create_restore_plan(backup_plan, destination_cluster)#
Create a restore plan.
Volume data for PVs attached to PVCs is backed up.
- delete_backup(backup)#
Delete a backup, including all associated volume resources.
- delete_backup_plan(backup_plan)#
Delete a backup plan.
If the backup plan still has associated backups, then it will only be deactivated.
- delete_restore(restore)#
Delete a restore and all of its associated VolumeRestores.
- delete_restore_plan(restore_plan)#
Delete a restore plan.
If the restore plan still has associated restores, then it will only be deactivated.
- get_cluster(cluster)#
Get details about a GKE cluster.
- get_firewall_rule(name)#
Get information about a Google Cloud firewall rule.
- list_backup_plans(filter_exp)#
Get backup plans with a specific label value.
- Parameters:
filter_exp (
str) –A filter expression to list only specific resources. More information in the docs:
https://docs.cloud.google.com/sdk/gcloud/reference/topic/filters
- Return type:
- list_backups(backup_plan, filter_exp)#
Get backups with from a backup plan, filtered by filter_exp.
- Parameters:
backup_plan (
str) – The fully-qualified name of the backup plan that took the backups.filter_exp (
str) –A filter expression to list only specific resources. More information in the docs:
https://docs.cloud.google.com/sdk/gcloud/reference/topic/filters
- Return type:
- list_restore_plans(filter_exp)#
Get restore plans with a specific label value.
- Parameters:
filter_exp (
str) –A filter expression to list only specific resources. More information in the docs:
https://docs.cloud.google.com/sdk/gcloud/reference/topic/filters
- Return type:
- list_restores(restore_plan, filter_exp)#
Get restores from a specific restore plan, filtered with filter_exp.
- Parameters:
restore_plan (
str) – The fully-qualified name of the restore plan that made the restore.filter_exp (
str) –A filter expression to list only specific resources. More information in the docs:
https://docs.cloud.google.com/sdk/gcloud/reference/topic/filters
- Return type:
- list_static_ip_addresses()#
List all of the provisioned static IP addresses.
- wait_for_backup(backup_name, interval=datetime.timedelta(seconds=5), attempts=720)#
Wait for a GKE backup to complete.
- Parameters:
- Raises:
GoogleCloudGKEBackupFailedError – If there was an error creating the backup.
RetryerTimeoutError – If the backup has not completed after the specified number of attempts.
- Return type:
- wait_for_restore(restore_name, interval=datetime.timedelta(seconds=5), attempts=720)#
Wait for a GKE restore to complete.
- Parameters:
- Raises:
GoogleCloudGKERestoreFailedError – If there was an error creating the restore.
RetryerTimeoutError – If the restore has not completed after the specified number of attempts.
- Return type: