Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Commit 44c10e1

Browse files
feat: Add task details and orchestration result details (#32)
* feat!: Consolidate task details into service API and add orchestration result details BREAKING CHANGE: This change relocates some task proto definitions and updates message fields, necessitating updates to imports. PiperOrigin-RevId: 423360094 Source-Link: googleapis/googleapis@c9a482e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0c2ce73c148389e4382c11eb7abfd0b26973cbb7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGMyY2U3M2MxNDgzODllNDM4MmMxMWViN2FiZmQwYjI2OTczY2JiNyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 2ec1240 commit 44c10e1

File tree

7 files changed

+455
-4
lines changed

7 files changed

+455
-4
lines changed

google/cloud/bigquery_migration/__init__.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,21 @@
2121
MigrationServiceAsyncClient,
2222
)
2323

24+
from google.cloud.bigquery_migration_v2alpha.types.assessment_task import (
25+
AssessmentOrchestrationResultDetails,
26+
)
27+
from google.cloud.bigquery_migration_v2alpha.types.assessment_task import (
28+
AssessmentTaskDetails,
29+
)
2430
from google.cloud.bigquery_migration_v2alpha.types.migration_entities import (
2531
MigrationSubtask,
2632
)
2733
from google.cloud.bigquery_migration_v2alpha.types.migration_entities import (
2834
MigrationTask,
2935
)
36+
from google.cloud.bigquery_migration_v2alpha.types.migration_entities import (
37+
MigrationTaskOrchestrationResult,
38+
)
3039
from google.cloud.bigquery_migration_v2alpha.types.migration_entities import (
3140
MigrationWorkflow,
3241
)
@@ -70,12 +79,32 @@
7079
from google.cloud.bigquery_migration_v2alpha.types.migration_service import (
7180
StartMigrationWorkflowRequest,
7281
)
82+
from google.cloud.bigquery_migration_v2alpha.types.translation_task import BteqOptions
83+
from google.cloud.bigquery_migration_v2alpha.types.translation_task import (
84+
DatasetReference,
85+
)
86+
from google.cloud.bigquery_migration_v2alpha.types.translation_task import Filter
87+
from google.cloud.bigquery_migration_v2alpha.types.translation_task import (
88+
IdentifierSettings,
89+
)
90+
from google.cloud.bigquery_migration_v2alpha.types.translation_task import (
91+
TeradataOptions,
92+
)
93+
from google.cloud.bigquery_migration_v2alpha.types.translation_task import (
94+
TranslationFileMapping,
95+
)
96+
from google.cloud.bigquery_migration_v2alpha.types.translation_task import (
97+
TranslationTaskDetails,
98+
)
7399

74100
__all__ = (
75101
"MigrationServiceClient",
76102
"MigrationServiceAsyncClient",
103+
"AssessmentOrchestrationResultDetails",
104+
"AssessmentTaskDetails",
77105
"MigrationSubtask",
78106
"MigrationTask",
107+
"MigrationTaskOrchestrationResult",
79108
"MigrationWorkflow",
80109
"ErrorDetail",
81110
"ErrorLocation",
@@ -93,4 +122,11 @@
93122
"ListMigrationWorkflowsRequest",
94123
"ListMigrationWorkflowsResponse",
95124
"StartMigrationWorkflowRequest",
125+
"BteqOptions",
126+
"DatasetReference",
127+
"Filter",
128+
"IdentifierSettings",
129+
"TeradataOptions",
130+
"TranslationFileMapping",
131+
"TranslationTaskDetails",
96132
)

google/cloud/bigquery_migration_v2alpha/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
from .services.migration_service import MigrationServiceClient
1818
from .services.migration_service import MigrationServiceAsyncClient
1919

20+
from .types.assessment_task import AssessmentOrchestrationResultDetails
21+
from .types.assessment_task import AssessmentTaskDetails
2022
from .types.migration_entities import MigrationSubtask
2123
from .types.migration_entities import MigrationTask
24+
from .types.migration_entities import MigrationTaskOrchestrationResult
2225
from .types.migration_entities import MigrationWorkflow
2326
from .types.migration_error_details import ErrorDetail
2427
from .types.migration_error_details import ErrorLocation
@@ -36,27 +39,44 @@
3639
from .types.migration_service import ListMigrationWorkflowsRequest
3740
from .types.migration_service import ListMigrationWorkflowsResponse
3841
from .types.migration_service import StartMigrationWorkflowRequest
42+
from .types.translation_task import BteqOptions
43+
from .types.translation_task import DatasetReference
44+
from .types.translation_task import Filter
45+
from .types.translation_task import IdentifierSettings
46+
from .types.translation_task import TeradataOptions
47+
from .types.translation_task import TranslationFileMapping
48+
from .types.translation_task import TranslationTaskDetails
3949

