cloud_sql_instances.proto 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219
  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/annotations.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/cloud/sql/v1/cloud_sql_resources.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/protobuf/wrappers.proto";
  21. import "google/api/client.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/sql/v1;sql";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "CloudSqlServiceProto";
  25. option java_package = "com.google.cloud.sql.v1";
  26. // LINT: LEGACY_NAMES
  27. // Service to manage Cloud SQL instances.
  28. service SqlInstancesService {
  29. option (google.api.default_host) = "sqladmin.googleapis.com";
  30. option (google.api.oauth_scopes) =
  31. "https://www.googleapis.com/auth/cloud-platform,"
  32. "https://www.googleapis.com/auth/sqlservice.admin";
  33. // Adds a new trusted Certificate Authority (CA) version for the specified
  34. // instance. Required to prepare for a certificate rotation. If a CA version
  35. // was previously added but never used in a certificate rotation, this
  36. // operation replaces that version. There cannot be more than one CA version
  37. // waiting to be rotated in.
  38. rpc AddServerCa(SqlInstancesAddServerCaRequest) returns (Operation) {
  39. option (google.api.http) = {
  40. post: "/v1/projects/{project}/instances/{instance}/addServerCa"
  41. };
  42. }
  43. // Creates a Cloud SQL instance as a clone of the source instance. Using this
  44. // operation might cause your instance to restart.
  45. rpc Clone(SqlInstancesCloneRequest) returns (Operation) {
  46. option (google.api.http) = {
  47. post: "/v1/projects/{project}/instances/{instance}/clone"
  48. body: "body"
  49. };
  50. }
  51. // Deletes a Cloud SQL instance.
  52. rpc Delete(SqlInstancesDeleteRequest) returns (Operation) {
  53. option (google.api.http) = {
  54. delete: "/v1/projects/{project}/instances/{instance}"
  55. };
  56. }
  57. // Demotes the stand-alone instance to be a Cloud SQL read replica for an
  58. // external database server.
  59. rpc DemoteMaster(SqlInstancesDemoteMasterRequest) returns (Operation) {
  60. option (google.api.http) = {
  61. post: "/v1/projects/{project}/instances/{instance}/demoteMaster"
  62. body: "body"
  63. };
  64. }
  65. // Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
  66. // dump or CSV file.
  67. rpc Export(SqlInstancesExportRequest) returns (Operation) {
  68. option (google.api.http) = {
  69. post: "/v1/projects/{project}/instances/{instance}/export"
  70. body: "body"
  71. };
  72. }
  73. // Initiates a manual failover of a high availability (HA) primary instance
  74. // to a standby instance, which becomes the primary instance. Users are
  75. // then rerouted to the new primary. For more information, see the
  76. // [Overview of high
  77. // availability](https://cloud.google.com/sql/docs/mysql/high-availability)
  78. // page in the Cloud SQL documentation.
  79. // If using Legacy HA (MySQL only), this causes the instance to failover to
  80. // its failover replica instance.
  81. rpc Failover(SqlInstancesFailoverRequest) returns (Operation) {
  82. option (google.api.http) = {
  83. post: "/v1/projects/{project}/instances/{instance}/failover"
  84. body: "body"
  85. };
  86. }
  87. // Retrieves a resource containing information about a Cloud SQL instance.
  88. rpc Get(SqlInstancesGetRequest) returns (DatabaseInstance) {
  89. option (google.api.http) = {
  90. get: "/v1/projects/{project}/instances/{instance}"
  91. };
  92. }
  93. // Imports data into a Cloud SQL instance from a SQL dump or CSV file in
  94. // Cloud Storage.
  95. rpc Import(SqlInstancesImportRequest) returns (Operation) {
  96. option (google.api.http) = {
  97. post: "/v1/projects/{project}/instances/{instance}/import"
  98. body: "body"
  99. };
  100. }
  101. // Creates a new Cloud SQL instance.
  102. rpc Insert(SqlInstancesInsertRequest) returns (Operation) {
  103. option (google.api.http) = {
  104. post: "/v1/projects/{project}/instances"
  105. body: "body"
  106. };
  107. }
  108. // Lists instances under a given project.
  109. rpc List(SqlInstancesListRequest) returns (InstancesListResponse) {
  110. option (google.api.http) = {
  111. get: "/v1/projects/{project}/instances"
  112. };
  113. }
  114. // Lists all of the trusted Certificate Authorities (CAs) for the specified
  115. // instance. There can be up to three CAs listed: the CA that was used to sign
  116. // the certificate that is currently in use, a CA that has been added but not
  117. // yet used to sign a certificate, and a CA used to sign a certificate that
  118. // has previously rotated out.
  119. rpc ListServerCas(SqlInstancesListServerCasRequest) returns (InstancesListServerCasResponse) {
  120. option (google.api.http) = {
  121. get: "/v1/projects/{project}/instances/{instance}/listServerCas"
  122. };
  123. }
  124. // Updates settings of a Cloud SQL instance.
  125. // This method supports patch semantics.
  126. rpc Patch(SqlInstancesPatchRequest) returns (Operation) {
  127. option (google.api.http) = {
  128. patch: "/v1/projects/{project}/instances/{instance}"
  129. body: "body"
  130. };
  131. }
  132. // Promotes the read replica instance to be a stand-alone Cloud SQL instance.
  133. // Using this operation might cause your instance to restart.
  134. rpc PromoteReplica(SqlInstancesPromoteReplicaRequest) returns (Operation) {
  135. option (google.api.http) = {
  136. post: "/v1/projects/{project}/instances/{instance}/promoteReplica"
  137. };
  138. }
  139. // Deletes all client certificates and generates a new server SSL certificate
  140. // for the instance.
  141. rpc ResetSslConfig(SqlInstancesResetSslConfigRequest) returns (Operation) {
  142. option (google.api.http) = {
  143. post: "/v1/projects/{project}/instances/{instance}/resetSslConfig"
  144. };
  145. }
  146. // Restarts a Cloud SQL instance.
  147. rpc Restart(SqlInstancesRestartRequest) returns (Operation) {
  148. option (google.api.http) = {
  149. post: "/v1/projects/{project}/instances/{instance}/restart"
  150. };
  151. }
  152. // Restores a backup of a Cloud SQL instance. Using this operation might cause
  153. // your instance to restart.
  154. rpc RestoreBackup(SqlInstancesRestoreBackupRequest) returns (Operation) {
  155. option (google.api.http) = {
  156. post: "/v1/projects/{project}/instances/{instance}/restoreBackup"
  157. body: "body"
  158. };
  159. }
  160. // Rotates the server certificate to one signed by the Certificate Authority
  161. // (CA) version previously added with the addServerCA method.
  162. rpc RotateServerCa(SqlInstancesRotateServerCaRequest) returns (Operation) {
  163. option (google.api.http) = {
  164. post: "/v1/projects/{project}/instances/{instance}/rotateServerCa"
  165. body: "body"
  166. };
  167. }
  168. // Starts the replication in the read replica instance.
  169. rpc StartReplica(SqlInstancesStartReplicaRequest) returns (Operation) {
  170. option (google.api.http) = {
  171. post: "/v1/projects/{project}/instances/{instance}/startReplica"
  172. };
  173. }
  174. // Stops the replication in the read replica instance.
  175. rpc StopReplica(SqlInstancesStopReplicaRequest) returns (Operation) {
  176. option (google.api.http) = {
  177. post: "/v1/projects/{project}/instances/{instance}/stopReplica"
  178. };
  179. }
  180. // Truncate MySQL general and slow query log tables
  181. // MySQL only.
  182. rpc TruncateLog(SqlInstancesTruncateLogRequest) returns (Operation) {
  183. option (google.api.http) = {
  184. post: "/v1/projects/{project}/instances/{instance}/truncateLog"
  185. body: "body"
  186. };
  187. }
  188. // Updates settings of a Cloud SQL instance. Using this operation might cause
  189. // your instance to restart.
  190. rpc Update(SqlInstancesUpdateRequest) returns (Operation) {
  191. option (google.api.http) = {
  192. put: "/v1/projects/{project}/instances/{instance}"
  193. body: "body"
  194. };
  195. }
  196. // Generates a short-lived X509 certificate containing the provided public key
  197. // and signed by a private key specific to the target instance. Users may use
  198. // the certificate to authenticate as themselves when connecting to the
  199. // database.
  200. rpc CreateEphemeral(SqlInstancesCreateEphemeralCertRequest) returns (SslCert) {
  201. option (google.api.http) = {
  202. post: "/v1/projects/{project}/instances/{instance}/createEphemeral"
  203. body: "body"
  204. };
  205. }
  206. // Reschedules the maintenance on the given instance.
  207. rpc RescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest) returns (Operation) {
  208. option (google.api.http) = {
  209. post: "/v1/projects/{project}/instances/{instance}/rescheduleMaintenance"
  210. body: "body"
  211. };
  212. }
  213. // Verify External primary instance external sync settings.
  214. rpc VerifyExternalSyncSettings(SqlInstancesVerifyExternalSyncSettingsRequest) returns (SqlInstancesVerifyExternalSyncSettingsResponse) {
  215. option (google.api.http) = {
  216. post: "/v1/projects/{project}/instances/{instance}/verifyExternalSyncSettings"
  217. body: "*"
  218. };
  219. }
  220. // Start External primary instance migration.
  221. rpc StartExternalSync(SqlInstancesStartExternalSyncRequest) returns (Operation) {
  222. option (google.api.http) = {
  223. post: "/v1/projects/{project}/instances/{instance}/startExternalSync"
  224. body: "*"
  225. };
  226. }
  227. }
  228. // Instance add server CA request.
  229. message SqlInstancesAddServerCaRequest {
  230. // Cloud SQL instance ID. This does not include the project ID.
  231. string instance = 1;
  232. // Project ID of the project that contains the instance.
  233. string project = 2;
  234. }
  235. // Instance clone request.
  236. message SqlInstancesCloneRequest {
  237. // The ID of the Cloud SQL instance to be cloned (source). This does not
  238. // include the project ID.
  239. string instance = 1;
  240. // Project ID of the source as well as the clone Cloud SQL instance.
  241. string project = 2;
  242. InstancesCloneRequest body = 100;
  243. }
  244. // Instance delete request.
  245. message SqlInstancesDeleteRequest {
  246. // Cloud SQL instance ID. This does not include the project ID.
  247. string instance = 1;
  248. // Project ID of the project that contains the instance to be deleted.
  249. string project = 2;
  250. }
  251. // Instance demote master request.
  252. message SqlInstancesDemoteMasterRequest {
  253. // Cloud SQL instance name.
  254. string instance = 1;
  255. // ID of the project that contains the instance.
  256. string project = 2;
  257. InstancesDemoteMasterRequest body = 100;
  258. }
  259. // Instance export request.
  260. message SqlInstancesExportRequest {
  261. // Cloud SQL instance ID. This does not include the project ID.
  262. string instance = 1;
  263. // Project ID of the project that contains the instance to be exported.
  264. string project = 2;
  265. InstancesExportRequest body = 100;
  266. }
  267. // Instance failover request.
  268. message SqlInstancesFailoverRequest {
  269. // Cloud SQL instance ID. This does not include the project ID.
  270. string instance = 1;
  271. // ID of the project that contains the read replica.
  272. string project = 2;
  273. InstancesFailoverRequest body = 100;
  274. }
  275. // Instance get request.
  276. message SqlInstancesGetRequest {
  277. // Database instance ID. This does not include the project ID.
  278. string instance = 1;
  279. // Project ID of the project that contains the instance.
  280. string project = 2;
  281. }
  282. // Instance import request.
  283. message SqlInstancesImportRequest {
  284. // Cloud SQL instance ID. This does not include the project ID.
  285. string instance = 1;
  286. // Project ID of the project that contains the instance.
  287. string project = 2;
  288. InstancesImportRequest body = 100;
  289. }
  290. // Instance insert request.
  291. message SqlInstancesInsertRequest {
  292. // Project ID of the project to which the newly created Cloud SQL instances
  293. // should belong.
  294. string project = 1;
  295. DatabaseInstance body = 100;
  296. }
  297. // Instance list request.
  298. message SqlInstancesListRequest {
  299. // A filter expression that filters resources listed in the response.
  300. // The expression is in the form of field:value. For example,
  301. // 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
  302. // their JSON representation, such as 'settings.userLabels.auto_start:true'.
  303. //
  304. // Multiple filter queries are space-separated. For example.
  305. // 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
  306. // expression is an AND expression. However, you can include AND and OR
  307. // expressions explicitly.
  308. string filter = 1;
  309. // The maximum number of results to return per response.
  310. uint32 max_results = 2;
  311. // A previously-returned page token representing part of the larger set of
  312. // results to view.
  313. string page_token = 3;
  314. // Project ID of the project for which to list Cloud SQL instances.
  315. string project = 4;
  316. }
  317. // Instance list server CAs request.
  318. message SqlInstancesListServerCasRequest {
  319. // Cloud SQL instance ID. This does not include the project ID.
  320. string instance = 1;
  321. // Project ID of the project that contains the instance.
  322. string project = 2;
  323. }
  324. // Instance patch request.
  325. message SqlInstancesPatchRequest {
  326. // Cloud SQL instance ID. This does not include the project ID.
  327. string instance = 1;
  328. // Project ID of the project that contains the instance.
  329. string project = 2;
  330. DatabaseInstance body = 100;
  331. }
  332. // Instance promote replica request.
  333. message SqlInstancesPromoteReplicaRequest {
  334. // Cloud SQL read replica instance name.
  335. string instance = 1;
  336. // ID of the project that contains the read replica.
  337. string project = 2;
  338. }
  339. // Instance reset SSL config request.
  340. message SqlInstancesResetSslConfigRequest {
  341. // Cloud SQL instance ID. This does not include the project ID.
  342. string instance = 1;
  343. // Project ID of the project that contains the instance.
  344. string project = 2;
  345. }
  346. // Instance restart request.
  347. message SqlInstancesRestartRequest {
  348. // Cloud SQL instance ID. This does not include the project ID.
  349. string instance = 1;
  350. // Project ID of the project that contains the instance to be restarted.
  351. string project = 2;
  352. }
  353. // Instance restore backup request.
  354. message SqlInstancesRestoreBackupRequest {
  355. // Cloud SQL instance ID. This does not include the project ID.
  356. string instance = 1;
  357. // Project ID of the project that contains the instance.
  358. string project = 2;
  359. InstancesRestoreBackupRequest body = 100;
  360. }
  361. // Instance rotate server CA request.
  362. message SqlInstancesRotateServerCaRequest {
  363. // Cloud SQL instance ID. This does not include the project ID.
  364. string instance = 1;
  365. // Project ID of the project that contains the instance.
  366. string project = 2;
  367. InstancesRotateServerCaRequest body = 100;
  368. }
  369. // Instance start replica request.
  370. message SqlInstancesStartReplicaRequest {
  371. // Cloud SQL read replica instance name.
  372. string instance = 1;
  373. // ID of the project that contains the read replica.
  374. string project = 2;
  375. }
  376. // Instance stop replica request.
  377. message SqlInstancesStopReplicaRequest {
  378. // Cloud SQL read replica instance name.
  379. string instance = 1;
  380. // ID of the project that contains the read replica.
  381. string project = 2;
  382. }
  383. // Instance truncate log request.
  384. message SqlInstancesTruncateLogRequest {
  385. // Cloud SQL instance ID. This does not include the project ID.
  386. string instance = 1;
  387. // Project ID of the Cloud SQL project.
  388. string project = 2;
  389. InstancesTruncateLogRequest body = 100;
  390. }
  391. // Instance update request.
  392. message SqlInstancesUpdateRequest {
  393. // Cloud SQL instance ID. This does not include the project ID.
  394. string instance = 1;
  395. // Project ID of the project that contains the instance.
  396. string project = 2;
  397. DatabaseInstance body = 100;
  398. }
  399. // Instance reschedule maintenance request.
  400. message SqlInstancesRescheduleMaintenanceRequest {
  401. // Cloud SQL instance ID. This does not include the project ID.
  402. string instance = 1;
  403. // ID of the project that contains the instance.
  404. string project = 2;
  405. SqlInstancesRescheduleMaintenanceRequestBody body = 100;
  406. }
  407. // Instance verify external sync settings request.
  408. message SqlInstancesVerifyExternalSyncSettingsRequest {
  409. enum ExternalSyncMode {
  410. // Unknown external sync mode, will be defaulted to ONLINE mode
  411. EXTERNAL_SYNC_MODE_UNSPECIFIED = 0;
  412. // Online external sync will set up replication after initial data external
  413. // sync
  414. ONLINE = 1;
  415. // Offline external sync only dumps and loads a one-time snapshot of
  416. // the primary instance's data
  417. OFFLINE = 2;
  418. }
  419. // Cloud SQL instance ID. This does not include the project ID.
  420. string instance = 1;
  421. // Project ID of the project that contains the instance.
  422. string project = 2;
  423. // Flag to enable verifying connection only
  424. bool verify_connection_only = 3;
  425. // External sync mode
  426. ExternalSyncMode sync_mode = 4;
  427. // Optional. Flag to verify settings required by replication setup only
  428. bool verify_replication_only = 5 [(google.api.field_behavior) = OPTIONAL];
  429. oneof sync_config {
  430. // Optional. MySQL-specific settings for start external sync.
  431. MySqlSyncConfig mysql_sync_config = 6 [(google.api.field_behavior) = OPTIONAL];
  432. }
  433. }
  434. // Instance start external sync request.
  435. message SqlInstancesStartExternalSyncRequest {
  436. // Cloud SQL instance ID. This does not include the project ID.
  437. string instance = 1;
  438. // ID of the project that contains the instance.
  439. string project = 2;
  440. // External sync mode.
  441. SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3;
  442. // Whether to skip the verification step (VESS).
  443. bool skip_verification = 4;
  444. oneof sync_config {
  445. // MySQL-specific settings for start external sync.
  446. MySqlSyncConfig mysql_sync_config = 6;
  447. }
  448. }
  449. // Instance create ephemeral certificate request.
  450. message SqlInstancesCreateEphemeralCertRequest {
  451. // Cloud SQL instance ID. This does not include the project ID.
  452. string instance = 1;
  453. // Project ID of the Cloud SQL project.
  454. string project = 2;
  455. SslCertsCreateEphemeralRequest body = 100;
  456. }
  457. // Database instance clone request.
  458. message InstancesCloneRequest {
  459. // Contains details about the clone operation.
  460. CloneContext clone_context = 1;
  461. }
  462. // Database demote primary instance request.
  463. message InstancesDemoteMasterRequest {
  464. // Contains details about the demoteMaster operation.
  465. DemoteMasterContext demote_master_context = 1;
  466. }
  467. // Database instance export request.
  468. message InstancesExportRequest {
  469. // Contains details about the export operation.
  470. ExportContext export_context = 1;
  471. }
  472. // Instance failover request.
  473. message InstancesFailoverRequest {
  474. // Failover Context.
  475. FailoverContext failover_context = 1;
  476. }
  477. // SslCerts create ephemeral certificate request.
  478. message SslCertsCreateEphemeralRequest {
  479. // PEM encoded public key to include in the signed certificate.
  480. string public_key = 1;
  481. // Access token to include in the signed certificate.
  482. string access_token = 2;
  483. }
  484. // Database instance import request.
  485. message InstancesImportRequest {
  486. // Contains details about the import operation.
  487. ImportContext import_context = 1;
  488. }
  489. // Database instances list response.
  490. message InstancesListResponse {
  491. // This is always **sql#instancesList**.
  492. string kind = 1;
  493. // List of warnings that occurred while handling the request.
  494. repeated ApiWarning warnings = 2;
  495. // List of database instance resources.
  496. repeated DatabaseInstance items = 3;
  497. // The continuation token, used to page through large result sets. Provide
  498. // this value in a subsequent request to return the next page of results.
  499. string next_page_token = 4;
  500. }
  501. // Instances ListServerCas response.
  502. message InstancesListServerCasResponse {
  503. // List of server CA certificates for the instance.
  504. repeated SslCert certs = 1;
  505. string active_version = 2;
  506. // This is always **sql#instancesListServerCas**.
  507. string kind = 3;
  508. }
  509. // Database instance restore backup request.
  510. message InstancesRestoreBackupRequest {
  511. // Parameters required to perform the restore backup operation.
  512. RestoreBackupContext restore_backup_context = 1;
  513. }
  514. // Rotate server CA request.
  515. message InstancesRotateServerCaRequest {
  516. // Contains details about the rotate server CA operation.
  517. RotateServerCaContext rotate_server_ca_context = 1;
  518. }
  519. // Instance truncate log request.
  520. message InstancesTruncateLogRequest {
  521. // Contains details about the truncate log operation.
  522. TruncateLogContext truncate_log_context = 1;
  523. }
  524. // Instance verify external sync settings response.
  525. message SqlInstancesVerifyExternalSyncSettingsResponse {
  526. // This is always **sql#migrationSettingErrorList**.
  527. string kind = 1;
  528. // List of migration violations.
  529. repeated SqlExternalSyncSettingError errors = 2;
  530. // List of migration warnings.
  531. repeated SqlExternalSyncSettingError warnings = 3;
  532. }
  533. // Database instance clone context.
  534. message CloneContext {
  535. // This is always **sql#cloneContext**.
  536. string kind = 1;
  537. // Reserved for future use.
  538. int64 pitr_timestamp_ms = 2;
  539. // Name of the Cloud SQL instance to be created as a clone.
  540. string destination_instance_name = 3;
  541. // Binary log coordinates, if specified, identify the position up to which the
  542. // source instance is cloned. If not specified, the source instance is
  543. // cloned up to the most recent binary log coordinates.
  544. BinLogCoordinates bin_log_coordinates = 4;
  545. // Timestamp, if specified, identifies the time to which the source instance
  546. // is cloned.
  547. google.protobuf.Timestamp point_in_time = 5;
  548. }
  549. // Binary log coordinates.
  550. message BinLogCoordinates {
  551. // Name of the binary log file for a Cloud SQL instance.
  552. string bin_log_file_name = 1;
  553. // Position (offset) within the binary log file.
  554. int64 bin_log_position = 2;
  555. // This is always **sql#binLogCoordinates**.
  556. string kind = 3;
  557. }
  558. // A Cloud SQL instance resource.
  559. message DatabaseInstance {
  560. message SqlFailoverReplica {
  561. // The name of the failover replica. If specified at instance creation, a
  562. // failover replica is created for the instance. The name
  563. // doesn't include the project ID.
  564. string name = 1;
  565. // The availability status of the failover replica. A false status indicates
  566. // that the failover replica is out of sync. The primary instance can only
  567. // failover to the failover replica when the status is true.
  568. google.protobuf.BoolValue available = 2;
  569. }
  570. // Any scheduled maintenance for this instance.
  571. message SqlScheduledMaintenance {
  572. // The start time of any upcoming scheduled maintenance for this instance.
  573. google.protobuf.Timestamp start_time = 1;
  574. bool can_defer = 2 [deprecated = true];
  575. // If the scheduled maintenance can be rescheduled.
  576. bool can_reschedule = 3;
  577. // Maintenance cannot be rescheduled to start beyond this deadline.
  578. optional google.protobuf.Timestamp schedule_deadline_time = 4;
  579. }
  580. // This message wraps up the information written by out-of-disk detection job.
  581. message SqlOutOfDiskReport {
  582. // This enum lists all possible states regarding out-of-disk issues.
  583. enum SqlOutOfDiskState {
  584. // Unspecified state
  585. SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0;
  586. // The instance has plenty space on data disk
  587. NORMAL = 1;
  588. // Data disk is almost used up. It is shutdown to prevent data
  589. // corruption.
  590. SOFT_SHUTDOWN = 2;
  591. }
  592. // This field represents the state generated by the proactive database
  593. // wellness job for OutOfDisk issues.
  594. // * Writers:
  595. // * the proactive database wellness job for OOD.
  596. // * Readers:
  597. // * the proactive database wellness job
  598. optional SqlOutOfDiskState sql_out_of_disk_state = 1;
  599. // The minimum recommended increase size in GigaBytes
  600. // This field is consumed by the frontend
  601. // * Writers:
  602. // * the proactive database wellness job for OOD.
  603. // * Readers:
  604. optional int32 sql_min_recommended_increase_size_gb = 2;
  605. }
  606. // The current serving state of the database instance.
  607. enum SqlInstanceState {
  608. // The state of the instance is unknown.
  609. SQL_INSTANCE_STATE_UNSPECIFIED = 0;
  610. // The instance is running, or has been stopped by owner.
  611. RUNNABLE = 1;
  612. // The instance is not available, for example due to problems with billing.
  613. SUSPENDED = 2;
  614. // The instance is being deleted.
  615. PENDING_DELETE = 3;
  616. // The instance is being created.
  617. PENDING_CREATE = 4;
  618. // The instance is down for maintenance.
  619. MAINTENANCE = 5;
  620. // The creation of the instance failed or a fatal error occurred during
  621. // maintenance.
  622. FAILED = 6;
  623. // The instance is under maintenance operations and the database is
  624. // available.
  625. ONLINE_MAINTENANCE = 7;
  626. }
  627. // This is always **sql#instance**.
  628. string kind = 1;
  629. // The current serving state of the Cloud SQL instance. This can be one of the
  630. // following:
  631. // * **SQL_INSTANCE_STATE_UNSPECIFIED**: The state of the instance is
  632. // unknown.
  633. // * **RUNNABLE**: The instance is running, or has been stopped by owner.
  634. // * **SUSPENDED**: The instance is not available, for example due to
  635. // problems with billing.
  636. // * **PENDING_DELETE**: The instance is being deleted.
  637. // * **PENDING_CREATE**: The instance is being created.
  638. // * **MAINTENANCE**: The instance is down for maintenance.
  639. // * **FAILED**: The instance creation failed.
  640. SqlInstanceState state = 2;
  641. // The database engine type and version. The **databaseVersion** field cannot
  642. // be changed after instance creation.
  643. // * **MySQL instances**: MYSQL_8_0, MYSQL_5_7 (default), or MYSQL_5_6.
  644. // * **PostgreSQL instances**: POSTGRES_9_6, POSTGRES_10, POSTGRES_11,
  645. // POSTGRES_12, POSTGRES_13 (default).
  646. // * **SQL Server instances**: SQLSERVER_2019_STANDARD,
  647. // SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, or SQLSERVER_2019_WEB,
  648. // SQLSERVER_2017_STANDARD (default), SQLSERVER_2017_ENTERPRISE,
  649. // SQLSERVER_2017_EXPRESS, or SQLSERVER_2017_WEB.
  650. SqlDatabaseVersion database_version = 3;
  651. // The user settings.
  652. Settings settings = 4;
  653. // This field is deprecated and will be removed from a future version of the
  654. // API. Use the **settings.settingsVersion** field instead.
  655. string etag = 5;
  656. // The name and status of the failover replica.
  657. SqlFailoverReplica failover_replica = 6;
  658. // The name of the instance which will act as primary in the replication
  659. // setup.
  660. string master_instance_name = 7;
  661. // The replicas of the instance.
  662. repeated string replica_names = 8;
  663. // The maximum disk size of the instance in bytes.
  664. google.protobuf.Int64Value max_disk_size = 9 [deprecated = true];
  665. // The current disk usage of the instance in bytes. This property has been
  666. // deprecated. Use the
  667. // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
  668. // Monitoring API instead. Please see [this
  669. // announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
  670. // for details.
  671. google.protobuf.Int64Value current_disk_size = 10 [deprecated = true];
  672. // The assigned IP addresses for the instance.
  673. repeated IpMapping ip_addresses = 11;
  674. // SSL configuration.
  675. SslCert server_ca_cert = 12;
  676. // The instance type. This can be one of the following:
  677. // * **CLOUD_SQL_INSTANCE**: A Cloud SQL instance that is not replicating
  678. // from a primary instance.
  679. // * **ON_PREMISES_INSTANCE**: An instance running on the customer's
  680. // premises.
  681. // * **READ_REPLICA_INSTANCE**: A Cloud SQL instance configured as a
  682. // read-replica.
  683. SqlInstanceType instance_type = 13;
  684. // The project ID of the project containing the Cloud SQL instance. The Google
  685. // apps domain is prefixed if applicable.
  686. string project = 14;
  687. // The IPv6 address assigned to the instance.
  688. // (Deprecated) This property was applicable only
  689. // to First Generation instances.
  690. string ipv6_address = 15 [deprecated = true];
  691. // The service account email address assigned to the instance. <br>This
  692. // property is read-only.
  693. string service_account_email_address = 16;
  694. // Configuration specific to on-premises instances.
  695. OnPremisesConfiguration on_premises_configuration = 17;
  696. // Configuration specific to failover replicas and read replicas.
  697. ReplicaConfiguration replica_configuration = 18;
  698. // The backend type.
  699. // **SECOND_GEN**: Cloud SQL database instance.
  700. // **EXTERNAL**: A database server that is not managed by Google.
  701. //
  702. // This property is read-only; use the **tier** property in the **settings**
  703. // object to determine the database type.
  704. SqlBackendType backend_type = 19;
  705. // The URI of this resource.
  706. string self_link = 20;
  707. // If the instance state is SUSPENDED, the reason for the suspension.
  708. repeated SqlSuspensionReason suspension_reason = 21;
  709. // Connection name of the Cloud SQL instance used in connection strings.
  710. string connection_name = 22;
  711. // Name of the Cloud SQL instance. This does not include the project ID.
  712. string name = 23;
  713. // The geographical region. Can be:
  714. // * **us-central** (**FIRST_GEN** instances only)
  715. // * **us-central1** (**SECOND_GEN** instances only)
  716. // * **asia-east1** or **europe-west1**.
  717. //
  718. // Defaults to **us-central** or **us-central1** depending on the instance
  719. // type. The region cannot be changed after instance creation.
  720. string region = 24;
  721. // The Compute Engine zone that the instance is currently serving from. This
  722. // value could be different from the zone that was specified when the instance
  723. // was created if the instance has failed over to its secondary zone.
  724. string gce_zone = 25;
  725. // The Compute Engine zone that the failover instance is currently serving
  726. // from for a regional instance. This value could be different
  727. // from the zone that was specified when the instance
  728. // was created if the instance has failed over to its secondary/failover zone.
  729. // Reserved for future use.
  730. string secondary_gce_zone = 34;
  731. // Disk encryption configuration specific to an instance.
  732. DiskEncryptionConfiguration disk_encryption_configuration = 26;
  733. // Disk encryption status specific to an instance.
  734. DiskEncryptionStatus disk_encryption_status = 27;
  735. // Initial root password. Use only on creation.
  736. string root_password = 29;
  737. // The start time of any upcoming scheduled maintenance for this instance.
  738. SqlScheduledMaintenance scheduled_maintenance = 30;
  739. // The status indicating if instance satisfiesPzs.
  740. // Reserved for future use.
  741. google.protobuf.BoolValue satisfies_pzs = 35;
  742. // This field represents the report generated by the proactive database
  743. // wellness job for OutOfDisk issues.
  744. // * Writers:
  745. // * the proactive database wellness job for OOD.
  746. // * Readers:
  747. // * the proactive database wellness job
  748. optional SqlOutOfDiskReport out_of_disk_report = 38;
  749. // Output only. The time when the instance was created in
  750. // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
  751. // **2012-11-15T16:19:00.094Z**.
  752. google.protobuf.Timestamp create_time = 39 [(google.api.field_behavior) = OUTPUT_ONLY];
  753. }
  754. // Reschedule options for maintenance windows.
  755. message SqlInstancesRescheduleMaintenanceRequestBody {
  756. message Reschedule {
  757. // Required. The type of the reschedule.
  758. RescheduleType reschedule_type = 1;
  759. // Optional. Timestamp when the maintenance shall be rescheduled to if
  760. // reschedule_type=SPECIFIC_TIME, in
  761. // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
  762. // **2012-11-15T16:19:00.094Z**.
  763. google.protobuf.Timestamp schedule_time = 2 [(google.api.field_behavior) = OPTIONAL];
  764. }
  765. enum RescheduleType {
  766. RESCHEDULE_TYPE_UNSPECIFIED = 0;
  767. // Reschedules maintenance to happen now (within 5 minutes).
  768. IMMEDIATE = 1;
  769. // Reschedules maintenance to occur within one week from the originally
  770. // scheduled day and time.
  771. NEXT_AVAILABLE_WINDOW = 2;
  772. // Reschedules maintenance to a specific time and day.
  773. SPECIFIC_TIME = 3;
  774. }
  775. // Required. The type of the reschedule the user wants.
  776. Reschedule reschedule = 3;
  777. }
  778. // Database instance demote primary instance context.
  779. message DemoteMasterContext {
  780. // This is always **sql#demoteMasterContext**.
  781. string kind = 1;
  782. // Verify GTID consistency for demote operation. Default value:
  783. // **True**. Setting this flag to false enables you to bypass GTID consistency
  784. // check between on-premises primary instance and Cloud SQL instance during
  785. // the demotion operation but also exposes you to the risk of future
  786. // replication failures. Change the value only if you know the reason for the
  787. // GTID divergence and are confident that doing so will not cause any
  788. // replication issues.
  789. google.protobuf.BoolValue verify_gtid_consistency = 2;
  790. // The name of the instance which will act as on-premises primary instance
  791. // in the replication setup.
  792. string master_instance_name = 3;
  793. // Configuration specific to read-replicas replicating from the on-premises
  794. // primary instance.
  795. DemoteMasterConfiguration replica_configuration = 4;
  796. // Flag to skip replication setup on the instance.
  797. bool skip_replication_setup = 5;
  798. }
  799. // Database instance failover context.
  800. message FailoverContext {
  801. // The current settings version of this instance. Request will be rejected if
  802. // this version doesn't match the current settings version.
  803. int64 settings_version = 1;
  804. // This is always **sql#failoverContext**.
  805. string kind = 2;
  806. }
  807. // Database instance restore from backup context.
  808. // Backup context contains source instance id and project id.
  809. message RestoreBackupContext {
  810. // This is always **sql#restoreBackupContext**.
  811. string kind = 1;
  812. // The ID of the backup run to restore from.
  813. int64 backup_run_id = 2;
  814. // The ID of the instance that the backup was taken from.
  815. string instance_id = 3;
  816. // The full project ID of the source instance.
  817. string project = 4;
  818. }
  819. // Instance rotate server CA context.
  820. message RotateServerCaContext {
  821. // This is always **sql#rotateServerCaContext**.
  822. string kind = 1;
  823. // The fingerprint of the next version to be rotated to. If left unspecified,
  824. // will be rotated to the most recently added server CA version.
  825. string next_version = 2;
  826. }
  827. // Database Instance truncate log context.
  828. message TruncateLogContext {
  829. // This is always **sql#truncateLogContext**.
  830. string kind = 1;
  831. // The type of log to truncate. Valid values are **MYSQL_GENERAL_TABLE** and
  832. // **MYSQL_SLOW_TABLE**.
  833. string log_type = 2;
  834. }
  835. // External primary instance migration setting error/warning.
  836. message SqlExternalSyncSettingError {
  837. enum SqlExternalSyncSettingErrorType {
  838. SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0;
  839. CONNECTION_FAILURE = 1;
  840. BINLOG_NOT_ENABLED = 2;
  841. INCOMPATIBLE_DATABASE_VERSION = 3;
  842. REPLICA_ALREADY_SETUP = 4;
  843. INSUFFICIENT_PRIVILEGE = 5;
  844. // Unsupported migration type.
  845. UNSUPPORTED_MIGRATION_TYPE = 6;
  846. // No pglogical extension installed on databases, applicable for postgres.
  847. NO_PGLOGICAL_INSTALLED = 7;
  848. // pglogical node already exists on databases, applicable for postgres.
  849. PGLOGICAL_NODE_ALREADY_EXISTS = 8;
  850. // The value of parameter wal_level is not set to logical.
  851. INVALID_WAL_LEVEL = 9;
  852. // The value of parameter shared_preload_libraries does not include
  853. // pglogical.
  854. INVALID_SHARED_PRELOAD_LIBRARY = 10;
  855. // The value of parameter max_replication_slots is not sufficient.
  856. INSUFFICIENT_MAX_REPLICATION_SLOTS = 11;
  857. // The value of parameter max_wal_senders is not sufficient.
  858. INSUFFICIENT_MAX_WAL_SENDERS = 12;
  859. // The value of parameter max_worker_processes is not sufficient.
  860. INSUFFICIENT_MAX_WORKER_PROCESSES = 13;
  861. // Extensions installed are either not supported or having unsupported
  862. // versions
  863. UNSUPPORTED_EXTENSIONS = 14;
  864. // The value of parameter rds.logical_replication is not set to 1.
  865. INVALID_RDS_LOGICAL_REPLICATION = 15;
  866. // The primary instance logging setup doesn't allow EM sync.
  867. INVALID_LOGGING_SETUP = 16;
  868. // The primary instance database parameter setup doesn't allow EM sync.
  869. INVALID_DB_PARAM = 17;
  870. // The gtid_mode is not supported, applicable for MySQL.
  871. UNSUPPORTED_GTID_MODE = 18;
  872. // SQL Server Agent is not running.
  873. SQLSERVER_AGENT_NOT_RUNNING = 19;
  874. // The table definition is not support due to missing primary key or replica
  875. // identity, applicable for postgres.
  876. UNSUPPORTED_TABLE_DEFINITION = 20;
  877. // The customer has a definer that will break EM setup.
  878. UNSUPPORTED_DEFINER = 21;
  879. // SQL Server @@SERVERNAME does not match actual host name
  880. SQLSERVER_SERVERNAME_MISMATCH = 22;
  881. // The primary instance has been setup and will fail the setup.
  882. PRIMARY_ALREADY_SETUP = 23;
  883. // The primary instance has unsupported binary log format.
  884. UNSUPPORTED_BINLOG_FORMAT = 24;
  885. // The primary instance's binary log retention setting.
  886. BINLOG_RETENTION_SETTING = 25;
  887. }
  888. // Can be **sql#externalSyncSettingError** or
  889. // **sql#externalSyncSettingWarning**.
  890. string kind = 1;
  891. // Identifies the specific error that occurred.
  892. SqlExternalSyncSettingErrorType type = 2;
  893. // Additional information about the error encountered.
  894. string detail = 3;
  895. }
  896. // On-premises instance configuration.
  897. message OnPremisesConfiguration {
  898. // The host and port of the on-premises instance in host:port format
  899. string host_port = 1;
  900. // This is always **sql#onPremisesConfiguration**.
  901. string kind = 2;
  902. // The username for connecting to on-premises instance.
  903. string username = 3;
  904. // The password for connecting to on-premises instance.
  905. string password = 4;
  906. // PEM representation of the trusted CA's x509 certificate.
  907. string ca_certificate = 5;
  908. // PEM representation of the replica's x509 certificate.
  909. string client_certificate = 6;
  910. // PEM representation of the replica's private key. The corresponsing public
  911. // key is encoded in the client's certificate.
  912. string client_key = 7;
  913. // The dump file to create the Cloud SQL replica.
  914. string dump_file_path = 8;
  915. // The reference to Cloud SQL instance if the source is Cloud SQL.
  916. InstanceReference source_instance = 15;
  917. }
  918. // Read-replica configuration for connecting to the primary instance.
  919. message ReplicaConfiguration {
  920. // This is always **sql#replicaConfiguration**.
  921. string kind = 1;
  922. // MySQL specific configuration when replicating from a MySQL on-premises
  923. // primary instance. Replication configuration information such as the
  924. // username, password, certificates, and keys are not stored in the instance
  925. // metadata. The configuration information is used only to set up the
  926. // replication connection and is stored by MySQL in a file named
  927. // **master.info** in the data directory.
  928. MySqlReplicaConfiguration mysql_replica_configuration = 2;
  929. // Specifies if the replica is the failover target. If the field is set to
  930. // **true** the replica will be designated as a failover replica. In case the
  931. // primary instance fails, the replica instance will be promoted as the new
  932. // primary instance. Only one replica can be specified as failover target, and
  933. // the replica has to be in different zone with the primary instance.
  934. google.protobuf.BoolValue failover_target = 3;
  935. }
  936. enum SqlInstanceType {
  937. // This is an unknown Cloud SQL instance type.
  938. SQL_INSTANCE_TYPE_UNSPECIFIED = 0;
  939. // A regular Cloud SQL instance.
  940. CLOUD_SQL_INSTANCE = 1;
  941. // An instance running on the customer's premises that is not managed by
  942. // Cloud SQL.
  943. ON_PREMISES_INSTANCE = 2;
  944. // A Cloud SQL instance acting as a read-replica.
  945. READ_REPLICA_INSTANCE = 3;
  946. }
  947. // The suspension reason of the database instance if the state is SUSPENDED.
  948. enum SqlSuspensionReason {
  949. // This is an unknown suspension reason.
  950. SQL_SUSPENSION_REASON_UNSPECIFIED = 0;
  951. // The instance is suspended due to billing issues (for example:, GCP account
  952. // issue)
  953. BILLING_ISSUE = 2;
  954. // The instance is suspended due to illegal content (for example:, child
  955. // pornography, copyrighted material, etc.).
  956. LEGAL_ISSUE = 3;
  957. // The instance is causing operational issues (for example:, causing the
  958. // database to crash).
  959. OPERATIONAL_ISSUE = 4;
  960. // The KMS key used by the instance is either revoked or denied access to
  961. KMS_KEY_ISSUE = 5;
  962. }