MCP Tools Reference: cloud-sql

工具:get_instance

获取 Cloud SQL 实例的详细信息。

以下示例演示了如何使用 curl 调用 get_instance MCP 工具。

Curl 请求
                  
curl --location 'https://sqladmin.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "get_instance",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

输入架构

实例获取请求。

SqlInstancesGetRequest

JSON 表示法
{
  "instance": string,
  "project": string
}
字段
instance

string

必需。数据库实例 ID。不包括项目 ID。

project

string

必需。实例所属的项目的 ID。

输出架构

Cloud SQL 实例资源。

DatabaseInstance

JSON 表示法
{
  "kind": string,
  "state": enum (SqlInstanceState),
  "databaseVersion": enum (SqlDatabaseVersion),
  "settings": {
    object (Settings)
  },
  "etag": string,
  "failoverReplica": {
    object (SqlFailoverReplica)
  },
  "masterInstanceName": string,
  "replicaNames": [
    string
  ],
  "maxDiskSize": string,
  "currentDiskSize": string,
  "ipAddresses": [
    {
      object (IpMapping)
    }
  ],
  "serverCaCert": {
    object (SslCert)
  },
  "instanceType": enum (SqlInstanceType),
  "project": string,
  "ipv6Address": string,
  "serviceAccountEmailAddress": string,
  "onPremisesConfiguration": {
    object (OnPremisesConfiguration)
  },
  "replicaConfiguration": {
    object (ReplicaConfiguration)
  },
  "backendType": enum (SqlBackendType),
  "selfLink": string,
  "suspensionReason": [
    enum (SqlSuspensionReason)
  ],
  "connectionName": string,
  "name": string,
  "region": string,
  "gceZone": string,
  "secondaryGceZone": string,
  "diskEncryptionConfiguration": {
    object (DiskEncryptionConfiguration)
  },
  "diskEncryptionStatus": {
    object (DiskEncryptionStatus)
  },
  "rootPassword": string,
  "scheduledMaintenance": {
    object (SqlScheduledMaintenance)
  },
  "satisfiesPzs": boolean,
  "databaseInstalledVersion": string,
  "createTime": string,
  "availableMaintenanceVersions": [
    string
  ],
  "maintenanceVersion": string,
  "upgradableDatabaseVersions": [
    {
      object (AvailableDatabaseVersion)
    }
  ],
  "replicationCluster": {
    object (ReplicationCluster)
  },
  "satisfiesPzi": boolean,
  "tags": {
    string: string,
    ...
  },
  "nodes": [
    {
      object (PoolNodeConfig)
    }
  ],
  "dnsNames": [
    {
      object (DnsNameMapping)
    }
  ],

  // Union field _out_of_disk_report can be only one of the following:
  "outOfDiskReport": {
    object (SqlOutOfDiskReport)
  }
  // End of list of possible types for union field _out_of_disk_report.

  // Union field _sql_network_architecture can be only one of the following:
  "sqlNetworkArchitecture": enum (SqlNetworkArchitecture)
  // End of list of possible types for union field _sql_network_architecture.

  // Union field _psc_service_attachment_link can be only one of the following:
  "pscServiceAttachmentLink": string
  // End of list of possible types for union field _psc_service_attachment_link.

  // Union field _dns_name can be only one of the following:
  "dnsName": string
  // End of list of possible types for union field _dns_name.

  // Union field _primary_dns_name can be only one of the following:
  "primaryDnsName": string
  // End of list of possible types for union field _primary_dns_name.

  // Union field _write_endpoint can be only one of the following:
  "writeEndpoint": string
  // End of list of possible types for union field _write_endpoint.

  // Union field _gemini_config can be only one of the following:
  "geminiConfig": {
    object (GeminiInstanceConfig)
  }
  // End of list of possible types for union field _gemini_config.

  // Union field _switch_transaction_logs_to_cloud_storage_enabled can be only
  // one of the following:
  "switchTransactionLogsToCloudStorageEnabled": boolean
  // End of list of possible types for union field
  // _switch_transaction_logs_to_cloud_storage_enabled.

  // Union field _include_replicas_for_major_version_upgrade can be only one of
  // the following:
  "includeReplicasForMajorVersionUpgrade": boolean
  // End of list of possible types for union field
  // _include_replicas_for_major_version_upgrade.

  // Union field _node_count can be only one of the following:
  "nodeCount": integer
  // End of list of possible types for union field _node_count.
}
字段
kind

string

始终为 sql#instance

state

enum (SqlInstanceState)

Cloud SQL 实例的当前服务状态。

databaseVersion

enum (SqlDatabaseVersion)

数据库引擎类型和版本。创建实例后,无法更改 databaseVersion 字段。

settings

object (Settings)

用户设置。

etag

string

此字段已弃用,将在未来版本的 API 中移除。应改用 settings.settingsVersion 字段。

failoverReplica

object (SqlFailoverReplica)

故障切换副本的名称和状态。

masterInstanceName

string

在复制设置中充当主实例的实例的名称。

replicaNames[]

string

实例的副本。

maxDiskSize
(deprecated)

string (Int64Value format)

实例的最大磁盘大小(以字节为单位)。

currentDiskSize
(deprecated)

string (Int64Value format)

实例的当前磁盘用量(以字节为单位)。此属性已被弃用。请改为在 Cloud Monitoring API 中使用“cloudsql.googleapis.com/database/disk/bytes_used”指标。如需了解详情,请参阅此公告

ipAddresses[]

object (IpMapping)

为实例分配的 IP 地址。

serverCaCert

object (SslCert)

SSL 配置。

instanceType

enum (SqlInstanceType)

实例类型。

project

string

包含 Cloud SQL 实例的项目的项目 ID。Google Apps 网域会带有前缀(如果适用)。

ipv6Address
(deprecated)

string

分配给实例的 IPv6 地址。(已弃用)此属性仅适用于第一代实例。

serviceAccountEmailAddress

string

分配给实例的服务账号电子邮件地址。\此属性为只读属性。

onPremisesConfiguration

object (OnPremisesConfiguration)

特定于本地实例的配置。

replicaConfiguration

object (ReplicaConfiguration)

特定于故障转移副本和读取副本的配置。

backendType

enum (SqlBackendType)

后端类型。SECOND_GEN:Cloud SQL 数据库实例。EXTERNAL:非 Google 管理的数据库服务器。

此属性为只读属性;使用 settings 对象中的 tier 属性确定数据库类型。

selfLink

string

此资源的 URI。

suspensionReason[]

enum (SqlSuspensionReason)

如果实例状态为 SUSPENDED,则为暂停的原因。

connectionName

string

连接字符串中使用的 Cloud SQL 实例的连接名称。

name

string

Cloud SQL 实例的名称。不包括项目 ID。

region

string

Cloud SQL 实例的地理区域。

可以是 Cloud SQL 运行的某个区域

例如,asia-east1europe-west1us-central1。默认值为 us-central1

gceZone

string

实例当前从中提供服务的 Compute Engine 地区。如果实例已故障转移到其辅助地区,则此值可能与创建实例时指定的地区不同。警告:更改此设置可能会导致实例重启。

secondaryGceZone

string

对于区域性实例,故障切换实例当前从中提供服务的 Compute Engine 可用区。如果实例故障切换到其辅助/故障切换地区,则此值可能与创建实例时指定的地区不同。

diskEncryptionConfiguration

object (DiskEncryptionConfiguration)

特定于实例的磁盘加密配置。

diskEncryptionStatus

object (DiskEncryptionStatus)

特定于实例的磁盘加密状态。

rootPassword

string

初始根密码。仅在创建时使用。您必须先设置根密码,然后才能连接到 PostgreSQL 实例。

scheduledMaintenance

object (SqlScheduledMaintenance)

此实例的任何近期维护的开始时间。

satisfiesPzs

boolean

此状态表示实例是否满足 PZS。

此状态预留以供将来使用。

databaseInstalledVersion

string

仅限输出。存储实例上运行的当前数据库版本,包括次要版本,例如 MYSQL_8_0_18