4050
__all__ = (
4151
"MigrationServiceAsyncClient",
52+
"AssessmentOrchestrationResultDetails",
53+
"AssessmentTaskDetails",
54+
"BteqOptions",
4255
"CreateMigrationWorkflowRequest",
56+
"DatasetReference",
4357
"DeleteMigrationWorkflowRequest",
4458
"ErrorDetail",
4559
"ErrorLocation",
60+
"Filter",
4661
"GetMigrationSubtaskRequest",
4762
"GetMigrationWorkflowRequest",
63+
"IdentifierSettings",
4864
"ListMigrationSubtasksRequest",
4965
"ListMigrationSubtasksResponse",
5066
"ListMigrationWorkflowsRequest",
5167
"ListMigrationWorkflowsResponse",
5268
"MigrationServiceClient",
5369
"MigrationSubtask",
5470
"MigrationTask",
71+
"MigrationTaskOrchestrationResult",
5572
"MigrationWorkflow",
5673
"Point",
5774
"ResourceErrorDetail",
5875
"StartMigrationWorkflowRequest",
76+
"TeradataOptions",
5977
"TimeInterval",
6078
"TimeSeries",
79+
"TranslationFileMapping",
80+
"TranslationTaskDetails",
6181
"TypedValue",
6282
)

google/cloud/bigquery_migration_v2alpha/types/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from .assessment_task import (
17+
AssessmentOrchestrationResultDetails,
18+
AssessmentTaskDetails,
19+
)
1620
from .migration_entities import (
1721
MigrationSubtask,
1822
MigrationTask,
23+
MigrationTaskOrchestrationResult,
1924
MigrationWorkflow,
2025
)
2126
from .migration_error_details import (
@@ -40,10 +45,22 @@
4045
ListMigrationWorkflowsResponse,
4146
StartMigrationWorkflowRequest,
4247
)
48+
from .translation_task import (
49+
BteqOptions,
50+
DatasetReference,
51+
Filter,
52+
IdentifierSettings,
53+
TeradataOptions,
54+
TranslationFileMapping,
55+
TranslationTaskDetails,
56+
)
4357

4458
__all__ = (
59+
"AssessmentOrchestrationResultDetails",
60+
"AssessmentTaskDetails",
4561
"MigrationSubtask",
4662
"MigrationTask",
63+
"MigrationTaskOrchestrationResult",
4764
"MigrationWorkflow",
4865
"ErrorDetail",
4966
"ErrorLocation",
@@ -61,4 +78,11 @@
6178
"ListMigrationWorkflowsRequest",
6279
"ListMigrationWorkflowsResponse",
6380
"StartMigrationWorkflowRequest",
81+
"BteqOptions",
82+
"DatasetReference",
83+
"Filter",
84+
"IdentifierSettings",
85+
"TeradataOptions",
86+
"TranslationFileMapping",
87+
"TranslationTaskDetails",
6488
)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
import proto # type: ignore
17+
18+
19+
__protobuf__ = proto.module(
20+
package="google.cloud.bigquery.migration.v2alpha",
21+
manifest={"AssessmentTaskDetails", "AssessmentOrchestrationResultDetails",},
22+
)
23+
24+
25+
class AssessmentTaskDetails(proto.Message):
26+
r"""Assessment task config.
27+
28+
Attributes:
29+
input_path (str):
30+
Required. The Cloud Storage path for
31+
assessment input files.
32+
output_dataset (str):
33+
Required. The BigQuery dataset for output.
34+
querylogs_path (str):
35+
Optional. An optional Cloud Storage path to
36+
write the query logs (which is then used as an
37+
input path on the translation task)
38+
data_source (str):
39+
Required. The data source or data warehouse
40+
type (eg: TERADATA/REDSHIFT) from which the
41+
input data is extracted.
42+
"""
43+
44+
input_path = proto.Field(proto.STRING, number=1,)
45+
output_dataset = proto.Field(proto.STRING, number=2,)
46+
querylogs_path = proto.Field(proto.STRING, number=3,)
47+
data_source = proto.Field(proto.STRING, number=4,)
48+
49+
50+
class AssessmentOrchestrationResultDetails(proto.Message):
51+
r"""Details for an assessment task orchestration result.
52+
53+
Attributes:
54+
output_tables_schema_version (str):
55+
Optional. The version used for the output
56+
table schemas.
57+
"""
58+
59+
output_tables_schema_version = proto.Field(proto.STRING, number=1,)
60+
61+
62+
__all__ = tuple(sorted(__protobuf__.manifest))

google/cloud/bigquery_migration_v2alpha/types/migration_entities.py

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,23 @@
1515
#
1616
import proto # type: ignore
1717

