cloud-sql-postgres-admin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUsage
使用方法
All scripts can be executed using Node.js. Replace and with actual values.
<param_name><param_value>Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.
所有脚本均可通过Node.js执行。将和替换为实际值。
<param_name><param_value>Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'注意:脚本会自动从各种.env文件加载环境变量。除非因缺少环境变量导致技能执行失败,否则不要要求用户设置变量。
Scripts
脚本
clone_instance
clone_instance
Clone an existing Cloud SQL instance into a new instance. The clone can be a direct copy of the source instance, or a point-in-time-recovery (PITR) clone from a specific timestamp. The call returns a Cloud SQL Operation object. Call wait_for_operation tool after this, make sure to use multiplier as 4 to poll the opertation status till it is marked DONE.
将现有Cloud SQL实例克隆到新实例中。克隆可以是源实例的直接副本,也可以是从特定时间点进行的时间点恢复(PITR)克隆。调用将返回一个Cloud SQL Operation对象。在此之后调用wait_for_operation工具,请确保使用乘数4来轮询操作状态,直到其标记为DONE。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| sourceInstanceName | string | The name of the instance to be cloned. | Yes | |
| destinationInstanceName | string | The name of the new instance that will be created by cloning the source instance. | Yes | |
| pointInTime | string | The timestamp in RFC 3339 format to which the source instance should be cloned. | No | |
| preferredZone | string | The preferred zone for the new instance. | No | |
| preferredSecondaryZone | string | The preferred secondary zone for the new instance. | No |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 | |
| sourceInstanceName | string | 要克隆的实例名称。 | 是 | |
| destinationInstanceName | string | 通过克隆源实例创建的新实例名称。 | 是 | |
| pointInTime | string | 要克隆到的源实例时间戳,格式为RFC 3339。 | 否 | |
| preferredZone | string | 新实例的首选可用区。 | 否 | |
| preferredSecondaryZone | string | 新实例的首选辅助可用区。 | 否 |
create_database
create_database
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| instance | string | The ID of the instance where the database will be created. | Yes | |
| name | string | The name for the new database. Must be unique within the instance. | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 | |
| instance | string | 要创建数据库的实例ID。 | 是 | |
| name | string | 新数据库的名称。必须在实例内唯一。 | 是 |
create_instance
create_instance
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| name | string | The name of the instance | Yes | |
| databaseVersion | string | The database version for Postgres. If not specified, defaults to the latest available version (e.g., POSTGRES_17). | No | |
| rootPassword | string | The root password for the instance | Yes | |
| editionPreset | string | The edition of the instance. Can be | No | |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 | |
| name | string | 实例名称 | 是 | |
| databaseVersion | string | Postgres的数据库版本。如果未指定,默认使用最新可用版本(例如POSTGRES_17)。 | 否 | |
| rootPassword | string | 实例的root密码 | 是 | |
| editionPreset | string | 实例版本。可以是 | 否 | |
create_user
create_user
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| instance | string | The ID of the instance where the user will be created. | Yes | |
| name | string | The name for the new user. Must be unique within the instance. | Yes | |
| password | string | A secure password for the new user. Not required for IAM users. | No | |
| iamUser | boolean | Set to true to create a Cloud IAM user. | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 | |
| instance | string | 要创建用户的实例ID。 | 是 | |
| name | string | 新用户的名称。必须在实例内唯一。 | 是 | |
| password | string | 新用户的安全密码。IAM用户不需要此参数。 | 否 | |
| iamUser | boolean | 设置为true以创建Cloud IAM用户。 | 是 |
get_instance
get_instance
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| projectId | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| instanceId | string | The instance ID | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| projectId | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 | |
| instanceId | string | 实例ID | 是 |
list_databases
list_databases
Lists all databases for a Cloud SQL instance.
列出Cloud SQL实例的所有数据库。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| instance | string | The instance ID | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 | |
| instance | string | 实例ID | 是 |
list_instances
list_instances
Lists all type of Cloud SQL instances for a project.
列出项目中所有类型的Cloud SQL实例。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 |
wait_for_operation
wait_for_operation
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | |
| operation | string | The operation ID | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。此参数已预先配置;除非用户明确提供不同的ID,否则不要询问。 | 否 | |
| operation | string | 操作ID | 是 |