cloud_sql_resources.proto 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.sql.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/protobuf/timestamp.proto";
  18. import "google/protobuf/wrappers.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/cloud/sql/v1;sql";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "CloudSqlResourcesProto";
  22. option java_package = "com.google.cloud.sql.v1";
  23. // LINT: LEGACY_NAMES
  24. // An entry for an Access Control list.
  25. message AclEntry {
  26. // The allowlisted value for the access control list.
  27. string value = 1;
  28. // The time when this access control entry expires in
  29. // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
  30. // **2012-11-15T16:19:00.094Z**.
  31. google.protobuf.Timestamp expiration_time = 2;
  32. // Optional. A label to identify this entry.
  33. string name = 3 [(google.api.field_behavior) = OPTIONAL];
  34. // This is always **sql#aclEntry**.
  35. string kind = 4;
  36. }
  37. // An Admin API warning message.
  38. message ApiWarning {
  39. enum SqlApiWarningCode {
  40. // An unknown or unset warning type from Cloud SQL API.
  41. SQL_API_WARNING_CODE_UNSPECIFIED = 0;
  42. // Warning when one or more regions are not reachable. The returned result
  43. // set may be incomplete.
  44. REGION_UNREACHABLE = 1;
  45. }
  46. // Code to uniquely identify the warning type.
  47. SqlApiWarningCode code = 1;
  48. // The warning message.
  49. string message = 2;
  50. // The region name for REGION_UNREACHABLE warning.
  51. string region = 3;
  52. }
  53. // We currently only support backup retention by specifying the number
  54. // of backups we will retain.
  55. message BackupRetentionSettings {
  56. // The units that retained_backups specifies, we only support COUNT.
  57. enum RetentionUnit {
  58. // Backup retention unit is unspecified, will be treated as COUNT.
  59. RETENTION_UNIT_UNSPECIFIED = 0;
  60. // Retention will be by count, eg. "retain the most recent 7 backups".
  61. COUNT = 1;
  62. }
  63. // The unit that 'retained_backups' represents.
  64. RetentionUnit retention_unit = 1;
  65. // Depending on the value of retention_unit, this is used to determine
  66. // if a backup needs to be deleted. If retention_unit is 'COUNT', we will
  67. // retain this many backups.
  68. google.protobuf.Int32Value retained_backups = 2;
  69. }
  70. // Database instance backup configuration.
  71. message BackupConfiguration {
  72. // Start time for the daily backup configuration in UTC timezone in the 24
  73. // hour format - **HH:MM**.
  74. string start_time = 1;
  75. // Whether this configuration is enabled.
  76. google.protobuf.BoolValue enabled = 2;
  77. // This is always **sql#backupConfiguration**.
  78. string kind = 3;
  79. // (MySQL only) Whether binary log is enabled. If backup configuration is
  80. // disabled, binarylog must be disabled as well.
  81. google.protobuf.BoolValue binary_log_enabled = 4;
  82. // Reserved for future use.
  83. google.protobuf.BoolValue replication_log_archiving_enabled = 5;
  84. // Location of the backup
  85. string location = 6;
  86. // (Postgres only) Whether point in time recovery is enabled.
  87. google.protobuf.BoolValue point_in_time_recovery_enabled = 7;
  88. // Backup retention settings.
  89. BackupRetentionSettings backup_retention_settings = 8;
  90. // The number of days of transaction logs we retain for point in time
  91. // restore, from 1-7.
  92. google.protobuf.Int32Value transaction_log_retention_days = 9;
  93. }
  94. // Backup context.
  95. message BackupContext {
  96. // The identifier of the backup.
  97. int64 backup_id = 1;
  98. // This is always **sql#backupContext**.
  99. string kind = 2;
  100. }
  101. // Represents a SQL database on the Cloud SQL instance.
  102. message Database {
  103. // This is always **sql#database**.
  104. string kind = 1;
  105. // The Cloud SQL charset value.
  106. string charset = 2;
  107. // The Cloud SQL collation value.
  108. string collation = 3;
  109. // This field is deprecated and will be removed from a future version of the
  110. // API.
  111. string etag = 4;
  112. // The name of the database in the Cloud SQL instance. This does not include
  113. // the project ID or instance name.
  114. string name = 5;
  115. // The name of the Cloud SQL instance. This does not include the project ID.
  116. string instance = 6;
  117. // The URI of this resource.
  118. string self_link = 7;
  119. // The project ID of the project containing the Cloud SQL database. The Google
  120. // apps domain is prefixed if applicable.
  121. string project = 8;
  122. oneof database_details {
  123. SqlServerDatabaseDetails sqlserver_database_details = 9;
  124. }
  125. }
  126. // Represents a Sql Server database on the Cloud SQL instance.
  127. message SqlServerDatabaseDetails {
  128. // The version of SQL Server with which the database is to be made compatible
  129. int32 compatibility_level = 1;
  130. // The recovery model of a SQL Server database
  131. string recovery_model = 2;
  132. }
  133. // Database flags for Cloud SQL instances.
  134. message DatabaseFlags {
  135. // The name of the flag. These flags are passed at instance startup, so
  136. // include both server options and system variables. Flags are
  137. // specified with underscores, not hyphens. For more information, see
  138. // [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
  139. // in the Cloud SQL documentation.
  140. string name = 1;
  141. // The value of the flag. Booleans are set to **on** for true
  142. // and **off** for false. This field must be omitted if the flag
  143. // doesn't take a value.
  144. string value = 2;
  145. }
  146. // MySQL-specific external server sync settings.
  147. message MySqlSyncConfig {
  148. // Flags to use for the initial dump.
  149. repeated SyncFlags initial_sync_flags = 1;
  150. }
  151. // Initial sync flags for certain Cloud SQL APIs.
  152. // Currently used for the MySQL external server initial dump.
  153. message SyncFlags {
  154. // The name of the flag.
  155. string name = 1;
  156. // The value of the flag. This field must be omitted if the flag
  157. // doesn't take a value.
  158. string value = 2;
  159. }
  160. // Reference to another Cloud SQL instance.
  161. message InstanceReference {
  162. // The name of the Cloud SQL instance being referenced.
  163. // This does not include the project ID.
  164. string name = 1;
  165. // The region of the Cloud SQL instance being referenced.
  166. string region = 2;
  167. // The project ID of the Cloud SQL instance being referenced.
  168. // The default is the same project ID as the instance references it.
  169. string project = 3;
  170. }
  171. // Read-replica configuration for connecting to the on-premises primary
  172. // instance.
  173. message DemoteMasterConfiguration {
  174. // This is always **sql#demoteMasterConfiguration**.
  175. string kind = 1;
  176. // MySQL specific configuration when replicating from a MySQL on-premises
  177. // primary instance. Replication configuration information such as the
  178. // username, password, certificates, and keys are not stored in the instance
  179. // metadata. The configuration information is used only to set up the
  180. // replication connection and is stored by MySQL in a file named
  181. // **master.info** in the data directory.
  182. DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2;
  183. }
  184. // Read-replica configuration specific to MySQL databases.
  185. message DemoteMasterMySqlReplicaConfiguration {
  186. // This is always **sql#demoteMasterMysqlReplicaConfiguration**.
  187. string kind = 1;
  188. // The username for the replication connection.
  189. string username = 2;
  190. // The password for the replication connection.
  191. string password = 3;
  192. // PEM representation of the replica's private key. The corresponsing public
  193. // key is encoded in the client's certificate. The format of the replica's
  194. // private key can be either PKCS #1 or PKCS #8.
  195. string client_key = 4;
  196. // PEM representation of the replica's x509 certificate.
  197. string client_certificate = 5;
  198. // PEM representation of the trusted CA's x509 certificate.
  199. string ca_certificate = 6;
  200. }
  201. // Database instance export context.
  202. message ExportContext {
  203. message SqlCsvExportOptions {
  204. // The select query used to extract the data.
  205. string select_query = 1;
  206. // Specifies the character that should appear before a data character that
  207. // needs to be escaped.
  208. string escape_character = 2;
  209. // Specifies the quoting character to be used when a data value is quoted.
  210. string quote_character = 3;
  211. // Specifies the character that separates columns within each row (line) of
  212. // the file.
  213. string fields_terminated_by = 4;
  214. // This is used to separate lines. If a line does not contain all fields,
  215. // the rest of the columns are set to their default values.
  216. string lines_terminated_by = 6;
  217. }
  218. message SqlExportOptions {
  219. // Options for exporting from MySQL.
  220. message MysqlExportOptions {
  221. // Option to include SQL statement required to set up replication.
  222. // * If set to **1**, the dump file includes
  223. // a CHANGE MASTER TO statement with the binary log coordinates,
  224. // and --set-gtid-purged is set to ON.
  225. // * If set to **2**, the CHANGE MASTER TO statement is written as
  226. // a SQL comment and has no effect.
  227. // * If set to any value other than **1**, --set-gtid-purged is set
  228. // to OFF.
  229. google.protobuf.Int32Value master_data = 1;
  230. }
  231. // Tables to export, or that were exported, from the specified database. If
  232. // you specify tables, specify one and only one database. For PostgreSQL
  233. // instances, you can specify only one table.
  234. repeated string tables = 1;
  235. // Export only schemas.
  236. google.protobuf.BoolValue schema_only = 2;
  237. MysqlExportOptions mysql_export_options = 3;
  238. }
  239. // The path to the file in Google Cloud Storage where the export will be
  240. // stored. The URI is in the form **gs://bucketName/fileName**. If the file
  241. // already exists, the request succeeds, but the operation fails. If
  242. // **fileType** is **SQL** and the filename ends with .gz,
  243. // the contents are compressed.
  244. string uri = 1;
  245. // Databases to be exported.
  246. // * **MySQL instances:** If **fileType** is **SQL** and no database is
  247. // specified, all databases are exported, except for the **mysql** system
  248. // database. If **fileType** is **CSV**, you can specify one database,
  249. // either by using this property or by using the
  250. // **csvExportOptions.selectQuery** property, which takes precedence
  251. // over this property.
  252. // * **PostgreSQL instances:** You must specify one database to be exported.
  253. // If **fileType** is **CSV**, this database must match the one specified in
  254. // the **csvExportOptions.selectQuery** property.
  255. // * **SQL Server instances:** You must specify one database to be exported,
  256. // and the **fileType** must be **BAK**.
  257. repeated string databases = 2;
  258. // This is always **sql#exportContext**.
  259. string kind = 3;
  260. // Options for exporting data as SQL statements.
  261. SqlExportOptions sql_export_options = 4;
  262. // Options for exporting data as CSV. **MySQL** and **PostgreSQL**
  263. // instances only.
  264. SqlCsvExportOptions csv_export_options = 5;
  265. // The file type for the specified uri.
  266. // * **SQL**: The file contains SQL statements.
  267. // * **CSV**: The file contains CSV data.
  268. // * **BAK**: The file contains backup data for a SQL Server instance.
  269. SqlFileType file_type = 6;
  270. // Option for export offload.
  271. google.protobuf.BoolValue offload = 8;
  272. }
  273. // Database instance import context.
  274. message ImportContext {
  275. message SqlCsvImportOptions {
  276. // The table to which CSV data is imported.
  277. string table = 1;
  278. // The columns to which CSV data is imported. If not specified, all columns
  279. // of the database table are loaded with CSV data.
  280. repeated string columns = 2;
  281. // Specifies the character that should appear before a data character that
  282. // needs to be escaped.
  283. string escape_character = 4;
  284. // Specifies the quoting character to be used when a data value is quoted.
  285. string quote_character = 5;
  286. // Specifies the character that separates columns within each row (line) of
  287. // the file.
  288. string fields_terminated_by = 6;
  289. // This is used to separate lines. If a line does not contain all fields,
  290. // the rest of the columns are set to their default values.
  291. string lines_terminated_by = 8;
  292. }
  293. message SqlBakImportOptions {
  294. message EncryptionOptions {
  295. // Path to the Certificate (.cer) in Cloud Storage, in the form
  296. // **gs://bucketName/fileName**. The instance must have
  297. // write permissions to the bucket and read access to the file.
  298. string cert_path = 1;
  299. // Path to the Certificate Private Key (.pvk) in Cloud Storage, in the
  300. // form **gs://bucketName/fileName**. The instance must have
  301. // write permissions to the bucket and read access to the file.
  302. string pvk_path = 2;
  303. // Password that encrypts the private key
  304. string pvk_password = 3;
  305. }
  306. EncryptionOptions encryption_options = 1;
  307. }
  308. // Path to the import file in Cloud Storage, in the form
  309. // **gs://bucketName/fileName**. Compressed gzip files (.gz) are supported
  310. // when **fileType** is **SQL**. The instance must have
  311. // write permissions to the bucket and read access to the file.
  312. string uri = 1;
  313. // The target database for the import. If **fileType** is **SQL**, this field
  314. // is required only if the import file does not specify a database, and is
  315. // overridden by any database specification in the import file. If
  316. // **fileType** is **CSV**, one database must be specified.
  317. string database = 2;
  318. // This is always **sql#importContext**.
  319. string kind = 3;
  320. // The file type for the specified uri. <br>**SQL**: The file
  321. // contains SQL statements. <br>**CSV**: The file contains CSV data.
  322. SqlFileType file_type = 4;
  323. // Options for importing data as CSV.
  324. SqlCsvImportOptions csv_import_options = 5;
  325. // The PostgreSQL user for this import operation. PostgreSQL instances only.
  326. string import_user = 6;
  327. // Import parameters specific to SQL Server .BAK files
  328. SqlBakImportOptions bak_import_options = 7;
  329. }
  330. enum SqlFileType {
  331. // Unknown file type.
  332. SQL_FILE_TYPE_UNSPECIFIED = 0;
  333. // File containing SQL statements.
  334. SQL = 1;
  335. // File in CSV format.
  336. CSV = 2;
  337. BAK = 4;
  338. }
  339. // IP Management configuration.
  340. message IpConfiguration {
  341. // Whether the instance is assigned a public IP address or not.
  342. google.protobuf.BoolValue ipv4_enabled = 1;
  343. // The resource link for the VPC network from which the Cloud SQL instance is
  344. // accessible for private IP. For example,
  345. // **/projects/myProject/global/networks/default**. This setting can
  346. // be updated, but it cannot be removed after it is set.
  347. string private_network = 2;
  348. // Whether SSL connections over IP are enforced or not.
  349. google.protobuf.BoolValue require_ssl = 3;
  350. // The list of external networks that are allowed to connect to the instance
  351. // using the IP. In 'CIDR' notation, also known as 'slash' notation (for
  352. // example: **192.168.100.0/24**).
  353. repeated AclEntry authorized_networks = 4;
  354. // The name of the allocated ip range for the private ip CloudSQL instance.
  355. // For example: "google-managed-services-default". If set, the instance ip
  356. // will be created in the allocated range. The range name must comply with
  357. // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
  358. // must be 1-63 characters long and match the regular expression
  359. // `[a-z]([-a-z0-9]*[a-z0-9])?.`
  360. // Reserved for future use.
  361. string allocated_ip_range = 6;
  362. }
  363. // Preferred location. This specifies where a Cloud SQL instance is located.
  364. // Note that if the preferred location is not available, the instance will be
  365. // located as close as possible within the region. Only one location may be
  366. // specified.
  367. message LocationPreference {
  368. // The App Engine application to follow, it must be in the same region as the
  369. // Cloud SQL instance.
  370. string follow_gae_application = 1 [deprecated = true];
  371. // The preferred Compute Engine zone (for example: us-central1-a,
  372. // us-central1-b, etc.).
  373. string zone = 2;
  374. // The preferred Compute Engine zone for the secondary/failover
  375. // (for example: us-central1-a, us-central1-b, etc.).
  376. // Reserved for future use.
  377. string secondary_zone = 4;
  378. // This is always **sql#locationPreference**.
  379. string kind = 3;
  380. }
  381. // Maintenance window. This specifies when a Cloud SQL instance is
  382. // restarted for system maintenance purposes.
  383. message MaintenanceWindow {
  384. // hour of day - 0 to 23.
  385. google.protobuf.Int32Value hour = 1;
  386. // day of week (1-7), starting on Monday.
  387. google.protobuf.Int32Value day = 2;
  388. // Maintenance timing setting: **canary** (Earlier) or **stable** (Later).
  389. // [Learn
  390. // more](https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen).
  391. SqlUpdateTrack update_track = 3;
  392. // This is always **sql#maintenanceWindow**.
  393. string kind = 4;
  394. }
  395. // Deny maintenance Periods. This specifies a date range during when all CSA
  396. // rollout will be denied.
  397. message DenyMaintenancePeriod {
  398. // "deny maintenance period" start date. If the year of the start date is
  399. // empty, the year of the end date also must be empty. In this case, it means
  400. // the deny maintenance period recurs every year. The date is in format
  401. // yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
  402. string start_date = 1;
  403. // "deny maintenance period" end date. If the year of the end date is empty,
  404. // the year of the start date also must be empty. In this case, it means the
  405. // no maintenance interval recurs every year. The date is in format yyyy-mm-dd
  406. // i.e., 2020-11-01, or mm-dd, i.e., 11-01
  407. string end_date = 2;
  408. // Time in UTC when the "deny maintenance period" starts on start_date and
  409. // ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
  410. string time = 3;
  411. }
  412. // Insights configuration. This specifies when Cloud SQL Insights feature is
  413. // enabled and optional configuration.
  414. message InsightsConfig {
  415. // Whether Query Insights feature is enabled.
  416. bool query_insights_enabled = 1;
  417. // Whether Query Insights will record client address when enabled.
  418. bool record_client_address = 2;
  419. // Whether Query Insights will record application tags from query when
  420. // enabled.
  421. bool record_application_tags = 3;
  422. // Maximum query length stored in bytes. Default value: 1024 bytes.
  423. // Range: 256-4500 bytes. Query length more than this field value will be
  424. // truncated to this value. When unset, query length will be the default
  425. // value. Changing query length will restart the database.
  426. google.protobuf.Int32Value query_string_length = 4;
  427. // Number of query execution plans captured by Insights per minute
  428. // for all queries combined. Default is 5.
  429. google.protobuf.Int32Value query_plans_per_minute = 5;
  430. }
  431. // Read-replica configuration specific to MySQL databases.
  432. message MySqlReplicaConfiguration {
  433. // Path to a SQL dump file in Google Cloud Storage from which the replica
  434. // instance is to be created. The URI is in the form gs://bucketName/fileName.
  435. // Compressed gzip files (.gz) are also supported.
  436. // Dumps have the binlog co-ordinates from which replication
  437. // begins. This can be accomplished by setting --master-data to 1 when using
  438. // mysqldump.
  439. string dump_file_path = 1;
  440. // The username for the replication connection.
  441. string username = 2;
  442. // The password for the replication connection.
  443. string password = 3;
  444. // Seconds to wait between connect retries. MySQL's default is 60 seconds.
  445. google.protobuf.Int32Value connect_retry_interval = 4;
  446. // Interval in milliseconds between replication heartbeats.
  447. google.protobuf.Int64Value master_heartbeat_period = 5;
  448. // PEM representation of the trusted CA's x509 certificate.
  449. string ca_certificate = 6;
  450. // PEM representation of the replica's x509 certificate.
  451. string client_certificate = 7;
  452. // PEM representation of the replica's private key. The corresponsing public
  453. // key is encoded in the client's certificate.
  454. string client_key = 8;
  455. // A list of permissible ciphers to use for SSL encryption.
  456. string ssl_cipher = 9;
  457. // Whether or not to check the primary instance's Common Name value in the
  458. // certificate that it sends during the SSL handshake.
  459. google.protobuf.BoolValue verify_server_certificate = 10;
  460. // This is always **sql#mysqlReplicaConfiguration**.
  461. string kind = 11;
  462. }
  463. // Disk encryption configuration for an instance.
  464. message DiskEncryptionConfiguration {
  465. // Resource name of KMS key for disk encryption
  466. string kms_key_name = 1;
  467. // This is always **sql#diskEncryptionConfiguration**.
  468. string kind = 2;
  469. }
  470. // Disk encryption status for an instance.
  471. message DiskEncryptionStatus {
  472. // KMS key version used to encrypt the Cloud SQL instance resource
  473. string kms_key_version_name = 1;
  474. // This is always **sql#diskEncryptionStatus**.
  475. string kind = 2;
  476. }
  477. // Database instance IP Mapping.
  478. message IpMapping {
  479. // The type of this IP address. A **PRIMARY** address is a public address that
  480. // can accept incoming connections. A **PRIVATE** address is a private address
  481. // that can accept incoming connections. An **OUTGOING** address is the source
  482. // address of connections originating from the instance, if supported.
  483. SqlIpAddressType type = 1;
  484. // The IP address assigned.
  485. string ip_address = 2;
  486. // The due time for this IP to be retired in
  487. // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
  488. // **2012-11-15T16:19:00.094Z**. This field is only available when
  489. // the IP is scheduled to be retired.
  490. google.protobuf.Timestamp time_to_retire = 3;
  491. }
  492. // An Operation resource.&nbsp;For successful operations that return an
  493. // Operation resource, only the fields relevant to the operation are populated
  494. // in the resource.
  495. message Operation {
  496. // The type of Cloud SQL operation.
  497. enum SqlOperationType {
  498. // Unknown operation type.
  499. SQL_OPERATION_TYPE_UNSPECIFIED = 0;
  500. // Imports data into a Cloud SQL instance.
  501. IMPORT = 1;
  502. // Exports data from a Cloud SQL instance to a Cloud Storage
  503. // bucket.
  504. EXPORT = 2;
  505. // Creates a new Cloud SQL instance.
  506. CREATE = 3;
  507. // Updates the settings of a Cloud SQL instance.
  508. UPDATE = 4;
  509. // Deletes a Cloud SQL instance.
  510. DELETE = 5;
  511. // Restarts the Cloud SQL instance.
  512. RESTART = 6;
  513. BACKUP = 7 [deprecated = true];
  514. SNAPSHOT = 8 [deprecated = true];
  515. // Performs instance backup.
  516. BACKUP_VOLUME = 9;
  517. // Deletes an instance backup.
  518. DELETE_VOLUME = 10;
  519. // Restores an instance backup.
  520. RESTORE_VOLUME = 11;
  521. // Injects a privileged user in mysql for MOB instances.
  522. INJECT_USER = 12;
  523. // Clones a Cloud SQL instance.
  524. CLONE = 14;
  525. // Stops replication on a Cloud SQL read replica instance.
  526. STOP_REPLICA = 15;
  527. // Starts replication on a Cloud SQL read replica instance.
  528. START_REPLICA = 16;
  529. // Promotes a Cloud SQL replica instance.
  530. PROMOTE_REPLICA = 17;
  531. // Creates a Cloud SQL replica instance.
  532. CREATE_REPLICA = 18;
  533. // Creates a new user in a Cloud SQL instance.
  534. CREATE_USER = 19;
  535. // Deletes a user from a Cloud SQL instance.
  536. DELETE_USER = 20;
  537. // Updates an existing user in a Cloud SQL instance.
  538. UPDATE_USER = 21;
  539. // Creates a database in the Cloud SQL instance.
  540. CREATE_DATABASE = 22;
  541. // Deletes a database in the Cloud SQL instance.
  542. DELETE_DATABASE = 23;
  543. // Updates a database in the Cloud SQL instance.
  544. UPDATE_DATABASE = 24;
  545. // Performs failover of an HA-enabled Cloud SQL
  546. // failover replica.
  547. FAILOVER = 25;
  548. // Deletes the backup taken by a backup run.
  549. DELETE_BACKUP = 26;
  550. RECREATE_REPLICA = 27;
  551. // Truncates a general or slow log table in MySQL.
  552. TRUNCATE_LOG = 28;
  553. // Demotes the stand-alone instance to be a Cloud SQL
  554. // read replica for an external database server.
  555. DEMOTE_MASTER = 29;
  556. // Indicates that the instance is currently in maintenance. Maintenance
  557. // typically causes the instance to be unavailable for 1-3 minutes.
  558. MAINTENANCE = 30;
  559. // This field is deprecated, and will be removed in future version of API.
  560. ENABLE_PRIVATE_IP = 31 [deprecated = true];
  561. DEFER_MAINTENANCE = 32 [deprecated = true];
  562. // Creates clone instance.
  563. CREATE_CLONE = 33 [deprecated = true];
  564. // Reschedule maintenance to another time.
  565. RESCHEDULE_MAINTENANCE = 34;
  566. // Starts external sync of a Cloud SQL EM replica to an external primary
  567. // instance.
  568. START_EXTERNAL_SYNC = 35;
  569. }
  570. // The status of an operation.
  571. enum SqlOperationStatus {
  572. // The state of the operation is unknown.
  573. SQL_OPERATION_STATUS_UNSPECIFIED = 0;
  574. // The operation has been queued, but has not started yet.
  575. PENDING = 1;
  576. // The operation is running.
  577. RUNNING = 2;
  578. // The operation completed.
  579. DONE = 3;
  580. }
  581. // This is always **sql#operation**.
  582. string kind = 1;
  583. string target_link = 2;
  584. // The status of an operation. Valid values are:
  585. // * **PENDING**
  586. // * **RUNNING**
  587. // * **DONE**
  588. // * **SQL_OPERATION_STATUS_UNSPECIFIED**
  589. SqlOperationStatus status = 3;
  590. // The email address of the user who initiated this operation.
  591. string user = 4;
  592. // The time this operation was enqueued in UTC timezone in [RFC
  593. // 3339](https://tools.ietf.org/html/rfc3339) format, for example
  594. // **2012-11-15T16:19:00.094Z**.
  595. google.protobuf.Timestamp insert_time = 5;
  596. // The time this operation actually started in UTC timezone in [RFC
  597. // 3339](https://tools.ietf.org/html/rfc3339) format, for example
  598. // **2012-11-15T16:19:00.094Z**.
  599. google.protobuf.Timestamp start_time = 6;
  600. // The time this operation finished in UTC timezone in [RFC
  601. // 3339](https://tools.ietf.org/html/rfc3339) format, for example
  602. // **2012-11-15T16:19:00.094Z**.
  603. google.protobuf.Timestamp end_time = 7;
  604. // If errors occurred during processing of this operation, this field will be
  605. // populated.
  606. OperationErrors error = 8;
  607. // The type of the operation. Valid values are:
  608. // * **CREATE**
  609. // * **DELETE**
  610. // * **UPDATE**
  611. // * **RESTART**
  612. // * **IMPORT**
  613. // * **EXPORT**
  614. // * **BACKUP_VOLUME**
  615. // * **RESTORE_VOLUME**
  616. // * **CREATE_USER**
  617. // * **DELETE_USER**
  618. // * **CREATE_DATABASE**
  619. // * **DELETE_DATABASE**
  620. SqlOperationType operation_type = 9;
  621. // The context for import operation, if applicable.
  622. ImportContext import_context = 10;
  623. // The context for export operation, if applicable.
  624. ExportContext export_context = 11;
  625. // The context for backup operation, if applicable.
  626. BackupContext backup_context = 17;
  627. // An identifier that uniquely identifies the operation. You can use this
  628. // identifier to retrieve the Operations resource that has information about
  629. // the operation.
  630. string name = 12;
  631. // Name of the database instance related to this operation.
  632. string target_id = 13;
  633. // The URI of this resource.
  634. string self_link = 14;
  635. // The project ID of the target instance related to this operation.
  636. string target_project = 15;
  637. }
  638. // Database instance operation error.
  639. message OperationError {
  640. // This is always **sql#operationError**.
  641. string kind = 1;
  642. // Identifies the specific error that occurred.
  643. string code = 2;
  644. // Additional information about the error encountered.
  645. string message = 3;
  646. }
  647. // Database instance operation errors list wrapper.
  648. message OperationErrors {
  649. // This is always **sql#operationErrors**.
  650. string kind = 1;
  651. // The list of errors encountered while processing this operation.
  652. repeated OperationError errors = 2;
  653. }
  654. // Database instance settings.
  655. message Settings {
  656. // Specifies when the instance is activated.
  657. enum SqlActivationPolicy {
  658. // Unknown activation plan.
  659. SQL_ACTIVATION_POLICY_UNSPECIFIED = 0;
  660. // The instance is always up and running.
  661. ALWAYS = 1;
  662. // The instance never starts.
  663. NEVER = 2;
  664. // The instance starts upon receiving requests.
  665. ON_DEMAND = 3 [deprecated = true];
  666. }
  667. // The version of instance settings. This is a required field for update
  668. // method to make sure concurrent updates are handled properly. During update,
  669. // use the most recent settingsVersion value for this instance and do not try
  670. // to update this value.
  671. google.protobuf.Int64Value settings_version = 1;
  672. // The App Engine app IDs that can access this instance.
  673. // (Deprecated) Applied to First Generation instances only.
  674. repeated string authorized_gae_applications = 2 [deprecated = true];
  675. // The tier (or machine type) for this instance, for example
  676. // **db-custom-1-3840**.
  677. string tier = 3;
  678. // This is always **sql#settings**.
  679. string kind = 4;
  680. // User-provided labels, represented as a dictionary where each label is a
  681. // single key value pair.
  682. map<string, string> user_labels = 5;
  683. // Availability type. Potential values:
  684. // * **ZONAL**: The instance serves data from only one zone. Outages in that
  685. // zone affect data accessibility.
  686. // * **REGIONAL**: The instance can serve data from more than one zone in a
  687. // region (it is highly available)./
  688. //
  689. // For more information, see [Overview of the High Availability
  690. // Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
  691. SqlAvailabilityType availability_type = 6;
  692. // The pricing plan for this instance. This can be either **PER_USE** or
  693. // **PACKAGE**. Only **PER_USE** is supported for Second Generation instances.
  694. SqlPricingPlan pricing_plan = 7;
  695. // The type of replication this instance uses. This can be either
  696. // **ASYNCHRONOUS** or **SYNCHRONOUS**. (Deprecated) This property was only
  697. // applicable to First Generation instances.
  698. SqlReplicationType replication_type = 8 [deprecated = true];
  699. // The maximum size to which storage capacity can be automatically increased.
  700. // The default value is 0, which specifies that there is no limit.
  701. google.protobuf.Int64Value storage_auto_resize_limit = 9;
  702. // The activation policy specifies when the instance is activated; it is
  703. // applicable only when the instance state is RUNNABLE. Valid values:
  704. // * **ALWAYS**: The instance is on, and remains so even in the absence of
  705. // connection requests.
  706. // * **NEVER**: The instance is off; it is not activated, even if a
  707. // connection request arrives.
  708. SqlActivationPolicy activation_policy = 10;
  709. // The settings for IP Management. This allows to enable or disable the
  710. // instance IP and manage which external networks can connect to the instance.
  711. // The IPv4 address cannot be disabled for Second Generation instances.
  712. IpConfiguration ip_configuration = 11;
  713. // Configuration to increase storage size automatically. The default value is
  714. // true.
  715. google.protobuf.BoolValue storage_auto_resize = 12;
  716. // The location preference settings. This allows the instance to be located as
  717. // near as possible to either an App Engine app or Compute Engine zone for
  718. // better performance. App Engine co-location was only applicable to First
  719. // Generation instances.
  720. LocationPreference location_preference = 13;
  721. // The database flags passed to the instance at startup.
  722. repeated DatabaseFlags database_flags = 14;
  723. // The type of data disk: **PD_SSD** (default) or **PD_HDD**. Not used for
  724. // First Generation instances.
  725. SqlDataDiskType data_disk_type = 15;
  726. // The maintenance window for this instance. This specifies when the instance
  727. // can be restarted for maintenance purposes.
  728. MaintenanceWindow maintenance_window = 16;
  729. // The daily backup configuration for the instance.
  730. BackupConfiguration backup_configuration = 17;
  731. // Configuration specific to read replica instances. Indicates whether
  732. // replication is enabled or not.
  733. google.protobuf.BoolValue database_replication_enabled = 18;
  734. // Configuration specific to read replica instances. Indicates whether
  735. // database flags for crash-safe replication are enabled. This property was
  736. // only applicable to First Generation instances.
  737. google.protobuf.BoolValue crash_safe_replication_enabled = 19 [deprecated = true];
  738. // The size of data disk, in GB. The data disk size minimum is 10GB.
  739. google.protobuf.Int64Value data_disk_size_gb = 20;
  740. // Active Directory configuration, relevant only for Cloud SQL for SQL Server.
  741. SqlActiveDirectoryConfig active_directory_config = 22;
  742. // The name of server Instance collation.
  743. string collation = 23;
  744. // Deny maintenance periods
  745. repeated DenyMaintenancePeriod deny_maintenance_periods = 24;
  746. // Insights configuration, for now relevant only for Postgres.
  747. InsightsConfig insights_config = 25;
  748. // SQL Server specific audit configuration.
  749. SqlServerAuditConfig sql_server_audit_config = 29;
  750. }
  751. // SslCerts Resource
  752. message SslCert {
  753. // This is always **sql#sslCert**.
  754. string kind = 1;
  755. // Serial number, as extracted from the certificate.
  756. string cert_serial_number = 2;
  757. // PEM representation.
  758. string cert = 3;
  759. // The time when the certificate was created in [RFC
  760. // 3339](https://tools.ietf.org/html/rfc3339) format, for example
  761. // **2012-11-15T16:19:00.094Z**
  762. google.protobuf.Timestamp create_time = 4;
  763. // User supplied name. Constrained to [a-zA-Z.-_ ]+.
  764. string common_name = 5;
  765. // The time when the certificate expires in [RFC
  766. // 3339](https://tools.ietf.org/html/rfc3339) format, for example
  767. // **2012-11-15T16:19:00.094Z**.
  768. google.protobuf.Timestamp expiration_time = 6;
  769. // Sha1 Fingerprint.
  770. string sha1_fingerprint = 7;
  771. // Name of the database instance.
  772. string instance = 8;
  773. // The URI of this resource.
  774. string self_link = 9;
  775. }
  776. // SslCertDetail.
  777. message SslCertDetail {
  778. // The public information about the cert.
  779. SslCert cert_info = 1;
  780. // The private key for the client cert, in pem format. Keep private in order
  781. // to protect your security.
  782. string cert_private_key = 2;
  783. }
  784. // Active Directory configuration, relevant only for Cloud SQL for SQL Server.
  785. message SqlActiveDirectoryConfig {
  786. // This is always sql#activeDirectoryConfig.
  787. string kind = 1;
  788. // The name of the domain (e.g., mydomain.com).
  789. string domain = 2;
  790. }
  791. // SQL Server specific audit configuration.
  792. message SqlServerAuditConfig {
  793. // This is always sql#sqlServerAuditConfig
  794. string kind = 1;
  795. // The name of the destination bucket (e.g., gs://mybucket).
  796. string bucket = 2;
  797. }
  798. enum SqlBackendType {
  799. // This is an unknown backend type for instance.
  800. SQL_BACKEND_TYPE_UNSPECIFIED = 0;
  801. // V1 speckle instance.
  802. FIRST_GEN = 1 [deprecated = true];
  803. // V2 speckle instance.
  804. SECOND_GEN = 2;
  805. // On premises instance.
  806. EXTERNAL = 3;
  807. }
  808. enum SqlIpAddressType {
  809. // This is an unknown IP address type.
  810. SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0;
  811. // IP address the customer is supposed to connect to. Usually this is the
  812. // load balancer's IP address
  813. PRIMARY = 1;
  814. // Source IP address of the connection a read replica establishes to its
  815. // external primary instance. This IP address can be allowlisted by the
  816. // customer in case it has a firewall that filters incoming connection to its
  817. // on premises primary instance.
  818. OUTGOING = 2;
  819. // Private IP used when using private IPs and network peering.
  820. PRIVATE = 3;
  821. // V1 IP of a migrated instance. We want the user to
  822. // decommission this IP as soon as the migration is complete.
  823. // Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
  824. MIGRATED_1ST_GEN = 4;
  825. }
  826. // The database engine type and version.
  827. enum SqlDatabaseVersion {
  828. // This is an unknown database version.
  829. SQL_DATABASE_VERSION_UNSPECIFIED = 0;
  830. // The database version is MySQL 5.1.
  831. MYSQL_5_1 = 2 [deprecated = true];
  832. // The database version is MySQL 5.5.
  833. MYSQL_5_5 = 3 [deprecated = true];
  834. // The database version is MySQL 5.6.
  835. MYSQL_5_6 = 5;
  836. // The database version is MySQL 5.7.
  837. MYSQL_5_7 = 6;
  838. // The database version is PostgreSQL 9.6.
  839. POSTGRES_9_6 = 9;
  840. // The database version is PostgreSQL 11.
  841. POSTGRES_11 = 10;
  842. // The database version is SQL Server 2017 Standard.
  843. SQLSERVER_2017_STANDARD = 11;
  844. // The database version is SQL Server 2017 Enterprise.
  845. SQLSERVER_2017_ENTERPRISE = 14;
  846. // The database version is SQL Server 2017 Express.
  847. SQLSERVER_2017_EXPRESS = 15;
  848. // The database version is SQL Server 2017 Web.
  849. SQLSERVER_2017_WEB = 16;
  850. // The database version is PostgreSQL 10.
  851. POSTGRES_10 = 18;
  852. // The database version is PostgreSQL 12.
  853. POSTGRES_12 = 19;
  854. // The database version is PostgreSQL 13.
  855. POSTGRES_13 = 23;
  856. // The database version is SQL Server 2019 Standard.
  857. SQLSERVER_2019_STANDARD = 26;
  858. // The database version is SQL Server 2019 Enterprise.
  859. SQLSERVER_2019_ENTERPRISE = 27;
  860. // The database version is SQL Server 2019 Express.
  861. SQLSERVER_2019_EXPRESS = 28;
  862. // The database version is SQL Server 2019 Web.
  863. SQLSERVER_2019_WEB = 29;
  864. }
  865. // The pricing plan for this instance.
  866. enum SqlPricingPlan {
  867. // This is an unknown pricing plan for this instance.
  868. SQL_PRICING_PLAN_UNSPECIFIED = 0;
  869. // The instance is billed at a monthly flat rate.
  870. PACKAGE = 1;
  871. // The instance is billed per usage.
  872. PER_USE = 2;
  873. }
  874. enum SqlReplicationType {
  875. // This is an unknown replication type for a Cloud SQL instance.
  876. SQL_REPLICATION_TYPE_UNSPECIFIED = 0;
  877. // The synchronous replication mode for First Generation instances. It is the
  878. // default value.
  879. SYNCHRONOUS = 1;
  880. // The asynchronous replication mode for First Generation instances. It
  881. // provides a slight performance gain, but if an outage occurs while this
  882. // option is set to asynchronous, you can lose up to a few seconds of updates
  883. // to your data.
  884. ASYNCHRONOUS = 2;
  885. }
  886. // The type of disk that is used for a v2 instance to use.
  887. enum SqlDataDiskType {
  888. // This is an unknown data disk type.
  889. SQL_DATA_DISK_TYPE_UNSPECIFIED = 0;
  890. // An SSD data disk.
  891. PD_SSD = 1;
  892. // An HDD data disk.
  893. PD_HDD = 2;
  894. // This field is deprecated and will be removed from a future version of the
  895. // API.
  896. OBSOLETE_LOCAL_SSD = 3 [deprecated = true];
  897. }
  898. // The availability type of the given Cloud SQL instance.
  899. enum SqlAvailabilityType {
  900. // This is an unknown Availability type.
  901. SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0;
  902. // Zonal available instance.
  903. ZONAL = 1;
  904. // Regional available instance.
  905. REGIONAL = 2;
  906. }
  907. enum SqlUpdateTrack {
  908. // This is an unknown maintenance timing preference.
  909. SQL_UPDATE_TRACK_UNSPECIFIED = 0;
  910. // For instance update that requires a restart, this update track indicates
  911. // your instance prefer to restart for new version early in maintenance
  912. // window.
  913. canary = 1;
  914. // For instance update that requires a restart, this update track indicates
  915. // your instance prefer to let Cloud SQL choose the timing of restart (within
  916. // its Maintenance window, if applicable).
  917. stable = 2;
  918. }