This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
/
datacatalog.py
1215 lines (984 loc) · 45.3 KB
/
datacatalog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import proto # type: ignore
from google.cloud.datacatalog_v1.types import bigquery
from google.cloud.datacatalog_v1.types import common
from google.cloud.datacatalog_v1.types import data_source as gcd_data_source
from google.cloud.datacatalog_v1.types import gcs_fileset_spec as gcd_gcs_fileset_spec
from google.cloud.datacatalog_v1.types import schema as gcd_schema
from google.cloud.datacatalog_v1.types import search
from google.cloud.datacatalog_v1.types import table_spec
from google.cloud.datacatalog_v1.types import tags as gcd_tags
from google.cloud.datacatalog_v1.types import timestamps
from google.cloud.datacatalog_v1.types import usage
from google.protobuf import field_mask_pb2 # type: ignore
__protobuf__ = proto.module(
package="google.cloud.datacatalog.v1",
manifest={
"EntryType",
"SearchCatalogRequest",
"SearchCatalogResponse",
"CreateEntryGroupRequest",
"UpdateEntryGroupRequest",
"GetEntryGroupRequest",
"DeleteEntryGroupRequest",
"ListEntryGroupsRequest",
"ListEntryGroupsResponse",
"CreateEntryRequest",
"UpdateEntryRequest",
"DeleteEntryRequest",
"GetEntryRequest",
"LookupEntryRequest",
"Entry",
"DatabaseTableSpec",
"DataSourceConnectionSpec",
"RoutineSpec",
"EntryGroup",
"CreateTagTemplateRequest",
"GetTagTemplateRequest",
"UpdateTagTemplateRequest",
"DeleteTagTemplateRequest",
"CreateTagRequest",
"UpdateTagRequest",
"DeleteTagRequest",
"CreateTagTemplateFieldRequest",
"UpdateTagTemplateFieldRequest",
"RenameTagTemplateFieldRequest",
"RenameTagTemplateFieldEnumValueRequest",
"DeleteTagTemplateFieldRequest",
"ListTagsRequest",
"ListTagsResponse",
"ListEntriesRequest",
"ListEntriesResponse",
},
)
class EntryType(proto.Enum):
r"""The enum field that lists all the types of entry resources in Data
Catalog. For example, a BigQuery table entry has the ``TABLE`` type.
"""
ENTRY_TYPE_UNSPECIFIED = 0
TABLE = 2
MODEL = 5
DATA_STREAM = 3
FILESET = 4
CLUSTER = 6
DATABASE = 7
DATA_SOURCE_CONNECTION = 8
ROUTINE = 9
SERVICE = 14
class SearchCatalogRequest(proto.Message):
r"""Request message for
[SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog].
Attributes:
scope (google.cloud.datacatalog_v1.types.SearchCatalogRequest.Scope):
Required. The scope of this search request.
The ``scope`` is invalid if ``include_org_ids``,
``include_project_ids`` are empty AND
``include_gcp_public_datasets`` is set to ``false``. In this
case, the request returns an error.
query (str):
Optional. The query string with a minimum of 3 characters
and specific syntax. For more information, see `Data Catalog
search
syntax <https://cloud.google.com/data-catalog/docs/how-to/search-reference>`__.
An empty query string returns all data assets (in the
specified scope) that you have access to.
A query string can be a simple ``xyz`` or qualified by
predicates:
- ``name:x``
- ``column:y``
- ``description:z``
page_size (int):
Number of results to return in a single
search page.
Can't be negative or 0, defaults to 10 in this
case. The maximum number is 1000. If exceeded,
throws an "invalid argument" exception.
page_token (str):
Optional. Pagination token that, if specified, returns the
next page of search results. If empty, returns the first
page.
This token is returned in the
[SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token]
field of the response to a previous
[SearchCatalogRequest][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]
call.
order_by (str):
Specifies the order of results.
Currently supported case-sensitive values are:
- ``relevance`` that can only be descending
- ``last_modified_timestamp [asc|desc]`` with descending
(``desc``) as default
If this parameter is omitted, it defaults to the descending
``relevance``.
"""
class Scope(proto.Message):
r"""The criteria that select the subspace used for query
matching.
Attributes:
include_org_ids (Sequence[str]):
The list of organization IDs to search within.
To find your organization ID, follow the steps from
[Creating and managing organizations]
(/resource-manager/docs/creating-managing-organization).
include_project_ids (Sequence[str]):
The list of project IDs to search within.
For more information on the distinction between project
names, IDs, and numbers, see
`Projects </docs/overview/#projects>`__.
include_gcp_public_datasets (bool):
If ``true``, include Google Cloud Platform (GCP) public
datasets in search results. By default, they are excluded.
See `Google Cloud Public Datasets </public-datasets>`__ for
more information.
restricted_locations (Sequence[str]):
Optional. The list of locations to search within. If empty,
all locations are searched.
Returns an error if any location in the list isn't one of
the `Supported
regions <https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions>`__.
If a location is unreachable, its name is returned in the
``SearchCatalogResponse.unreachable`` field. To get
additional information on the error, repeat the search
request and set the location name as the value of this
parameter.
include_public_tag_templates (bool):
Optional. If ``true``, include [public tag
templates][google.cloud.datacatalog.v1.TagTemplate.is_publicly_readable]
in the search results. By default, they are included only if
you have explicit permissions on them to view them. For
example, if you are the owner.
Other scope fields, for example, ``include_org_ids``, still
restrict the returned public tag templates and at least one
of them is required.
"""
include_org_ids = proto.RepeatedField(proto.STRING, number=2,)
include_project_ids = proto.RepeatedField(proto.STRING, number=3,)
include_gcp_public_datasets = proto.Field(proto.BOOL, number=7,)
restricted_locations = proto.RepeatedField(proto.STRING, number=16,)
include_public_tag_templates = proto.Field(proto.BOOL, number=19,)
scope = proto.Field(proto.MESSAGE, number=6, message=Scope,)
query = proto.Field(proto.STRING, number=1,)
page_size = proto.Field(proto.INT32, number=2,)
page_token = proto.Field(proto.STRING, number=3,)
order_by = proto.Field(proto.STRING, number=5,)
class SearchCatalogResponse(proto.Message):
r"""Response message for
[SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog].
Attributes:
results (Sequence[google.cloud.datacatalog_v1.types.SearchCatalogResult]):
Search results.
next_page_token (str):
Pagination token that can be used in
subsequent calls to retrieve the next page of
results.
unreachable (Sequence[str]):
Unreachable locations. Search results don't include data
from those locations.
To get additional information on an error, repeat the search
request and restrict it to specific locations by setting the
``SearchCatalogRequest.scope.restricted_locations``
parameter.
"""
@property
def raw_page(self):
return self
results = proto.RepeatedField(
proto.MESSAGE, number=1, message=search.SearchCatalogResult,
)
next_page_token = proto.Field(proto.STRING, number=3,)
unreachable = proto.RepeatedField(proto.STRING, number=6,)
class CreateEntryGroupRequest(proto.Message):
r"""Request message for
[CreateEntryGroup][google.cloud.datacatalog.v1.DataCatalog.CreateEntryGroup].
Attributes:
parent (str):
Required. The names of the project and
location that the new entry group belongs to.
Note: The entry group itself and its child
resources might not be stored in the location
specified in its name.
entry_group_id (str):
Required. The ID of the entry group to create.
The ID must contain only letters (a-z, A-Z), numbers (0-9),
underscores (_), and must start with a letter or underscore.
The maximum size is 64 bytes when encoded in UTF-8.
entry_group (google.cloud.datacatalog_v1.types.EntryGroup):
The entry group to create. Defaults to empty.
"""
parent = proto.Field(proto.STRING, number=1,)
entry_group_id = proto.Field(proto.STRING, number=3,)
entry_group = proto.Field(proto.MESSAGE, number=2, message="EntryGroup",)
class UpdateEntryGroupRequest(proto.Message):
r"""Request message for
[UpdateEntryGroup][google.cloud.datacatalog.v1.DataCatalog.UpdateEntryGroup].
Attributes:
entry_group (google.cloud.datacatalog_v1.types.EntryGroup):
Required. Updates for the entry group. The ``name`` field
must be set.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Names of fields whose values to overwrite on
an entry group.
If this parameter is absent or empty, all
modifiable fields are overwritten. If such
fields are non-required and omitted in the
request body, their values are emptied.
"""
entry_group = proto.Field(proto.MESSAGE, number=1, message="EntryGroup",)
update_mask = proto.Field(
proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,
)
class GetEntryGroupRequest(proto.Message):
r"""Request message for
[GetEntryGroup][google.cloud.datacatalog.v1.DataCatalog.GetEntryGroup].
Attributes:
name (str):
Required. The name of the entry group to get.
read_mask (google.protobuf.field_mask_pb2.FieldMask):
The fields to return. If empty or omitted,
all fields are returned.
"""
name = proto.Field(proto.STRING, number=1,)
read_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,)
class DeleteEntryGroupRequest(proto.Message):
r"""Request message for
[DeleteEntryGroup][google.cloud.datacatalog.v1.DataCatalog.DeleteEntryGroup].
Attributes:
name (str):
Required. The name of the entry group to
delete.
force (bool):
Optional. If true, deletes all entries in the
entry group.
"""
name = proto.Field(proto.STRING, number=1,)
force = proto.Field(proto.BOOL, number=2,)
class ListEntryGroupsRequest(proto.Message):
r"""Request message for
[ListEntryGroups][google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups].
Attributes:
parent (str):
Required. The name of the location that
contains the entry groups to list.
Can be provided as a URL.
page_size (int):
Optional. The maximum number of items to return.
Default is 10. Maximum limit is 1000. Throws an invalid
argument if ``page_size`` is greater than 1000.
page_token (str):
Optional. Pagination token that specifies the
next page to return. If empty, returns the first
page.
"""
parent = proto.Field(proto.STRING, number=1,)
page_size = proto.Field(proto.INT32, number=2,)
page_token = proto.Field(proto.STRING, number=3,)
class ListEntryGroupsResponse(proto.Message):
r"""Response message for
[ListEntryGroups][google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups].
Attributes:
entry_groups (Sequence[google.cloud.datacatalog_v1.types.EntryGroup]):
Entry group details.
next_page_token (str):
Pagination token to specify in the next call
to retrieve the next page of results. Empty if
there are no more items.
"""
@property
def raw_page(self):
return self
entry_groups = proto.RepeatedField(proto.MESSAGE, number=1, message="EntryGroup",)
next_page_token = proto.Field(proto.STRING, number=2,)
class CreateEntryRequest(proto.Message):
r"""Request message for
[CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry].
Attributes:
parent (str):
Required. The name of the entry group this
entry belongs to.
Note: The entry itself and its child resources
might not be stored in the location specified in
its name.
entry_id (str):
Required. The ID of the entry to create.
The ID must contain only letters (a-z, A-Z), numbers (0-9),
and underscores (_). The maximum size is 64 bytes when
encoded in UTF-8.
entry (google.cloud.datacatalog_v1.types.Entry):
Required. The entry to create.
"""
parent = proto.Field(proto.STRING, number=1,)
entry_id = proto.Field(proto.STRING, number=3,)
entry = proto.Field(proto.MESSAGE, number=2, message="Entry",)
class UpdateEntryRequest(proto.Message):
r"""Request message for
[UpdateEntry][google.cloud.datacatalog.v1.DataCatalog.UpdateEntry].
Attributes:
entry (google.cloud.datacatalog_v1.types.Entry):
Required. Updates for the entry. The ``name`` field must be
set.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Names of fields whose values to overwrite on an entry.
If this parameter is absent or empty, all modifiable fields
are overwritten. If such fields are non-required and omitted
in the request body, their values are emptied.
You can modify only the fields listed below.
For entries with type ``DATA_STREAM``:
- ``schema``
For entries with type ``FILESET``:
- ``schema``
- ``display_name``
- ``description``
- ``gcs_fileset_spec``
- ``gcs_fileset_spec.file_patterns``
For entries with ``user_specified_type``:
- ``schema``
- ``display_name``
- ``description``
- ``user_specified_type``
- ``user_specified_system``
- ``linked_resource``
- ``source_system_timestamps``
"""
entry = proto.Field(proto.MESSAGE, number=1, message="Entry",)
update_mask = proto.Field(
proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,
)
class DeleteEntryRequest(proto.Message):
r"""Request message for
[DeleteEntry][google.cloud.datacatalog.v1.DataCatalog.DeleteEntry].
Attributes:
name (str):
Required. The name of the entry to delete.
"""
name = proto.Field(proto.STRING, number=1,)
class GetEntryRequest(proto.Message):
r"""Request message for
[GetEntry][google.cloud.datacatalog.v1.DataCatalog.GetEntry].
Attributes:
name (str):
Required. The name of the entry to get.
"""
name = proto.Field(proto.STRING, number=1,)
class LookupEntryRequest(proto.Message):
r"""Request message for
[LookupEntry][google.cloud.datacatalog.v1.DataCatalog.LookupEntry].
Attributes:
linked_resource (str):
The full name of the Google Cloud Platform resource the Data
Catalog entry represents. For more information, see [Full
Resource Name]
(https://cloud.google.com/apis/design/resource_names#full_resource_name).
Full names are case-sensitive. For example:
- ``//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}``
- ``//pubsub.googleapis.com/projects/{PROJECT_ID}/topics/{TOPIC_ID}``
sql_resource (str):
The SQL name of the entry. SQL names are case-sensitive.
Examples:
- ``pubsub.topic.{PROJECT_ID}.{TOPIC_ID}``
- ``pubsub.topic.{PROJECT_ID}.``\ \`\ ``{TOPIC.ID.SEPARATED.WITH.DOTS}``\ \`
- ``bigquery.table.{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}``
- ``bigquery.dataset.{PROJECT_ID}.{DATASET_ID}``
- ``datacatalog.entry.{PROJECT_ID}.{LOCATION_ID}.{ENTRY_GROUP_ID}.{ENTRY_ID}``
Identifiers (``*_ID``) should comply with the [Lexical
structure in Standard SQL]
(https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical).
fully_qualified_name (str):
Fully qualified name (FQN) of the resource.
FQNs take two forms:
- For non-regionalized resources:
``{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}``
- For regionalized resources:
``{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}``
Example for a DPMS table:
``dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}``
"""
linked_resource = proto.Field(proto.STRING, number=1, oneof="target_name",)
sql_resource = proto.Field(proto.STRING, number=3, oneof="target_name",)
fully_qualified_name = proto.Field(proto.STRING, number=5, oneof="target_name",)
class Entry(proto.Message):
r"""Entry metadata. A Data Catalog entry represents another resource in
Google Cloud Platform (such as a BigQuery dataset or a Pub/Sub
topic) or outside of it. You can use the ``linked_resource`` field
in the entry resource to refer to the original resource ID of the
source system.
An entry resource contains resource details, for example, its
schema. Additionally, you can attach flexible metadata to an entry
in the form of a [Tag][google.cloud.datacatalog.v1.Tag].
Attributes:
name (str):
Output only. The resource name of an entry in
URL format.
Note: The entry itself and its child resources
might not be stored in the location specified in
its name.
linked_resource (str):
The resource this metadata entry refers to.
For Google Cloud Platform resources, ``linked_resource`` is
the [Full Resource Name]
(https://cloud.google.com/apis/design/resource_names#full_resource_name).
For example, the ``linked_resource`` for a table resource
from BigQuery is:
``//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}``
Output only when the entry is one of the types in the
``EntryType`` enum.
For entries with a ``user_specified_type``, this field is
optional and defaults to an empty string.
The resource string must contain only letters (a-z, A-Z),
numbers (0-9), underscores (_), periods (.), colons (:),
slashes (/), dashes (-), and hashes (#). The maximum size is
200 bytes when encoded in UTF-8.
fully_qualified_name (str):
Fully qualified name (FQN) of the resource. Set
automatically for entries representing resources from synced
systems. Settable only during creation and read-only
afterwards. Can be used for search and lookup of the
entries.
FQNs take two forms:
- For non-regionalized resources:
``{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}``
- For regionalized resources:
``{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}``
Example for a DPMS table:
``dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}``
type_ (google.cloud.datacatalog_v1.types.EntryType):
The type of the entry. Only used for entries with types
listed in the ``EntryType`` enum.
Currently, only ``FILESET`` enum value is allowed. All other
entries created in Data Catalog must use the
``user_specified_type``.
user_specified_type (str):
Custom entry type that doesn't match any of the values
allowed for input and listed in the ``EntryType`` enum.
When creating an entry, first check the type values in the
enum. If there are no appropriate types for the new entry,
provide a custom value, for example, ``my_special_type``.
The ``user_specified_type`` string has the following
limitations:
- Is case insensitive.
- Must begin with a letter or underscore.
- Can only contain letters, numbers, and underscores.
- Must be at least 1 character and at most 64 characters
long.
integrated_system (google.cloud.datacatalog_v1.types.IntegratedSystem):
Output only. Indicates the entry's source
system that Data Catalog integrates with, such
as BigQuery, Pub/Sub, or Dataproc Metastore.
user_specified_system (str):
Indicates the entry's source system that Data Catalog
doesn't automatically integrate with.
The ``user_specified_system`` string has the following
limitations:
- Is case insensitive.
- Must begin with a letter or underscore.
- Can only contain letters, numbers, and underscores.
- Must be at least 1 character and at most 64 characters
long.
gcs_fileset_spec (google.cloud.datacatalog_v1.types.GcsFilesetSpec):
Specification that applies to a Cloud Storage fileset. Valid
only for entries with the ``FILESET`` type.
bigquery_table_spec (google.cloud.datacatalog_v1.types.BigQueryTableSpec):
Specification that applies to a BigQuery table. Valid only
for entries with the ``TABLE`` type.
bigquery_date_sharded_spec (google.cloud.datacatalog_v1.types.BigQueryDateShardedSpec):
Specification for a group of BigQuery tables with the
``[prefix]YYYYMMDD`` name pattern.
For more information, see [Introduction to partitioned
tables]
(https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding).
database_table_spec (google.cloud.datacatalog_v1.types.DatabaseTableSpec):
Specification that applies to a table resource. Valid only
for entries with the ``TABLE`` type.
data_source_connection_spec (google.cloud.datacatalog_v1.types.DataSourceConnectionSpec):
Specification that applies to a data source connection.
Valid only for entries with the ``DATA_SOURCE_CONNECTION``
type.
routine_spec (google.cloud.datacatalog_v1.types.RoutineSpec):
Specification that applies to a user-defined function or
procedure. Valid only for entries with the ``ROUTINE`` type.
display_name (str):
Display name of an entry.
The name must contain only Unicode letters, numbers (0-9),
underscores (_), dashes (-), spaces ( ), and can't start or
end with spaces. The maximum size is 200 bytes when encoded
in UTF-8. Default value is an empty string.
description (str):
Entry description that can consist of several
sentences or paragraphs that describe entry
contents.
The description must not contain Unicode non-
characters as well as C0 and C1 control codes
except tabs (HT), new lines (LF), carriage
returns (CR), and page breaks (FF).
The maximum size is 2000 bytes when encoded in
UTF-8. Default value is an empty string.
schema (google.cloud.datacatalog_v1.types.Schema):
Schema of the entry. An entry might not have
any schema attached to it.
source_system_timestamps (google.cloud.datacatalog_v1.types.SystemTimestamps):
Timestamps from the underlying resource, not from the Data
Catalog entry.
Output only when the entry has a type listed in the
``EntryType`` enum. For entries with
``user_specified_type``, this field is optional and defaults
to an empty timestamp.
usage_signal (google.cloud.datacatalog_v1.types.UsageSignal):
Output only. Resource usage statistics.
labels (Sequence[google.cloud.datacatalog_v1.types.Entry.LabelsEntry]):
Cloud labels attached to the entry.
In Data Catalog, you can create and modify
labels attached only to custom entries. Synced
entries have unmodifiable labels that come from
the source system.
data_source (google.cloud.datacatalog_v1.types.DataSource):
Output only. Physical location of the entry.
"""
name = proto.Field(proto.STRING, number=1,)
linked_resource = proto.Field(proto.STRING, number=9,)
fully_qualified_name = proto.Field(proto.STRING, number=29,)
type_ = proto.Field(proto.ENUM, number=2, oneof="entry_type", enum="EntryType",)
user_specified_type = proto.Field(proto.STRING, number=16, oneof="entry_type",)
integrated_system = proto.Field(
proto.ENUM, number=17, oneof="system", enum=common.IntegratedSystem,
)
user_specified_system = proto.Field(proto.STRING, number=18, oneof="system",)
gcs_fileset_spec = proto.Field(
proto.MESSAGE,
number=6,
oneof="type_spec",
message=gcd_gcs_fileset_spec.GcsFilesetSpec,
)
bigquery_table_spec = proto.Field(
proto.MESSAGE,
number=12,
oneof="type_spec",
message=table_spec.BigQueryTableSpec,
)
bigquery_date_sharded_spec = proto.Field(
proto.MESSAGE,
number=15,
oneof="type_spec",
message=table_spec.BigQueryDateShardedSpec,
)
database_table_spec = proto.Field(
proto.MESSAGE, number=24, oneof="spec", message="DatabaseTableSpec",
)
data_source_connection_spec = proto.Field(
proto.MESSAGE, number=27, oneof="spec", message="DataSourceConnectionSpec",
)
routine_spec = proto.Field(
proto.MESSAGE, number=28, oneof="spec", message="RoutineSpec",
)
display_name = proto.Field(proto.STRING, number=3,)
description = proto.Field(proto.STRING, number=4,)
schema = proto.Field(proto.MESSAGE, number=5, message=gcd_schema.Schema,)
source_system_timestamps = proto.Field(
proto.MESSAGE, number=7, message=timestamps.SystemTimestamps,
)
usage_signal = proto.Field(proto.MESSAGE, number=13, message=usage.UsageSignal,)
labels = proto.MapField(proto.STRING, proto.STRING, number=14,)
data_source = proto.Field(
proto.MESSAGE, number=20, message=gcd_data_source.DataSource,
)
class DatabaseTableSpec(proto.Message):
r"""Specification that applies to a table resource. Valid only for
entries with the ``TABLE`` type.
Attributes:
type_ (google.cloud.datacatalog_v1.types.DatabaseTableSpec.TableType):
Type of this table.
"""
class TableType(proto.Enum):
r"""Type of the table."""
TABLE_TYPE_UNSPECIFIED = 0
NATIVE = 1
EXTERNAL = 2
type_ = proto.Field(proto.ENUM, number=1, enum=TableType,)
class DataSourceConnectionSpec(proto.Message):
r"""Specification that applies to a data source connection. Valid only
for entries with the ``DATA_SOURCE_CONNECTION`` type.
Attributes:
bigquery_connection_spec (google.cloud.datacatalog_v1.types.BigQueryConnectionSpec):
Fields specific to BigQuery connections.
"""
bigquery_connection_spec = proto.Field(
proto.MESSAGE, number=1, message=bigquery.BigQueryConnectionSpec,
)
class RoutineSpec(proto.Message):
r"""Specification that applies to a routine. Valid only for entries with
the ``ROUTINE`` type.
Attributes:
routine_type (google.cloud.datacatalog_v1.types.RoutineSpec.RoutineType):
The type of the routine.
language (str):
The language the routine is written in. The exact value
depends on the source system. For BigQuery routines,
possible values are:
- ``SQL``
- ``JAVASCRIPT``
routine_arguments (Sequence[google.cloud.datacatalog_v1.types.RoutineSpec.Argument]):
Arguments of the routine.
return_type (str):
Return type of the argument. The exact value
depends on the source system and the language.
definition_body (str):
The body of the routine.
bigquery_routine_spec (google.cloud.datacatalog_v1.types.BigQueryRoutineSpec):
Fields specific for BigQuery routines.
"""
class RoutineType(proto.Enum):
r"""The fine-grained type of the routine."""
ROUTINE_TYPE_UNSPECIFIED = 0
SCALAR_FUNCTION = 1
PROCEDURE = 2
class Argument(proto.Message):
r"""Input or output argument of a function or stored procedure.
Attributes:
name (str):
The name of the argument. A return argument
of a function might not have a name.
mode (google.cloud.datacatalog_v1.types.RoutineSpec.Argument.Mode):
Specifies whether the argument is input or
output.
type_ (str):
Type of the argument. The exact value depends
on the source system and the language.
"""
class Mode(proto.Enum):
r"""The input or output mode of the argument."""
MODE_UNSPECIFIED = 0
IN = 1
OUT = 2
INOUT = 3
name = proto.Field(proto.STRING, number=1,)
mode = proto.Field(proto.ENUM, number=2, enum="RoutineSpec.Argument.Mode",)
type_ = proto.Field(proto.STRING, number=3,)
routine_type = proto.Field(proto.ENUM, number=1, enum=RoutineType,)
language = proto.Field(proto.STRING, number=2,)
routine_arguments = proto.RepeatedField(proto.MESSAGE, number=3, message=Argument,)
return_type = proto.Field(proto.STRING, number=4,)
definition_body = proto.Field(proto.STRING, number=5,)
bigquery_routine_spec = proto.Field(
proto.MESSAGE,
number=6,
oneof="system_spec",
message=bigquery.BigQueryRoutineSpec,
)
class EntryGroup(proto.Message):
r"""Entry group metadata.
An ``EntryGroup`` resource represents a logical grouping of zero or
more Data Catalog [Entry][google.cloud.datacatalog.v1.Entry]
resources.
Attributes:
name (str):
The resource name of the entry group in URL
format.
Note: The entry group itself and its child
resources might not be stored in the location
specified in its name.
display_name (str):
A short name to identify the entry group, for
example, "analytics data - jan 2011". Default
value is an empty string.
description (str):
Entry group description. Can consist of
several sentences or paragraphs that describe
the entry group contents. Default value is an
empty string.
data_catalog_timestamps (google.cloud.datacatalog_v1.types.SystemTimestamps):
Output only. Timestamps of the entry group.
Default value is empty.
"""
name = proto.Field(proto.STRING, number=1,)
display_name = proto.Field(proto.STRING, number=2,)
description = proto.Field(proto.STRING, number=3,)
data_catalog_timestamps = proto.Field(
proto.MESSAGE, number=4, message=timestamps.SystemTimestamps,
)
class CreateTagTemplateRequest(proto.Message):
r"""Request message for
[CreateTagTemplate][google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplate].
Attributes:
parent (str):
Required. The name of the project and the template location
`region <https://cloud.google.com/data-catalog/docs/concepts/regions>`__.
tag_template_id (str):
Required. The ID of the tag template to create.
The ID must contain only lowercase letters (a-z), numbers
(0-9), or underscores (_), and must start with a letter or
underscore. The maximum size is 64 bytes when encoded in
UTF-8.
tag_template (google.cloud.datacatalog_v1.types.TagTemplate):
Required. The tag template to create.
"""
parent = proto.Field(proto.STRING, number=1,)
tag_template_id = proto.Field(proto.STRING, number=3,)
tag_template = proto.Field(proto.MESSAGE, number=2, message=gcd_tags.TagTemplate,)
class GetTagTemplateRequest(proto.Message):
r"""Request message for
[GetTagTemplate][google.cloud.datacatalog.v1.DataCatalog.GetTagTemplate].
Attributes:
name (str):
Required. The name of the tag template to
get.
"""
name = proto.Field(proto.STRING, number=1,)
class UpdateTagTemplateRequest(proto.Message):
r"""Request message for
[UpdateTagTemplate][google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplate].
Attributes:
tag_template (google.cloud.datacatalog_v1.types.TagTemplate):
Required. The template to update. The ``name`` field must be
set.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Names of fields whose values to overwrite on a tag template.
Currently, only ``display_name`` can be overwritten.
If this parameter is absent or empty, all modifiable fields
are overwritten. If such fields are non-required and omitted
in the request body, their values are emptied.
"""
tag_template = proto.Field(proto.MESSAGE, number=1, message=gcd_tags.TagTemplate,)
update_mask = proto.Field(
proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,
)
class DeleteTagTemplateRequest(proto.Message):
r"""Request message for
[DeleteTagTemplate][google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplate].
Attributes:
name (str):
Required. The name of the tag template to
delete.
force (bool):
Required. If true, deletes all tags that use this template.
Currently, ``true`` is the only supported value.
"""
name = proto.Field(proto.STRING, number=1,)
force = proto.Field(proto.BOOL, number=2,)
class CreateTagRequest(proto.Message):
r"""Request message for
[CreateTag][google.cloud.datacatalog.v1.DataCatalog.CreateTag].
Attributes:
parent (str):
Required. The name of the resource to attach
this tag to.
Tags can be attached to entries or entry groups.
An entry can have up to 1000 attached tags.
Note: The tag and its child resources might not
be stored in the location specified in its name.
tag (google.cloud.datacatalog_v1.types.Tag):
Required. The tag to create.
"""
parent = proto.Field(proto.STRING, number=1,)
tag = proto.Field(proto.MESSAGE, number=2, message=gcd_tags.Tag,)
class UpdateTagRequest(proto.Message):
r"""Request message for
[UpdateTag][google.cloud.datacatalog.v1.DataCatalog.UpdateTag].
Attributes:
tag (google.cloud.datacatalog_v1.types.Tag):
Required. The updated tag. The "name" field
must be set.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Names of fields whose values to overwrite on a tag.
Currently, a tag has the only modifiable field with the name
``fields``.
In general, if this parameter is absent or empty, all
modifiable fields are overwritten. If such fields are
non-required and omitted in the request body, their values
are emptied.
"""
tag = proto.Field(proto.MESSAGE, number=1, message=gcd_tags.Tag,)
update_mask = proto.Field(
proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,
)
class DeleteTagRequest(proto.Message):
r"""Request message for
[DeleteTag][google.cloud.datacatalog.v1.DataCatalog.DeleteTag].
Attributes:
name (str):
Required. The name of the tag to delete.
"""
name = proto.Field(proto.STRING, number=1,)
class CreateTagTemplateFieldRequest(proto.Message):
r"""Request message for
[CreateTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplateField].