google-cloud-datastore-admin-v1 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/lib/google/cloud/datastore/admin/v1/datastore_admin/client.rb +180 -0
- data/lib/google/cloud/datastore/admin/v1/version.rb +1 -1
- data/lib/google/datastore/admin/v1/datastore_admin_pb.rb +10 -0
- data/lib/google/datastore/admin/v1/datastore_admin_services_pb.rb +26 -0
- data/lib/google/datastore/admin/v1/migration_pb.rb +44 -0
- data/proto_docs/google/datastore/admin/v1/datastore_admin.rb +27 -0
- data/proto_docs/google/datastore/admin/v1/index.rb +1 -1
- data/proto_docs/google/datastore/admin/v1/migration.rb +90 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3625c8bbc579cb83a08da7a675c8193d06e8dc19524650f7371b9d8708f35f12
|
4
|
+
data.tar.gz: fdcbf5a5caa4cfb53d7d5eb09ef38cc89669dad416ddf485e8e0047eede1f3b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ced0fa3e2b18b60889b4105266559956b9b445f7ddfc1e1ffe24ecd83887cd66bd7ed23cd3bc39a6a78cc005f15dd9127622dd855ac95030ee9612a5064916fe
|
7
|
+
data.tar.gz: 7994125ffa47a36f100627f9bc143c8a696ee61852efaa5b899373c8b87217f74e065067c414456c461fd931e9a17aba25e1ff4b66de17d27ee3b5cd37484d4a
|
data/LICENSE.md
CHANGED
@@ -1,192 +1,190 @@
|
|
1
|
-
Apache License
|
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
|
-
same "printed page" as the copyright notice for easier
|
189
|
-
identification within third-party archives.
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
190
188
|
|
191
189
|
Copyright [yyyy] [name of copyright owner]
|
192
190
|
|
@@ -194,7 +192,7 @@ identification within third-party archives.
|
|
194
192
|
you may not use this file except in compliance with the License.
|
195
193
|
You may obtain a copy of the License at
|
196
194
|
|
197
|
-
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
198
196
|
|
199
197
|
Unless required by applicable law or agreed to in writing, software
|
200
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -128,6 +128,10 @@ module Google
|
|
128
128
|
|
129
129
|
default_config.rpcs.import_entities.timeout = 60.0
|
130
130
|
|
131
|
+
default_config.rpcs.create_index.timeout = 60.0
|
132
|
+
|
133
|
+
default_config.rpcs.delete_index.timeout = 60.0
|
134
|
+
|
131
135
|
default_config.rpcs.get_index.timeout = 60.0
|
132
136
|
default_config.rpcs.get_index.retry_policy = {
|
133
137
|
initial_delay: 0.1,
|
@@ -430,6 +434,168 @@ module Google
|
|
430
434
|
raise ::Google::Cloud::Error.from_error(e)
|
431
435
|
end
|
432
436
|
|
437
|
+
##
|
438
|
+
# Creates the specified index.
|
439
|
+
# A newly created index's initial state is `CREATING`. On completion of the
|
440
|
+
# returned {::Google::Longrunning::Operation google.longrunning.Operation}, the state will be `READY`.
|
441
|
+
# If the index already exists, the call will return an `ALREADY_EXISTS`
|
442
|
+
# status.
|
443
|
+
#
|
444
|
+
# During index creation, the process could result in an error, in which
|
445
|
+
# case the index will move to the `ERROR` state. The process can be recovered
|
446
|
+
# by fixing the data that caused the error, removing the index with
|
447
|
+
# {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#delete_index delete}, then
|
448
|
+
# re-creating the index with [create]
|
449
|
+
# [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
|
450
|
+
#
|
451
|
+
# Indexes with a single property cannot be created.
|
452
|
+
#
|
453
|
+
# @overload create_index(request, options = nil)
|
454
|
+
# Pass arguments to `create_index` via a request object, either of type
|
455
|
+
# {::Google::Cloud::Datastore::Admin::V1::CreateIndexRequest} or an equivalent Hash.
|
456
|
+
#
|
457
|
+
# @param request [::Google::Cloud::Datastore::Admin::V1::CreateIndexRequest, ::Hash]
|
458
|
+
# A request object representing the call parameters. Required. To specify no
|
459
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
460
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
461
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
462
|
+
#
|
463
|
+
# @overload create_index(project_id: nil, index: nil)
|
464
|
+
# Pass arguments to `create_index` via keyword arguments. Note that at
|
465
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
466
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
467
|
+
#
|
468
|
+
# @param project_id [::String]
|
469
|
+
# Project ID against which to make the request.
|
470
|
+
# @param index [::Google::Cloud::Datastore::Admin::V1::Index, ::Hash]
|
471
|
+
# The index to create. The name and state fields are output only and will be
|
472
|
+
# ignored. Single property indexes cannot be created or deleted.
|
473
|
+
#
|
474
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
475
|
+
# @yieldparam response [::Gapic::Operation]
|
476
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
477
|
+
#
|
478
|
+
# @return [::Gapic::Operation]
|
479
|
+
#
|
480
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
481
|
+
#
|
482
|
+
def create_index request, options = nil
|
483
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
484
|
+
|
485
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::Admin::V1::CreateIndexRequest
|
486
|
+
|
487
|
+
# Converts hash and nil to an options object
|
488
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
489
|
+
|
490
|
+
# Customize the options with defaults
|
491
|
+
metadata = @config.rpcs.create_index.metadata.to_h
|
492
|
+
|
493
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
494
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
495
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
496
|
+
gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
|
497
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
498
|
+
|
499
|
+
header_params = {
|
500
|
+
"project_id" => request.project_id
|
501
|
+
}
|
502
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
503
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
504
|
+
|
505
|
+
options.apply_defaults timeout: @config.rpcs.create_index.timeout,
|
506
|
+
metadata: metadata,
|
507
|
+
retry_policy: @config.rpcs.create_index.retry_policy
|
508
|
+
options.apply_defaults metadata: @config.metadata,
|
509
|
+
retry_policy: @config.retry_policy
|
510
|
+
|
511
|
+
@datastore_admin_stub.call_rpc :create_index, request, options: options do |response, operation|
|
512
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
513
|
+
yield response, operation if block_given?
|
514
|
+
return response
|
515
|
+
end
|
516
|
+
rescue ::GRPC::BadStatus => e
|
517
|
+
raise ::Google::Cloud::Error.from_error(e)
|
518
|
+
end
|
519
|
+
|
520
|
+
##
|
521
|
+
# Deletes an existing index.
|
522
|
+
# An index can only be deleted if it is in a `READY` or `ERROR` state. On
|
523
|
+
# successful execution of the request, the index will be in a `DELETING`
|
524
|
+
# {::Google::Cloud::Datastore::Admin::V1::Index::State state}. And on completion of the
|
525
|
+
# returned {::Google::Longrunning::Operation google.longrunning.Operation}, the index will be removed.
|
526
|
+
#
|
527
|
+
# During index deletion, the process could result in an error, in which
|
528
|
+
# case the index will move to the `ERROR` state. The process can be recovered
|
529
|
+
# by fixing the data that caused the error, followed by calling
|
530
|
+
# {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#delete_index delete} again.
|
531
|
+
#
|
532
|
+
# @overload delete_index(request, options = nil)
|
533
|
+
# Pass arguments to `delete_index` via a request object, either of type
|
534
|
+
# {::Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest} or an equivalent Hash.
|
535
|
+
#
|
536
|
+
# @param request [::Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest, ::Hash]
|
537
|
+
# A request object representing the call parameters. Required. To specify no
|
538
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
539
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
540
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
541
|
+
#
|
542
|
+
# @overload delete_index(project_id: nil, index_id: nil)
|
543
|
+
# Pass arguments to `delete_index` via keyword arguments. Note that at
|
544
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
545
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
546
|
+
#
|
547
|
+
# @param project_id [::String]
|
548
|
+
# Project ID against which to make the request.
|
549
|
+
# @param index_id [::String]
|
550
|
+
# The resource ID of the index to delete.
|
551
|
+
#
|
552
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
553
|
+
# @yieldparam response [::Gapic::Operation]
|
554
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
555
|
+
#
|
556
|
+
# @return [::Gapic::Operation]
|
557
|
+
#
|
558
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
559
|
+
#
|
560
|
+
def delete_index request, options = nil
|
561
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
562
|
+
|
563
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest
|
564
|
+
|
565
|
+
# Converts hash and nil to an options object
|
566
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
567
|
+
|
568
|
+
# Customize the options with defaults
|
569
|
+
metadata = @config.rpcs.delete_index.metadata.to_h
|
570
|
+
|
571
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
572
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
573
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
574
|
+
gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
|
575
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
576
|
+
|
577
|
+
header_params = {
|
578
|
+
"project_id" => request.project_id,
|
579
|
+
"index_id" => request.index_id
|
580
|
+
}
|
581
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
582
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
583
|
+
|
584
|
+
options.apply_defaults timeout: @config.rpcs.delete_index.timeout,
|
585
|
+
metadata: metadata,
|
586
|
+
retry_policy: @config.rpcs.delete_index.retry_policy
|
587
|
+
options.apply_defaults metadata: @config.metadata,
|
588
|
+
retry_policy: @config.retry_policy
|
589
|
+
|
590
|
+
@datastore_admin_stub.call_rpc :delete_index, request, options: options do |response, operation|
|
591
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
592
|
+
yield response, operation if block_given?
|
593
|
+
return response
|
594
|
+
end
|
595
|
+
rescue ::GRPC::BadStatus => e
|
596
|
+
raise ::Google::Cloud::Error.from_error(e)
|
597
|
+
end
|
598
|
+
|
433
599
|
##
|
434
600
|
# Gets an index.
|
435
601
|
#
|
@@ -721,6 +887,16 @@ module Google
|
|
721
887
|
#
|
722
888
|
attr_reader :import_entities
|
723
889
|
##
|
890
|
+
# RPC-specific configuration for `create_index`
|
891
|
+
# @return [::Gapic::Config::Method]
|
892
|
+
#
|
893
|
+
attr_reader :create_index
|
894
|
+
##
|
895
|
+
# RPC-specific configuration for `delete_index`
|
896
|
+
# @return [::Gapic::Config::Method]
|
897
|
+
#
|
898
|
+
attr_reader :delete_index
|
899
|
+
##
|
724
900
|
# RPC-specific configuration for `get_index`
|
725
901
|
# @return [::Gapic::Config::Method]
|
726
902
|
#
|
@@ -737,6 +913,10 @@ module Google
|
|
737
913
|
@export_entities = ::Gapic::Config::Method.new export_entities_config
|
738
914
|
import_entities_config = parent_rpcs&.import_entities if parent_rpcs&.respond_to? :import_entities
|
739
915
|
@import_entities = ::Gapic::Config::Method.new import_entities_config
|
916
|
+
create_index_config = parent_rpcs&.create_index if parent_rpcs&.respond_to? :create_index
|
917
|
+
@create_index = ::Gapic::Config::Method.new create_index_config
|
918
|
+
delete_index_config = parent_rpcs&.delete_index if parent_rpcs&.respond_to? :delete_index
|
919
|
+
@delete_index = ::Gapic::Config::Method.new delete_index_config
|
740
920
|
get_index_config = parent_rpcs&.get_index if parent_rpcs&.respond_to? :get_index
|
741
921
|
@get_index = ::Gapic::Config::Method.new get_index_config
|
742
922
|
list_indexes_config = parent_rpcs&.list_indexes if parent_rpcs&.respond_to? :list_indexes
|
@@ -65,6 +65,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
65
65
|
repeated :kinds, :string, 1
|
66
66
|
repeated :namespace_ids, :string, 2
|
67
67
|
end
|
68
|
+
add_message "google.datastore.admin.v1.CreateIndexRequest" do
|
69
|
+
optional :project_id, :string, 1
|
70
|
+
optional :index, :message, 3, "google.datastore.admin.v1.Index"
|
71
|
+
end
|
72
|
+
add_message "google.datastore.admin.v1.DeleteIndexRequest" do
|
73
|
+
optional :project_id, :string, 1
|
74
|
+
optional :index_id, :string, 3
|
75
|
+
end
|
68
76
|
add_message "google.datastore.admin.v1.GetIndexRequest" do
|
69
77
|
optional :project_id, :string, 1
|
70
78
|
optional :index_id, :string, 3
|
@@ -108,6 +116,8 @@ module Google
|
|
108
116
|
ExportEntitiesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ExportEntitiesMetadata").msgclass
|
109
117
|
ImportEntitiesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ImportEntitiesMetadata").msgclass
|
110
118
|
EntityFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.EntityFilter").msgclass
|
119
|
+
CreateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.CreateIndexRequest").msgclass
|
120
|
+
DeleteIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.DeleteIndexRequest").msgclass
|
111
121
|
GetIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.GetIndexRequest").msgclass
|
112
122
|
ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ListIndexesRequest").msgclass
|
113
123
|
ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ListIndexesResponse").msgclass
|
@@ -109,6 +109,32 @@ module Google
|
|
109
109
|
# created. If an ImportEntities operation is cancelled, it is possible
|
110
110
|
# that a subset of the data has already been imported to Cloud Datastore.
|
111
111
|
rpc :ImportEntities, ::Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest, ::Google::Longrunning::Operation
|
112
|
+
# Creates the specified index.
|
113
|
+
# A newly created index's initial state is `CREATING`. On completion of the
|
114
|
+
# returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
|
115
|
+
# If the index already exists, the call will return an `ALREADY_EXISTS`
|
116
|
+
# status.
|
117
|
+
#
|
118
|
+
# During index creation, the process could result in an error, in which
|
119
|
+
# case the index will move to the `ERROR` state. The process can be recovered
|
120
|
+
# by fixing the data that caused the error, removing the index with
|
121
|
+
# [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
|
122
|
+
# re-creating the index with [create]
|
123
|
+
# [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
|
124
|
+
#
|
125
|
+
# Indexes with a single property cannot be created.
|
126
|
+
rpc :CreateIndex, ::Google::Cloud::Datastore::Admin::V1::CreateIndexRequest, ::Google::Longrunning::Operation
|
127
|
+
# Deletes an existing index.
|
128
|
+
# An index can only be deleted if it is in a `READY` or `ERROR` state. On
|
129
|
+
# successful execution of the request, the index will be in a `DELETING`
|
130
|
+
# [state][google.datastore.admin.v1.Index.State]. And on completion of the
|
131
|
+
# returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.
|
132
|
+
#
|
133
|
+
# During index deletion, the process could result in an error, in which
|
134
|
+
# case the index will move to the `ERROR` state. The process can be recovered
|
135
|
+
# by fixing the data that caused the error, followed by calling
|
136
|
+
# [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
|
137
|
+
rpc :DeleteIndex, ::Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest, ::Google::Longrunning::Operation
|
112
138
|
# Gets an index.
|
113
139
|
rpc :GetIndex, ::Google::Cloud::Datastore::Admin::V1::GetIndexRequest, ::Google::Cloud::Datastore::Admin::V1::Index
|
114
140
|
# Lists the indexes that match the specified filters. Datastore uses an
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/datastore/admin/v1/migration.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_file("google/datastore/admin/v1/migration.proto", :syntax => :proto3) do
|
8
|
+
add_message "google.datastore.admin.v1.MigrationStateEvent" do
|
9
|
+
optional :state, :enum, 1, "google.datastore.admin.v1.MigrationState"
|
10
|
+
end
|
11
|
+
add_message "google.datastore.admin.v1.MigrationProgressEvent" do
|
12
|
+
optional :step, :enum, 1, "google.datastore.admin.v1.MigrationStep"
|
13
|
+
end
|
14
|
+
add_enum "google.datastore.admin.v1.MigrationState" do
|
15
|
+
value :MIGRATION_STATE_UNSPECIFIED, 0
|
16
|
+
value :RUNNING, 1
|
17
|
+
value :PAUSED, 2
|
18
|
+
value :COMPLETE, 3
|
19
|
+
end
|
20
|
+
add_enum "google.datastore.admin.v1.MigrationStep" do
|
21
|
+
value :MIGRATION_STEP_UNSPECIFIED, 0
|
22
|
+
value :START, 1
|
23
|
+
value :COPY_AND_VERIFY, 2
|
24
|
+
value :REDIRECT_EVENTUALLY_CONSISTENT_READS, 3
|
25
|
+
value :REDIRECT_STRONGLY_CONSISTENT_READS, 4
|
26
|
+
value :REDIRECT_WRITES, 5
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module Google
|
32
|
+
module Cloud
|
33
|
+
module Datastore
|
34
|
+
module Admin
|
35
|
+
module V1
|
36
|
+
MigrationStateEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStateEvent").msgclass
|
37
|
+
MigrationProgressEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationProgressEvent").msgclass
|
38
|
+
MigrationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationState").enummodule
|
39
|
+
MigrationStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStep").enummodule
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -281,6 +281,33 @@ module Google
|
|
281
281
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
282
282
|
end
|
283
283
|
|
284
|
+
# The request for
|
285
|
+
# {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#create_index google.datastore.admin.v1.DatastoreAdmin.CreateIndex}.
|
286
|
+
# @!attribute [rw] project_id
|
287
|
+
# @return [::String]
|
288
|
+
# Project ID against which to make the request.
|
289
|
+
# @!attribute [rw] index
|
290
|
+
# @return [::Google::Cloud::Datastore::Admin::V1::Index]
|
291
|
+
# The index to create. The name and state fields are output only and will be
|
292
|
+
# ignored. Single property indexes cannot be created or deleted.
|
293
|
+
class CreateIndexRequest
|
294
|
+
include ::Google::Protobuf::MessageExts
|
295
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
296
|
+
end
|
297
|
+
|
298
|
+
# The request for
|
299
|
+
# {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#delete_index google.datastore.admin.v1.DatastoreAdmin.DeleteIndex}.
|
300
|
+
# @!attribute [rw] project_id
|
301
|
+
# @return [::String]
|
302
|
+
# Project ID against which to make the request.
|
303
|
+
# @!attribute [rw] index_id
|
304
|
+
# @return [::String]
|
305
|
+
# The resource ID of the index to delete.
|
306
|
+
class DeleteIndexRequest
|
307
|
+
include ::Google::Protobuf::MessageExts
|
308
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
309
|
+
end
|
310
|
+
|
284
311
|
# The request for {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#get_index google.datastore.admin.v1.DatastoreAdmin.GetIndex}.
|
285
312
|
# @!attribute [rw] project_id
|
286
313
|
# @return [::String]
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Datastore
|
23
|
+
module Admin
|
24
|
+
module V1
|
25
|
+
# An event signifying a change in state of a [migration from Cloud Datastore to
|
26
|
+
# Cloud Firestore in Datastore
|
27
|
+
# mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
|
28
|
+
# @!attribute [rw] state
|
29
|
+
# @return [::Google::Cloud::Datastore::Admin::V1::MigrationState]
|
30
|
+
# The new state of the migration.
|
31
|
+
class MigrationStateEvent
|
32
|
+
include ::Google::Protobuf::MessageExts
|
33
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
34
|
+
end
|
35
|
+
|
36
|
+
# An event signifying the start of a new step in a [migration from Cloud
|
37
|
+
# Datastore to Cloud Firestore in Datastore
|
38
|
+
# mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
|
39
|
+
# @!attribute [rw] step
|
40
|
+
# @return [::Google::Cloud::Datastore::Admin::V1::MigrationStep]
|
41
|
+
# The step that is starting.
|
42
|
+
#
|
43
|
+
# An event with step set to `START` indicates that the migration
|
44
|
+
# has been reverted back to the initial pre-migration state.
|
45
|
+
class MigrationProgressEvent
|
46
|
+
include ::Google::Protobuf::MessageExts
|
47
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
48
|
+
end
|
49
|
+
|
50
|
+
# States for a migration.
|
51
|
+
module MigrationState
|
52
|
+
# Unspecified.
|
53
|
+
MIGRATION_STATE_UNSPECIFIED = 0
|
54
|
+
|
55
|
+
# The migration is running.
|
56
|
+
RUNNING = 1
|
57
|
+
|
58
|
+
# The migration is paused.
|
59
|
+
PAUSED = 2
|
60
|
+
|
61
|
+
# The migration is complete.
|
62
|
+
COMPLETE = 3
|
63
|
+
end
|
64
|
+
|
65
|
+
# Steps in a migration.
|
66
|
+
module MigrationStep
|
67
|
+
# Unspecified.
|
68
|
+
MIGRATION_STEP_UNSPECIFIED = 0
|
69
|
+
|
70
|
+
# Start of migration.
|
71
|
+
START = 1
|
72
|
+
|
73
|
+
# Data is copied to Cloud Firestore and then verified to match the data in
|
74
|
+
# Cloud Datastore.
|
75
|
+
COPY_AND_VERIFY = 2
|
76
|
+
|
77
|
+
# Eventually-consistent reads are redirected to Cloud Firestore.
|
78
|
+
REDIRECT_EVENTUALLY_CONSISTENT_READS = 3
|
79
|
+
|
80
|
+
# Strongly-consistent reads are redirected to Cloud Firestore.
|
81
|
+
REDIRECT_STRONGLY_CONSISTENT_READS = 4
|
82
|
+
|
83
|
+
# Writes are redirected to Cloud Firestore.
|
84
|
+
REDIRECT_WRITES = 5
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-datastore-admin-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -174,11 +174,13 @@ files:
|
|
174
174
|
- lib/google/datastore/admin/v1/datastore_admin_pb.rb
|
175
175
|
- lib/google/datastore/admin/v1/datastore_admin_services_pb.rb
|
176
176
|
- lib/google/datastore/admin/v1/index_pb.rb
|
177
|
+
- lib/google/datastore/admin/v1/migration_pb.rb
|
177
178
|
- proto_docs/README.md
|
178
179
|
- proto_docs/google/api/field_behavior.rb
|
179
180
|
- proto_docs/google/api/resource.rb
|
180
181
|
- proto_docs/google/datastore/admin/v1/datastore_admin.rb
|
181
182
|
- proto_docs/google/datastore/admin/v1/index.rb
|
183
|
+
- proto_docs/google/datastore/admin/v1/migration.rb
|
182
184
|
- proto_docs/google/longrunning/operations.rb
|
183
185
|
- proto_docs/google/protobuf/any.rb
|
184
186
|
- proto_docs/google/protobuf/duration.rb
|
@@ -204,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
206
|
- !ruby/object:Gem::Version
|
205
207
|
version: '0'
|
206
208
|
requirements: []
|
207
|
-
rubygems_version: 3.2.
|
209
|
+
rubygems_version: 3.2.11
|
208
210
|
signing_key:
|
209
211
|
specification_version: 4
|
210
212
|
summary: API Client library for the Firestore in Datastore mode Admin V1 API
|