mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-02-02 19:24:59 -05:00
## Description This pull request adds a new tool, cloud-sql-restore-backup, which enables restoring a backup onto a Cloud SQL instance from the toolbox using the Cloud SQL Admin API. The tool supports restoring standard, project level, and BackupDR backups. Tested: <img width="3758" height="532" alt="image" src="https://github.com/user-attachments/assets/d1d61af7-d96e-417c-898c-65b876de4c5e" /> ## PR Checklist > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [x] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) - [x] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #2170 Co-authored-by: Averi Kitsch <akitsch@google.com>
69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
# Copyright 2025 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
sources:
|
|
cloud-sql-admin-source:
|
|
kind: cloud-sql-admin
|
|
defaultProject: ${CLOUD_SQL_POSTGRES_PROJECT:}
|
|
|
|
tools:
|
|
create_instance:
|
|
kind: cloud-sql-postgres-create-instance
|
|
source: cloud-sql-admin-source
|
|
get_instance:
|
|
kind: cloud-sql-get-instance
|
|
source: cloud-sql-admin-source
|
|
list_instances:
|
|
kind: cloud-sql-list-instances
|
|
source: cloud-sql-admin-source
|
|
create_database:
|
|
kind: cloud-sql-create-database
|
|
source: cloud-sql-admin-source
|
|
list_databases:
|
|
kind: cloud-sql-list-databases
|
|
source: cloud-sql-admin-source
|
|
create_user:
|
|
kind: cloud-sql-create-users
|
|
source: cloud-sql-admin-source
|
|
wait_for_operation:
|
|
kind: cloud-sql-wait-for-operation
|
|
source: cloud-sql-admin-source
|
|
multiplier: 4
|
|
clone_instance:
|
|
kind: cloud-sql-clone-instance
|
|
source: cloud-sql-admin-source
|
|
postgres_upgrade_precheck:
|
|
kind: postgres-upgrade-precheck
|
|
source: cloud-sql-admin-source
|
|
create_backup:
|
|
kind: cloud-sql-create-backup
|
|
source: cloud-sql-admin-source
|
|
restore_backup:
|
|
kind: cloud-sql-restore-backup
|
|
source: cloud-sql-admin-source
|
|
|
|
toolsets:
|
|
cloud_sql_postgres_admin_tools:
|
|
- create_instance
|
|
- get_instance
|
|
- list_instances
|
|
- create_database
|
|
- list_databases
|
|
- create_user
|
|
- wait_for_operation
|
|
- postgres_upgrade_precheck
|
|
- clone_instance
|
|
- create_backup
|
|
- restore_backup
|