alloydb-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
脚本
create_cluster
create_cluster
Creates a new AlloyDB cluster. This is a long-running operation, but the API call returns quickly. This will return operation id to be used by get operations tool. Take all parameters from user in one go.
创建一个新的AlloyDB集群。这是一个长时间运行的操作,但API调用会快速返回。它将返回操作ID,供查询操作工具使用。一次性获取用户提供的所有参数。
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 | |
| location | string | The location to create the cluster in. The default value is us-central1. If quota is exhausted then use other regions. | No | |
| cluster | string | A unique ID for the AlloyDB cluster. | Yes | |
| password | string | A secure password for the initial user. | Yes | |
| network | string | The name of the VPC network to connect the cluster to (e.g., 'default'). | No | |
| user | string | The name for the initial superuser. Defaults to 'postgres' if not provided. | No |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 创建集群的位置。默认值为us-central1。如果该区域配额用尽,则使用其他区域。 | 否 | |
| cluster | string | AlloyDB集群的唯一ID。 | 是 | |
| password | string | 初始用户的安全密码。 | 是 | |
| network | string | 连接集群的VPC网络名称(例如:'default')。 | 否 | |
| user | string | 初始超级用户的名称。如果未提供,默认值为'postgres'。 | 否 |
create_instance
create_instance
Creates a new AlloyDB instance (PRIMARY or READ_POOL) within a cluster. This is a long-running operation. This will return operation id to be used by get operations tool. Take all parameters from user in one go.
在集群内创建一个新的AlloyDB实例(PRIMARY或READ_POOL)。这是一个长时间运行的操作。它将返回操作ID,供查询操作工具使用。一次性获取用户提供的所有参数。
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 | |
| location | string | The location of the cluster (e.g., 'us-central1'). | Yes | |
| cluster | string | The ID of the cluster to create the instance in. | Yes | |
| instance | string | A unique ID for the new AlloyDB instance. | Yes | |
| instanceType | string | The type of instance to create. Valid values are: PRIMARY and READ_POOL. Default is PRIMARY | No | |
| displayName | string | An optional, user-friendly name for the instance. | No | |
| nodeCount | integer | The number of nodes in the read pool. Required only if instanceType is READ_POOL. Default is 1. | No | |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 集群所在的位置(例如:'us-central1')。 | 是 | |
| cluster | string | 要在其中创建实例的集群ID。 | 是 | |
| instance | string | 新AlloyDB实例的唯一ID。 | 是 | |
| instanceType | string | 要创建的实例类型。有效值为:PRIMARY和READ_POOL。默认值为PRIMARY | 否 | |
| displayName | string | 实例的可选友好名称。 | 否 | |
| nodeCount | integer | 只读池中的节点数量。仅当instanceType为READ_POOL时必填。默认值为1。 | 否 | |
database_overview
database_overview
Fetches the current state of the PostgreSQL server, returning the version, whether it's a replica, uptime duration, maximum connection limit, number of current connections, number of active connections, and the percentage of connections in use.
获取PostgreSQL服务器的当前状态,返回版本信息、是否为副本、运行时长、最大连接限制、当前连接数、活跃连接数以及连接使用率百分比。
get_cluster
get_cluster
Retrieves details about a specific AlloyDB cluster.
检索特定AlloyDB集群的详细信息。
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 | |
| location | string | The location of the cluster (e.g., 'us-central1'). | Yes | |
| cluster | string | The ID of the cluster. | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 集群所在的位置(例如:'us-central1')。 | 是 | |
| cluster | string | 集群的ID。 | 是 |
get_instance
get_instance
Retrieves details about a specific AlloyDB instance.
检索特定AlloyDB实例的详细信息。
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 | |
| location | string | The location of the instance (e.g., 'us-central1'). | Yes | |
| cluster | string | The ID of the cluster. | Yes | |
| instance | string | The ID of the instance. | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 实例所在的位置(例如:'us-central1')。 | 是 | |
| cluster | string | 集群的ID。 | 是 | |
| instance | string | 实例的ID。 | 是 |
list_clusters
list_clusters
Lists all AlloyDB clusters in a given project and location.
列出指定项目和位置下的所有AlloyDB集群。
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 | |
| location | string | Optional: The location to list clusters in (e.g., 'us-central1'). Use '-' to list clusters across all locations.(Default: '-') | No | |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 可选:要列出集群的位置(例如:'us-central1')。使用'-'可列出所有位置的集群。(默认值:'-') | 否 | |
list_instances
list_instances
Lists all AlloyDB instances in a given project, location and cluster.
列出指定项目、位置和集群下的所有AlloyDB实例。
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 | |
| location | string | Optional: The location of the cluster (e.g., 'us-central1'). Use '-' to get results for all regions.(Default: '-') | No | |
| cluster | string | Optional: The ID of the cluster to list instances from. Use '-' to get results for all clusters.(Default: '-') | No | |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 可选:集群所在的位置(例如:'us-central1')。使用'-'可获取所有区域的结果。(默认值:'-') | 否 | |
| cluster | string | 可选:要列出实例的集群ID。使用'-'可获取所有集群的结果。(默认值:'-') | 否 | |
wait_for_operation
wait_for_operation
This will poll on operations API until the operation is done. For checking operation status we need projectId, locationID and operationId. Once instance is created give follow up steps on how to use the variables to bring data plane MCP server up in local and remote setup.
该脚本会轮询操作API,直到操作完成。检查操作状态需要projectId、locationID和operationId。实例创建完成后,提供后续步骤,说明如何使用这些变量在本地和远程环境中启动数据平面MCP服务器。
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 | |
| location | string | The location ID | Yes | |
| operation | string | The operation ID | Yes |
| 名称 | 类型 | 描述 | 必填 | 默认值 |
|---|---|---|---|---|
| project | string | GCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。 | 否 | |
| location | string | 位置ID | 是 | |
| operation | string | 操作ID | 是 |