createTime

string (Timestamp format)

仅限输出。实例的创建时间,采用 RFC 3339 格式,例如 2012-11-15T16:19:00.094Z

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

availableMaintenanceVersions[]

string

仅限输出。列出适用于相应实例的所有维护版本

maintenanceVersion

string

实例上的当前软件版本。

upgradableDatabaseVersions[]

object (AvailableDatabaseVersion)

仅限输出。所有可升级的数据库版本。

replicationCluster

object (ReplicationCluster)

可选。主实例和灾难恢复 (DR) 副本对。灾难恢复副本是一种跨区域副本,您可以在主实例发生区域性故障时指定该副本用于故障切换。适用于 MySQL 和 PostgreSQL。

satisfiesPzi

boolean

仅限输出。此状态表示实例是否满足 PZI。

此状态预留以供将来使用。

tags

map (key: string, value: string)

可选。仅限输入。不可变。绑定到此实例的标记键和标记值。您必须将映射中的每个项表示为:"<tag-key-namespaced-name>" : "<tag-value-short-name>"

例如,单个资源可以具有以下标记:

  "123/environment": "production",
  "123/costCenter": "marketing",

如需详细了解如何创建和管理标记,请参阅 https://cloud.google.com/resource-manager/docs/tags/tags-overview

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

nodes[]

object (PoolNodeConfig)

仅限输出。包含读取池的每个读取池节点的相关信息的条目。

dnsNames[]

object (DnsNameMapping)

仅限输出。相应实例使用的 DNS 名称列表。

联合字段 _out_of_disk_report

_out_of_disk_report 只能是下列其中一项:

outOfDiskReport

object (SqlOutOfDiskReport)

此字段表示由主动数据库健康状况作业针对 OutOfDisk 问题生成的报告。* Writer:* 针对 OOD 的主动数据库健康状况作业。* 读取者:* 主动数据库运行状况作业

联合字段 _sql_network_architecture

_sql_network_architecture 只能是下列其中一项:

sqlNetworkArchitecture

enum (SqlNetworkArchitecture)

联合字段 _psc_service_attachment_link

_psc_service_attachment_link 只能是下列其中一项:

pscServiceAttachmentLink

string

仅限输出。指向 PSC 实例的服务连接的链接。

联合字段 _dns_name

_dns_name 只能是下列其中一项:

dnsName

string

仅限输出。实例的 DNS 名称。

联合字段 _primary_dns_name

_primary_dns_name 只能是下列其中一项:

primaryDnsName
(deprecated)

string

仅限输出。已弃用:请改用 write_endpoint。

联合字段 _write_endpoint

_write_endpoint 只能是下列其中一项:

writeEndpoint

string

仅限输出。复制组中主实例的 DNS 名称。

联合字段 _gemini_config

_gemini_config 只能是下列其中一项:

geminiConfig

object (GeminiInstanceConfig)

Gemini 实例配置。

联合字段 _switch_transaction_logs_to_cloud_storage_enabled

_switch_transaction_logs_to_cloud_storage_enabled 只能是下列其中一项:

switchTransactionLogsToCloudStorageEnabled

boolean

仅限输入。Cloud SQL 是否已启用,以将时间点恢复日志文件的存储位置从数据磁盘切换到 Cloud Storage。

联合字段 _include_replicas_for_major_version_upgrade

_include_replicas_for_major_version_upgrade 只能是下列其中一项:

includeReplicasForMajorVersionUpgrade

boolean

仅限输入。确定在启动主实例的主要版本就地升级时,是否对副本进行主要版本就地升级。

联合字段 _node_count

_node_count 只能是下列其中一项:

nodeCount

integer

读取池中的读取池节点数。

设置

JSON 表示法
{
  "settingsVersion": string,
  "authorizedGaeApplications": [
    string
  ],
  "tier": string,
  "kind": string,
  "userLabels": {
    string: string,
    ...
  },
  "availabilityType": enum (SqlAvailabilityType),
  "pricingPlan": enum (SqlPricingPlan),
  "replicationType": enum (SqlReplicationType),
  "storageAutoResizeLimit": string,
  "activationPolicy": enum (SqlActivationPolicy),
  "ipConfiguration": {
    object (IpConfiguration)
  },
  "storageAutoResize": boolean,
  "locationPreference": {
    object (LocationPreference)
  },
  "databaseFlags": [
    {
      object (DatabaseFlags)
    }
  ],
  "dataDiskType": enum (SqlDataDiskType),
  "maintenanceWindow": {
    object (MaintenanceWindow)
  },
  "backupConfiguration": {
    object (BackupConfiguration)
  },
  "databaseReplicationEnabled": boolean,
  "crashSafeReplicationEnabled": boolean,
  "dataDiskSizeGb": string,
  "activeDirectoryConfig": {
    object (SqlActiveDirectoryConfig)
  },
  "collation": string,
  "denyMaintenancePeriods": [
    {
      object (DenyMaintenancePeriod)
    }
  ],
  "insightsConfig": {
    object (InsightsConfig)
  },
  "passwordValidationPolicy": {
    object (PasswordValidationPolicy)
  },
  "sqlServerAuditConfig": {
    object (SqlServerAuditConfig)
  },
  "edition": enum (Edition),
  "connectorEnforcement": enum (ConnectorEnforcement),
  "deletionProtectionEnabled": boolean,
  "timeZone": string,
  "advancedMachineFeatures": {
    object (AdvancedMachineFeatures)
  },
  "dataCacheConfig": {
    object (DataCacheConfig)
  },
  "replicationLagMaxSeconds": integer,
  "enableGoogleMlIntegration": boolean,
  "enableDataplexIntegration": boolean,
  "retainBackupsOnDelete": boolean,
  "entraidConfig": {
    object (SqlServerEntraIdConfig)
  },
  "performanceCaptureConfig": {
    object (PerformanceCaptureConfig)
  },

  // Union field _data_disk_provisioned_iops can be only one of the following:
  "dataDiskProvisionedIops": string
  // End of list of possible types for union field _data_disk_provisioned_iops.

  // Union field _data_disk_provisioned_throughput can be only one of the
  // following:
  "dataDiskProvisionedThroughput": string
  // End of list of possible types for union field
  // _data_disk_provisioned_throughput.

  // Union field _connection_pool_config can be only one of the following:
  "connectionPoolConfig": {
    object (ConnectionPoolConfig)
  }
  // End of list of possible types for union field _connection_pool_config.

  // Union field _final_backup_config can be only one of the following:
  "finalBackupConfig": {
    object (FinalBackupConfig)
  }
  // End of list of possible types for union field _final_backup_config.

  // Union field _read_pool_auto_scale_config can be only one of the following:
  "readPoolAutoScaleConfig": {
    object (ReadPoolAutoScaleConfig)
  }
  // End of list of possible types for union field _read_pool_auto_scale_config.

  // Union field _auto_upgrade_enabled can be only one of the following:
  "autoUpgradeEnabled": boolean
  // End of list of possible types for union field _auto_upgrade_enabled.

  // Union field _data_api_access can be only one of the following:
  "dataApiAccess": enum (DataApiAccess)
  // End of list of possible types for union field _data_api_access.
}
字段
settingsVersion

string (Int64Value format)

实例设置的版本。这是更新方法的必填字段,用于确保正确处理并发更新。在更新期间,请为此实例使用最新的 settingsVersion 值,并且不要尝试更新此值。

authorizedGaeApplications[]
(deprecated)

string

可以访问此实例的 App Engine 应用 ID。(已弃用)仅应用于第一代实例。

tier

string

相应实例的层级(或机器类型),例如 db-custom-1-3840。警告:更改此设置会重启实例。

kind

string

始终为 sql#settings

userLabels

map (key: string, value: string)

用户提供的标签,以字典形式表示,其中每个标签都是一个键值对。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

availabilityType

enum (SqlAvailabilityType)

可用性类型。可能的值:* ZONAL:实例仅从一个地区传送数据。该地区的服务中断会影响数据可访问性。* REGIONAL:实例可以从区域中的多个地区传送数据(高可用性)。/

