alloydb-postgres-admin

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Usage

使用方法

All scripts can be executed using Node.js. Replace
<param_name>
and
<param_value>
with actual values.
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

参数

NameTypeDescriptionRequiredDefault
projectstringThe GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.No
locationstringThe location to create the cluster in. The default value is us-central1. If quota is exhausted then use other regions.No
us-central1
clusterstringA unique ID for the AlloyDB cluster.Yes
passwordstringA secure password for the initial user.Yes
networkstringThe name of the VPC network to connect the cluster to (e.g., 'default').No
default
userstringThe name for the initial superuser. Defaults to 'postgres' if not provided.No

名称类型描述必填默认值
projectstringGCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。
locationstring创建集群的位置。默认值为us-central1。如果该区域配额用尽,则使用其他区域。
us-central1
clusterstringAlloyDB集群的唯一ID。
passwordstring初始用户的安全密码。
networkstring连接集群的VPC网络名称(例如:'default')。
default
userstring初始超级用户的名称。如果未提供,默认值为'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

参数

NameTypeDescriptionRequiredDefault
projectstringThe GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.No
locationstringThe location of the cluster (e.g., 'us-central1').Yes
clusterstringThe ID of the cluster to create the instance in.Yes
instancestringA unique ID for the new AlloyDB instance.Yes
instanceTypestringThe type of instance to create. Valid values are: PRIMARY and READ_POOL. Default is PRIMARYNo
PRIMARY
displayNamestringAn optional, user-friendly name for the instance.No
nodeCountintegerThe number of nodes in the read pool. Required only if instanceType is READ_POOL. Default is 1.No
1

名称类型描述必填默认值
projectstringGCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。
locationstring集群所在的位置(例如:'us-central1')。
clusterstring要在其中创建实例的集群ID。
instancestring新AlloyDB实例的唯一ID。
instanceTypestring要创建的实例类型。有效值为:PRIMARY和READ_POOL。默认值为PRIMARY
PRIMARY
displayNamestring实例的可选友好名称。
nodeCountinteger只读池中的节点数量。仅当instanceType为READ_POOL时必填。默认值为1。
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

参数

NameTypeDescriptionRequiredDefault
projectstringThe GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.No
locationstringThe location of the cluster (e.g., 'us-central1').Yes
clusterstringThe ID of the cluster.Yes

名称类型描述必填默认值
projectstringGCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。
locationstring集群所在的位置(例如:'us-central1')。
clusterstring集群的ID。

get_instance

get_instance

Retrieves details about a specific AlloyDB instance.
检索特定AlloyDB实例的详细信息。

Parameters

参数

NameTypeDescriptionRequiredDefault
projectstringThe GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.No
locationstringThe location of the instance (e.g., 'us-central1').Yes
clusterstringThe ID of the cluster.Yes
instancestringThe ID of the instance.Yes

名称类型描述必填默认值
projectstringGCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。
locationstring实例所在的位置(例如:'us-central1')。
clusterstring集群的ID。
instancestring实例的ID。

list_clusters

list_clusters

Lists all AlloyDB clusters in a given project and location.
列出指定项目和位置下的所有AlloyDB集群。

Parameters

参数

NameTypeDescriptionRequiredDefault
projectstringThe GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.No
locationstringOptional: The location to list clusters in (e.g., 'us-central1'). Use '-' to list clusters across all locations.(Default: '-')No
-

名称类型描述必填默认值
projectstringGCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。
locationstring可选:要列出集群的位置(例如:'us-central1')。使用'-'可列出所有位置的集群。(默认值:'-')
-

list_instances

list_instances

Lists all AlloyDB instances in a given project, location and cluster.
列出指定项目、位置和集群下的所有AlloyDB实例。

Parameters

参数

NameTypeDescriptionRequiredDefault
projectstringThe GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.No
locationstringOptional: The location of the cluster (e.g., 'us-central1'). Use '-' to get results for all regions.(Default: '-')No
-
clusterstringOptional: The ID of the cluster to list instances from. Use '-' to get results for all clusters.(Default: '-')No
-

名称类型描述必填默认值
projectstringGCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。
locationstring可选:集群所在的位置(例如:'us-central1')。使用'-'可获取所有区域的结果。(默认值:'-')
-
clusterstring可选:要列出实例的集群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

参数

NameTypeDescriptionRequiredDefault
projectstringThe GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.No
locationstringThe location IDYes
operationstringThe operation IDYes

名称类型描述必填默认值
projectstringGCP项目ID。已预先配置,除非用户明确提供不同的ID,否则无需询问。
locationstring位置ID
operationstring操作ID