Skip to content

Commit 1236b08

Browse files
Google APIscopybara-github
authored andcommitted
feat: define Datastore -> Firestore in Datastore mode migration long running operation metadata
PiperOrigin-RevId: 419875388
1 parent 82c132f commit 1236b08

4 files changed

Lines changed: 64 additions & 24 deletions

File tree

google/datastore/admin/v1/BUILD.bazel

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -14,6 +23,7 @@ proto_library(
1423
srcs = [
1524
"datastore_admin.proto",
1625
"index.proto",
26+
"migration.proto",
1727
],
1828
deps = [
1929
"//google/api:annotations_proto",
@@ -60,11 +70,13 @@ java_gapic_library(
6070
srcs = [":admin_proto_with_info"],
6171
gapic_yaml = "datastore_admin_gapic.yaml",
6272
grpc_service_config = "datastore_admin_grpc_service_config.json",
73+
service_yaml = "datastore_v1.yaml",
6374
test_deps = [
6475
":admin_java_grpc",
6576
],
6677
deps = [
6778
":admin_java_proto",
79+
"//google/api:api_java_proto",
6880
],
6981
)
7082

@@ -115,11 +127,12 @@ go_gapic_library(
115127
grpc_service_config = "datastore_admin_grpc_service_config.json",
116128
importpath = "cloud.google.com/go/datastore/admin/apiv1;admin",
117129
service_yaml = "datastore_v1.yaml",
130+
metadata = True,
118131
deps = [
119132
":admin_go_proto",
120133
"//google/longrunning:longrunning_go_proto",
121-
"@com_google_cloud_go//longrunning:go_default_library",
122134
"@com_google_cloud_go//longrunning/autogen:go_default_library",
135+
"@com_google_cloud_go//longrunning:go_default_library",
123136
],
124137
)
125138

@@ -136,6 +149,7 @@ go_gapic_assembly_pkg(
136149
deps = [
137150
":admin_go_gapic",
138151
":admin_go_gapic_srcjar-test.srcjar",
152+
":admin_go_gapic_srcjar-metadata.srcjar",
139153
":admin_go_proto",
140154
],
141155
)
@@ -150,16 +164,17 @@ load(
150164
)
151165

152166
py_gapic_library(
153-
name = "datastore-admin_py_gapic",
167+
name = "admin_py_gapic",
154168
srcs = [":admin_proto"],
155169
grpc_service_config = "datastore_admin_grpc_service_config.json",
156170
opt_args = ["python-gapic-namespace=google.cloud, python-gapic-name=datastore-admin"],
157171
)
158172

173+
# Open Source Packages
159174
py_gapic_assembly_pkg(
160175
name = "datastore-admin-v1-py",
161176
deps = [
162-
":datastore-admin_py_gapic",
177+
":admin_py_gapic",
163178
],
164179
)
165180

@@ -217,8 +232,9 @@ load(
217232

218233
nodejs_gapic_library(
219234
name = "admin_nodejs_gapic",
235+
package_name = "@google-cloud/datastore-admin",
220236
src = ":admin_proto_with_info",
221-
extra_protoc_parameters = ["metadata", "template=typescript_gapic"],
237+
extra_protoc_parameters = ["metadata"],
222238
grpc_service_config = "datastore_admin_grpc_service_config.json",
223239
package = "google.datastore.admin.v1",
224240
service_yaml = "datastore_v1.yaml",
@@ -238,8 +254,8 @@ nodejs_gapic_assembly_pkg(
238254
##############################################################################
239255
load(
240256
"@com_google_googleapis_imports//:imports.bzl",
241-
"ruby_cloud_gapic_library",
242257
"ruby_gapic_assembly_pkg",
258+
"ruby_cloud_gapic_library",
243259
"ruby_grpc_library",
244260
"ruby_proto_library",
245261
)

google/datastore/admin/v1/datastore_admin.proto

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/datastore/admin/v1/index.proto";
23+
import "google/datastore/admin/v1/migration.proto";
2324
import "google/longrunning/operations.proto";
2425
import "google/protobuf/timestamp.proto";
2526

@@ -353,24 +354,6 @@ message ExportEntitiesMetadata {
353354
string output_url_prefix = 5;
354355
}
355356

356-
// Operation types.
357-
enum OperationType {
358-
// Unspecified.
359-
OPERATION_TYPE_UNSPECIFIED = 0;
360-
361-
// ExportEntities.
362-
EXPORT_ENTITIES = 1;
363-
364-
// ImportEntities.
365-
IMPORT_ENTITIES = 2;
366-
367-
// CreateIndex.
368-
CREATE_INDEX = 3;
369-
370-
// DeleteIndex.
371-
DELETE_INDEX = 4;
372-
}
373-
374357
// Metadata for ImportEntities operations.
375358
message ImportEntitiesMetadata {
376359
// Metadata common to all Datastore Admin operations.
@@ -490,3 +473,39 @@ message IndexOperationMetadata {
490473
// The index resource ID that this operation is acting on.
491474
string index_id = 3;
492475
}
476+
477+
// Metadata for Datastore to Firestore migration operations.
478+
//
479+
// The DatastoreFirestoreMigration operation is not started by the end-user via
480+
// an explicit "creation" method. This is an intentional deviation from the LRO
481+
// design pattern.
482+
//
483+
// This singleton resource can be accessed at:
484+
// `projects/{project_id}/datastore-firestore-migration`
485+
message DatastoreFirestoreMigrationMetadata {
486+
// The current state of migration from Cloud Datastore to Cloud Firestore in
487+
// Datastore mode.
488+
MigrationState migration_state = 1;
489+
490+
// The current step of migration from Cloud Datastore to Cloud Firestore in
491+
// Datastore mode.
492+
MigrationStep migration_step = 2;
493+
}
494+
495+
// Operation types.
496+
enum OperationType {
497+
// Unspecified.
498+
OPERATION_TYPE_UNSPECIFIED = 0;
499+
500+
// ExportEntities.
501+
EXPORT_ENTITIES = 1;
502+
503+
// ImportEntities.
504+
IMPORT_ENTITIES = 2;
505+
506+
// CreateIndex.
507+
CREATE_INDEX = 3;
508+
509+
// DeleteIndex.
510+
DELETE_INDEX = 4;
511+
}

google/datastore/admin/v1/datastore_v1.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ apis:
77
- name: google.datastore.admin.v1.DatastoreAdmin
88

99
types:
10+
- name: google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata
1011
- name: google.datastore.admin.v1.ExportEntitiesMetadata
1112
- name: google.datastore.admin.v1.ExportEntitiesResponse
1213
- name: google.datastore.admin.v1.ImportEntitiesMetadata
1314
- name: google.datastore.admin.v1.IndexOperationMetadata
15+
- name: google.datastore.admin.v1.MigrationProgressEvent
16+
- name: google.datastore.admin.v1.MigrationStateEvent
1417

1518
documentation:
1619
summary: |-

google/datastore/admin/v1/migration.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ syntax = "proto3";
1616

1717
package google.datastore.admin.v1;
1818

19+
import "google/api/annotations.proto";
20+
1921
option csharp_namespace = "Google.Cloud.Datastore.Admin.V1";
2022
option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;admin";
2123
option java_multiple_files = true;

0 commit comments

Comments
 (0)