google-cloud-spanner-admin-instance-v1 0.1.2 → 0.3.1
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/instance/v1.rb +3 -0
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb +40 -34
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb +96 -11
- data/lib/google/cloud/spanner/admin/instance/v1/version.rb +1 -1
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +10 -10
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +50 -14
- 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/instance/v1/spanner_instance_admin.rb +1 -1
- metadata +13 -9
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
parent_config = while namespace.any?
|
83
83
|
parent_name = namespace.join "::"
|
84
84
|
parent_const = const_get parent_name
|
85
|
-
break parent_const.configure if parent_const
|
85
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
86
86
|
namespace.pop
|
87
87
|
end
|
88
88
|
default_config = Client::Configuration.new parent_config
|
@@ -90,33 +90,33 @@ module Google
|
|
90
90
|
default_config.rpcs.list_instance_configs.timeout = 3600.0
|
91
91
|
default_config.rpcs.list_instance_configs.retry_policy = {
|
92
92
|
initial_delay: 1.0,
|
93
|
-
|
94
|
-
|
95
|
-
|
93
|
+
max_delay: 32.0,
|
94
|
+
multiplier: 1.3,
|
95
|
+
retry_codes: [14, 4]
|
96
96
|
}
|
97
97
|
|
98
98
|
default_config.rpcs.get_instance_config.timeout = 3600.0
|
99
99
|
default_config.rpcs.get_instance_config.retry_policy = {
|
100
100
|
initial_delay: 1.0,
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
max_delay: 32.0,
|
102
|
+
multiplier: 1.3,
|
103
|
+
retry_codes: [14, 4]
|
104
104
|
}
|
105
105
|
|
106
106
|
default_config.rpcs.list_instances.timeout = 3600.0
|
107
107
|
default_config.rpcs.list_instances.retry_policy = {
|
108
108
|
initial_delay: 1.0,
|
109
|
-
|
110
|
-
|
111
|
-
|
109
|
+
max_delay: 32.0,
|
110
|
+
multiplier: 1.3,
|
111
|
+
retry_codes: [14, 4]
|
112
112
|
}
|
113
113
|
|
114
114
|
default_config.rpcs.get_instance.timeout = 3600.0
|
115
115
|
default_config.rpcs.get_instance.retry_policy = {
|
116
116
|
initial_delay: 1.0,
|
117
|
-
|
118
|
-
|
119
|
-
|
117
|
+
max_delay: 32.0,
|
118
|
+
multiplier: 1.3,
|
119
|
+
retry_codes: [14, 4]
|
120
120
|
}
|
121
121
|
|
122
122
|
default_config.rpcs.create_instance.timeout = 3600.0
|
@@ -126,9 +126,9 @@ module Google
|
|
126
126
|
default_config.rpcs.delete_instance.timeout = 3600.0
|
127
127
|
default_config.rpcs.delete_instance.retry_policy = {
|
128
128
|
initial_delay: 1.0,
|
129
|
-
|
130
|
-
|
131
|
-
|
129
|
+
max_delay: 32.0,
|
130
|
+
multiplier: 1.3,
|
131
|
+
retry_codes: [14, 4]
|
132
132
|
}
|
133
133
|
|
134
134
|
default_config.rpcs.set_iam_policy.timeout = 30.0
|
@@ -136,9 +136,9 @@ module Google
|
|
136
136
|
default_config.rpcs.get_iam_policy.timeout = 30.0
|
137
137
|
default_config.rpcs.get_iam_policy.retry_policy = {
|
138
138
|
initial_delay: 1.0,
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
max_delay: 32.0,
|
140
|
+
multiplier: 1.3,
|
141
|
+
retry_codes: [14, 4]
|
142
142
|
}
|
143
143
|
|
144
144
|
default_config.rpcs.test_iam_permissions.timeout = 30.0
|
@@ -204,7 +204,13 @@ module Google
|
|
204
204
|
|
205
205
|
# Create credentials
|
206
206
|
credentials = @config.credentials
|
207
|
-
|
207
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
208
|
+
# but only if the default endpoint does not have a region prefix.
|
209
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
210
|
+
@config.endpoint == Client.configure.endpoint &&
|
211
|
+
!@config.endpoint.split(".").first.include?("-")
|
212
|
+
credentials ||= Credentials.default scope: @config.scope,
|
213
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
208
214
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
209
215
|
credentials = Credentials.new credentials, scope: @config.scope
|
210
216
|
end
|
@@ -1152,14 +1158,14 @@ module Google
|
|
1152
1158
|
|
1153
1159
|
config_attr :endpoint, "spanner.googleapis.com", ::String
|
1154
1160
|
config_attr :credentials, nil do |value|
|
1155
|
-
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1161
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1156
1162
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
1157
1163
|
allowed.any? { |klass| klass === value }
|
1158
1164
|
end
|
1159
1165
|
config_attr :scope, nil, ::String, ::Array, nil
|
1160
1166
|
config_attr :lib_name, nil, ::String, nil
|
1161
1167
|
config_attr :lib_version, nil, ::String, nil
|
1162
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
1168
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
1163
1169
|
config_attr :interceptors, nil, ::Array, nil
|
1164
1170
|
config_attr :timeout, nil, ::Numeric, nil
|
1165
1171
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -1180,7 +1186,7 @@ module Google
|
|
1180
1186
|
def rpcs
|
1181
1187
|
@rpcs ||= begin
|
1182
1188
|
parent_rpcs = nil
|
1183
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
1189
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1184
1190
|
Rpcs.new parent_rpcs
|
1185
1191
|
end
|
1186
1192
|
end
|
@@ -1192,7 +1198,7 @@ module Google
|
|
1192
1198
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1193
1199
|
# the following configuration fields:
|
1194
1200
|
#
|
1195
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
1201
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1196
1202
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
1197
1203
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1198
1204
|
# include the following keys:
|
@@ -1256,25 +1262,25 @@ module Google
|
|
1256
1262
|
|
1257
1263
|
# @private
|
1258
1264
|
def initialize parent_rpcs = nil
|
1259
|
-
list_instance_configs_config = parent_rpcs
|
1265
|
+
list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs
|
1260
1266
|
@list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config
|
1261
|
-
get_instance_config_config = parent_rpcs
|
1267
|
+
get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config
|
1262
1268
|
@get_instance_config = ::Gapic::Config::Method.new get_instance_config_config
|
1263
|
-
list_instances_config = parent_rpcs
|
1269
|
+
list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
|
1264
1270
|
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
1265
|
-
get_instance_config = parent_rpcs
|
1271
|
+
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|
1266
1272
|
@get_instance = ::Gapic::Config::Method.new get_instance_config
|
1267
|
-
create_instance_config = parent_rpcs
|
1273
|
+
create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
|
1268
1274
|
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
1269
|
-
update_instance_config = parent_rpcs
|
1275
|
+
update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
|
1270
1276
|
@update_instance = ::Gapic::Config::Method.new update_instance_config
|
1271
|
-
delete_instance_config = parent_rpcs
|
1277
|
+
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
1272
1278
|
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
1273
|
-
set_iam_policy_config = parent_rpcs
|
1279
|
+
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
1274
1280
|
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
1275
|
-
get_iam_policy_config = parent_rpcs
|
1281
|
+
get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
|
1276
1282
|
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
1277
|
-
test_iam_permissions_config = parent_rpcs
|
1283
|
+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
1278
1284
|
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
1279
1285
|
|
1280
1286
|
yield self if block_given?
|
@@ -105,8 +105,13 @@ module Google
|
|
105
105
|
# Lists operations that match the specified filter in the request. If the
|
106
106
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
107
107
|
#
|
108
|
-
# NOTE: the `name` binding
|
109
|
-
# to use different resource name schemes, such as `users/*/operations`.
|
108
|
+
# NOTE: the `name` binding allows API services to override the binding
|
109
|
+
# to use different resource name schemes, such as `users/*/operations`. To
|
110
|
+
# override the binding, API services can add a binding such as
|
111
|
+
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
112
|
+
# For backwards compatibility, the default name includes the operations
|
113
|
+
# collection id, however overriding users must ensure the name binding
|
114
|
+
# is the parent resource, without the operations collection id.
|
110
115
|
#
|
111
116
|
# @overload list_operations(request, options = nil)
|
112
117
|
# Pass arguments to `list_operations` via a request object, either of type
|
@@ -124,7 +129,7 @@ module Google
|
|
124
129
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
125
130
|
#
|
126
131
|
# @param name [::String]
|
127
|
-
# The name of the operation
|
132
|
+
# The name of the operation's parent resource.
|
128
133
|
# @param filter [::String]
|
129
134
|
# The standard list filter.
|
130
135
|
# @param page_size [::Integer]
|
@@ -392,6 +397,79 @@ module Google
|
|
392
397
|
raise ::Google::Cloud::Error.from_error(e)
|
393
398
|
end
|
394
399
|
|
400
|
+
##
|
401
|
+
# Waits for the specified long-running operation until it is done or reaches
|
402
|
+
# at most a specified timeout, returning the latest state. If the operation
|
403
|
+
# is already done, the latest state is immediately returned. If the timeout
|
404
|
+
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
405
|
+
# timeout is used. If the server does not support this method, it returns
|
406
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
407
|
+
# Note that this method is on a best-effort basis. It may return the latest
|
408
|
+
# state before the specified timeout (including immediately), meaning even an
|
409
|
+
# immediate response is no guarantee that the operation is done.
|
410
|
+
#
|
411
|
+
# @overload wait_operation(request, options = nil)
|
412
|
+
# Pass arguments to `wait_operation` via a request object, either of type
|
413
|
+
# {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
|
414
|
+
#
|
415
|
+
# @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
|
416
|
+
# A request object representing the call parameters. Required. To specify no
|
417
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
418
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
419
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
420
|
+
#
|
421
|
+
# @overload wait_operation(name: nil, timeout: nil)
|
422
|
+
# Pass arguments to `wait_operation` via keyword arguments. Note that at
|
423
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
424
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
425
|
+
#
|
426
|
+
# @param name [::String]
|
427
|
+
# The name of the operation resource to wait on.
|
428
|
+
# @param timeout [::Google::Protobuf::Duration, ::Hash]
|
429
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
430
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
431
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
432
|
+
#
|
433
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
434
|
+
# @yieldparam response [::Gapic::Operation]
|
435
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
436
|
+
#
|
437
|
+
# @return [::Gapic::Operation]
|
438
|
+
#
|
439
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
440
|
+
#
|
441
|
+
def wait_operation request, options = nil
|
442
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
443
|
+
|
444
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
|
445
|
+
|
446
|
+
# Converts hash and nil to an options object
|
447
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
448
|
+
|
449
|
+
# Customize the options with defaults
|
450
|
+
metadata = @config.rpcs.wait_operation.metadata.to_h
|
451
|
+
|
452
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
453
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
454
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
455
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
|
456
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
457
|
+
|
458
|
+
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
459
|
+
metadata: metadata,
|
460
|
+
retry_policy: @config.rpcs.wait_operation.retry_policy
|
461
|
+
options.apply_defaults metadata: @config.metadata,
|
462
|
+
retry_policy: @config.retry_policy
|
463
|
+
|
464
|
+
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
465
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
466
|
+
yield response, operation if block_given?
|
467
|
+
return response
|
468
|
+
end
|
469
|
+
rescue ::GRPC::BadStatus => e
|
470
|
+
raise ::Google::Cloud::Error.from_error(e)
|
471
|
+
end
|
472
|
+
|
395
473
|
##
|
396
474
|
# Configuration class for the Operations API.
|
397
475
|
#
|
@@ -477,14 +555,14 @@ module Google
|
|
477
555
|
|
478
556
|
config_attr :endpoint, "spanner.googleapis.com", ::String
|
479
557
|
config_attr :credentials, nil do |value|
|
480
|
-
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
558
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
481
559
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
482
560
|
allowed.any? { |klass| klass === value }
|
483
561
|
end
|
484
562
|
config_attr :scope, nil, ::String, ::Array, nil
|
485
563
|
config_attr :lib_name, nil, ::String, nil
|
486
564
|
config_attr :lib_version, nil, ::String, nil
|
487
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
565
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
488
566
|
config_attr :interceptors, nil, ::Array, nil
|
489
567
|
config_attr :timeout, nil, ::Numeric, nil
|
490
568
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -505,7 +583,7 @@ module Google
|
|
505
583
|
def rpcs
|
506
584
|
@rpcs ||= begin
|
507
585
|
parent_rpcs = nil
|
508
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
586
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
509
587
|
Rpcs.new parent_rpcs
|
510
588
|
end
|
511
589
|
end
|
@@ -517,7 +595,7 @@ module Google
|
|
517
595
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
518
596
|
# the following configuration fields:
|
519
597
|
#
|
520
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
598
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
521
599
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
522
600
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
523
601
|
# include the following keys:
|
@@ -548,17 +626,24 @@ module Google
|
|
548
626
|
# @return [::Gapic::Config::Method]
|
549
627
|
#
|
550
628
|
attr_reader :cancel_operation
|
629
|
+
##
|
630
|
+
# RPC-specific configuration for `wait_operation`
|
631
|
+
# @return [::Gapic::Config::Method]
|
632
|
+
#
|
633
|
+
attr_reader :wait_operation
|
551
634
|
|
552
635
|
# @private
|
553
636
|
def initialize parent_rpcs = nil
|
554
|
-
list_operations_config = parent_rpcs
|
637
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
555
638
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
556
|
-
get_operation_config = parent_rpcs
|
639
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
557
640
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
558
|
-
delete_operation_config = parent_rpcs
|
641
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
559
642
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
560
|
-
cancel_operation_config = parent_rpcs
|
643
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
561
644
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
645
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
646
|
+
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
562
647
|
|
563
648
|
yield self if block_given?
|
564
649
|
end
|
@@ -56,13 +56,13 @@ module Google
|
|
56
56
|
self.service_name = 'google.spanner.admin.instance.v1.InstanceAdmin'
|
57
57
|
|
58
58
|
# Lists the supported instance configurations for a given project.
|
59
|
-
rpc :ListInstanceConfigs, Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse
|
59
|
+
rpc :ListInstanceConfigs, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse
|
60
60
|
# Gets information about a particular instance configuration.
|
61
|
-
rpc :GetInstanceConfig, Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig
|
61
|
+
rpc :GetInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig
|
62
62
|
# Lists all instances in the given project.
|
63
|
-
rpc :ListInstances, Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse
|
63
|
+
rpc :ListInstances, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse
|
64
64
|
# Gets information about a particular instance.
|
65
|
-
rpc :GetInstance, Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, Google::Cloud::Spanner::Admin::Instance::V1::Instance
|
65
|
+
rpc :GetInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::Instance
|
66
66
|
# Creates an instance and begins preparing it to begin serving. The
|
67
67
|
# returned [long-running operation][google.longrunning.Operation]
|
68
68
|
# can be used to track the progress of preparing the new
|
@@ -97,7 +97,7 @@ module Google
|
|
97
97
|
# [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
|
98
98
|
# The [response][google.longrunning.Operation.response] field type is
|
99
99
|
# [Instance][google.spanner.admin.instance.v1.Instance], if successful.
|
100
|
-
rpc :CreateInstance, Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, Google::Longrunning::Operation
|
100
|
+
rpc :CreateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Google::Longrunning::Operation
|
101
101
|
# Updates an instance, and begins allocating or releasing resources
|
102
102
|
# as requested. The returned [long-running
|
103
103
|
# operation][google.longrunning.Operation] can be used to track the
|
@@ -138,7 +138,7 @@ module Google
|
|
138
138
|
#
|
139
139
|
# Authorization requires `spanner.instances.update` permission on
|
140
140
|
# resource [name][google.spanner.admin.instance.v1.Instance.name].
|
141
|
-
rpc :UpdateInstance, Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, Google::Longrunning::Operation
|
141
|
+
rpc :UpdateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation
|
142
142
|
# Deletes an instance.
|
143
143
|
#
|
144
144
|
# Immediately upon completion of the request:
|
@@ -150,26 +150,26 @@ module Google
|
|
150
150
|
# * The instance and *all of its databases* immediately and
|
151
151
|
# irrevocably disappear from the API. All data in the databases
|
152
152
|
# is permanently deleted.
|
153
|
-
rpc :DeleteInstance, Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, Google::Protobuf::Empty
|
153
|
+
rpc :DeleteInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Google::Protobuf::Empty
|
154
154
|
# Sets the access control policy on an instance resource. Replaces any
|
155
155
|
# existing policy.
|
156
156
|
#
|
157
157
|
# Authorization requires `spanner.instances.setIamPolicy` on
|
158
158
|
# [resource][google.iam.v1.SetIamPolicyRequest.resource].
|
159
|
-
rpc :SetIamPolicy, Google::Iam::V1::SetIamPolicyRequest, Google::Iam::V1::Policy
|
159
|
+
rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy
|
160
160
|
# Gets the access control policy for an instance resource. Returns an empty
|
161
161
|
# policy if an instance exists but does not have a policy set.
|
162
162
|
#
|
163
163
|
# Authorization requires `spanner.instances.getIamPolicy` on
|
164
164
|
# [resource][google.iam.v1.GetIamPolicyRequest.resource].
|
165
|
-
rpc :GetIamPolicy, Google::Iam::V1::GetIamPolicyRequest, Google::Iam::V1::Policy
|
165
|
+
rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy
|
166
166
|
# Returns permissions that the caller has on the specified instance resource.
|
167
167
|
#
|
168
168
|
# Attempting this RPC on a non-existent Cloud Spanner instance resource will
|
169
169
|
# result in a NOT_FOUND error if the user has `spanner.instances.list`
|
170
170
|
# permission on the containing Google Cloud Project. Otherwise returns an
|
171
171
|
# empty set of permissions.
|
172
|
-
rpc :TestIamPermissions, Google::Iam::V1::TestIamPermissionsRequest, Google::Iam::V1::TestIamPermissionsResponse
|
172
|
+
rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse
|
173
173
|
end
|
174
174
|
|
175
175
|
Stub = Service.rpc_stub_class
|
@@ -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
|
@@ -43,12 +43,12 @@ module Google
|
|
43
43
|
#
|
44
44
|
# The ResourceDescriptor Yaml config will look like:
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
46
|
+
# resources:
|
47
|
+
# - type: "pubsub.googleapis.com/Topic"
|
48
|
+
# name_descriptor:
|
49
|
+
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
+
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
+
# parent_name_extractor: "projects/{project}"
|
52
52
|
#
|
53
53
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
54
|
# live under multiple parents.
|
@@ -183,15 +183,24 @@ module Google
|
|
183
183
|
# }
|
184
184
|
# @!attribute [rw] plural
|
185
185
|
# @return [::String]
|
186
|
-
# The plural name used in the resource name, such as
|
187
|
-
# the name of 'projects/\\{project}'
|
188
|
-
#
|
186
|
+
# The plural name used in the resource name and permission names, such as
|
187
|
+
# 'projects' for the resource name of 'projects/\\{project}' and the permission
|
188
|
+
# name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
|
189
|
+
# concept of the `plural` field in k8s CRD spec
|
189
190
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
191
|
+
#
|
192
|
+
# Note: The plural form is required even for singleton resources. See
|
193
|
+
# https://aip.dev/156
|
190
194
|
# @!attribute [rw] singular
|
191
195
|
# @return [::String]
|
192
196
|
# The same concept of the `singular` field in k8s CRD spec
|
193
197
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
194
198
|
# Such as "project" for the `resourcemanager.googleapis.com/Project` type.
|
199
|
+
# @!attribute [rw] style
|
200
|
+
# @return [::Array<::Google::Api::ResourceDescriptor::Style>]
|
201
|
+
# Style flag(s) for this resource.
|
202
|
+
# These indicate that a resource is expected to conform to a given
|
203
|
+
# style. See the specific style flags for additional information.
|
195
204
|
class ResourceDescriptor
|
196
205
|
include ::Google::Protobuf::MessageExts
|
197
206
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -211,6 +220,22 @@ module Google
|
|
211
220
|
# that from being necessary once there are multiple patterns.)
|
212
221
|
FUTURE_MULTI_PATTERN = 2
|
213
222
|
end
|
223
|
+
|
224
|
+
# A flag representing a specific style that a resource claims to conform to.
|
225
|
+
module Style
|
226
|
+
# The unspecified value. Do not use.
|
227
|
+
STYLE_UNSPECIFIED = 0
|
228
|
+
|
229
|
+
# This resource is intended to be "declarative-friendly".
|
230
|
+
#
|
231
|
+
# Declarative-friendly resources must be more strictly consistent, and
|
232
|
+
# setting this to true communicates to tools that this resource should
|
233
|
+
# adhere to declarative-friendly expectations.
|
234
|
+
#
|
235
|
+
# Note: This is used by the API linter (linter.aip.dev) to enable
|
236
|
+
# additional checks.
|
237
|
+
DECLARATIVE_FRIENDLY = 1
|
238
|
+
end
|
214
239
|
end
|
215
240
|
|
216
241
|
# Defines a proto annotation that describes a string field that refers to
|
@@ -226,6 +251,17 @@ module Google
|
|
226
251
|
# type: "pubsub.googleapis.com/Topic"
|
227
252
|
# }];
|
228
253
|
# }
|
254
|
+
#
|
255
|
+
# Occasionally, a field may reference an arbitrary resource. In this case,
|
256
|
+
# APIs use the special value * in their resource reference.
|
257
|
+
#
|
258
|
+
# Example:
|
259
|
+
#
|
260
|
+
# message GetIamPolicyRequest {
|
261
|
+
# string resource = 2 [(google.api.resource_reference) = {
|
262
|
+
# type: "*"
|
263
|
+
# }];
|
264
|
+
# }
|
229
265
|
# @!attribute [rw] child_type
|
230
266
|
# @return [::String]
|
231
267
|
# The resource type of a child collection that the annotated field
|
@@ -234,11 +270,11 @@ module Google
|
|
234
270
|
#
|
235
271
|
# Example:
|
236
272
|
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
240
|
-
#
|
241
|
-
#
|
273
|
+
# message ListLogEntriesRequest {
|
274
|
+
# string parent = 1 [(google.api.resource_reference) = {
|
275
|
+
# child_type: "logging.googleapis.com/LogEntry"
|
276
|
+
# };
|
277
|
+
# }
|
242
278
|
class ResourceReference
|
243
279
|
include ::Google::Protobuf::MessageExts
|
244
280
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|