google-cloud-spanner 1.14.0 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/google-cloud-spanner.rb +13 -0
- data/lib/google/cloud/spanner.rb +2 -1
- data/lib/google/cloud/spanner/admin/database.rb +3 -2
- data/lib/google/cloud/spanner/admin/database/v1.rb +3 -2
- data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +742 -20
- data/lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json +40 -0
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/field_mask.rb +222 -0
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/timestamp.rb +113 -0
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/backup.rb +325 -0
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +197 -30
- data/lib/google/cloud/spanner/admin/instance.rb +1 -1
- data/lib/google/cloud/spanner/admin/instance/v1.rb +1 -1
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +6 -13
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +8 -5
- data/lib/google/cloud/spanner/batch_client.rb +5 -3
- data/lib/google/cloud/spanner/batch_snapshot.rb +43 -8
- data/lib/google/cloud/spanner/client.rb +57 -8
- data/lib/google/cloud/spanner/project.rb +31 -6
- data/lib/google/cloud/spanner/results.rb +4 -2
- data/lib/google/cloud/spanner/service.rb +3 -1
- data/lib/google/cloud/spanner/session.rb +37 -6
- data/lib/google/cloud/spanner/snapshot.rb +26 -3
- data/lib/google/cloud/spanner/transaction.rb +49 -5
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +8 -1
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +91 -102
- data/lib/google/cloud/spanner/v1/spanner_client.rb +112 -136
- data/lib/google/cloud/spanner/version.rb +1 -1
- data/lib/google/spanner/admin/database/v1/backup_pb.rb +98 -0
- data/lib/google/spanner/admin/database/v1/common_pb.rb +28 -0
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +53 -0
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +82 -12
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +1 -2
- data/lib/google/spanner/v1/spanner_pb.rb +5 -0
- data/lib/google/spanner/v1/spanner_services_pb.rb +31 -40
- metadata +7 -2
@@ -64,6 +64,46 @@
|
|
64
64
|
"timeout_millis": 30000,
|
65
65
|
"retry_codes_name": "non_idempotent",
|
66
66
|
"retry_params_name": "default"
|
67
|
+
},
|
68
|
+
"CreateBackup": {
|
69
|
+
"timeout_millis": 30000,
|
70
|
+
"retry_codes_name": "non_idempotent",
|
71
|
+
"retry_params_name": "default"
|
72
|
+
},
|
73
|
+
"GetBackup": {
|
74
|
+
"timeout_millis": 30000,
|
75
|
+
"retry_codes_name": "idempotent",
|
76
|
+
"retry_params_name": "default"
|
77
|
+
},
|
78
|
+
"UpdateBackup": {
|
79
|
+
"timeout_millis": 30000,
|
80
|
+
"retry_codes_name": "non_idempotent",
|
81
|
+
"retry_params_name": "default"
|
82
|
+
},
|
83
|
+
"DeleteBackup": {
|
84
|
+
"timeout_millis": 30000,
|
85
|
+
"retry_codes_name": "idempotent",
|
86
|
+
"retry_params_name": "default"
|
87
|
+
},
|
88
|
+
"ListBackups": {
|
89
|
+
"timeout_millis": 30000,
|
90
|
+
"retry_codes_name": "idempotent",
|
91
|
+
"retry_params_name": "default"
|
92
|
+
},
|
93
|
+
"RestoreDatabase": {
|
94
|
+
"timeout_millis": 30000,
|
95
|
+
"retry_codes_name": "non_idempotent",
|
96
|
+
"retry_params_name": "default"
|
97
|
+
},
|
98
|
+
"ListDatabaseOperations": {
|
99
|
+
"timeout_millis": 30000,
|
100
|
+
"retry_codes_name": "idempotent",
|
101
|
+
"retry_params_name": "default"
|
102
|
+
},
|
103
|
+
"ListBackupOperations": {
|
104
|
+
"timeout_millis": 30000,
|
105
|
+
"retry_codes_name": "idempotent",
|
106
|
+
"retry_params_name": "default"
|
67
107
|
}
|
68
108
|
}
|
69
109
|
}
|
@@ -0,0 +1,222 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
module Google
|
17
|
+
module Protobuf
|
18
|
+
# `FieldMask` represents a set of symbolic field paths, for example:
|
19
|
+
#
|
20
|
+
# paths: "f.a"
|
21
|
+
# paths: "f.b.d"
|
22
|
+
#
|
23
|
+
# Here `f` represents a field in some root message, `a` and `b`
|
24
|
+
# fields in the message found in `f`, and `d` a field found in the
|
25
|
+
# message in `f.b`.
|
26
|
+
#
|
27
|
+
# Field masks are used to specify a subset of fields that should be
|
28
|
+
# returned by a get operation or modified by an update operation.
|
29
|
+
# Field masks also have a custom JSON encoding (see below).
|
30
|
+
#
|
31
|
+
# = Field Masks in Projections
|
32
|
+
#
|
33
|
+
# When used in the context of a projection, a response message or
|
34
|
+
# sub-message is filtered by the API to only contain those fields as
|
35
|
+
# specified in the mask. For example, if the mask in the previous
|
36
|
+
# example is applied to a response message as follows:
|
37
|
+
#
|
38
|
+
# f {
|
39
|
+
# a : 22
|
40
|
+
# b {
|
41
|
+
# d : 1
|
42
|
+
# x : 2
|
43
|
+
# }
|
44
|
+
# y : 13
|
45
|
+
# }
|
46
|
+
# z: 8
|
47
|
+
#
|
48
|
+
# The result will not contain specific values for fields x,y and z
|
49
|
+
# (their value will be set to the default, and omitted in proto text
|
50
|
+
# output):
|
51
|
+
#
|
52
|
+
#
|
53
|
+
# f {
|
54
|
+
# a : 22
|
55
|
+
# b {
|
56
|
+
# d : 1
|
57
|
+
# }
|
58
|
+
# }
|
59
|
+
#
|
60
|
+
# A repeated field is not allowed except at the last position of a
|
61
|
+
# paths string.
|
62
|
+
#
|
63
|
+
# If a FieldMask object is not present in a get operation, the
|
64
|
+
# operation applies to all fields (as if a FieldMask of all fields
|
65
|
+
# had been specified).
|
66
|
+
#
|
67
|
+
# Note that a field mask does not necessarily apply to the
|
68
|
+
# top-level response message. In case of a REST get operation, the
|
69
|
+
# field mask applies directly to the response, but in case of a REST
|
70
|
+
# list operation, the mask instead applies to each individual message
|
71
|
+
# in the returned resource list. In case of a REST custom method,
|
72
|
+
# other definitions may be used. Where the mask applies will be
|
73
|
+
# clearly documented together with its declaration in the API. In
|
74
|
+
# any case, the effect on the returned resource/resources is required
|
75
|
+
# behavior for APIs.
|
76
|
+
#
|
77
|
+
# = Field Masks in Update Operations
|
78
|
+
#
|
79
|
+
# A field mask in update operations specifies which fields of the
|
80
|
+
# targeted resource are going to be updated. The API is required
|
81
|
+
# to only change the values of the fields as specified in the mask
|
82
|
+
# and leave the others untouched. If a resource is passed in to
|
83
|
+
# describe the updated values, the API ignores the values of all
|
84
|
+
# fields not covered by the mask.
|
85
|
+
#
|
86
|
+
# If a repeated field is specified for an update operation, new values will
|
87
|
+
# be appended to the existing repeated field in the target resource. Note that
|
88
|
+
# a repeated field is only allowed in the last position of a `paths` string.
|
89
|
+
#
|
90
|
+
# If a sub-message is specified in the last position of the field mask for an
|
91
|
+
# update operation, then new value will be merged into the existing sub-message
|
92
|
+
# in the target resource.
|
93
|
+
#
|
94
|
+
# For example, given the target message:
|
95
|
+
#
|
96
|
+
# f {
|
97
|
+
# b {
|
98
|
+
# d: 1
|
99
|
+
# x: 2
|
100
|
+
# }
|
101
|
+
# c: [1]
|
102
|
+
# }
|
103
|
+
#
|
104
|
+
# And an update message:
|
105
|
+
#
|
106
|
+
# f {
|
107
|
+
# b {
|
108
|
+
# d: 10
|
109
|
+
# }
|
110
|
+
# c: [2]
|
111
|
+
# }
|
112
|
+
#
|
113
|
+
# then if the field mask is:
|
114
|
+
#
|
115
|
+
# paths: ["f.b", "f.c"]
|
116
|
+
#
|
117
|
+
# then the result will be:
|
118
|
+
#
|
119
|
+
# f {
|
120
|
+
# b {
|
121
|
+
# d: 10
|
122
|
+
# x: 2
|
123
|
+
# }
|
124
|
+
# c: [1, 2]
|
125
|
+
# }
|
126
|
+
#
|
127
|
+
# An implementation may provide options to override this default behavior for
|
128
|
+
# repeated and message fields.
|
129
|
+
#
|
130
|
+
# In order to reset a field's value to the default, the field must
|
131
|
+
# be in the mask and set to the default value in the provided resource.
|
132
|
+
# Hence, in order to reset all fields of a resource, provide a default
|
133
|
+
# instance of the resource and set all fields in the mask, or do
|
134
|
+
# not provide a mask as described below.
|
135
|
+
#
|
136
|
+
# If a field mask is not present on update, the operation applies to
|
137
|
+
# all fields (as if a field mask of all fields has been specified).
|
138
|
+
# Note that in the presence of schema evolution, this may mean that
|
139
|
+
# fields the client does not know and has therefore not filled into
|
140
|
+
# the request will be reset to their default. If this is unwanted
|
141
|
+
# behavior, a specific service may require a client to always specify
|
142
|
+
# a field mask, producing an error if not.
|
143
|
+
#
|
144
|
+
# As with get operations, the location of the resource which
|
145
|
+
# describes the updated values in the request message depends on the
|
146
|
+
# operation kind. In any case, the effect of the field mask is
|
147
|
+
# required to be honored by the API.
|
148
|
+
#
|
149
|
+
# == Considerations for HTTP REST
|
150
|
+
#
|
151
|
+
# The HTTP kind of an update operation which uses a field mask must
|
152
|
+
# be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
153
|
+
# (PUT must only be used for full updates).
|
154
|
+
#
|
155
|
+
# = JSON Encoding of Field Masks
|
156
|
+
#
|
157
|
+
# In JSON, a field mask is encoded as a single string where paths are
|
158
|
+
# separated by a comma. Fields name in each path are converted
|
159
|
+
# to/from lower-camel naming conventions.
|
160
|
+
#
|
161
|
+
# As an example, consider the following message declarations:
|
162
|
+
#
|
163
|
+
# message Profile {
|
164
|
+
# User user = 1;
|
165
|
+
# Photo photo = 2;
|
166
|
+
# }
|
167
|
+
# message User {
|
168
|
+
# string display_name = 1;
|
169
|
+
# string address = 2;
|
170
|
+
# }
|
171
|
+
#
|
172
|
+
# In proto a field mask for `Profile` may look as such:
|
173
|
+
#
|
174
|
+
# mask {
|
175
|
+
# paths: "user.display_name"
|
176
|
+
# paths: "photo"
|
177
|
+
# }
|
178
|
+
#
|
179
|
+
# In JSON, the same mask is represented as below:
|
180
|
+
#
|
181
|
+
# {
|
182
|
+
# mask: "user.displayName,photo"
|
183
|
+
# }
|
184
|
+
#
|
185
|
+
# = Field Masks and Oneof Fields
|
186
|
+
#
|
187
|
+
# Field masks treat fields in oneofs just as regular fields. Consider the
|
188
|
+
# following message:
|
189
|
+
#
|
190
|
+
# message SampleMessage {
|
191
|
+
# oneof test_oneof {
|
192
|
+
# string name = 4;
|
193
|
+
# SubMessage sub_message = 9;
|
194
|
+
# }
|
195
|
+
# }
|
196
|
+
#
|
197
|
+
# The field mask can be:
|
198
|
+
#
|
199
|
+
# mask {
|
200
|
+
# paths: "name"
|
201
|
+
# }
|
202
|
+
#
|
203
|
+
# Or:
|
204
|
+
#
|
205
|
+
# mask {
|
206
|
+
# paths: "sub_message"
|
207
|
+
# }
|
208
|
+
#
|
209
|
+
# Note that oneof type names ("test_oneof" in this case) cannot be used in
|
210
|
+
# paths.
|
211
|
+
#
|
212
|
+
# == Field Mask Verification
|
213
|
+
#
|
214
|
+
# The implementation of any API method which has a FieldMask type field in the
|
215
|
+
# request should verify the included field paths, and return an
|
216
|
+
# `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
|
217
|
+
# @!attribute [rw] paths
|
218
|
+
# @return [Array<String>]
|
219
|
+
# The set of field mask paths.
|
220
|
+
class FieldMask; end
|
221
|
+
end
|
222
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
module Google
|
17
|
+
module Protobuf
|
18
|
+
# A Timestamp represents a point in time independent of any time zone or local
|
19
|
+
# calendar, encoded as a count of seconds and fractions of seconds at
|
20
|
+
# nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
21
|
+
# January 1, 1970, in the proleptic Gregorian calendar which extends the
|
22
|
+
# Gregorian calendar backwards to year one.
|
23
|
+
#
|
24
|
+
# All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
25
|
+
# second table is needed for interpretation, using a [24-hour linear
|
26
|
+
# smear](https://developers.google.com/time/smear).
|
27
|
+
#
|
28
|
+
# The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
29
|
+
# restricting to that range, we ensure that we can convert to and from [RFC
|
30
|
+
# 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
31
|
+
#
|
32
|
+
# = Examples
|
33
|
+
#
|
34
|
+
# Example 1: Compute Timestamp from POSIX `time()`.
|
35
|
+
#
|
36
|
+
# Timestamp timestamp;
|
37
|
+
# timestamp.set_seconds(time(NULL));
|
38
|
+
# timestamp.set_nanos(0);
|
39
|
+
#
|
40
|
+
# Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
41
|
+
#
|
42
|
+
# struct timeval tv;
|
43
|
+
# gettimeofday(&tv, NULL);
|
44
|
+
#
|
45
|
+
# Timestamp timestamp;
|
46
|
+
# timestamp.set_seconds(tv.tv_sec);
|
47
|
+
# timestamp.set_nanos(tv.tv_usec * 1000);
|
48
|
+
#
|
49
|
+
# Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
50
|
+
#
|
51
|
+
# FILETIME ft;
|
52
|
+
# GetSystemTimeAsFileTime(&ft);
|
53
|
+
# UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
54
|
+
#
|
55
|
+
# // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
56
|
+
# // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
57
|
+
# Timestamp timestamp;
|
58
|
+
# timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
59
|
+
# timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
60
|
+
#
|
61
|
+
# Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
62
|
+
#
|
63
|
+
# long millis = System.currentTimeMillis();
|
64
|
+
#
|
65
|
+
# Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
66
|
+
# .setNanos((int) ((millis % 1000) * 1000000)).build();
|
67
|
+
#
|
68
|
+
#
|
69
|
+
# Example 5: Compute Timestamp from current time in Python.
|
70
|
+
#
|
71
|
+
# timestamp = Timestamp()
|
72
|
+
# timestamp.GetCurrentTime()
|
73
|
+
#
|
74
|
+
# = JSON Mapping
|
75
|
+
#
|
76
|
+
# In JSON format, the Timestamp type is encoded as a string in the
|
77
|
+
# [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
78
|
+
# format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
|
79
|
+
# where \\{year} is always expressed using four digits while \\{month}, \\{day},
|
80
|
+
# \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
|
81
|
+
# seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
82
|
+
# are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
83
|
+
# is required. A proto3 JSON serializer should always use UTC (as indicated by
|
84
|
+
# "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
85
|
+
# able to accept both UTC and other timezones (as indicated by an offset).
|
86
|
+
#
|
87
|
+
# For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
88
|
+
# 01:30 UTC on January 15, 2017.
|
89
|
+
#
|
90
|
+
# In JavaScript, one can convert a Date object to this format using the
|
91
|
+
# standard
|
92
|
+
# [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
93
|
+
# method. In Python, a standard `datetime.datetime` object can be converted
|
94
|
+
# to this format using
|
95
|
+
# [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
96
|
+
# the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
97
|
+
# the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
98
|
+
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
99
|
+
# ) to obtain a formatter capable of generating timestamps in this format.
|
100
|
+
# @!attribute [rw] seconds
|
101
|
+
# @return [Integer]
|
102
|
+
# Represents seconds of UTC time since Unix epoch
|
103
|
+
# 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
104
|
+
# 9999-12-31T23:59:59Z inclusive.
|
105
|
+
# @!attribute [rw] nanos
|
106
|
+
# @return [Integer]
|
107
|
+
# Non-negative fractions of a second at nanosecond resolution. Negative
|
108
|
+
# second values with fractions must still have non-negative nanos values
|
109
|
+
# that count forward in time. Must be from 0 to 999,999,999
|
110
|
+
# inclusive.
|
111
|
+
class Timestamp; end
|
112
|
+
end
|
113
|
+
end
|
data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/backup.rb
ADDED
@@ -0,0 +1,325 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
module Google
|
17
|
+
module Spanner
|
18
|
+
module Admin
|
19
|
+
module Database
|
20
|
+
module V1
|
21
|
+
# A backup of a Cloud Spanner database.
|
22
|
+
# @!attribute [rw] database
|
23
|
+
# @return [String]
|
24
|
+
# Required for the {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateBackup CreateBackup} operation.
|
25
|
+
# Name of the database from which this backup was
|
26
|
+
# created. This needs to be in the same instance as the backup.
|
27
|
+
# Values are of the form
|
28
|
+
# `projects/<project>/instances/<instance>/databases/<database>`.
|
29
|
+
# @!attribute [rw] expire_time
|
30
|
+
# @return [Google::Protobuf::Timestamp]
|
31
|
+
# Required for the {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateBackup CreateBackup}
|
32
|
+
# operation. The expiration time of the backup, with microseconds
|
33
|
+
# granularity that must be at least 6 hours and at most 366 days
|
34
|
+
# from the time the CreateBackup request is processed. Once the `expire_time`
|
35
|
+
# has passed, the backup is eligible to be automatically deleted by Cloud
|
36
|
+
# Spanner to free the resources used by the backup.
|
37
|
+
# @!attribute [rw] name
|
38
|
+
# @return [String]
|
39
|
+
# Output only for the {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateBackup CreateBackup} operation.
|
40
|
+
# Required for the {Google::Spanner::Admin::Database::V1::DatabaseAdmin::UpdateBackup UpdateBackup} operation.
|
41
|
+
#
|
42
|
+
# A globally unique identifier for the backup which cannot be
|
43
|
+
# changed. Values are of the form
|
44
|
+
# `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
|
45
|
+
# The final segment of the name must be between 2 and 60 characters
|
46
|
+
# in length.
|
47
|
+
#
|
48
|
+
# The backup is stored in the location(s) specified in the instance
|
49
|
+
# configuration of the instance containing the backup, identified
|
50
|
+
# by the prefix of the backup name of the form
|
51
|
+
# `projects/<project>/instances/<instance>`.
|
52
|
+
# @!attribute [rw] create_time
|
53
|
+
# @return [Google::Protobuf::Timestamp]
|
54
|
+
# Output only. The backup will contain an externally consistent
|
55
|
+
# copy of the database at the timestamp specified by
|
56
|
+
# `create_time`. `create_time` is approximately the time the
|
57
|
+
# {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateBackup CreateBackup} request is received.
|
58
|
+
# @!attribute [rw] size_bytes
|
59
|
+
# @return [Integer]
|
60
|
+
# Output only. Size of the backup in bytes.
|
61
|
+
# @!attribute [rw] state
|
62
|
+
# @return [Google::Spanner::Admin::Database::V1::Backup::State]
|
63
|
+
# Output only. The current state of the backup.
|
64
|
+
# @!attribute [rw] referencing_databases
|
65
|
+
# @return [Array<String>]
|
66
|
+
# Output only. The names of the restored databases that reference the backup.
|
67
|
+
# The database names are of
|
68
|
+
# the form `projects/<project>/instances/<instance>/databases/<database>`.
|
69
|
+
# Referencing databases may exist in different instances. The existence of
|
70
|
+
# any referencing database prevents the backup from being deleted. When a
|
71
|
+
# restored database from the backup enters the `READY` state, the reference
|
72
|
+
# to the backup is removed.
|
73
|
+
class Backup
|
74
|
+
# Indicates the current state of the backup.
|
75
|
+
module State
|
76
|
+
# Not specified.
|
77
|
+
STATE_UNSPECIFIED = 0
|
78
|
+
|
79
|
+
# The pending backup is still being created. Operations on the
|
80
|
+
# backup may fail with `FAILED_PRECONDITION` in this state.
|
81
|
+
CREATING = 1
|
82
|
+
|
83
|
+
# The backup is complete and ready for use.
|
84
|
+
READY = 2
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateBackup CreateBackup}.
|
89
|
+
# @!attribute [rw] parent
|
90
|
+
# @return [String]
|
91
|
+
# Required. The name of the instance in which the backup will be
|
92
|
+
# created. This must be the same instance that contains the database the
|
93
|
+
# backup will be created from. The backup will be stored in the
|
94
|
+
# location(s) specified in the instance configuration of this
|
95
|
+
# instance. Values are of the form
|
96
|
+
# `projects/<project>/instances/<instance>`.
|
97
|
+
# @!attribute [rw] backup_id
|
98
|
+
# @return [String]
|
99
|
+
# Required. The id of the backup to be created. The `backup_id` appended to
|
100
|
+
# `parent` forms the full backup name of the form
|
101
|
+
# `projects/<project>/instances/<instance>/backups/<backup_id>`.
|
102
|
+
# @!attribute [rw] backup
|
103
|
+
# @return [Google::Spanner::Admin::Database::V1::Backup]
|
104
|
+
# Required. The backup to create.
|
105
|
+
class CreateBackupRequest; end
|
106
|
+
|
107
|
+
# Metadata type for the operation returned by
|
108
|
+
# {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateBackup CreateBackup}.
|
109
|
+
# @!attribute [rw] name
|
110
|
+
# @return [String]
|
111
|
+
# The name of the backup being created.
|
112
|
+
# @!attribute [rw] database
|
113
|
+
# @return [String]
|
114
|
+
# The name of the database the backup is created from.
|
115
|
+
# @!attribute [rw] progress
|
116
|
+
# @return [Google::Spanner::Admin::Database::V1::OperationProgress]
|
117
|
+
# The progress of the
|
118
|
+
# {Google::Spanner::Admin::Database::V1::DatabaseAdmin::CreateBackup CreateBackup} operation.
|
119
|
+
# @!attribute [rw] cancel_time
|
120
|
+
# @return [Google::Protobuf::Timestamp]
|
121
|
+
# The time at which cancellation of this operation was received.
|
122
|
+
# {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}
|
123
|
+
# starts asynchronous cancellation on a long-running operation. The server
|
124
|
+
# makes a best effort to cancel the operation, but success is not guaranteed.
|
125
|
+
# Clients can use
|
126
|
+
# {Google::Longrunning::Operations::GetOperation Operations::GetOperation} or
|
127
|
+
# other methods to check whether the cancellation succeeded or whether the
|
128
|
+
# operation completed despite cancellation. On successful cancellation,
|
129
|
+
# the operation is not deleted; instead, it becomes an operation with
|
130
|
+
# an {Operation#error} value with a {Google::Rpc::Status#code} of 1,
|
131
|
+
# corresponding to `Code.CANCELLED`.
|
132
|
+
class CreateBackupMetadata; end
|
133
|
+
|
134
|
+
# The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::UpdateBackup UpdateBackup}.
|
135
|
+
# @!attribute [rw] backup
|
136
|
+
# @return [Google::Spanner::Admin::Database::V1::Backup]
|
137
|
+
# Required. The backup to update. `backup.name`, and the fields to be updated
|
138
|
+
# as specified by `update_mask` are required. Other fields are ignored.
|
139
|
+
# Update is only supported for the following fields:
|
140
|
+
# * `backup.expire_time`.
|
141
|
+
# @!attribute [rw] update_mask
|
142
|
+
# @return [Google::Protobuf::FieldMask]
|
143
|
+
# Required. A mask specifying which fields (e.g. `expire_time`) in the
|
144
|
+
# Backup resource should be updated. This mask is relative to the Backup
|
145
|
+
# resource, not to the request message. The field mask must always be
|
146
|
+
# specified; this prevents any future fields from being erased accidentally
|
147
|
+
# by clients that do not know about them.
|
148
|
+
class UpdateBackupRequest; end
|
149
|
+
|
150
|
+
# The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::GetBackup GetBackup}.
|
151
|
+
# @!attribute [rw] name
|
152
|
+
# @return [String]
|
153
|
+
# Required. Name of the backup.
|
154
|
+
# Values are of the form
|
155
|
+
# `projects/<project>/instances/<instance>/backups/<backup>`.
|
156
|
+
class GetBackupRequest; end
|
157
|
+
|
158
|
+
# The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::DeleteBackup DeleteBackup}.
|
159
|
+
# @!attribute [rw] name
|
160
|
+
# @return [String]
|
161
|
+
# Required. Name of the backup to delete.
|
162
|
+
# Values are of the form
|
163
|
+
# `projects/<project>/instances/<instance>/backups/<backup>`.
|
164
|
+
class DeleteBackupRequest; end
|
165
|
+
|
166
|
+
# The request for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListBackups ListBackups}.
|
167
|
+
# @!attribute [rw] parent
|
168
|
+
# @return [String]
|
169
|
+
# Required. The instance to list backups from. Values are of the
|
170
|
+
# form `projects/<project>/instances/<instance>`.
|
171
|
+
# @!attribute [rw] filter
|
172
|
+
# @return [String]
|
173
|
+
# An expression that filters the list of returned backups.
|
174
|
+
#
|
175
|
+
# A filter expression consists of a field name, a comparison operator, and a
|
176
|
+
# value for filtering.
|
177
|
+
# The value must be a string, a number, or a boolean. The comparison operator
|
178
|
+
# must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
179
|
+
# Colon `:` is the contains operator. Filter rules are not case sensitive.
|
180
|
+
#
|
181
|
+
# The following fields in the {Google::Spanner::Admin::Database::V1::Backup Backup} are eligible for filtering:
|
182
|
+
#
|
183
|
+
# * `name`
|
184
|
+
# * `database`
|
185
|
+
# * `state`
|
186
|
+
# * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
187
|
+
# * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
188
|
+
# * `size_bytes`
|
189
|
+
#
|
190
|
+
# You can combine multiple expressions by enclosing each expression in
|
191
|
+
# parentheses. By default, expressions are combined with AND logic, but
|
192
|
+
# you can specify AND, OR, and NOT logic explicitly.
|
193
|
+
#
|
194
|
+
# Here are a few examples:
|
195
|
+
#
|
196
|
+
# * `name:Howl` - The backup's name contains the string "howl".
|
197
|
+
# * `database:prod`
|
198
|
+
# * The database's name contains the string "prod".
|
199
|
+
# * `state:CREATING` - The backup is pending creation.
|
200
|
+
# * `state:READY` - The backup is fully created and ready for use.
|
201
|
+
# * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
|
202
|
+
# * The backup name contains the string "howl" and `create_time`
|
203
|
+
# of the backup is before 2018-03-28T14:50:00Z.
|
204
|
+
# * `expire_time < \"2018-03-28T14:50:00Z\"`
|
205
|
+
# * The backup `expire_time` is before 2018-03-28T14:50:00Z.
|
206
|
+
# * `size_bytes > 10000000000` - The backup's size is greater than 10GB
|
207
|
+
# @!attribute [rw] page_size
|
208
|
+
# @return [Integer]
|
209
|
+
# Number of backups to be returned in the response. If 0 or
|
210
|
+
# less, defaults to the server's maximum allowed page size.
|
211
|
+
# @!attribute [rw] page_token
|
212
|
+
# @return [String]
|
213
|
+
# If non-empty, `page_token` should contain a
|
214
|
+
# {Google::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token} from a
|
215
|
+
# previous {Google::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse} to the same `parent` and with the same
|
216
|
+
# `filter`.
|
217
|
+
class ListBackupsRequest; end
|
218
|
+
|
219
|
+
# The response for {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListBackups ListBackups}.
|
220
|
+
# @!attribute [rw] backups
|
221
|
+
# @return [Array<Google::Spanner::Admin::Database::V1::Backup>]
|
222
|
+
# The list of matching backups. Backups returned are ordered by `create_time`
|
223
|
+
# in descending order, starting from the most recent `create_time`.
|
224
|
+
# @!attribute [rw] next_page_token
|
225
|
+
# @return [String]
|
226
|
+
# `next_page_token` can be sent in a subsequent
|
227
|
+
# {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListBackups ListBackups} call to fetch more
|
228
|
+
# of the matching backups.
|
229
|
+
class ListBackupsResponse; end
|
230
|
+
|
231
|
+
# The request for
|
232
|
+
# {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListBackupOperations ListBackupOperations}.
|
233
|
+
# @!attribute [rw] parent
|
234
|
+
# @return [String]
|
235
|
+
# Required. The instance of the backup operations. Values are of
|
236
|
+
# the form `projects/<project>/instances/<instance>`.
|
237
|
+
# @!attribute [rw] filter
|
238
|
+
# @return [String]
|
239
|
+
# An expression that filters the list of returned backup operations.
|
240
|
+
#
|
241
|
+
# A filter expression consists of a field name, a
|
242
|
+
# comparison operator, and a value for filtering.
|
243
|
+
# The value must be a string, a number, or a boolean. The comparison operator
|
244
|
+
# must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
245
|
+
# Colon `:` is the contains operator. Filter rules are not case sensitive.
|
246
|
+
#
|
247
|
+
# The following fields in the {Google::Longrunning::Operation operation}
|
248
|
+
# are eligible for filtering:
|
249
|
+
#
|
250
|
+
# * `name` - The name of the long-running operation
|
251
|
+
# * `done` - False if the operation is in progress, else true.
|
252
|
+
# * `metadata.@type` - the type of metadata. For example, the type string
|
253
|
+
# for {Google::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} is
|
254
|
+
# `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
|
255
|
+
# * `metadata.<field_name>` - any field in metadata.value.
|
256
|
+
# * `error` - Error associated with the long-running operation.
|
257
|
+
# * `response.@type` - the type of response.
|
258
|
+
# * `response.<field_name>` - any field in response.value.
|
259
|
+
#
|
260
|
+
# You can combine multiple expressions by enclosing each expression in
|
261
|
+
# parentheses. By default, expressions are combined with AND logic, but
|
262
|
+
# you can specify AND, OR, and NOT logic explicitly.
|
263
|
+
#
|
264
|
+
# Here are a few examples:
|
265
|
+
#
|
266
|
+
# * `done:true` - The operation is complete.
|
267
|
+
# * `metadata.database:prod` - The database the backup was taken from has
|
268
|
+
# a name containing the string "prod".
|
269
|
+
# * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
|
270
|
+
# `(metadata.name:howl) AND` <br/>
|
271
|
+
# `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
|
272
|
+
# `(error:*)` - Returns operations where:
|
273
|
+
# * The operation's metadata type is {Google::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
|
274
|
+
# * The backup name contains the string "howl".
|
275
|
+
# * The operation started before 2018-03-28T14:50:00Z.
|
276
|
+
# * The operation resulted in an error.
|
277
|
+
# @!attribute [rw] page_size
|
278
|
+
# @return [Integer]
|
279
|
+
# Number of operations to be returned in the response. If 0 or
|
280
|
+
# less, defaults to the server's maximum allowed page size.
|
281
|
+
# @!attribute [rw] page_token
|
282
|
+
# @return [String]
|
283
|
+
# If non-empty, `page_token` should contain a
|
284
|
+
# {Google::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token}
|
285
|
+
# from a previous {Google::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse} to the
|
286
|
+
# same `parent` and with the same `filter`.
|
287
|
+
class ListBackupOperationsRequest; end
|
288
|
+
|
289
|
+
# The response for
|
290
|
+
# {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListBackupOperations ListBackupOperations}.
|
291
|
+
# @!attribute [rw] operations
|
292
|
+
# @return [Array<Google::Longrunning::Operation>]
|
293
|
+
# The list of matching backup [long-running
|
294
|
+
# operations][google.longrunning.Operation]. Each operation's name will be
|
295
|
+
# prefixed by the backup's name and the operation's
|
296
|
+
# {Google::Longrunning::Operation#metadata metadata} will be of type
|
297
|
+
# {Google::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. Operations returned include those that are
|
298
|
+
# pending or have completed/failed/canceled within the last 7 days.
|
299
|
+
# Operations returned are ordered by
|
300
|
+
# `operation.metadata.value.progress.start_time` in descending order starting
|
301
|
+
# from the most recently started operation.
|
302
|
+
# @!attribute [rw] next_page_token
|
303
|
+
# @return [String]
|
304
|
+
# `next_page_token` can be sent in a subsequent
|
305
|
+
# {Google::Spanner::Admin::Database::V1::DatabaseAdmin::ListBackupOperations ListBackupOperations}
|
306
|
+
# call to fetch more of the matching metadata.
|
307
|
+
class ListBackupOperationsResponse; end
|
308
|
+
|
309
|
+
# Information about a backup.
|
310
|
+
# @!attribute [rw] backup
|
311
|
+
# @return [String]
|
312
|
+
# Name of the backup.
|
313
|
+
# @!attribute [rw] create_time
|
314
|
+
# @return [Google::Protobuf::Timestamp]
|
315
|
+
# The backup contains an externally consistent copy of `source_database` at
|
316
|
+
# the timestamp specified by `create_time`.
|
317
|
+
# @!attribute [rw] source_database
|
318
|
+
# @return [String]
|
319
|
+
# Name of the database the backup was created from.
|
320
|
+
class BackupInfo; end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|