google-cloud-spanner-admin-database-v1 0.2.1 → 0.6.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/README.md +66 -2
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb +96 -70
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb +94 -9
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb +44 -0
- data/lib/google/cloud/spanner/admin/database/v1/version.rb +1 -1
- data/lib/google/spanner/admin/database/v1/backup_pb.rb +16 -0
- data/lib/google/spanner/admin/database/v1/common_pb.rb +18 -0
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +19 -0
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- data/proto_docs/google/spanner/admin/database/v1/backup.rb +72 -12
- data/proto_docs/google/spanner/admin/database/v1/common.rb +45 -0
- data/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb +94 -5
- metadata +13 -9
@@ -45,6 +45,50 @@ module Google
|
|
45
45
|
"projects/#{project}/instances/#{instance}/backups/#{backup}"
|
46
46
|
end
|
47
47
|
|
48
|
+
##
|
49
|
+
# Create a fully-qualified CryptoKey resource string.
|
50
|
+
#
|
51
|
+
# The resource will be in the following format:
|
52
|
+
#
|
53
|
+
# `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
|
54
|
+
#
|
55
|
+
# @param project [String]
|
56
|
+
# @param location [String]
|
57
|
+
# @param key_ring [String]
|
58
|
+
# @param crypto_key [String]
|
59
|
+
#
|
60
|
+
# @return [::String]
|
61
|
+
def crypto_key_path project:, location:, key_ring:, crypto_key:
|
62
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
63
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
64
|
+
raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
|
65
|
+
|
66
|
+
"projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
|
67
|
+
end
|
68
|
+
|
69
|
+
##
|
70
|
+
# Create a fully-qualified CryptoKeyVersion resource string.
|
71
|
+
#
|
72
|
+
# The resource will be in the following format:
|
73
|
+
#
|
74
|
+
# `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
|
75
|
+
#
|
76
|
+
# @param project [String]
|
77
|
+
# @param location [String]
|
78
|
+
# @param key_ring [String]
|
79
|
+
# @param crypto_key [String]
|
80
|
+
# @param crypto_key_version [String]
|
81
|
+
#
|
82
|
+
# @return [::String]
|
83
|
+
def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version:
|
84
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
85
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
86
|
+
raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
|
87
|
+
raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/"
|
88
|
+
|
89
|
+
"projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
|
90
|
+
end
|
91
|
+
|
48
92
|
##
|
49
93
|
# Create a fully-qualified Database resource string.
|
50
94
|
#
|
@@ -14,12 +14,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
14
14
|
add_file("google/spanner/admin/database/v1/backup.proto", :syntax => :proto3) do
|
15
15
|
add_message "google.spanner.admin.database.v1.Backup" do
|
16
16
|
optional :database, :string, 2
|
17
|
+
optional :version_time, :message, 9, "google.protobuf.Timestamp"
|
17
18
|
optional :expire_time, :message, 3, "google.protobuf.Timestamp"
|
18
19
|
optional :name, :string, 1
|
19
20
|
optional :create_time, :message, 4, "google.protobuf.Timestamp"
|
20
21
|
optional :size_bytes, :int64, 5
|
21
22
|
optional :state, :enum, 6, "google.spanner.admin.database.v1.Backup.State"
|
22
23
|
repeated :referencing_databases, :string, 7
|
24
|
+
optional :encryption_info, :message, 8, "google.spanner.admin.database.v1.EncryptionInfo"
|
23
25
|
end
|
24
26
|
add_enum "google.spanner.admin.database.v1.Backup.State" do
|
25
27
|
value :STATE_UNSPECIFIED, 0
|
@@ -30,6 +32,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
30
32
|
optional :parent, :string, 1
|
31
33
|
optional :backup_id, :string, 2
|
32
34
|
optional :backup, :message, 3, "google.spanner.admin.database.v1.Backup"
|
35
|
+
optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig"
|
33
36
|
end
|
34
37
|
add_message "google.spanner.admin.database.v1.CreateBackupMetadata" do
|
35
38
|
optional :name, :string, 1
|
@@ -69,9 +72,20 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
69
72
|
end
|
70
73
|
add_message "google.spanner.admin.database.v1.BackupInfo" do
|
71
74
|
optional :backup, :string, 1
|
75
|
+
optional :version_time, :message, 4, "google.protobuf.Timestamp"
|
72
76
|
optional :create_time, :message, 2, "google.protobuf.Timestamp"
|
73
77
|
optional :source_database, :string, 3
|
74
78
|
end
|
79
|
+
add_message "google.spanner.admin.database.v1.CreateBackupEncryptionConfig" do
|
80
|
+
optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType"
|
81
|
+
optional :kms_key_name, :string, 2
|
82
|
+
end
|
83
|
+
add_enum "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType" do
|
84
|
+
value :ENCRYPTION_TYPE_UNSPECIFIED, 0
|
85
|
+
value :USE_DATABASE_ENCRYPTION, 1
|
86
|
+
value :GOOGLE_DEFAULT_ENCRYPTION, 2
|
87
|
+
value :CUSTOMER_MANAGED_ENCRYPTION, 3
|
88
|
+
end
|
75
89
|
end
|
76
90
|
end
|
77
91
|
|
@@ -93,6 +107,8 @@ module Google
|
|
93
107
|
ListBackupOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsRequest").msgclass
|
94
108
|
ListBackupOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsResponse").msgclass
|
95
109
|
BackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInfo").msgclass
|
110
|
+
CreateBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig").msgclass
|
111
|
+
CreateBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType").enummodule
|
96
112
|
end
|
97
113
|
end
|
98
114
|
end
|
@@ -4,7 +4,9 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
require 'google/api/field_behavior_pb'
|
7
|
+
require 'google/api/resource_pb'
|
7
8
|
require 'google/protobuf/timestamp_pb'
|
9
|
+
require 'google/rpc/status_pb'
|
8
10
|
require 'google/api/annotations_pb'
|
9
11
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
12
|
add_file("google/spanner/admin/database/v1/common.proto", :syntax => :proto3) do
|
@@ -13,6 +15,19 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
13
15
|
optional :start_time, :message, 2, "google.protobuf.Timestamp"
|
14
16
|
optional :end_time, :message, 3, "google.protobuf.Timestamp"
|
15
17
|
end
|
18
|
+
add_message "google.spanner.admin.database.v1.EncryptionConfig" do
|
19
|
+
optional :kms_key_name, :string, 2
|
20
|
+
end
|
21
|
+
add_message "google.spanner.admin.database.v1.EncryptionInfo" do
|
22
|
+
optional :encryption_type, :enum, 3, "google.spanner.admin.database.v1.EncryptionInfo.Type"
|
23
|
+
optional :encryption_status, :message, 4, "google.rpc.Status"
|
24
|
+
optional :kms_key_version, :string, 2
|
25
|
+
end
|
26
|
+
add_enum "google.spanner.admin.database.v1.EncryptionInfo.Type" do
|
27
|
+
value :TYPE_UNSPECIFIED, 0
|
28
|
+
value :GOOGLE_DEFAULT_ENCRYPTION, 1
|
29
|
+
value :CUSTOMER_MANAGED_ENCRYPTION, 2
|
30
|
+
end
|
16
31
|
end
|
17
32
|
end
|
18
33
|
|
@@ -23,6 +38,9 @@ module Google
|
|
23
38
|
module Database
|
24
39
|
module V1
|
25
40
|
OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OperationProgress").msgclass
|
41
|
+
EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionConfig").msgclass
|
42
|
+
EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo").msgclass
|
43
|
+
EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo.Type").enummodule
|
26
44
|
end
|
27
45
|
end
|
28
46
|
end
|
@@ -27,6 +27,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
27
27
|
optional :state, :enum, 2, "google.spanner.admin.database.v1.Database.State"
|
28
28
|
optional :create_time, :message, 3, "google.protobuf.Timestamp"
|
29
29
|
optional :restore_info, :message, 4, "google.spanner.admin.database.v1.RestoreInfo"
|
30
|
+
optional :encryption_config, :message, 5, "google.spanner.admin.database.v1.EncryptionConfig"
|
31
|
+
repeated :encryption_info, :message, 8, "google.spanner.admin.database.v1.EncryptionInfo"
|
32
|
+
optional :version_retention_period, :string, 6
|
33
|
+
optional :earliest_version_time, :message, 7, "google.protobuf.Timestamp"
|
30
34
|
end
|
31
35
|
add_enum "google.spanner.admin.database.v1.Database.State" do
|
32
36
|
value :STATE_UNSPECIFIED, 0
|
@@ -47,6 +51,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
47
51
|
optional :parent, :string, 1
|
48
52
|
optional :create_statement, :string, 2
|
49
53
|
repeated :extra_statements, :string, 3
|
54
|
+
optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.EncryptionConfig"
|
50
55
|
end
|
51
56
|
add_message "google.spanner.admin.database.v1.CreateDatabaseMetadata" do
|
52
57
|
optional :database, :string, 1
|
@@ -64,6 +69,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
64
69
|
repeated :statements, :string, 2
|
65
70
|
repeated :commit_timestamps, :message, 3, "google.protobuf.Timestamp"
|
66
71
|
optional :throttled, :bool, 4
|
72
|
+
repeated :progress, :message, 5, "google.spanner.admin.database.v1.OperationProgress"
|
67
73
|
end
|
68
74
|
add_message "google.spanner.admin.database.v1.DropDatabaseRequest" do
|
69
75
|
optional :database, :string, 1
|
@@ -87,10 +93,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
87
93
|
add_message "google.spanner.admin.database.v1.RestoreDatabaseRequest" do
|
88
94
|
optional :parent, :string, 1
|
89
95
|
optional :database_id, :string, 2
|
96
|
+
optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig"
|
90
97
|
oneof :source do
|
91
98
|
optional :backup, :string, 3
|
92
99
|
end
|
93
100
|
end
|
101
|
+
add_message "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig" do
|
102
|
+
optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType"
|
103
|
+
optional :kms_key_name, :string, 2
|
104
|
+
end
|
105
|
+
add_enum "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType" do
|
106
|
+
value :ENCRYPTION_TYPE_UNSPECIFIED, 0
|
107
|
+
value :USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION, 1
|
108
|
+
value :GOOGLE_DEFAULT_ENCRYPTION, 2
|
109
|
+
value :CUSTOMER_MANAGED_ENCRYPTION, 3
|
110
|
+
end
|
94
111
|
add_message "google.spanner.admin.database.v1.RestoreDatabaseMetadata" do
|
95
112
|
optional :name, :string, 1
|
96
113
|
optional :source_type, :enum, 2, "google.spanner.admin.database.v1.RestoreSourceType"
|
@@ -134,6 +151,8 @@ module Google
|
|
134
151
|
ListDatabaseOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsRequest").msgclass
|
135
152
|
ListDatabaseOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsResponse").msgclass
|
136
153
|
RestoreDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseRequest").msgclass
|
154
|
+
RestoreDatabaseEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig").msgclass
|
155
|
+
RestoreDatabaseEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType").enummodule
|
137
156
|
RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseMetadata").msgclass
|
138
157
|
OptimizeRestoredDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata").msgclass
|
139
158
|
RestoreSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreSourceType").enummodule
|
@@ -54,6 +54,12 @@ module Google
|
|
54
54
|
# This indicates that the field may be set once in a request to create a
|
55
55
|
# resource, but may not be changed thereafter.
|
56
56
|
IMMUTABLE = 5
|
57
|
+
|
58
|
+
# Denotes that a (repeated) field is an unordered list.
|
59
|
+
# This indicates that the service may provide the elements of the list
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
|
+
# provided. Additionally, the list's order may or may not be stable.
|
62
|
+
UNORDERED_LIST = 6
|
57
63
|
end
|
58
64
|
end
|
59
65
|
end
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @return [::String]
|
26
26
|
# The server-assigned name, which is only unique within the same service that
|
27
27
|
# originally returns it. If you use the default HTTP mapping, the
|
28
|
-
# `name` should
|
28
|
+
# `name` should be a resource name ending with `operations/{unique_id}`.
|
29
29
|
# @!attribute [rw] metadata
|
30
30
|
# @return [::Google::Protobuf::Any]
|
31
31
|
# Service-specific metadata associated with the operation. It typically
|
@@ -35,7 +35,7 @@ module Google
|
|
35
35
|
# @!attribute [rw] done
|
36
36
|
# @return [::Boolean]
|
37
37
|
# If the value is `false`, it means the operation is still in progress.
|
38
|
-
# If true
|
38
|
+
# If `true`, the operation is completed, and either `error` or `response` is
|
39
39
|
# available.
|
40
40
|
# @!attribute [rw] error
|
41
41
|
# @return [::Google::Rpc::Status]
|
@@ -67,7 +67,7 @@ module Google
|
|
67
67
|
# The request message for Operations.ListOperations.
|
68
68
|
# @!attribute [rw] name
|
69
69
|
# @return [::String]
|
70
|
-
# The name of the operation
|
70
|
+
# The name of the operation's parent resource.
|
71
71
|
# @!attribute [rw] filter
|
72
72
|
# @return [::String]
|
73
73
|
# The standard list filter.
|
@@ -112,6 +112,20 @@ module Google
|
|
112
112
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
113
113
|
end
|
114
114
|
|
115
|
+
# The request message for Operations.WaitOperation.
|
116
|
+
# @!attribute [rw] name
|
117
|
+
# @return [::String]
|
118
|
+
# The name of the operation resource to wait on.
|
119
|
+
# @!attribute [rw] timeout
|
120
|
+
# @return [::Google::Protobuf::Duration]
|
121
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
122
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
123
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
124
|
+
class WaitOperationRequest
|
125
|
+
include ::Google::Protobuf::MessageExts
|
126
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
127
|
+
end
|
128
|
+
|
115
129
|
# A message representing the message types used by a long-running operation.
|
116
130
|
#
|
117
131
|
# Example:
|
@@ -57,10 +57,13 @@ module Google
|
|
57
57
|
# Example 4: Pack and unpack a message in Go
|
58
58
|
#
|
59
59
|
# foo := &pb.Foo{...}
|
60
|
-
# any, err :=
|
60
|
+
# any, err := anypb.New(foo)
|
61
|
+
# if err != nil {
|
62
|
+
# ...
|
63
|
+
# }
|
61
64
|
# ...
|
62
65
|
# foo := &pb.Foo{}
|
63
|
-
# if err :=
|
66
|
+
# if err := any.UnmarshalTo(foo); err != nil {
|
64
67
|
# ...
|
65
68
|
# }
|
66
69
|
#
|
@@ -0,0 +1,98 @@
|
|
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 Protobuf
|
22
|
+
# A Duration represents a signed, fixed-length span of time represented
|
23
|
+
# as a count of seconds and fractions of seconds at nanosecond
|
24
|
+
# resolution. It is independent of any calendar and concepts like "day"
|
25
|
+
# or "month". It is related to Timestamp in that the difference between
|
26
|
+
# two Timestamp values is a Duration and it can be added or subtracted
|
27
|
+
# from a Timestamp. Range is approximately +-10,000 years.
|
28
|
+
#
|
29
|
+
# # Examples
|
30
|
+
#
|
31
|
+
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
32
|
+
#
|
33
|
+
# Timestamp start = ...;
|
34
|
+
# Timestamp end = ...;
|
35
|
+
# Duration duration = ...;
|
36
|
+
#
|
37
|
+
# duration.seconds = end.seconds - start.seconds;
|
38
|
+
# duration.nanos = end.nanos - start.nanos;
|
39
|
+
#
|
40
|
+
# if (duration.seconds < 0 && duration.nanos > 0) {
|
41
|
+
# duration.seconds += 1;
|
42
|
+
# duration.nanos -= 1000000000;
|
43
|
+
# } else if (duration.seconds > 0 && duration.nanos < 0) {
|
44
|
+
# duration.seconds -= 1;
|
45
|
+
# duration.nanos += 1000000000;
|
46
|
+
# }
|
47
|
+
#
|
48
|
+
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
49
|
+
#
|
50
|
+
# Timestamp start = ...;
|
51
|
+
# Duration duration = ...;
|
52
|
+
# Timestamp end = ...;
|
53
|
+
#
|
54
|
+
# end.seconds = start.seconds + duration.seconds;
|
55
|
+
# end.nanos = start.nanos + duration.nanos;
|
56
|
+
#
|
57
|
+
# if (end.nanos < 0) {
|
58
|
+
# end.seconds -= 1;
|
59
|
+
# end.nanos += 1000000000;
|
60
|
+
# } else if (end.nanos >= 1000000000) {
|
61
|
+
# end.seconds += 1;
|
62
|
+
# end.nanos -= 1000000000;
|
63
|
+
# }
|
64
|
+
#
|
65
|
+
# Example 3: Compute Duration from datetime.timedelta in Python.
|
66
|
+
#
|
67
|
+
# td = datetime.timedelta(days=3, minutes=10)
|
68
|
+
# duration = Duration()
|
69
|
+
# duration.FromTimedelta(td)
|
70
|
+
#
|
71
|
+
# # JSON Mapping
|
72
|
+
#
|
73
|
+
# In JSON format, the Duration type is encoded as a string rather than an
|
74
|
+
# object, where the string ends in the suffix "s" (indicating seconds) and
|
75
|
+
# is preceded by the number of seconds, with nanoseconds expressed as
|
76
|
+
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
77
|
+
# encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
78
|
+
# be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
79
|
+
# microsecond should be expressed in JSON format as "3.000001s".
|
80
|
+
# @!attribute [rw] seconds
|
81
|
+
# @return [::Integer]
|
82
|
+
# Signed seconds of the span of time. Must be from -315,576,000,000
|
83
|
+
# to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
84
|
+
# 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
85
|
+
# @!attribute [rw] nanos
|
86
|
+
# @return [::Integer]
|
87
|
+
# Signed fractions of a second at nanosecond resolution of the span
|
88
|
+
# of time. Durations less than one second are represented with a 0
|
89
|
+
# `seconds` field and a positive or negative `nanos` field. For durations
|
90
|
+
# of one second or more, a non-zero value for the `nanos` field must be
|
91
|
+
# of the same sign as the `seconds` field. Must be from -999,999,999
|
92
|
+
# to +999,999,999 inclusive.
|
93
|
+
class Duration
|
94
|
+
include ::Google::Protobuf::MessageExts
|
95
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -70,7 +70,16 @@ module Google
|
|
70
70
|
# .setNanos((int) ((millis % 1000) * 1000000)).build();
|
71
71
|
#
|
72
72
|
#
|
73
|
-
# Example 5: Compute Timestamp from
|
73
|
+
# Example 5: Compute Timestamp from Java `Instant.now()`.
|
74
|
+
#
|
75
|
+
# Instant now = Instant.now();
|
76
|
+
#
|
77
|
+
# Timestamp timestamp =
|
78
|
+
# Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
79
|
+
# .setNanos(now.getNano()).build();
|
80
|
+
#
|
81
|
+
#
|
82
|
+
# Example 6: Compute Timestamp from current time in Python.
|
74
83
|
#
|
75
84
|
# timestamp = Timestamp()
|
76
85
|
# timestamp.GetCurrentTime()
|
@@ -31,6 +31,12 @@ module Google
|
|
31
31
|
# created. This needs to be in the same instance as the backup.
|
32
32
|
# Values are of the form
|
33
33
|
# `projects/<project>/instances/<instance>/databases/<database>`.
|
34
|
+
# @!attribute [rw] version_time
|
35
|
+
# @return [::Google::Protobuf::Timestamp]
|
36
|
+
# The backup will contain an externally consistent copy of the database at
|
37
|
+
# the timestamp specified by `version_time`. If `version_time` is not
|
38
|
+
# specified, the system will set `version_time` to the `create_time` of the
|
39
|
+
# backup.
|
34
40
|
# @!attribute [rw] expire_time
|
35
41
|
# @return [::Google::Protobuf::Timestamp]
|
36
42
|
# Required for the {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup}
|
@@ -56,10 +62,9 @@ module Google
|
|
56
62
|
# `projects/<project>/instances/<instance>`.
|
57
63
|
# @!attribute [r] create_time
|
58
64
|
# @return [::Google::Protobuf::Timestamp]
|
59
|
-
# Output only. The
|
60
|
-
#
|
61
|
-
# `
|
62
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} request is received.
|
65
|
+
# Output only. The time the {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup}
|
66
|
+
# request is received. If the request does not specify `version_time`, the
|
67
|
+
# `version_time` of the backup will be equivalent to the `create_time`.
|
63
68
|
# @!attribute [r] size_bytes
|
64
69
|
# @return [::Integer]
|
65
70
|
# Output only. Size of the backup in bytes.
|
@@ -75,6 +80,9 @@ module Google
|
|
75
80
|
# any referencing database prevents the backup from being deleted. When a
|
76
81
|
# restored database from the backup enters the `READY` state, the reference
|
77
82
|
# to the backup is removed.
|
83
|
+
# @!attribute [r] encryption_info
|
84
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo]
|
85
|
+
# Output only. The encryption information for the backup.
|
78
86
|
class Backup
|
79
87
|
include ::Google::Protobuf::MessageExts
|
80
88
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -110,6 +118,13 @@ module Google
|
|
110
118
|
# @!attribute [rw] backup
|
111
119
|
# @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
|
112
120
|
# Required. The backup to create.
|
121
|
+
# @!attribute [rw] encryption_config
|
122
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig]
|
123
|
+
# Optional. The encryption configuration used to encrypt the backup. If this field is
|
124
|
+
# not specified, the backup will use the same
|
125
|
+
# encryption configuration as the database by default, namely
|
126
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} =
|
127
|
+
# `USE_DATABASE_ENCRYPTION`.
|
113
128
|
class CreateBackupRequest
|
114
129
|
include ::Google::Protobuf::MessageExts
|
115
130
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -138,7 +153,8 @@ module Google
|
|
138
153
|
# other methods to check whether the cancellation succeeded or whether the
|
139
154
|
# operation completed despite cancellation. On successful cancellation,
|
140
155
|
# the operation is not deleted; instead, it becomes an operation with
|
141
|
-
# an
|
156
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
157
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
|
142
158
|
# corresponding to `Code.CANCELLED`.
|
143
159
|
class CreateBackupMetadata
|
144
160
|
include ::Google::Protobuf::MessageExts
|
@@ -206,8 +222,9 @@ module Google
|
|
206
222
|
# * `name`
|
207
223
|
# * `database`
|
208
224
|
# * `state`
|
209
|
-
# * `create_time`
|
210
|
-
# * `expire_time`
|
225
|
+
# * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
226
|
+
# * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
227
|
+
# * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
211
228
|
# * `size_bytes`
|
212
229
|
#
|
213
230
|
# You can combine multiple expressions by enclosing each expression in
|
@@ -295,9 +312,9 @@ module Google
|
|
295
312
|
# * `done:true` - The operation is complete.
|
296
313
|
# * `metadata.database:prod` - The database the backup was taken from has
|
297
314
|
# a name containing the string "prod".
|
298
|
-
# * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`
|
299
|
-
# `(metadata.name:howl) AND`
|
300
|
-
# `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
|
315
|
+
# * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
316
|
+
# `(metadata.name:howl) AND` \
|
317
|
+
# `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
301
318
|
# `(error:*)` - Returns operations where:
|
302
319
|
# * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
|
303
320
|
# * The backup name contains the string "howl".
|
@@ -345,10 +362,17 @@ module Google
|
|
345
362
|
# @!attribute [rw] backup
|
346
363
|
# @return [::String]
|
347
364
|
# Name of the backup.
|
348
|
-
# @!attribute [rw]
|
365
|
+
# @!attribute [rw] version_time
|
349
366
|
# @return [::Google::Protobuf::Timestamp]
|
350
367
|
# The backup contains an externally consistent copy of `source_database` at
|
351
|
-
# the timestamp specified by `
|
368
|
+
# the timestamp specified by `version_time`. If the
|
369
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} request did not specify
|
370
|
+
# `version_time`, the `version_time` of the backup is equivalent to the
|
371
|
+
# `create_time`.
|
372
|
+
# @!attribute [rw] create_time
|
373
|
+
# @return [::Google::Protobuf::Timestamp]
|
374
|
+
# The time the {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} request was
|
375
|
+
# received.
|
352
376
|
# @!attribute [rw] source_database
|
353
377
|
# @return [::String]
|
354
378
|
# Name of the database the backup was created from.
|
@@ -356,6 +380,42 @@ module Google
|
|
356
380
|
include ::Google::Protobuf::MessageExts
|
357
381
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
358
382
|
end
|
383
|
+
|
384
|
+
# Encryption configuration for the backup to create.
|
385
|
+
# @!attribute [rw] encryption_type
|
386
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig::EncryptionType]
|
387
|
+
# Required. The encryption type of the backup.
|
388
|
+
# @!attribute [rw] kms_key_name
|
389
|
+
# @return [::String]
|
390
|
+
# Optional. The Cloud KMS key that will be used to protect the backup.
|
391
|
+
# This field should be set only when
|
392
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} is
|
393
|
+
# `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
|
394
|
+
# `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
|
395
|
+
class CreateBackupEncryptionConfig
|
396
|
+
include ::Google::Protobuf::MessageExts
|
397
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
398
|
+
|
399
|
+
# Encryption types for the backup.
|
400
|
+
module EncryptionType
|
401
|
+
# Unspecified. Do not use.
|
402
|
+
ENCRYPTION_TYPE_UNSPECIFIED = 0
|
403
|
+
|
404
|
+
# Use the same encryption configuration as the database. This is the
|
405
|
+
# default option when
|
406
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig encryption_config} is empty.
|
407
|
+
# For example, if the database is using `Customer_Managed_Encryption`, the
|
408
|
+
# backup will be using the same Cloud KMS key as the database.
|
409
|
+
USE_DATABASE_ENCRYPTION = 1
|
410
|
+
|
411
|
+
# Use Google default encryption.
|
412
|
+
GOOGLE_DEFAULT_ENCRYPTION = 2
|
413
|
+
|
414
|
+
# Use customer managed encryption. If specified, `kms_key_name`
|
415
|
+
# must contain a valid Cloud KMS key.
|
416
|
+
CUSTOMER_MANAGED_ENCRYPTION = 3
|
417
|
+
end
|
418
|
+
end
|
359
419
|
end
|
360
420
|
end
|
361
421
|
end
|