如需了解详情,请参阅高可用性配置概览

pricingPlan

enum (SqlPricingPlan)

此实例的定价方案。可以是 PER_USEPACKAGE。第二代实例仅支持 PER_USE

replicationType
(deprecated)

enum (SqlReplicationType)

此实例使用的复制类型。可以是 ASYNCHRONOUSSYNCHRONOUS。(已弃用)此属性仅适用于第一代实例。

storageAutoResizeLimit

string (Int64Value format)

可自动增加的存储空间大小上限。默认值为 0,表示没有限制。

activationPolicy

enum (SqlActivationPolicy)

激活政策指定实例的激活时间;仅当实例状态为 RUNNABLE 时才适用。有效值:* ALWAYS:实例处于开启状态,即使没有连接请求,也是如此。* NEVER:实例已关闭;它不会激活,即使连接请求到达也是如此。

ipConfiguration

object (IpConfiguration)

IP 管理的设置。这样可以启用或停用实例 IP 并管理哪些外部网络可以连接到实例。无法为第二代实例停用 IPv4 地址。

storageAutoResize

boolean

用于自动增加存储空间大小的配置。默认值为 true。

locationPreference

object (LocationPreference)

位置偏好设置。这允许实例尽可能接近 App Engine 应用或 Compute Engine 地区,以实现更好的性能。App Engine 主机托管服务仅适用于第一代实例。

databaseFlags[]

object (DatabaseFlags)

启动时传递给实例的数据库标志。

dataDiskType

enum (SqlDataDiskType)

数据磁盘的类型:PD_SSD(默认)或 PD_HDD。不用于第一代实例。

maintenanceWindow

object (MaintenanceWindow)

此实例的维护期。这用于指定何时可以重启实例以进行维护。

backupConfiguration

object (BackupConfiguration)

实例的每日备份配置。

databaseReplicationEnabled

boolean

读取副本实例的特定配置。指示是否已启用复制功能。警告:更改此设置会重启实例。

crashSafeReplicationEnabled
(deprecated)

boolean

读取副本实例的特定配置。指示是否已启用用于实现崩溃安全复制的数据库标志。此属性仅适用于第一代实例。

dataDiskSizeGb

string (Int64Value format)

数据磁盘的大小(以 GB 为单位)。数据磁盘大小下限为 10GB。

activeDirectoryConfig

object (SqlActiveDirectoryConfig)

Active Directory 配置,仅适用于 Cloud SQL for SQL Server。

collation

string

服务器实例排序规则的名称。

denyMaintenancePeriods[]

object (DenyMaintenancePeriod)

拒绝维护期

insightsConfig

object (InsightsConfig)

数据洞见配置,目前仅适用于 Postgres。

passwordValidationPolicy

object (PasswordValidationPolicy)

实例的本地用户密码验证政策。

sqlServerAuditConfig

object (SqlServerAuditConfig)

SQL Server 特定审核配置。

edition

enum (Edition)

可选。相应实例的版本。

connectorEnforcement

enum (ConnectorEnforcement)

指定连接是否必须使用 Cloud SQL 连接器。选项值包括:NOT_REQUIRED(可以连接 Cloud SQL 实例,而无需使用 Cloud SQL 连接器)和 REQUIRED(仅允许使用 Cloud SQL 连接器的连接)。

请注意,使用 REQUIRED 会停用所有现有已获授权的网络。如果在创建新实例时未指定此字段,则使用 NOT_REQUIRED。如果在修补或更新现有实例时未指定此字段,则该字段在实例中保持不变。

deletionProtectionEnabled

boolean

用于防止意外删除实例的配置。

timeZone

string

服务器时区,仅适用于 Cloud SQL for SQL Server。

advancedMachineFeatures

object (AdvancedMachineFeatures)

指定实例的高级机器配置,仅适用于 SQL Server。

dataCacheConfig

object (DataCacheConfig)

数据缓存的配置。

replicationLagMaxSeconds

integer

可选。在出现一定复制延迟后重新创建副本的配置值

enableGoogleMlIntegration

boolean

可选。当此参数设置为 true 时,Cloud SQL 实例可以连接到 Vertex AI,将针对实时预测和数据洞见的请求传递给 AI。默认值为 false。此限制仅适用于 Cloud SQL for MySQL 和 Cloud SQL for PostgreSQL 实例。

enableDataplexIntegration

boolean

可选。默认情况下,Cloud SQL 实例已针对 Dataplex 停用架构提取功能。如果此参数设置为 true,则会激活 Cloud SQL 实例上 Dataplex 的架构提取功能。

retainBackupsOnDelete

boolean

可选。如果此参数设置为 true,即使实例被删除,Cloud SQL 也会保留该实例的备份。按需备份将一直保留,直到客户删除备份或项目为止。系统会根据备份保留设置保留自动备份。

entraidConfig

object (SqlServerEntraIdConfig)

可选。SQL Server 实例的 Microsoft Entra ID 配置。

performanceCaptureConfig

object (PerformanceCaptureConfig)

可选。性能捕获的配置,可在高负载情况下提供诊断指标。

联合字段 _data_disk_provisioned_iops

_data_disk_provisioned_iops 只能是下列其中一项:

dataDiskProvisionedIops

string (int64 format)

可选。数据磁盘的每秒预配 I/O 操作数。此字段仅用于 Hyperdisk Balanced 磁盘类型。

联合字段 _data_disk_provisioned_throughput

_data_disk_provisioned_throughput 只能是下列其中一项:

dataDiskProvisionedThroughput

string (int64 format)

可选。数据磁盘的预配吞吐量,以 MiB/秒为单位。此字段仅用于 Hyperdisk Balanced 磁盘类型。

联合字段 _connection_pool_config

_connection_pool_config 只能是下列其中一项:

connectionPoolConfig

object (ConnectionPoolConfig)

可选。实例的托管式连接池配置。

联合字段 _final_backup_config

_final_backup_config 只能是下列其中一项:

finalBackupConfig

object (FinalBackupConfig)

可选。实例的最终备份配置。

联合字段 _read_pool_auto_scale_config

_read_pool_auto_scale_config 只能是下列其中一项:

readPoolAutoScaleConfig

object (ReadPoolAutoScaleConfig)

可选。实例的读取池自动扩缩配置。

联合字段 _auto_upgrade_enabled

_auto_upgrade_enabled 只能是下列其中一项:

autoUpgradeEnabled

boolean

可选。Cloud SQL for MySQL 自动升级配置。如果此参数设置为 true,则会为 MySQL 8.0 次要版本启用自动升级。MySQL 版本必须为 8.0.35 或更高版本。

联合字段 _data_api_access

_data_api_access 只能是下列其中一项:

dataApiAccess

enum (DataApiAccess)

此参数用于控制是否允许使用 ExecuteSql API 连接到实例。默认情况下不允许。

Int64Value

JSON 表示法
{
  "value": string
}
字段
value

string (int64 format)

int64 值。

UserLabelsEntry

JSON 表示法
{
  "key": string,
  "value": string
}
字段
key

string

value

string

IpConfiguration

JSON 表示法
{
  "ipv4Enabled": boolean,
  "privateNetwork": string,
  "requireSsl": boolean,
  "authorizedNetworks": [
    {
      object (AclEntry)
    }
  ],
  "allocatedIpRange": string,
  "enablePrivatePathForGoogleCloudServices": boolean,
  "sslMode": enum (SslMode),
  "customSubjectAlternativeNames": [
    string
  ],

  // Union field _psc_config can be only one of the following:
  "pscConfig": {
    object (PscConfig)
  }
  // End of list of possible types for union field _psc_config.

  // Union field _server_ca_mode can be only one of the following:
  "serverCaMode": enum (CaMode)
  // End of list of possible types for union field _server_ca_mode.

  // Union field _server_ca_pool can be only one of the following:
  "serverCaPool": string
  // End of list of possible types for union field _server_ca_pool.

  // Union field _server_certificate_rotation_mode can be only one of the
  // following:
  "serverCertificateRotationMode": enum (ServerCertificateRotationMode)
  // End of list of possible types for union field
  // _server_certificate_rotation_mode.
}
字段
ipv4Enabled