18+
from google.cloud.bigquery_migration_v2alpha.types import assessment_task
1819
from google.cloud.bigquery_migration_v2alpha.types import migration_error_details
1920
from google.cloud.bigquery_migration_v2alpha.types import migration_metrics
21+
from google.cloud.bigquery_migration_v2alpha.types import translation_task
2022
from google.protobuf import any_pb2 # type: ignore
2123
from google.protobuf import timestamp_pb2 # type: ignore
2224
from google.rpc import error_details_pb2 # type: ignore
2325

2426

2527
__protobuf__ = proto.module(
2628
package="google.cloud.bigquery.migration.v2alpha",
27-
manifest={"MigrationWorkflow", "MigrationTask", "MigrationSubtask",},
29+
manifest={
30+
"MigrationWorkflow",
31+
"MigrationTask",
32+
"MigrationSubtask",
33+
"MigrationTaskOrchestrationResult",
34+
},
2835
)
2936

3037

@@ -79,7 +86,23 @@ class MigrationTask(proto.Message):
7986
r"""A single task for a migration which has details about the
8087
configuration of the task.
8188
89+
This message has `oneof`_ fields (mutually exclusive fields).
90+
For each oneof, at most one member field can be set at the same time.
91+
Setting any member of the oneof automatically clears all other
92+
members.
93+
94+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
95+
8296
Attributes:
97+
assessment_task_details (google.cloud.bigquery_migration_v2alpha.types.AssessmentTaskDetails):
98+
Task configuration for Assessment.
99+
100+
This field is a member of `oneof`_ ``task_details``.
101+
translation_task_details (google.cloud.bigquery_migration_v2alpha.types.TranslationTaskDetails):
102+
Task configuration for Batch/Offline SQL
103+
Translation.
104+
105+
This field is a member of `oneof`_ ``task_details``.
83106
id (str):
84107
Output only. Immutable. The unique identifier
85108
for the migration task. The ID is server-
@@ -88,9 +111,9 @@ class MigrationTask(proto.Message):
88111
The type of the task. This must be a
89112
supported task type.
90113
details (google.protobuf.any_pb2.Any):
91-
The details of the task. The type URL must be
92-
one of the supported task details messages and
93-
correspond to the Task's type.
114+
DEPRECATED! Use one of the task_details below. The details
115+
of the task. The type URL must be one of the supported task
116+
details messages and correspond to the Task's type.
94117
state (google.cloud.bigquery_migration_v2alpha.types.MigrationTask.State):
95118
Output only. The current state of the task.
96119
processing_error (google.rpc.error_details_pb2.ErrorInfo):
@@ -100,6 +123,9 @@ class MigrationTask(proto.Message):
100123
Time when the task was created.
101124
last_update_time (google.protobuf.timestamp_pb2.Timestamp):
102125
Time when the task was last updated.
126+
orchestration_result (google.cloud.bigquery_migration_v2alpha.types.MigrationTaskOrchestrationResult):
127+
Output only. Additional information about the
128+
orchestration.
103129
"""
104130

105131
class State(proto.Enum):
@@ -112,6 +138,18 @@ class State(proto.Enum):
112138
SUCCEEDED = 5
113139
FAILED = 6
114140

141+
assessment_task_details = proto.Field(
142+
proto.MESSAGE,
143+
number=12,
144+
oneof="task_details",
145+
message=assessment_task.AssessmentTaskDetails,
146+
)
147+
translation_task_details = proto.Field(
148+
proto.MESSAGE,
149+
number=13,
150+
oneof="task_details",
151+
message=translation_task.TranslationTaskDetails,
152+
)
115153
id = proto.Field(proto.STRING, number=1,)
116154
type_ = proto.Field(proto.STRING, number=2,)
117155
details = proto.Field(proto.MESSAGE, number=3, message=any_pb2.Any,)
@@ -123,6 +161,9 @@ class State(proto.Enum):
123161
last_update_time = proto.Field(
124162
proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,
125163
)
164+
orchestration_result = proto.Field(
165+
proto.MESSAGE, number=10, message="MigrationTaskOrchestrationResult",
166+
)
126167

127168

128169
class MigrationSubtask(proto.Message):
@@ -202,4 +243,26 @@ class State(proto.Enum):
202243
)
203244

204245

246+
class MigrationTaskOrchestrationResult(proto.Message):
247+
r"""Additional information from the orchestrator when it is done
248+
with the task orchestration.
249+
250+
251+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
252+
253+
Attributes:
254+
assessment_details (google.cloud.bigquery_migration_v2alpha.types.AssessmentOrchestrationResultDetails):
255+
Details specific to assessment task types.
256+
257+
This field is a member of `oneof`_ ``details``.
258+
"""
259+
260+
assessment_details = proto.Field(
261+
proto.MESSAGE,
262+
number=1,
263+
oneof="details",
264+
message=assessment_task.AssessmentOrchestrationResultDetails,
265+
)
266+
267+
205268
__all__ = tuple(sorted(__protobuf__.manifest))

0 commit comments

Comments
 (0)