1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.cloud.bigquery.biglake.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/protobuf/field_mask.proto"; 24import "google/protobuf/timestamp.proto"; 25 26option go_package = "cloud.google.com/go/bigquery/biglake/apiv1/biglakepb;biglakepb"; 27option java_multiple_files = true; 28option java_outer_classname = "MetastoreProto"; 29option java_package = "com.google.cloud.bigquery.biglake.v1"; 30 31// BigLake Metastore is a serverless, highly available, multi-tenant runtime 32// metastore for Google Cloud Data Analytics products. 33// 34// The BigLake Metastore API defines the following resource model: 35// 36// * A collection of Google Cloud projects: `/projects/*` 37// * Each project has a collection of available locations: `/locations/*` 38// * Each location has a collection of catalogs: `/catalogs/*` 39// * Each catalog has a collection of databases: `/databases/*` 40// * Each database has a collection of tables: `/tables/*` 41service MetastoreService { 42 option (google.api.default_host) = "biglake.googleapis.com"; 43 option (google.api.oauth_scopes) = 44 "https://www.googleapis.com/auth/bigquery," 45 "https://www.googleapis.com/auth/cloud-platform"; 46 47 // Creates a new catalog. 48 rpc CreateCatalog(CreateCatalogRequest) returns (Catalog) { 49 option (google.api.http) = { 50 post: "/v1/{parent=projects/*/locations/*}/catalogs" 51 body: "catalog" 52 }; 53 option (google.api.method_signature) = "parent,catalog,catalog_id"; 54 } 55 56 // Deletes an existing catalog specified by the catalog ID. 57 rpc DeleteCatalog(DeleteCatalogRequest) returns (Catalog) { 58 option (google.api.http) = { 59 delete: "/v1/{name=projects/*/locations/*/catalogs/*}" 60 }; 61 option (google.api.method_signature) = "name"; 62 } 63 64 // Gets the catalog specified by the resource name. 65 rpc GetCatalog(GetCatalogRequest) returns (Catalog) { 66 option (google.api.http) = { 67 get: "/v1/{name=projects/*/locations/*/catalogs/*}" 68 }; 69 option (google.api.method_signature) = "name"; 70 } 71 72 // List all catalogs in a specified project. 73 rpc ListCatalogs(ListCatalogsRequest) returns (ListCatalogsResponse) { 74 option (google.api.http) = { 75 get: "/v1/{parent=projects/*/locations/*}/catalogs" 76 }; 77 option (google.api.method_signature) = "parent"; 78 } 79 80 // Creates a new database. 81 rpc CreateDatabase(CreateDatabaseRequest) returns (Database) { 82 option (google.api.http) = { 83 post: "/v1/{parent=projects/*/locations/*/catalogs/*}/databases" 84 body: "database" 85 }; 86 option (google.api.method_signature) = "parent,database,database_id"; 87 } 88 89 // Deletes an existing database specified by the database ID. 90 rpc DeleteDatabase(DeleteDatabaseRequest) returns (Database) { 91 option (google.api.http) = { 92 delete: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*}" 93 }; 94 option (google.api.method_signature) = "name"; 95 } 96 97 // Updates an existing database specified by the database ID. 98 rpc UpdateDatabase(UpdateDatabaseRequest) returns (Database) { 99 option (google.api.http) = { 100 patch: "/v1/{database.name=projects/*/locations/*/catalogs/*/databases/*}" 101 body: "database" 102 }; 103 option (google.api.method_signature) = "database,update_mask"; 104 } 105 106 // Gets the database specified by the resource name. 107 rpc GetDatabase(GetDatabaseRequest) returns (Database) { 108 option (google.api.http) = { 109 get: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*}" 110 }; 111 option (google.api.method_signature) = "name"; 112 } 113 114 // List all databases in a specified catalog. 115 rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { 116 option (google.api.http) = { 117 get: "/v1/{parent=projects/*/locations/*/catalogs/*}/databases" 118 }; 119 option (google.api.method_signature) = "parent"; 120 } 121 122 // Creates a new table. 123 rpc CreateTable(CreateTableRequest) returns (Table) { 124 option (google.api.http) = { 125 post: "/v1/{parent=projects/*/locations/*/catalogs/*/databases/*}/tables" 126 body: "table" 127 }; 128 option (google.api.method_signature) = "parent,table,table_id"; 129 } 130 131 // Deletes an existing table specified by the table ID. 132 rpc DeleteTable(DeleteTableRequest) returns (Table) { 133 option (google.api.http) = { 134 delete: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*/tables/*}" 135 }; 136 option (google.api.method_signature) = "name"; 137 } 138 139 // Updates an existing table specified by the table ID. 140 rpc UpdateTable(UpdateTableRequest) returns (Table) { 141 option (google.api.http) = { 142 patch: "/v1/{table.name=projects/*/locations/*/catalogs/*/databases/*/tables/*}" 143 body: "table" 144 }; 145 option (google.api.method_signature) = "table,update_mask"; 146 } 147 148 // Renames an existing table specified by the table ID. 149 rpc RenameTable(RenameTableRequest) returns (Table) { 150 option (google.api.http) = { 151 post: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*/tables/*}:rename" 152 body: "*" 153 }; 154 option (google.api.method_signature) = "name,new_name"; 155 } 156 157 // Gets the table specified by the resource name. 158 rpc GetTable(GetTableRequest) returns (Table) { 159 option (google.api.http) = { 160 get: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*/tables/*}" 161 }; 162 option (google.api.method_signature) = "name"; 163 } 164 165 // List all tables in a specified database. 166 rpc ListTables(ListTablesRequest) returns (ListTablesResponse) { 167 option (google.api.http) = { 168 get: "/v1/{parent=projects/*/locations/*/catalogs/*/databases/*}/tables" 169 }; 170 option (google.api.method_signature) = "parent"; 171 } 172} 173 174// View on Table. Represents which fields will be populated for calls that 175// return Table objects. 176enum TableView { 177 // Default value. The API will default to the BASIC view. 178 TABLE_VIEW_UNSPECIFIED = 0; 179 180 // Include only table names. 181 // This is the default value. 182 BASIC = 1; 183 184 // Include everything. 185 FULL = 2; 186} 187 188// Catalog is the container of databases. 189message Catalog { 190 option (google.api.resource) = { 191 type: "biglake.googleapis.com/Catalog" 192 pattern: "projects/{project}/locations/{location}/catalogs/{catalog}" 193 }; 194 195 // Output only. The resource name. 196 // Format: 197 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id} 198 string name = 1 [ 199 (google.api.field_behavior) = OUTPUT_ONLY, 200 (google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" } 201 ]; 202 203 // Output only. The creation time of the catalog. 204 google.protobuf.Timestamp create_time = 2 205 [(google.api.field_behavior) = OUTPUT_ONLY]; 206 207 // Output only. The last modification time of the catalog. 208 google.protobuf.Timestamp update_time = 3 209 [(google.api.field_behavior) = OUTPUT_ONLY]; 210 211 // Output only. The deletion time of the catalog. Only set after the catalog 212 // is deleted. 213 google.protobuf.Timestamp delete_time = 4 214 [(google.api.field_behavior) = OUTPUT_ONLY]; 215 216 // Output only. The time when this catalog is considered expired. Only set 217 // after the catalog is deleted. 218 google.protobuf.Timestamp expire_time = 5 219 [(google.api.field_behavior) = OUTPUT_ONLY]; 220} 221 222// Database is the container of tables. 223message Database { 224 option (google.api.resource) = { 225 type: "biglake.googleapis.com/Database" 226 pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/databases/{database}" 227 }; 228 229 // The database type. 230 enum Type { 231 // The type is not specified. 232 TYPE_UNSPECIFIED = 0; 233 234 // Represents a database storing tables compatible with Hive Metastore 235 // tables. 236 HIVE = 1; 237 } 238 239 // Options specified for the database type. 240 oneof options { 241 // Options of a Hive database. 242 HiveDatabaseOptions hive_options = 7; 243 } 244 245 // Output only. The resource name. 246 // Format: 247 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id} 248 string name = 1 [ 249 (google.api.field_behavior) = OUTPUT_ONLY, 250 (google.api.resource_reference) = { 251 type: "biglake.googleapis.com/Database" 252 } 253 ]; 254 255 // Output only. The creation time of the database. 256 google.protobuf.Timestamp create_time = 2 257 [(google.api.field_behavior) = OUTPUT_ONLY]; 258 259 // Output only. The last modification time of the database. 260 google.protobuf.Timestamp update_time = 3 261 [(google.api.field_behavior) = OUTPUT_ONLY]; 262 263 // Output only. The deletion time of the database. Only set after the database 264 // is deleted. 265 google.protobuf.Timestamp delete_time = 4 266 [(google.api.field_behavior) = OUTPUT_ONLY]; 267 268 // Output only. The time when this database is considered expired. Only set 269 // after the database is deleted. 270 google.protobuf.Timestamp expire_time = 5 271 [(google.api.field_behavior) = OUTPUT_ONLY]; 272 273 // The database type. 274 Type type = 6; 275} 276 277// Represents a table. 278message Table { 279 option (google.api.resource) = { 280 type: "biglake.googleapis.com/Table" 281 pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/databases/{database}/tables/{table}" 282 }; 283 284 // The table type. 285 enum Type { 286 // The type is not specified. 287 TYPE_UNSPECIFIED = 0; 288 289 // Represents a table compatible with Hive Metastore tables. 290 HIVE = 1; 291 } 292 293 // Options specified for the table type. 294 oneof options { 295 // Options of a Hive table. 296 HiveTableOptions hive_options = 7; 297 } 298 299 // Output only. The resource name. 300 // Format: 301 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id} 302 string name = 1 [ 303 (google.api.field_behavior) = OUTPUT_ONLY, 304 (google.api.resource_reference) = { type: "biglake.googleapis.com/Table" } 305 ]; 306 307 // Output only. The creation time of the table. 308 google.protobuf.Timestamp create_time = 2 309 [(google.api.field_behavior) = OUTPUT_ONLY]; 310 311 // Output only. The last modification time of the table. 312 google.protobuf.Timestamp update_time = 3 313 [(google.api.field_behavior) = OUTPUT_ONLY]; 314 315 // Output only. The deletion time of the table. Only set after the table is 316 // deleted. 317 google.protobuf.Timestamp delete_time = 4 318 [(google.api.field_behavior) = OUTPUT_ONLY]; 319 320 // Output only. The time when this table is considered expired. Only set after 321 // the table is deleted. 322 google.protobuf.Timestamp expire_time = 5 323 [(google.api.field_behavior) = OUTPUT_ONLY]; 324 325 // The table type. 326 Type type = 6; 327 328 // The checksum of a table object computed by the server based on the value of 329 // other fields. It may be sent on update requests to ensure the client has an 330 // up-to-date value before proceeding. It is only checked for update table 331 // operations. 332 string etag = 8; 333} 334 335// Request message for the CreateCatalog method. 336message CreateCatalogRequest { 337 // Required. The parent resource where this catalog will be created. 338 // Format: projects/{project_id_or_number}/locations/{location_id} 339 string parent = 1 [ 340 (google.api.field_behavior) = REQUIRED, 341 (google.api.resource_reference) = { 342 type: "locations.googleapis.com/Location" 343 } 344 ]; 345 346 // Required. The catalog to create. 347 // The `name` field does not need to be provided. 348 Catalog catalog = 2 [(google.api.field_behavior) = REQUIRED]; 349 350 // Required. The ID to use for the catalog, which will become the final 351 // component of the catalog's resource name. 352 string catalog_id = 3 [(google.api.field_behavior) = REQUIRED]; 353} 354 355// Request message for the DeleteCatalog method. 356message DeleteCatalogRequest { 357 // Required. The name of the catalog to delete. 358 // Format: 359 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id} 360 string name = 1 [ 361 (google.api.field_behavior) = REQUIRED, 362 (google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" } 363 ]; 364} 365 366// Request message for the GetCatalog method. 367message GetCatalogRequest { 368 // Required. The name of the catalog to retrieve. 369 // Format: 370 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id} 371 string name = 1 [ 372 (google.api.field_behavior) = REQUIRED, 373 (google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" } 374 ]; 375} 376 377// Request message for the ListCatalogs method. 378message ListCatalogsRequest { 379 // Required. The parent, which owns this collection of catalogs. 380 // Format: projects/{project_id_or_number}/locations/{location_id} 381 string parent = 1 [ 382 (google.api.field_behavior) = REQUIRED, 383 (google.api.resource_reference) = { 384 type: "locations.googleapis.com/Location" 385 } 386 ]; 387 388 // The maximum number of catalogs to return. The service may return fewer than 389 // this value. 390 // If unspecified, at most 50 catalogs will be returned. 391 // The maximum value is 1000; values above 1000 will be coerced to 1000. 392 int32 page_size = 2; 393 394 // A page token, received from a previous `ListCatalogs` call. 395 // Provide this to retrieve the subsequent page. 396 // 397 // When paginating, all other parameters provided to `ListCatalogs` must match 398 // the call that provided the page token. 399 string page_token = 3; 400} 401 402// Response message for the ListCatalogs method. 403message ListCatalogsResponse { 404 // The catalogs from the specified project. 405 repeated Catalog catalogs = 1; 406 407 // A token, which can be sent as `page_token` to retrieve the next page. 408 // If this field is omitted, there are no subsequent pages. 409 string next_page_token = 2; 410} 411 412// Request message for the CreateDatabase method. 413message CreateDatabaseRequest { 414 // Required. The parent resource where this database will be created. 415 // Format: 416 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id} 417 string parent = 1 [ 418 (google.api.field_behavior) = REQUIRED, 419 (google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" } 420 ]; 421 422 // Required. The database to create. 423 // The `name` field does not need to be provided. 424 Database database = 2 [(google.api.field_behavior) = REQUIRED]; 425 426 // Required. The ID to use for the database, which will become the final 427 // component of the database's resource name. 428 string database_id = 3 [(google.api.field_behavior) = REQUIRED]; 429} 430 431// Request message for the DeleteDatabase method. 432message DeleteDatabaseRequest { 433 // Required. The name of the database to delete. 434 // Format: 435 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id} 436 string name = 1 [ 437 (google.api.field_behavior) = REQUIRED, 438 (google.api.resource_reference) = { 439 type: "biglake.googleapis.com/Database" 440 } 441 ]; 442} 443 444// Request message for the UpdateDatabase method. 445message UpdateDatabaseRequest { 446 // Required. The database to update. 447 // 448 // The database's `name` field is used to identify the database to update. 449 // Format: 450 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id} 451 Database database = 1 [(google.api.field_behavior) = REQUIRED]; 452 453 // The list of fields to update. 454 // 455 // For the `FieldMask` definition, see 456 // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask 457 // If not set, defaults to all of the fields that are allowed to update. 458 google.protobuf.FieldMask update_mask = 2; 459} 460 461// Request message for the GetDatabase method. 462message GetDatabaseRequest { 463 // Required. The name of the database to retrieve. 464 // Format: 465 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id} 466 string name = 1 [ 467 (google.api.field_behavior) = REQUIRED, 468 (google.api.resource_reference) = { 469 type: "biglake.googleapis.com/Database" 470 } 471 ]; 472} 473 474// Request message for the ListDatabases method. 475message ListDatabasesRequest { 476 // Required. The parent, which owns this collection of databases. 477 // Format: 478 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id} 479 string parent = 1 [ 480 (google.api.field_behavior) = REQUIRED, 481 (google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" } 482 ]; 483 484 // The maximum number of databases to return. The service may return fewer 485 // than this value. 486 // If unspecified, at most 50 databases will be returned. 487 // The maximum value is 1000; values above 1000 will be coerced to 1000. 488 int32 page_size = 2; 489 490 // A page token, received from a previous `ListDatabases` call. 491 // Provide this to retrieve the subsequent page. 492 // 493 // When paginating, all other parameters provided to `ListDatabases` must 494 // match the call that provided the page token. 495 string page_token = 3; 496} 497 498// Response message for the ListDatabases method. 499message ListDatabasesResponse { 500 // The databases from the specified catalog. 501 repeated Database databases = 1; 502 503 // A token, which can be sent as `page_token` to retrieve the next page. 504 // If this field is omitted, there are no subsequent pages. 505 string next_page_token = 2; 506} 507 508// Request message for the CreateTable method. 509message CreateTableRequest { 510 // Required. The parent resource where this table will be created. 511 // Format: 512 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id} 513 string parent = 1 [ 514 (google.api.field_behavior) = REQUIRED, 515 (google.api.resource_reference) = { 516 type: "biglake.googleapis.com/Database" 517 } 518 ]; 519 520 // Required. The table to create. The `name` field does not need to be 521 // provided for the table creation. 522 Table table = 2 [(google.api.field_behavior) = REQUIRED]; 523 524 // Required. The ID to use for the table, which will become the final 525 // component of the table's resource name. 526 string table_id = 3 [(google.api.field_behavior) = REQUIRED]; 527} 528 529// Request message for the DeleteTable method. 530message DeleteTableRequest { 531 // Required. The name of the table to delete. 532 // Format: 533 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id} 534 string name = 1 [ 535 (google.api.field_behavior) = REQUIRED, 536 (google.api.resource_reference) = { type: "biglake.googleapis.com/Table" } 537 ]; 538} 539 540// Request message for the UpdateTable method. 541message UpdateTableRequest { 542 // Required. The table to update. 543 // 544 // The table's `name` field is used to identify the table to update. 545 // Format: 546 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id} 547 Table table = 1 [(google.api.field_behavior) = REQUIRED]; 548 549 // The list of fields to update. 550 // 551 // For the `FieldMask` definition, see 552 // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask 553 // If not set, defaults to all of the fields that are allowed to update. 554 google.protobuf.FieldMask update_mask = 2; 555} 556 557// Request message for the RenameTable method in MetastoreService 558message RenameTableRequest { 559 // Required. The table's `name` field is used to identify the table to rename. 560 // Format: 561 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id} 562 string name = 1 [ 563 (google.api.field_behavior) = REQUIRED, 564 (google.api.resource_reference) = { type: "biglake.googleapis.com/Table" } 565 ]; 566 567 // Required. The new `name` for the specified table, must be in the same 568 // database. Format: 569 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id} 570 string new_name = 2 [ 571 (google.api.field_behavior) = REQUIRED, 572 (google.api.resource_reference) = { type: "biglake.googleapis.com/Table" } 573 ]; 574} 575 576// Request message for the GetTable method. 577message GetTableRequest { 578 // Required. The name of the table to retrieve. 579 // Format: 580 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id} 581 string name = 1 [ 582 (google.api.field_behavior) = REQUIRED, 583 (google.api.resource_reference) = { type: "biglake.googleapis.com/Table" } 584 ]; 585} 586 587// Request message for the ListTables method. 588message ListTablesRequest { 589 // Required. The parent, which owns this collection of tables. 590 // Format: 591 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id} 592 string parent = 1 [ 593 (google.api.field_behavior) = REQUIRED, 594 (google.api.resource_reference) = { 595 type: "biglake.googleapis.com/Database" 596 } 597 ]; 598 599 // The maximum number of tables to return. The service may return fewer than 600 // this value. 601 // If unspecified, at most 50 tables will be returned. 602 // The maximum value is 1000; values above 1000 will be coerced to 1000. 603 int32 page_size = 2; 604 605 // A page token, received from a previous `ListTables` call. 606 // Provide this to retrieve the subsequent page. 607 // 608 // When paginating, all other parameters provided to `ListTables` must match 609 // the call that provided the page token. 610 string page_token = 3; 611 612 // The view for the returned tables. 613 TableView view = 4; 614} 615 616// Response message for the ListTables method. 617message ListTablesResponse { 618 // The tables from the specified database. 619 repeated Table tables = 1; 620 621 // A token, which can be sent as `page_token` to retrieve the next page. 622 // If this field is omitted, there are no subsequent pages. 623 string next_page_token = 2; 624} 625 626// Options of a Hive database. 627message HiveDatabaseOptions { 628 // Cloud Storage folder URI where the database data is stored, starting with 629 // "gs://". 630 string location_uri = 1; 631 632 // Stores user supplied Hive database parameters. 633 map<string, string> parameters = 2; 634} 635 636// Options of a Hive table. 637message HiveTableOptions { 638 // Serializer and deserializer information. 639 message SerDeInfo { 640 // The fully qualified Java class name of the serialization library. 641 string serialization_lib = 1; 642 } 643 644 // Stores physical storage information of the data. 645 message StorageDescriptor { 646 // Cloud Storage folder URI where the table data is stored, starting with 647 // "gs://". 648 string location_uri = 1; 649 650 // The fully qualified Java class name of the input format. 651 string input_format = 2; 652 653 // The fully qualified Java class name of the output format. 654 string output_format = 3; 655 656 // Serializer and deserializer information. 657 SerDeInfo serde_info = 4; 658 } 659 660 // Stores user supplied Hive table parameters. 661 map<string, string> parameters = 1; 662 663 // Hive table type. For example, MANAGED_TABLE, EXTERNAL_TABLE. 664 string table_type = 2; 665 666 // Stores physical storage information of the data. 667 StorageDescriptor storage_descriptor = 3; 668} 669