boolean

实例是否分配有公共 IP 地址。

privateNetwork

string

VPC 网络的资源链接,通过该网络,您可以通过专用 IP 访问 Cloud SQL 实例。例如 /projects/myProject/global/networks/default。此设置可以更新,但设置后无法移除。

requireSsl

boolean

请改用 ssl_mode

是否强制执行通过 IP 的 SSL/TLS 连接。如果设置为 false,则允许非 SSL/非 TLS 和 SSL/TLS 连接。对于 SSL/TLS 连接,不会验证客户端证书。如果设置为 true,则仅允许使用 SSL/TLS 加密并具有有效客户端证书的连接。如果您想强制执行 SSL/TLS,但不强制要求使用有效的客户端证书,请使用 ssl_mode 标志,而不是 require_ssl 标志。

authorizedNetworks[]

object (AclEntry)

允许使用 IP 连接到实例的外部网络列表。采用“CIDR”表示法,也称为“斜杠”表示法(例如:157.197.200.0/24)。

allocatedIpRange

string

专用 IP Cloud SQL 实例的已分配 IP 范围的名称。例如:“google-managed-services-default”。如果设置,则实例 IP 将在分配的范围内创建。范围名称必须符合 RFC 1035 的要求。具体而言,名称的长度必须为 1-63 个字符,并且必须与正则表达式 [a-z]([-a-z0-9]*[a-z0-9])?. 匹配。

enablePrivatePathForGoogleCloudServices

boolean

控制从 Google 服务(例如 BigQuery)到专用 IP 地址实例的连接。

sslMode

enum (SslMode)

指定如何在数据库连接中强制执行 SSL/TLS。如果您必须使用 require_ssl 标志来实现向后兼容,则只有以下值对有效:

对于 PostgreSQL 和 MySQL:

  • ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTEDrequire_ssl=false之间
  • ssl_mode=ENCRYPTED_ONLYrequire_ssl=false
  • ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIREDrequire_ssl=true之间

对于 SQL Server:

  • ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTEDrequire_ssl=false之间
  • ssl_mode=ENCRYPTED_ONLYrequire_ssl=true之间

ssl_mode 的值优先于 require_ssl 的值。

例如,对于 ssl_mode=ENCRYPTED_ONLYrequire_ssl=false 这对值,ssl_mode=ENCRYPTED_ONLY 表示仅接受 SSL 连接,而 require_ssl=false 表示同时接受非 SSL 连接和 SSL 连接。在这种情况下,MySQL 和 PostgreSQL 数据库会遵循 ssl_mode 并仅接受 SSL 连接。

customSubjectAlternativeNames[]

string

可选。Cloud SQL 实例的自定义主题备用名称(SAN)。

联合字段 _psc_config

_psc_config 只能是下列其中一项:

pscConfig

object (PscConfig)

相应实例的 PSC 设置。

联合字段 _server_ca_mode

_server_ca_mode 只能是下列其中一项:

serverCaMode

enum (CaMode)

指定服务器证书使用的 CA 类型。

联合字段 _server_ca_pool

_server_ca_pool 只能是下列其中一项:

serverCaPool

string

可选。对于 server_ca_modeCUSTOMER_MANAGED_CAS_CA 的实例,服务器 CA 池的资源名称。格式:projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}

联合字段 _server_certificate_rotation_mode

_server_certificate_rotation_mode 只能是下列其中一项:

serverCertificateRotationMode

enum (ServerCertificateRotationMode)

可选。控制自动服务器证书轮替功能。此功能默认处于停用状态。启用后,服务器证书将在 Cloud SQL 计划性维护或自助维护更新期间自动轮换,最长可提前六个月轮换。只有当 server_ca_mode 为 GOOGLE_MANAGED_CAS_CA 或 CUSTOMER_MANAGED_CAS_CA 时,才能设置此设置。

BoolValue

JSON 表示法
{
  "value": boolean
}
字段
value

boolean

布尔值。

AclEntry

JSON 表示法
{
  "value": string,
  "expirationTime": string,
  "name": string,
  "kind": string
}
字段
value

string

访问权限控制列表的许可名单值。

expirationTime

string (Timestamp format)

此访问权限控制条目的到期时间,采用 RFC 3339 格式,例如 2012-11-15T16:19:00.094Z

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

name

string

可选。用于标识此条目的标签。

kind

string

始终为 sql#aclEntry

时间戳

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
字段
seconds

string (int64 format)

表示世界协调时间 (UTC) 的秒数(从 Unix 纪元 1970-01-01T00:00:00Z 开始算起)。必须介于 -62135596800 到 253402300799 之间(含边界值),对应于 0001-01-01T00:00:00Z 到 9999-12-31T23:59:59Z。

nanos

integer

秒数的非负小数部分(以纳秒为单位)。此字段是时长的纳秒部分,而不是秒的替代项。对于含小数部分的负秒数,仍必须包含按时间递升的非负纳秒值。必须在 0 到 999,999,999 之间(含边界值)。

PscConfig

JSON 表示法
{
  "allowedConsumerProjects": [
    string
  ],
  "pscAutoConnections": [
    {
      object (PscAutoConnectionConfig)
    }
  ],
  "networkAttachmentUri": string,

  // Union field _psc_enabled can be only one of the following:
  "pscEnabled": boolean
  // End of list of possible types for union field _psc_enabled.
}
字段
allowedConsumerProjects[]

string

可选。已列入许可名单的使用方项目列表,这些项目可以通过 PSC 连接到此实例。这些项目中的任何网络都可以通过 PSC 连接到此实例。

此列表中的每个使用方项目都可以通过项目编号(数字)或项目 ID(字母数字)来表示。

pscAutoConnections[]

object (PscAutoConnectionConfig)

可选。可用于连接到此 Cloud SQL 实例的所请求 Private Service Connect 使用方端点的设置列表。

networkAttachmentUri

string

可选。已启用 Private Service Connect 的 Cloud SQL 实例获授权通过 PSC 接口连接的使用方网络的网络连接。格式:projects/PROJECT 区域/REGION/networkAttachments/ID

联合字段 _psc_enabled

_psc_enabled 只能是下列其中一项:

pscEnabled

boolean

相应实例是否已启用 PSC 连接。

PscAutoConnectionConfig

JSON 表示法
{
  "consumerProject": string,
  "consumerNetwork": string,

  // Union field _ip_address can be only one of the following:
  "ipAddress": string
  // End of list of possible types for union field _ip_address.

  // Union field _status can be only one of the following:
  "status": string
  // End of list of possible types for union field _status.

  // Union field _consumer_network_status can be only one of the following:
  "consumerNetworkStatus": string
  // End of list of possible types for union field _consumer_network_status.
}
字段
consumerProject

string

可选。这是相应使用方端点的使用方服务项目的项目 ID。

可选。仅当 consumer_network 是共享 VPC 网络时,此参数才适用。

consumerNetwork

string

可选。相应使用方端点的使用方网络。这必须是包含宿主项目和网络名称的资源路径。

例如 projects/project1/global/networks/network1

相应网络的使用方宿主项目可能与使用方服务项目不同。

联合字段 _ip_address

_ip_address 只能是下列其中一项:

ipAddress

string

消费类电子设备端点的 IP 地址。

联合字段 _status

_status 只能是下列其中一项:

status

string

使用方端点的连接状态。

联合字段 _consumer_network_status

_consumer_network_status 只能是下列其中一项:

consumerNetworkStatus

string

消费类网络的连接政策状态。

LocationPreference

JSON 表示法
{
  "followGaeApplication": string,
  "zone": string,
  "secondaryZone": string,
  "kind": string
}
字段
followGaeApplication
(deprecated)

string

要关注的 App Engine 应用,它必须与 Cloud SQL 实例位于同一区域。警告:更改此设置可能会导致实例重启。

zone

string

首选 Compute Engine 可用区(例如 us-central1-a、us-central1-b 等)。警告:更改此设置可能会导致实例重启。

secondaryZone

string

辅助/故障切换的首选 Compute Engine 可用区(例如:us-central1-a、us-central1-b 等)。如需停用此字段,请将其设置为“no_secondary_zone”。

kind

string

始终为 sql#locationPreference

DatabaseFlags

JSON 表示法
{
  "name": string,
  "value": string
}
字段
name

string

标志的名称。这些标志在实例启动时传递,因此包含服务器选项和系统变量。应使用下划线(而不是连字符)指定标志。如需了解详情,请参阅 Cloud SQL 文档中的配置数据库标志

value

string

标志的值。布尔值标志设置为 on(表示 true)和 off(表示 false)。如果标记未采用值,则必须省略此字段。

MaintenanceWindow

JSON 表示法
{
  "hour": integer,
  "day": integer,
  "updateTrack": enum (SqlUpdateTrack),
  "kind": string
}
字段
hour

integer

时段 - 0 至 23。采用世界协调时间 (UTC) 时区指定。

day

integer

星期几 - MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY。采用世界协调时间 (UTC) 时区指定。以整数形式(1 到 7)返回,其中 1 表示星期一。

updateTrack

enum (SqlUpdateTrack)

维护时间设置:canarystableweek5。如需了解详情,请参阅 Cloud SQL 实例维护简介

kind

string

始终为 sql#maintenanceWindow

Int32Value

JSON 表示法
{
  "value": integer
}
字段
value

integer

int32 值。

BackupConfiguration

JSON 表示法
{
  "startTime": string,
  "enabled": boolean,
  "kind": string,
  "binaryLogEnabled": boolean,
  "replicationLogArchivingEnabled": boolean,
  "location": string,
  "pointInTimeRecoveryEnabled": boolean,
  "backupRetentionSettings": {
    object (BackupRetentionSettings)
  },
  "transactionLogRetentionDays": integer,

  // Union field _transactional_log_storage_state can be only one of the
  // following:
  "transactionalLogStorageState": enum (TransactionalLogStorageState)
  // End of list of possible types for union field
  // _transactional_log_storage_state.

  // Union field _backup_tier can be only one of the following:
  "backupTier": enum (BackupTier)
  // End of list of possible types for union field _backup_tier.
}
字段
startTime

string

每日备份配置的开始时间(世界协调时间 (UTC) 时区,采用 24 小时制 - HH:MM)。

enabled

boolean

是否启用此配置。

kind

string

始终为 sql#backupConfiguration

binaryLogEnabled

boolean

(仅限 MySQL)是否已启用二进制日志。如果停用了备份配置,则还必须停用二进制日志。

replicationLogArchivingEnabled

boolean

留待将来使用。

location

string

备份的位置

pointInTimeRecoveryEnabled

boolean

时间点恢复是否已启用。

backupRetentionSettings

object (BackupRetentionSettings)

备份保留设置。

transactionLogRetentionDays

integer

我们为时间点恢复保留的事务日志的天数(1 至 7 天)。

联合字段 _transactional_log_storage_state

_transactional_log_storage_state 只能是下列其中一项:

transactionalLogStorageState

enum (TransactionalLogStorageState)

仅限输出。此值包含用于对数据库执行时间点恢复 (PITR) 的事务日志的存储位置。

联合字段 _backup_tier

_backup_tier 只能是下列其中一项:

backupTier

enum (BackupTier)

仅限输出。管理实例备份的备份层级。

BackupRetentionSettings

JSON 表示法
{
  "retentionUnit": enum (RetentionUnit),
  "retainedBackups": integer
}
字段
retentionUnit

enum (RetentionUnit)

“retained_backups”所表示的单位。

retainedBackups

integer

根据 retention_unit 的值,此参数用于确定是否需要删除备份。如果 retention_unit 为“COUNT”,我们将保留相应数量的备份。

SqlActiveDirectoryConfig

JSON 表示法
{
  "kind": string,
  "domain": string,
  "mode": enum (ActiveDirectoryMode),
  "dnsServers": [
    string
  ],
  "adminCredentialSecretName": string,
  "organizationalUnit": string
}
字段
kind

string

这始终为 sql#activeDirectoryConfig。

domain

string

网域的名称(例如 mydomain.com)。

mode

enum (ActiveDirectoryMode)

可选。Active Directory 配置的模式。

dnsServers[]

string

可选。用于引导 Active Directory 的网域控制器 IPv4 地址。

adminCredentialSecretName

string

可选。用于存储管理员凭据的 Secret Manager 密钥。(例如,projects/{project}/secrets/{secret})。

organizationalUnit

string

可选。组织部门的标识名。这是组织部门的完整层次结构路径。

DenyMaintenancePeriod

JSON 表示法
{
  "startDate": string,
  "endDate": string,
  "time": string
}
字段
startDate

string

“拒绝维护期”开始日期。如果开始日期的年份为空,则结束日期的年份也必须为空。在这种情况下,这意味着拒绝维护期每年重复一次。日期格式为 yyyy-mm-dd,即 2020-11-01,或者 mm-dd,即 11-01

endDate

string

“拒绝维护期”结束日期。如果结束日期的年份为空,开始日期的年份也必须为空。在这种情况下,这意味着拒绝维护期每年重复一次。日期格式为 yyyy-mm-dd,即 2020-11-01,或者 mm-dd,即 11-01

time

string

“拒绝维护期”在 start_date 开始和在 end_date 结束时的世界协调时间 (UTC)。时间采用 HH:mm:SS 格式,即 00:00:00

InsightsConfig

JSON 表示法
{
  "queryInsightsEnabled": boolean,
  "recordClientAddress": boolean,
  "recordApplicationTags": boolean,
  "queryStringLength": integer,
  "queryPlansPerMinute": integer,
  "enhancedQueryInsightsEnabled": boolean
}
字段
queryInsightsEnabled

boolean

Query Insights 功能是否已启用。

recordClientAddress

boolean

启用后,Query Insights 是否会记录客户端地址。

recordApplicationTags

boolean

启用后,Query Insights 是否会记录查询中的应用标记。

queryStringLength

integer

以字节为单位存储的查询长度上限。默认值:1024 字节。范围:256-4500 字节。如果查询长度大于此字段值,则会被截断为此值。如果未设置,查询长度将为默认值。更改查询长度将重启数据库。

queryPlansPerMinute

integer

Insights 每分钟捕获的查询执行计划数量(针对所有查询)。默认值为 5。

enhancedQueryInsightsEnabled

boolean

可选。增强型 Query Insights 功能是否已启用。

PasswordValidationPolicy

JSON 表示法
{
  "minLength": integer,
  "complexity": enum (Complexity),
  "reuseInterval": integer,
  "disallowUsernameSubstring": boolean,
  "passwordChangeInterval": string,
  "enablePasswordPolicy": boolean,
  "disallowCompromisedCredentials": boolean
}
字段
minLength

integer

允许的字符数下限。

complexity

enum (Complexity)

密码的复杂度。

reuseInterval

integer

不得重复使用的先前密码数量。

disallowUsernameSubstring

boolean

禁止将用户名作为密码的一部分。

passwordChangeInterval

string (Duration format)

可以更改密码的最短间隔。此标志仅适用于 PostgreSQL。

该时长以秒为单位,最多包含九个小数位,以“s”结尾。示例:"3.5s"

enablePasswordPolicy

boolean

是否启用密码政策。启用后,密码必须符合复杂度要求。请保持此政策处于启用状态,以帮助防止未经授权的访问。如果此政策已停用,系统会允许使用安全系数低的密码。

disallowCompromisedCredentials
(deprecated)

boolean

此字段已弃用,将在未来版本的 API 中移除。

时长

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
字段
seconds

string (int64 format)

时间段的带符号秒数。必须介于 -315,576,000,000 到 +315,576,000,000 之间(含边界值)。注意:这些界限是通过以下计算得出的:60 秒/分钟 * 60 分钟/小时 * 24 小时/天 * 365.25 天/年 * 10000 年

nanos

integer

时间跨度的有符号秒数小数部分(以纳秒为单位)。小于 1 秒的时长用 0 seconds 字段和正或负 nanos 字段表示。对于时长为 1 秒或更长时间的情况,nanos 字段的非零值必须与 seconds 字段的符号相同。必须介于 -999,999,999 到 +999,999,999 之间(含边界值)。

SqlServerAuditConfig

JSON 表示法
{
  "kind": string,
  "bucket": string,
  "retentionInterval": string,
  "uploadInterval": string
}
字段
kind

string

这始终为 sql#sqlServerAuditConfig

bucket

string

目标存储桶的名称(例如,gs://mybucket)。

retentionInterval

string (Duration format)

生成审核文件的保留时长。

该时长以秒为单位,最多包含九个小数位,以“s”结尾。示例:"3.5s"

uploadInterval

string (Duration format)

上传生成的审核文件的频率。

该时长以秒为单位,最多包含九个小数位,以“s”结尾。示例:"3.5s"

AdvancedMachineFeatures

JSON 表示法
{
  "threadsPerCore": integer
}
字段
threadsPerCore

integer

每个物理核心的线程数。

DataCacheConfig

JSON 表示法
{
  "dataCacheEnabled": boolean
}
字段
dataCacheEnabled

boolean

实例是否已启用数据缓存。

ConnectionPoolConfig

JSON 表示法
{
  "flags": [
    {
      object (ConnectionPoolFlags)
    }
  ],

  // Union field _connection_pooling_enabled can be only one of the following:
  "connectionPoolingEnabled": boolean
  // End of list of possible types for union field _connection_pooling_enabled.

  // Union field _pooler_count can be only one of the following:
  "poolerCount": integer
  // End of list of possible types for union field _pooler_count.
}
字段
flags[]

object (ConnectionPoolFlags)

可选。连接池配置标志的列表。

联合字段 _connection_pooling_enabled

_connection_pooling_enabled 只能是下列其中一项:

connectionPoolingEnabled

boolean

是否已启用托管式连接池。

联合字段 _pooler_count

_pooler_count 只能是下列其中一项:

poolerCount

integer

仅限输出。连接池的数量。

ConnectionPoolFlags

JSON 表示法
{
  "name": string,
  "value": string
}
字段
name

string

必需。标志的名称。

value

string

必需。标志的值。布尔值标志设置为 on(表示 true)和 off(表示 false)。如果标记未采用值,则必须省略此字段。

FinalBackupConfig

JSON 表示法
{

  // Union field _enabled can be only one of the following:
  "enabled": boolean
  // End of list of possible types for union field _enabled.

  // Union field _retention_days can be only one of the following:
  "retentionDays": integer
  // End of list of possible types for union field _retention_days.
}
字段

联合字段 _enabled

_enabled 只能是下列其中一项:

enabled

boolean

相应实例是否已启用最终备份。

联合字段 _retention_days

_retention_days 只能是下列其中一项:

retentionDays

integer

实例删除后保留最终备份的天数。最终备份将在(实例删除时间 + 保留天数)后清除。

ReadPoolAutoScaleConfig

JSON 表示法
{
  "targetMetrics": [
    {
      object (TargetMetric)
    }
  ],

  // Union field _enabled can be only one of the following:
  "enabled": boolean
  // End of list of possible types for union field _enabled.

  // Union field _min_node_count can be only one of the following:
  "minNodeCount": integer
  // End of list of possible types for union field _min_node_count.

  // Union field _max_node_count can be only one of the following:
  "maxNodeCount": integer
  // End of list of possible types for union field _max_node_count.

  // Union field _disable_scale_in can be only one of the following:
  "disableScaleIn": boolean
  // End of list of possible types for union field _disable_scale_in.

  // Union field _scale_in_cooldown_seconds can be only one of the following:
  "scaleInCooldownSeconds": integer
  // End of list of possible types for union field _scale_in_cooldown_seconds.

  // Union field _scale_out_cooldown_seconds can be only one of the following:
  "scaleOutCooldownSeconds": integer
  // End of list of possible types for union field _scale_out_cooldown_seconds.
}
字段
targetMetrics[]

object (TargetMetric)

可选。读取池自动伸缩的目标指标。

联合字段 _enabled

_enabled 只能是下列其中一项:

enabled

boolean

指示是否已启用读取池自动伸缩功能。

联合字段 _min_node_count

_min_node_count 只能是下列其中一项:

minNodeCount

integer

要维护的读取池节点数下限。

联合字段 _max_node_count

_max_node_count 只能是下列其中一项:

maxNodeCount

integer

要维护的读取池节点数上限。

联合字段 _disable_scale_in

_disable_scale_in 只能是下列其中一项:

disableScaleIn

boolean

表示读取池自动伸缩是否支持缩减操作(移除节点)。

联合字段 _scale_in_cooldown_seconds

_scale_in_cooldown_seconds 只能是下列其中一项:

scaleInCooldownSeconds

integer

缩减操作的冷却期。

联合字段 _scale_out_cooldown_seconds

_scale_out_cooldown_seconds 只能是下列其中一项:

scaleOutCooldownSeconds

integer

横向扩容操作的冷却期。

TargetMetric

JSON 表示法
{

  // Union field _metric can be only one of the following:
  "metric": string
  // End of list of possible types for union field _metric.

  // Union field _target_value can be only one of the following:
  "targetValue": number
  // End of list of possible types for union field _target_value.
}
字段

联合字段 _metric

_metric 只能是下列其中一项:

metric

string

用于自动伸缩的指标名称。

联合字段 _target_value

_target_value 只能是下列其中一项:

targetValue

number

相应指标的目标值。

SqlServerEntraIdConfig

JSON 表示法
{
  "kind": string,
  "tenantId": string,
  "applicationId": string
}
字段
kind

string

仅限输出。这始终为 sql#sqlServerEntraIdConfig

tenantId

string

可选。Entra ID 配置的租户 ID。

applicationId

string

可选。Entra ID 配置的应用 ID。

PerformanceCaptureConfig

JSON 表示法
{

  // Union field _enabled can be only one of the following:
  "enabled": boolean
  // End of list of possible types for union field _enabled.

  // Union field _probing_interval_seconds can be only one of the following:
  "probingIntervalSeconds": integer
  // End of list of possible types for union field _probing_interval_seconds.

  // Union field _probe_threshold can be only one of the following:
  "probeThreshold": integer
  // End of list of possible types for union field _probe_threshold.

  // Union field _running_threads_threshold can be only one of the following:
  "runningThreadsThreshold": integer
  // End of list of possible types for union field _running_threads_threshold.

  // Union field _seconds_behind_source_threshold can be only one of the
  // following:
  "secondsBehindSourceThreshold": integer
  // End of list of possible types for union field
  // _seconds_behind_source_threshold.

  // Union field _transaction_duration_threshold can be only one of the
  // following:
  "transactionDurationThreshold": integer
  // End of list of possible types for union field
  // _transaction_duration_threshold.
}
字段

联合字段 _enabled

_enabled 只能是下列其中一项:

enabled

boolean

可选。启用或停用表演捕捉功能。

联合字段 _probing_interval_seconds

_probing_interval_seconds 只能是下列其中一项:

probingIntervalSeconds

integer

可选。任意两次探测之间的时间间隔(以秒为单位)。

联合字段 _probe_threshold

_probe_threshold 只能是下列其中一项:

probeThreshold

integer

可选。触发实例状态捕获的连续读数高于阈值的最小次数。

联合字段 _running_threads_threshold

_running_threads_threshold 只能是下列其中一项:

runningThreadsThreshold

integer

可选。触发主服务器上的捕获所需的最低运行服务器线程数。

联合字段 _seconds_behind_source_threshold

_seconds_behind_source_threshold 只能是下列其中一项:

secondsBehindSourceThreshold

integer

可选。副本必须滞后于主实例的最短时间(以秒为单位),才能触发副本上的捕获。

联合字段 _transaction_duration_threshold

_transaction_duration_threshold 只能是下列其中一项:

transactionDurationThreshold

integer

可选。交易需要保持打开状态的时长(以秒为单位),之后监听器才会开始记录该交易。

SqlFailoverReplica

JSON 表示法
{
  "name": string,
  "available": boolean
}
字段
name

string

故障切换副本的名称。如果在创建实例时指定,则会为该实例创建故障切换副本。名称不包含项目 ID。

available

boolean

故障转移副本的可用性状态。值为 false 表示故障转移副本不同步。主实例只能在状态为 true 时故障切换到故障切换副本。

IpMapping

JSON 表示法
{
  "type": enum (SqlIpAddressType),
  "ipAddress": string,
  "timeToRetire": string
}
字段
type

enum (SqlIpAddressType)

此 IP 地址的类型。PRIMARY 地址是可以接受传入连接的公共地址。PRIVATE 地址是可以接受传入连接的专用地址。OUTGOING 地址是源自实例的连接的来源地址(如果支持)。

ipAddress

string

分配的 IP 地址。

timeToRetire

string (Timestamp format)

此 IP 的截止时间,采用 RFC 3339 格式,例如 2012-11-15T16:19:00.094Z。仅当 IP 计划停用时,此字段才可用。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

SslCert

JSON 表示法
{
  "kind": string,
  "certSerialNumber": string,
  "cert": string,
  "createTime": string,
  "commonName": string,
  "expirationTime": string,
  "sha1Fingerprint": string,
  "instance": string,
  "selfLink": string
}
字段
kind

string

始终为 sql#sslCert

certSerialNumber

string

从证书中提取的序列号。

cert

string

PEM 表示法。

createTime

string (Timestamp format)

证书的创建时间采用 RFC 3339 格式,例如 2012-11-15T16:19:00.094Z

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

commonName

string

用户提供的名称。限制为 [a-zA-Z.-_ ]+。

expirationTime

string (Timestamp format)

证书过期时间采用 RFC 3339 格式,例如 2012-11-15T16:19:00.094Z

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

sha1Fingerprint

string

SHA1 指纹。

instance

string

数据库实例的名称。

selfLink

string

此资源的 URI。

OnPremisesConfiguration

JSON 表示法
{
  "hostPort": string,
  "kind": string,
  "username": string,
  "password": string,
  "caCertificate": string,
  "clientCertificate": string,
  "clientKey": string,
  "dumpFilePath": string,
  "sourceInstance": {
    object (InstanceReference)
  },
  "selectedObjects": [
    {
      object (SelectedObjects)
    }
  ],
  "sslOption": enum (SslOption)
}
字段
hostPort

string

本地实例的主机和端口(采用主机:端口格式)

kind

string

始终为 sql#onPremisesConfiguration

username

string

用于连接到本地实例的用户名。

password

string

用于连接到本地实例的密码。

caCertificate

string

可信 CA x509 证书的 PEM 表示法。

clientCertificate

string

副本 x509 证书的 PEM 表示法。

clientKey

string

副本私钥的 PEM 表示法。相应的公钥在客户端的证书中进行编码。

dumpFilePath

string

用于创建 Cloud SQL 副本的转储文件。

sourceInstance

object (InstanceReference)

如果来源是 Cloud SQL,则为 Cloud SQL 实例的引用。

selectedObjects[]

object (SelectedObjects)

可选。用户选择从外部源实例复制的对象列表。

sslOption

enum (SslOption)

可选。用于副本连接到本地源的 SSL 选项。

InstanceReference

JSON 表示法
{
  "name": string,
  "region": string,
  "project": string
}
字段
name

string

所引用 Cloud SQL 实例的名称。不包括项目 ID。

region

string

所引用 Cloud SQL 实例的区域。

project

string

所引用 Cloud SQL 实例的项目 ID。默认值与实例引用的项目 ID 相同。

SelectedObjects

JSON 表示法
{
  "database": string
}
字段
database

string

必需。要迁移的数据库的名称。

ReplicaConfiguration

JSON 表示法
{
  "kind": string,
  "mysqlReplicaConfiguration": {
    object (MySqlReplicaConfiguration)
  },
  "failoverTarget": boolean,
  "cascadableReplica": boolean
}
字段
kind

string

始终为 sql#replicaConfiguration

mysqlReplicaConfiguration

object (MySqlReplicaConfiguration)

从 MySQL 本地主实例复制时的 MySQL 特定配置。复制配置信息(如用户名、密码、证书和密钥)不会存储在实例元数据中。配置信息仅用于设置复制连接,由 MySQL 存储在数据目录中名为 master.info 的文件中。

failoverTarget

boolean

指定副本是否为故障转移目标。如果将该字段设置为 true,则副本将被指定为故障切换副本。如果主实例发生故障,则副本实例将升级为新的主实例。只能将一个副本指定为故障切换目标,并且副本必须与主实例位于不同的地区。

cascadableReplica

boolean

可选。指定 SQL Server 副本是否为可级联副本。可级联副本是一种 SQL Server 跨区域副本,支持在其下创建副本。

MySqlReplicaConfiguration

JSON 表示法
{
  "dumpFilePath": string,
  "username": string,
  "password": string,
  "connectRetryInterval": integer,
  "masterHeartbeatPeriod": string,
  "caCertificate": string,
  "clientCertificate": string,
  "clientKey": string,
  "sslCipher": string,
  "verifyServerCertificate": boolean,
  "kind": string
}
字段
dumpFilePath

string

Google Cloud Storage 中要从中创建副本实例的 SQL 转储文件的路径。URI 的格式为 gs://bucketName/fileName。系统还支持压缩的 gzip 文件 (.gz)。转储具有复制开始的二进制日志坐标。这可以通过在使用 mysqldump 时将 --master-data 设置为 1 来实现。

username

string

用于复制连接的用户名。

password

string

用于复制连接的密码。

connectRetryInterval

integer

连接重试之间等待的秒数。MySQL 的默认值为 60 秒。

masterHeartbeatPeriod

string (Int64Value format)

复制检测信号之间的间隔(以毫秒为单位)。

caCertificate

string

可信 CA x509 证书的 PEM 表示法。

clientCertificate

string

副本 x509 证书的 PEM 表示法。

clientKey

string

副本私钥的 PEM 表示法。相应的公钥在客户端的证书中进行编码。

sslCipher

string

用于 SSL 加密的允许加密方式的列表。

verifyServerCertificate

boolean

是否检查主实例在 SSL 握手期间发送的证书中的通用名称值。

kind

string

始终为 sql#mysqlReplicaConfiguration

DiskEncryptionConfiguration

JSON 表示法
{
  "kmsKeyName": string,
  "kind": string
}
字段
kmsKeyName

string

用于磁盘加密的 KMS 密钥的资源名称

kind

string

始终为 sql#diskEncryptionConfiguration

DiskEncryptionStatus

JSON 表示法
{
  "kmsKeyVersionName": string,
  "kind": string
}
字段
kmsKeyVersionName

string

用于加密 Cloud SQL 实例资源的 KMS 密钥版本

kind

string

始终为 sql#diskEncryptionStatus

SqlScheduledMaintenance

JSON 表示法
{
  "startTime": string,
  "canDefer": boolean,
  "canReschedule": boolean,

  // Union field _schedule_deadline_time can be only one of the following:
  "scheduleDeadlineTime": string
  // End of list of possible types for union field _schedule_deadline_time.
}
字段
startTime

string (Timestamp format)

此实例的任何近期维护的开始时间。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

canDefer
(deprecated)

boolean

canReschedule

boolean

如果可以重新安排计划维护。

联合字段 _schedule_deadline_time

_schedule_deadline_time 只能是下列其中一项:

scheduleDeadlineTime

string (Timestamp format)

维护无法重新安排到此截止日期之后开始。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

SqlOutOfDiskReport

JSON 表示法
{

  // Union field _sql_out_of_disk_state can be only one of the following:
  "sqlOutOfDiskState": enum (SqlOutOfDiskState)
  // End of list of possible types for union field _sql_out_of_disk_state.

  // Union field _sql_min_recommended_increase_size_gb can be only one of the
  // following:
  "sqlMinRecommendedIncreaseSizeGb": integer
  // End of list of possible types for union field
  // _sql_min_recommended_increase_size_gb.
}
字段

联合字段 _sql_out_of_disk_state

_sql_out_of_disk_state 只能是下列其中一项:

sqlOutOfDiskState

enum (SqlOutOfDiskState)

此字段表示主动数据库健康状况作业针对 OutOfDisk 问题生成的健康状况。* Writer:* 针对 OOD 的主动数据库健康状况作业。* 读取者:* 主动数据库运行状况作业

联合字段 _sql_min_recommended_increase_size_gb

_sql_min_recommended_increase_size_gb 只能是下列其中一项:

sqlMinRecommendedIncreaseSizeGb

integer

建议的最小增加大小(以 GB 为单位)此字段由前端使用 * Writer: * OOD 的主动数据库健康状况作业。* 阅读器:

AvailableDatabaseVersion

JSON 表示法
{

  // Union field _major_version can be only one of the following:
  "majorVersion": string
  // End of list of possible types for union field _major_version.

  // Union field _name can be only one of the following:
  "name": string
  // End of list of possible types for union field _name.

  // Union field _display_name can be only one of the following:
  "displayName": string
  // End of list of possible types for union field _display_name.
}
字段

联合字段 _major_version

_major_version 只能是下列其中一项:

majorVersion

string

版本的主要版本名称。

联合字段 _name

_name 只能是下列其中一项:

name

string

数据库版本名称。对于 MySQL 8.0,此字符串提供数据库主要版本和次要版本。

联合字段 _display_name

_display_name 只能是下列其中一项:

displayName

string

数据库版本的显示名称。

ReplicationCluster

JSON 表示法
{
  "psaWriteEndpoint": string,
  "failoverDrReplicaName": string,
  "drReplica": boolean
}
字段
psaWriteEndpoint

string

仅限输出。如果设置,此字段表示相应实例具有指向集群主实例的专用服务访问 (PSA) DNS 端点。如果此实例是主实例,则 DNS 端点指向此实例。在切换或副本故障切换操作后,此 DNS 端点会指向升级后的实例。此字段是只读字段,会作为信息返回给用户。即使独立实例尚无灾难恢复副本或灾难恢复副本已被删除,此字段也可能存在。

failoverDrReplicaName

string

可选。如果实例是主实例,则此字段用于标识灾难恢复 (DR) 副本。灾难恢复副本是企业 Plus 版实例的可选配置。如果实例是读取副本,则不设置该字段。将此字段设置为副本名称,以指定主实例的灾难恢复副本。移除副本名称以移除灾难恢复副本指定。

drReplica

boolean

仅限输出。只读字段,用于指示相应副本是否为灾难恢复副本。如果实例是主实例,则不会设置此字段。

GeminiInstanceConfig

JSON 表示法
{

  // Union field _entitled can be only one of the following:
  "entitled": boolean
  // End of list of possible types for union field _entitled.

  // Union field _google_vacuum_mgmt_enabled can be only one of the following:
  "googleVacuumMgmtEnabled": boolean
  // End of list of possible types for union field _google_vacuum_mgmt_enabled.

  // Union field _oom_session_cancel_enabled can be only one of the following:
  "oomSessionCancelEnabled": boolean
  // End of list of possible types for union field _oom_session_cancel_enabled.

  // Union field _active_query_enabled can be only one of the following:
  "activeQueryEnabled": boolean
  // End of list of possible types for union field _active_query_enabled.

  // Union field _index_advisor_enabled can be only one of the following:
  "indexAdvisorEnabled": boolean
  // End of list of possible types for union field _index_advisor_enabled.

  // Union field _flag_recommender_enabled can be only one of the following:
  "flagRecommenderEnabled": boolean
  // End of list of possible types for union field _flag_recommender_enabled.
}
字段

联合字段 _entitled

_entitled 只能是下列其中一项:

entitled

boolean

仅限输出。Gemini 是否已启用。

联合字段 _google_vacuum_mgmt_enabled

_google_vacuum_mgmt_enabled 只能是下列其中一项:

googleVacuumMgmtEnabled

boolean

仅限输出。吸尘管理是否已启用。

联合字段 _oom_session_cancel_enabled

_oom_session_cancel_enabled 只能是下列其中一项:

oomSessionCancelEnabled

boolean

仅限输出。是否启用了取消内存不足 (OOM) 会话。

联合字段 _active_query_enabled

_active_query_enabled 只能是下列其中一项:

activeQueryEnabled

boolean

仅限输出。活跃查询是否已启用。

联合字段 _index_advisor_enabled

_index_advisor_enabled 只能是下列其中一项:

indexAdvisorEnabled

boolean

仅限输出。索引顾问是否已启用。

联合字段 _flag_recommender_enabled

_flag_recommender_enabled 只能是下列其中一项:

flagRecommenderEnabled

boolean

仅限输出。标志推荐器是否已启用。

TagsEntry

JSON 表示法
{
  "key": string,
  "value": string
}
字段
key

string

value

string

PoolNodeConfig

JSON 表示法
{
  "ipAddresses": [
    {
      object (IpMapping)
    }
  ],
  "dnsNames": [
    {
      object (DnsNameMapping)
    }
  ],
  "pscAutoConnections": [
    {
      object (PscAutoConnectionConfig)
    }
  ],

  // Union field _name can be only one of the following:
  "name": string
  // End of list of possible types for union field _name.

  // Union field _gce_zone can be only one of the following:
  "gceZone": string
  // End of list of possible types for union field _gce_zone.

  // Union field _dns_name can be only one of the following:
  "dnsName": string
  // End of list of possible types for union field _dns_name.

  // Union field _state can be only one of the following:
  "state": enum (SqlInstanceState)
  // End of list of possible types for union field _state.

  // Union field _psc_service_attachment_link can be only one of the following:
  "pscServiceAttachmentLink": string
  // End of list of possible types for union field _psc_service_attachment_link.
}
字段
ipAddresses[]

object (IpMapping)

仅限输出。包含可用于连接到读取池节点的 IP 地址的映射。

dnsNames[]

object (DnsNameMapping)

仅限输出。相应读取池节点使用的 DNS 名称列表。

pscAutoConnections[]

object (PscAutoConnectionConfig)

仅限输出。可用于连接到此读取池节点的自动设置的 Private Service Connect (PSC) 使用方端点的设置列表。

联合字段 _name

_name 只能是下列其中一项:

name

string

仅限输出。读取池节点的名称,用于检索指标和日志。

联合字段 _gce_zone

_gce_zone 只能是下列其中一项:

gceZone

string

仅限输出。读取池节点的可用区。

联合字段 _dns_name

_dns_name 只能是下列其中一项:

dnsName

string

仅限输出。读取池节点的 DNS 名称。

联合字段 _state

_state 只能是下列其中一项:

state

enum (SqlInstanceState)

仅限输出。读取池节点的当前状态。

联合字段 _psc_service_attachment_link

_psc_service_attachment_link 只能是下列其中一项:

pscServiceAttachmentLink

string

仅限输出。读取池节点的 Private Service Connect (PSC) 服务连接。

DnsNameMapping

JSON 表示法
{
  "name": string,
  "connectionType": enum (ConnectionType),
  "dnsScope": enum (DnsScope),
  "recordManager": enum (RecordManager)
}
字段
name

string

仅限输出。DNS 名称。

connectionType

enum (ConnectionType)

仅限输出。DNS 名称的连接类型。

dnsScope

enum (DnsScope)

仅限输出。DNS 名称适用的范围。

recordManager

enum (RecordManager)

仅限输出。相应 DNS 记录的管理员。

工具注释

破坏性提示:❌ | 等幂性提示:❌ | 只读提示:✅ | 开放世界提示:❌