google-cloud-cloud_dms-v1 0.4.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -235,7 +235,8 @@ module Google
235
235
  credentials: credentials,
236
236
  endpoint: @config.endpoint,
237
237
  channel_args: @config.channel_args,
238
- interceptors: @config.interceptors
238
+ interceptors: @config.interceptors,
239
+ channel_pool_config: @config.channel_pool
239
240
  )
240
241
  end
241
242
 
@@ -488,8 +489,8 @@ module Google
488
489
  # job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
489
490
  # object.
490
491
  # @param request_id [::String]
491
- # A unique ID used to identify the request. If the server receives two
492
- # requests with the same ID, then the second request is ignored.
492
+ # Optional. A unique ID used to identify the request. If the server receives
493
+ # two requests with the same ID, then the second request is ignored.
493
494
  #
494
495
  # It is recommended to always set this value to a UUID.
495
496
  #
@@ -790,13 +791,16 @@ module Google
790
791
  # @param options [::Gapic::CallOptions, ::Hash]
791
792
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
792
793
  #
793
- # @overload start_migration_job(name: nil)
794
+ # @overload start_migration_job(name: nil, skip_validation: nil)
794
795
  # Pass arguments to `start_migration_job` via keyword arguments. Note that at
795
796
  # least one keyword argument is required. To specify no parameters, or to keep all
796
797
  # the default parameter values, pass an empty Hash as a request object (see above).
797
798
  #
798
799
  # @param name [::String]
799
800
  # Name of the migration job resource to start.
801
+ # @param skip_validation [::Boolean]
802
+ # Optional. Start the migration job without running prior configuration
803
+ # verification. Defaults to `false`.
800
804
  #
801
805
  # @yield [response, operation] Access the result along with the RPC operation
802
806
  # @yieldparam response [::Gapic::Operation]
@@ -1165,13 +1169,19 @@ module Google
1165
1169
  # @param options [::Gapic::CallOptions, ::Hash]
1166
1170
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1167
1171
  #
1168
- # @overload verify_migration_job(name: nil)
1172
+ # @overload verify_migration_job(name: nil, update_mask: nil, migration_job: nil)
1169
1173
  # Pass arguments to `verify_migration_job` via keyword arguments. Note that at
1170
1174
  # least one keyword argument is required. To specify no parameters, or to keep all
1171
1175
  # the default parameter values, pass an empty Hash as a request object (see above).
1172
1176
  #
1173
1177
  # @param name [::String]
1174
1178
  # Name of the migration job resource to verify.
1179
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1180
+ # Optional. Field mask is used to specify the changed fields to be verified.
1181
+ # It will not update the migration job.
1182
+ # @param migration_job [::Google::Cloud::CloudDMS::V1::MigrationJob, ::Hash]
1183
+ # Optional. The changed migration job parameters to verify.
1184
+ # It will not update the migration job.
1175
1185
  #
1176
1186
  # @yield [response, operation] Access the result along with the RPC operation
1177
1187
  # @yieldparam response [::Gapic::Operation]
@@ -1260,13 +1270,16 @@ module Google
1260
1270
  # @param options [::Gapic::CallOptions, ::Hash]
1261
1271
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1262
1272
  #
1263
- # @overload restart_migration_job(name: nil)
1273
+ # @overload restart_migration_job(name: nil, skip_validation: nil)
1264
1274
  # Pass arguments to `restart_migration_job` via keyword arguments. Note that at
1265
1275
  # least one keyword argument is required. To specify no parameters, or to keep all
1266
1276
  # the default parameter values, pass an empty Hash as a request object (see above).
1267
1277
  #
1268
1278
  # @param name [::String]
1269
1279
  # Name of the migration job resource to restart.
1280
+ # @param skip_validation [::Boolean]
1281
+ # Optional. Restart the migration job without running prior configuration
1282
+ # verification. Defaults to `false`.
1270
1283
  #
1271
1284
  # @yield [response, operation] Access the result along with the RPC operation
1272
1285
  # @yieldparam response [::Gapic::Operation]
@@ -1434,6 +1447,106 @@ module Google
1434
1447
  raise ::Google::Cloud::Error.from_error(e)
1435
1448
  end
1436
1449
 
1450
+ ##
1451
+ # Generate a TCP Proxy configuration script to configure a cloud-hosted VM
1452
+ # running a TCP Proxy.
1453
+ #
1454
+ # @overload generate_tcp_proxy_script(request, options = nil)
1455
+ # Pass arguments to `generate_tcp_proxy_script` via a request object, either of type
1456
+ # {::Google::Cloud::CloudDMS::V1::GenerateTcpProxyScriptRequest} or an equivalent Hash.
1457
+ #
1458
+ # @param request [::Google::Cloud::CloudDMS::V1::GenerateTcpProxyScriptRequest, ::Hash]
1459
+ # A request object representing the call parameters. Required. To specify no
1460
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1461
+ # @param options [::Gapic::CallOptions, ::Hash]
1462
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1463
+ #
1464
+ # @overload generate_tcp_proxy_script(migration_job: nil, vm_name: nil, vm_machine_type: nil, vm_zone: nil, vm_subnet: nil)
1465
+ # Pass arguments to `generate_tcp_proxy_script` via keyword arguments. Note that at
1466
+ # least one keyword argument is required. To specify no parameters, or to keep all
1467
+ # the default parameter values, pass an empty Hash as a request object (see above).
1468
+ #
1469
+ # @param migration_job [::String]
1470
+ # Name of the migration job resource to generate the TCP Proxy script.
1471
+ # @param vm_name [::String]
1472
+ # Required. The name of the Compute instance that will host the proxy.
1473
+ # @param vm_machine_type [::String]
1474
+ # Required. The type of the Compute instance that will host the proxy.
1475
+ # @param vm_zone [::String]
1476
+ # Optional. The Google Cloud Platform zone to create the VM in. The fully
1477
+ # qualified name of the zone must be specified, including the region name,
1478
+ # for example "us-central1-b". If not specified, uses the "-b" zone of the
1479
+ # destination Connection Profile's region.
1480
+ # @param vm_subnet [::String]
1481
+ # Required. The name of the subnet the Compute instance will use for private
1482
+ # connectivity. Must be supplied in the form of
1483
+ # projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}.
1484
+ # Note: the region for the subnet must match the Compute instance region.
1485
+ #
1486
+ # @yield [response, operation] Access the result along with the RPC operation
1487
+ # @yieldparam response [::Google::Cloud::CloudDMS::V1::TcpProxyScript]
1488
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1489
+ #
1490
+ # @return [::Google::Cloud::CloudDMS::V1::TcpProxyScript]
1491
+ #
1492
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1493
+ #
1494
+ # @example Basic example
1495
+ # require "google/cloud/cloud_dms/v1"
1496
+ #
1497
+ # # Create a client object. The client can be reused for multiple calls.
1498
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1499
+ #
1500
+ # # Create a request. To set request fields, pass in keyword arguments.
1501
+ # request = Google::Cloud::CloudDMS::V1::GenerateTcpProxyScriptRequest.new
1502
+ #
1503
+ # # Call the generate_tcp_proxy_script method.
1504
+ # result = client.generate_tcp_proxy_script request
1505
+ #
1506
+ # # The returned object is of type Google::Cloud::CloudDMS::V1::TcpProxyScript.
1507
+ # p result
1508
+ #
1509
+ def generate_tcp_proxy_script request, options = nil
1510
+ raise ::ArgumentError, "request must be provided" if request.nil?
1511
+
1512
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::GenerateTcpProxyScriptRequest
1513
+
1514
+ # Converts hash and nil to an options object
1515
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1516
+
1517
+ # Customize the options with defaults
1518
+ metadata = @config.rpcs.generate_tcp_proxy_script.metadata.to_h
1519
+
1520
+ # Set x-goog-api-client and x-goog-user-project headers
1521
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1522
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1523
+ gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
1524
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1525
+
1526
+ header_params = {}
1527
+ if request.migration_job
1528
+ header_params["migration_job"] = request.migration_job
1529
+ end
1530
+
1531
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1532
+ metadata[:"x-goog-request-params"] ||= request_params_header
1533
+
1534
+ options.apply_defaults timeout: @config.rpcs.generate_tcp_proxy_script.timeout,
1535
+ metadata: metadata,
1536
+ retry_policy: @config.rpcs.generate_tcp_proxy_script.retry_policy
1537
+
1538
+ options.apply_defaults timeout: @config.timeout,
1539
+ metadata: @config.metadata,
1540
+ retry_policy: @config.retry_policy
1541
+
1542
+ @data_migration_service_stub.call_rpc :generate_tcp_proxy_script, request, options: options do |response, operation|
1543
+ yield response, operation if block_given?
1544
+ return response
1545
+ end
1546
+ rescue ::GRPC::BadStatus => e
1547
+ raise ::Google::Cloud::Error.from_error(e)
1548
+ end
1549
+
1437
1550
  ##
1438
1551
  # Retrieves a list of all connection profiles in a given project and
1439
1552
  # location.
@@ -2783,7 +2896,7 @@ module Google
2783
2896
  # @param options [::Gapic::CallOptions, ::Hash]
2784
2897
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2785
2898
  #
2786
- # @overload delete_conversion_workspace(name: nil, request_id: nil)
2899
+ # @overload delete_conversion_workspace(name: nil, request_id: nil, force: nil)
2787
2900
  # Pass arguments to `delete_conversion_workspace` via keyword arguments. Note that at
2788
2901
  # least one keyword argument is required. To specify no parameters, or to keep all
2789
2902
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -2798,6 +2911,9 @@ module Google
2798
2911
  #
2799
2912
  # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
2800
2913
  # (_), and hyphens (-). The maximum length is 40 characters.
2914
+ # @param force [::Boolean]
2915
+ # Force delete the conversion workspace, even if there's a running migration
2916
+ # that is using the workspace.
2801
2917
  #
2802
2918
  # @yield [response, operation] Access the result along with the RPC operation
2803
2919
  # @yieldparam response [::Gapic::Operation]
@@ -2871,6 +2987,390 @@ module Google
2871
2987
  raise ::Google::Cloud::Error.from_error(e)
2872
2988
  end
2873
2989
 
2990
+ ##
2991
+ # Creates a new mapping rule for a given conversion workspace.
2992
+ #
2993
+ # @overload create_mapping_rule(request, options = nil)
2994
+ # Pass arguments to `create_mapping_rule` via a request object, either of type
2995
+ # {::Google::Cloud::CloudDMS::V1::CreateMappingRuleRequest} or an equivalent Hash.
2996
+ #
2997
+ # @param request [::Google::Cloud::CloudDMS::V1::CreateMappingRuleRequest, ::Hash]
2998
+ # A request object representing the call parameters. Required. To specify no
2999
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3000
+ # @param options [::Gapic::CallOptions, ::Hash]
3001
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3002
+ #
3003
+ # @overload create_mapping_rule(parent: nil, mapping_rule_id: nil, mapping_rule: nil, request_id: nil)
3004
+ # Pass arguments to `create_mapping_rule` via keyword arguments. Note that at
3005
+ # least one keyword argument is required. To specify no parameters, or to keep all
3006
+ # the default parameter values, pass an empty Hash as a request object (see above).
3007
+ #
3008
+ # @param parent [::String]
3009
+ # Required. The parent which owns this collection of mapping rules.
3010
+ # @param mapping_rule_id [::String]
3011
+ # Required. The ID of the rule to create.
3012
+ # @param mapping_rule [::Google::Cloud::CloudDMS::V1::MappingRule, ::Hash]
3013
+ # Required. Represents a [mapping rule]
3014
+ # (https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules)
3015
+ # object.
3016
+ # @param request_id [::String]
3017
+ # A unique ID used to identify the request. If the server receives two
3018
+ # requests with the same ID, then the second request is ignored.
3019
+ #
3020
+ # It is recommended to always set this value to a UUID.
3021
+ #
3022
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
3023
+ # (_), and hyphens (-). The maximum length is 40 characters.
3024
+ #
3025
+ # @yield [response, operation] Access the result along with the RPC operation
3026
+ # @yieldparam response [::Google::Cloud::CloudDMS::V1::MappingRule]
3027
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3028
+ #
3029
+ # @return [::Google::Cloud::CloudDMS::V1::MappingRule]
3030
+ #
3031
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3032
+ #
3033
+ # @example Basic example
3034
+ # require "google/cloud/cloud_dms/v1"
3035
+ #
3036
+ # # Create a client object. The client can be reused for multiple calls.
3037
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
3038
+ #
3039
+ # # Create a request. To set request fields, pass in keyword arguments.
3040
+ # request = Google::Cloud::CloudDMS::V1::CreateMappingRuleRequest.new
3041
+ #
3042
+ # # Call the create_mapping_rule method.
3043
+ # result = client.create_mapping_rule request
3044
+ #
3045
+ # # The returned object is of type Google::Cloud::CloudDMS::V1::MappingRule.
3046
+ # p result
3047
+ #
3048
+ def create_mapping_rule request, options = nil
3049
+ raise ::ArgumentError, "request must be provided" if request.nil?
3050
+
3051
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::CreateMappingRuleRequest
3052
+
3053
+ # Converts hash and nil to an options object
3054
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3055
+
3056
+ # Customize the options with defaults
3057
+ metadata = @config.rpcs.create_mapping_rule.metadata.to_h
3058
+
3059
+ # Set x-goog-api-client and x-goog-user-project headers
3060
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3061
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3062
+ gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
3063
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3064
+
3065
+ header_params = {}
3066
+ if request.parent
3067
+ header_params["parent"] = request.parent
3068
+ end
3069
+
3070
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3071
+ metadata[:"x-goog-request-params"] ||= request_params_header
3072
+
3073
+ options.apply_defaults timeout: @config.rpcs.create_mapping_rule.timeout,
3074
+ metadata: metadata,
3075
+ retry_policy: @config.rpcs.create_mapping_rule.retry_policy
3076
+
3077
+ options.apply_defaults timeout: @config.timeout,
3078
+ metadata: @config.metadata,
3079
+ retry_policy: @config.retry_policy
3080
+
3081
+ @data_migration_service_stub.call_rpc :create_mapping_rule, request, options: options do |response, operation|
3082
+ yield response, operation if block_given?
3083
+ return response
3084
+ end
3085
+ rescue ::GRPC::BadStatus => e
3086
+ raise ::Google::Cloud::Error.from_error(e)
3087
+ end
3088
+
3089
+ ##
3090
+ # Deletes a single mapping rule.
3091
+ #
3092
+ # @overload delete_mapping_rule(request, options = nil)
3093
+ # Pass arguments to `delete_mapping_rule` via a request object, either of type
3094
+ # {::Google::Cloud::CloudDMS::V1::DeleteMappingRuleRequest} or an equivalent Hash.
3095
+ #
3096
+ # @param request [::Google::Cloud::CloudDMS::V1::DeleteMappingRuleRequest, ::Hash]
3097
+ # A request object representing the call parameters. Required. To specify no
3098
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3099
+ # @param options [::Gapic::CallOptions, ::Hash]
3100
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3101
+ #
3102
+ # @overload delete_mapping_rule(name: nil, request_id: nil)
3103
+ # Pass arguments to `delete_mapping_rule` via keyword arguments. Note that at
3104
+ # least one keyword argument is required. To specify no parameters, or to keep all
3105
+ # the default parameter values, pass an empty Hash as a request object (see above).
3106
+ #
3107
+ # @param name [::String]
3108
+ # Required. Name of the mapping rule resource to delete.
3109
+ # @param request_id [::String]
3110
+ # Optional. A unique ID used to identify the request. If the server receives
3111
+ # two requests with the same ID, then the second request is ignored.
3112
+ #
3113
+ # It is recommended to always set this value to a UUID.
3114
+ #
3115
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
3116
+ # (_), and hyphens (-). The maximum length is 40 characters.
3117
+ #
3118
+ # @yield [response, operation] Access the result along with the RPC operation
3119
+ # @yieldparam response [::Google::Protobuf::Empty]
3120
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3121
+ #
3122
+ # @return [::Google::Protobuf::Empty]
3123
+ #
3124
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3125
+ #
3126
+ # @example Basic example
3127
+ # require "google/cloud/cloud_dms/v1"
3128
+ #
3129
+ # # Create a client object. The client can be reused for multiple calls.
3130
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
3131
+ #
3132
+ # # Create a request. To set request fields, pass in keyword arguments.
3133
+ # request = Google::Cloud::CloudDMS::V1::DeleteMappingRuleRequest.new
3134
+ #
3135
+ # # Call the delete_mapping_rule method.
3136
+ # result = client.delete_mapping_rule request
3137
+ #
3138
+ # # The returned object is of type Google::Protobuf::Empty.
3139
+ # p result
3140
+ #
3141
+ def delete_mapping_rule request, options = nil
3142
+ raise ::ArgumentError, "request must be provided" if request.nil?
3143
+
3144
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::DeleteMappingRuleRequest
3145
+
3146
+ # Converts hash and nil to an options object
3147
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3148
+
3149
+ # Customize the options with defaults
3150
+ metadata = @config.rpcs.delete_mapping_rule.metadata.to_h
3151
+
3152
+ # Set x-goog-api-client and x-goog-user-project headers
3153
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3154
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3155
+ gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
3156
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3157
+
3158
+ header_params = {}
3159
+ if request.name
3160
+ header_params["name"] = request.name
3161
+ end
3162
+
3163
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3164
+ metadata[:"x-goog-request-params"] ||= request_params_header
3165
+
3166
+ options.apply_defaults timeout: @config.rpcs.delete_mapping_rule.timeout,
3167
+ metadata: metadata,
3168
+ retry_policy: @config.rpcs.delete_mapping_rule.retry_policy
3169
+
3170
+ options.apply_defaults timeout: @config.timeout,
3171
+ metadata: @config.metadata,
3172
+ retry_policy: @config.retry_policy
3173
+
3174
+ @data_migration_service_stub.call_rpc :delete_mapping_rule, request, options: options do |response, operation|
3175
+ yield response, operation if block_given?
3176
+ return response
3177
+ end
3178
+ rescue ::GRPC::BadStatus => e
3179
+ raise ::Google::Cloud::Error.from_error(e)
3180
+ end
3181
+
3182
+ ##
3183
+ # Lists the mapping rules for a specific conversion workspace.
3184
+ #
3185
+ # @overload list_mapping_rules(request, options = nil)
3186
+ # Pass arguments to `list_mapping_rules` via a request object, either of type
3187
+ # {::Google::Cloud::CloudDMS::V1::ListMappingRulesRequest} or an equivalent Hash.
3188
+ #
3189
+ # @param request [::Google::Cloud::CloudDMS::V1::ListMappingRulesRequest, ::Hash]
3190
+ # A request object representing the call parameters. Required. To specify no
3191
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3192
+ # @param options [::Gapic::CallOptions, ::Hash]
3193
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3194
+ #
3195
+ # @overload list_mapping_rules(parent: nil, page_size: nil, page_token: nil)
3196
+ # Pass arguments to `list_mapping_rules` via keyword arguments. Note that at
3197
+ # least one keyword argument is required. To specify no parameters, or to keep all
3198
+ # the default parameter values, pass an empty Hash as a request object (see above).
3199
+ #
3200
+ # @param parent [::String]
3201
+ # Required. Name of the conversion workspace resource whose mapping rules are
3202
+ # listed in the form of:
3203
+ # projects/\\{project}/locations/\\{location}/conversionWorkspaces/\\{conversion_workspace}.
3204
+ # @param page_size [::Integer]
3205
+ # The maximum number of rules to return. The service may return
3206
+ # fewer than this value.
3207
+ # @param page_token [::String]
3208
+ # The nextPageToken value received in the previous call to
3209
+ # mappingRules.list, used in the subsequent request to retrieve the next
3210
+ # page of results. On first call this should be left blank. When paginating,
3211
+ # all other parameters provided to mappingRules.list must match the call
3212
+ # that provided the page token.
3213
+ #
3214
+ # @yield [response, operation] Access the result along with the RPC operation
3215
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MappingRule>]
3216
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3217
+ #
3218
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MappingRule>]
3219
+ #
3220
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3221
+ #
3222
+ # @example Basic example
3223
+ # require "google/cloud/cloud_dms/v1"
3224
+ #
3225
+ # # Create a client object. The client can be reused for multiple calls.
3226
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
3227
+ #
3228
+ # # Create a request. To set request fields, pass in keyword arguments.
3229
+ # request = Google::Cloud::CloudDMS::V1::ListMappingRulesRequest.new
3230
+ #
3231
+ # # Call the list_mapping_rules method.
3232
+ # result = client.list_mapping_rules request
3233
+ #
3234
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3235
+ # # over elements, and API calls will be issued to fetch pages as needed.
3236
+ # result.each do |item|
3237
+ # # Each element is of type ::Google::Cloud::CloudDMS::V1::MappingRule.
3238
+ # p item
3239
+ # end
3240
+ #
3241
+ def list_mapping_rules request, options = nil
3242
+ raise ::ArgumentError, "request must be provided" if request.nil?
3243
+
3244
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::ListMappingRulesRequest
3245
+
3246
+ # Converts hash and nil to an options object
3247
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3248
+
3249
+ # Customize the options with defaults
3250
+ metadata = @config.rpcs.list_mapping_rules.metadata.to_h
3251
+
3252
+ # Set x-goog-api-client and x-goog-user-project headers
3253
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3254
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3255
+ gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
3256
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3257
+
3258
+ header_params = {}
3259
+ if request.parent
3260
+ header_params["parent"] = request.parent
3261
+ end
3262
+
3263
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3264
+ metadata[:"x-goog-request-params"] ||= request_params_header
3265
+
3266
+ options.apply_defaults timeout: @config.rpcs.list_mapping_rules.timeout,
3267
+ metadata: metadata,
3268
+ retry_policy: @config.rpcs.list_mapping_rules.retry_policy
3269
+
3270
+ options.apply_defaults timeout: @config.timeout,
3271
+ metadata: @config.metadata,
3272
+ retry_policy: @config.retry_policy
3273
+
3274
+ @data_migration_service_stub.call_rpc :list_mapping_rules, request, options: options do |response, operation|
3275
+ response = ::Gapic::PagedEnumerable.new @data_migration_service_stub, :list_mapping_rules, request, response, operation, options
3276
+ yield response, operation if block_given?
3277
+ return response
3278
+ end
3279
+ rescue ::GRPC::BadStatus => e
3280
+ raise ::Google::Cloud::Error.from_error(e)
3281
+ end
3282
+
3283
+ ##
3284
+ # Gets the details of a mapping rule.
3285
+ #
3286
+ # @overload get_mapping_rule(request, options = nil)
3287
+ # Pass arguments to `get_mapping_rule` via a request object, either of type
3288
+ # {::Google::Cloud::CloudDMS::V1::GetMappingRuleRequest} or an equivalent Hash.
3289
+ #
3290
+ # @param request [::Google::Cloud::CloudDMS::V1::GetMappingRuleRequest, ::Hash]
3291
+ # A request object representing the call parameters. Required. To specify no
3292
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3293
+ # @param options [::Gapic::CallOptions, ::Hash]
3294
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3295
+ #
3296
+ # @overload get_mapping_rule(name: nil)
3297
+ # Pass arguments to `get_mapping_rule` via keyword arguments. Note that at
3298
+ # least one keyword argument is required. To specify no parameters, or to keep all
3299
+ # the default parameter values, pass an empty Hash as a request object (see above).
3300
+ #
3301
+ # @param name [::String]
3302
+ # Required. Name of the mapping rule resource to get.
3303
+ # Example: conversionWorkspaces/123/mappingRules/rule123
3304
+ #
3305
+ # In order to retrieve a previous revision of the mapping rule, also provide
3306
+ # the revision ID.
3307
+ # Example:
3308
+ # conversionWorkspace/123/mappingRules/rule123@c7cfa2a8c7cfa2a8c7cfa2a8c7cfa2a8
3309
+ #
3310
+ # @yield [response, operation] Access the result along with the RPC operation
3311
+ # @yieldparam response [::Google::Cloud::CloudDMS::V1::MappingRule]
3312
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3313
+ #
3314
+ # @return [::Google::Cloud::CloudDMS::V1::MappingRule]
3315
+ #
3316
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3317
+ #
3318
+ # @example Basic example
3319
+ # require "google/cloud/cloud_dms/v1"
3320
+ #
3321
+ # # Create a client object. The client can be reused for multiple calls.
3322
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
3323
+ #
3324
+ # # Create a request. To set request fields, pass in keyword arguments.
3325
+ # request = Google::Cloud::CloudDMS::V1::GetMappingRuleRequest.new
3326
+ #
3327
+ # # Call the get_mapping_rule method.
3328
+ # result = client.get_mapping_rule request
3329
+ #
3330
+ # # The returned object is of type Google::Cloud::CloudDMS::V1::MappingRule.
3331
+ # p result
3332
+ #
3333
+ def get_mapping_rule request, options = nil
3334
+ raise ::ArgumentError, "request must be provided" if request.nil?
3335
+
3336
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::GetMappingRuleRequest
3337
+
3338
+ # Converts hash and nil to an options object
3339
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3340
+
3341
+ # Customize the options with defaults
3342
+ metadata = @config.rpcs.get_mapping_rule.metadata.to_h
3343
+
3344
+ # Set x-goog-api-client and x-goog-user-project headers
3345
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3346
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3347
+ gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
3348
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3349
+
3350
+ header_params = {}
3351
+ if request.name
3352
+ header_params["name"] = request.name
3353
+ end
3354
+
3355
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3356
+ metadata[:"x-goog-request-params"] ||= request_params_header
3357
+
3358
+ options.apply_defaults timeout: @config.rpcs.get_mapping_rule.timeout,
3359
+ metadata: metadata,
3360
+ retry_policy: @config.rpcs.get_mapping_rule.retry_policy
3361
+
3362
+ options.apply_defaults timeout: @config.timeout,
3363
+ metadata: @config.metadata,
3364
+ retry_policy: @config.retry_policy
3365
+
3366
+ @data_migration_service_stub.call_rpc :get_mapping_rule, request, options: options do |response, operation|
3367
+ yield response, operation if block_given?
3368
+ return response
3369
+ end
3370
+ rescue ::GRPC::BadStatus => e
3371
+ raise ::Google::Cloud::Error.from_error(e)
3372
+ end
3373
+
2874
3374
  ##
2875
3375
  # Imports a snapshot of the source database into the
2876
3376
  # conversion workspace.
@@ -2898,9 +3398,10 @@ module Google
2898
3398
  # Should the conversion workspace be committed automatically after the
2899
3399
  # seed operation.
2900
3400
  # @param source_connection_profile [::String]
2901
- # Fully qualified (Uri) name of the source connection profile.
3401
+ # Optional. Fully qualified (Uri) name of the source connection profile.
2902
3402
  # @param destination_connection_profile [::String]
2903
- # Fully qualified (Uri) name of the destination connection profile.
3403
+ # Optional. Fully qualified (Uri) name of the destination connection
3404
+ # profile.
2904
3405
  #
2905
3406
  # @yield [response, operation] Access the result along with the RPC operation
2906
3407
  # @yieldparam response [::Gapic::Operation]
@@ -2998,12 +3499,12 @@ module Google
2998
3499
  # in the form of:
2999
3500
  # projects/\\{project}/locations/\\{location}/conversionWorkspaces/\\{conversion_workspace}.
3000
3501
  # @param rules_format [::Google::Cloud::CloudDMS::V1::ImportRulesFileFormat]
3001
- # The format of the rules content file.
3502
+ # Required. The format of the rules content file.
3002
3503
  # @param rules_files [::Array<::Google::Cloud::CloudDMS::V1::ImportMappingRulesRequest::RulesFile, ::Hash>]
3003
- # One or more rules files.
3504
+ # Required. One or more rules files.
3004
3505
  # @param auto_commit [::Boolean]
3005
- # Should the conversion workspace be committed automatically after the
3006
- # import operation.
3506
+ # Required. Should the conversion workspace be committed automatically after
3507
+ # the import operation.
3007
3508
  #
3008
3509
  # @yield [response, operation] Access the result along with the RPC operation
3009
3510
  # @yieldparam response [::Gapic::Operation]
@@ -3090,7 +3591,7 @@ module Google
3090
3591
  # @param options [::Gapic::CallOptions, ::Hash]
3091
3592
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3092
3593
  #
3093
- # @overload convert_conversion_workspace(name: nil, auto_commit: nil, filter: nil)
3594
+ # @overload convert_conversion_workspace(name: nil, auto_commit: nil, filter: nil, convert_full_path: nil)
3094
3595
  # Pass arguments to `convert_conversion_workspace` via keyword arguments. Note that at
3095
3596
  # least one keyword argument is required. To specify no parameters, or to keep all
3096
3597
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -3099,11 +3600,15 @@ module Google
3099
3600
  # Name of the conversion workspace resource to convert in the form of:
3100
3601
  # projects/\\{project}/locations/\\{location}/conversionWorkspaces/\\{conversion_workspace}.
3101
3602
  # @param auto_commit [::Boolean]
3102
- # Specifies whether the conversion workspace is to be committed automatically
3103
- # after the conversion.
3603
+ # Optional. Specifies whether the conversion workspace is to be committed
3604
+ # automatically after the conversion.
3104
3605
  # @param filter [::String]
3105
- # Filter the entities to convert. Leaving this field empty will convert all
3106
- # of the entities. Supports Google AIP-160 style filtering.
3606
+ # Optional. Filter the entities to convert. Leaving this field empty will
3607
+ # convert all of the entities. Supports Google AIP-160 style filtering.
3608
+ # @param convert_full_path [::Boolean]
3609
+ # Optional. Automatically convert the full entity path for each entity
3610
+ # specified by the filter. For example, if the filter specifies a table, that
3611
+ # table schema (and database if there is one) will also be converted.
3107
3612
  #
3108
3613
  # @yield [response, operation] Access the result along with the RPC operation
3109
3614
  # @yieldparam response [::Gapic::Operation]
@@ -3378,7 +3883,7 @@ module Google
3378
3883
  # @param options [::Gapic::CallOptions, ::Hash]
3379
3884
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3380
3885
  #
3381
- # @overload apply_conversion_workspace(name: nil, filter: nil, connection_profile: nil)
3886
+ # @overload apply_conversion_workspace(name: nil, filter: nil, dry_run: nil, auto_commit: nil, connection_profile: nil)
3382
3887
  # Pass arguments to `apply_conversion_workspace` via keyword arguments. Note that at
3383
3888
  # least one keyword argument is required. To specify no parameters, or to keep all
3384
3889
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -3390,8 +3895,16 @@ module Google
3390
3895
  # @param filter [::String]
3391
3896
  # Filter which entities to apply. Leaving this field empty will apply all of
3392
3897
  # the entities. Supports Google AIP 160 based filtering.
3898
+ # @param dry_run [::Boolean]
3899
+ # Optional. Only validates the apply process, but doesn't change the
3900
+ # destination database. Only works for PostgreSQL destination connection
3901
+ # profile.
3902
+ # @param auto_commit [::Boolean]
3903
+ # Optional. Specifies whether the conversion workspace is to be committed
3904
+ # automatically after the apply.
3393
3905
  # @param connection_profile [::String]
3394
- # Fully qualified (Uri) name of the destination connection profile.
3906
+ # Optional. Fully qualified (Uri) name of the destination connection
3907
+ # profile.
3395
3908
  #
3396
3909
  # @yield [response, operation] Access the result along with the RPC operation
3397
3910
  # @yieldparam response [::Gapic::Operation]
@@ -3483,7 +3996,7 @@ module Google
3483
3996
  # @param options [::Gapic::CallOptions, ::Hash]
3484
3997
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3485
3998
  #
3486
- # @overload describe_database_entities(conversion_workspace: nil, page_size: nil, page_token: nil, tree: nil, uncommitted: nil, commit_id: nil, filter: nil)
3999
+ # @overload describe_database_entities(conversion_workspace: nil, page_size: nil, page_token: nil, tree: nil, uncommitted: nil, commit_id: nil, filter: nil, view: nil)
3487
4000
  # Pass arguments to `describe_database_entities` via keyword arguments. Note that at
3488
4001
  # least one keyword argument is required. To specify no parameters, or to keep all
3489
4002
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -3493,25 +4006,28 @@ module Google
3493
4006
  # are described. Must be in the form of:
3494
4007
  # projects/\\{project}/locations/\\{location}/conversionWorkspaces/\\{conversion_workspace}.
3495
4008
  # @param page_size [::Integer]
3496
- # The maximum number of entities to return. The service may return
4009
+ # Optional. The maximum number of entities to return. The service may return
3497
4010
  # fewer entities than the value specifies.
3498
4011
  # @param page_token [::String]
3499
- # The nextPageToken value received in the previous call to
4012
+ # Optional. The nextPageToken value received in the previous call to
3500
4013
  # conversionWorkspace.describeDatabaseEntities, used in the subsequent
3501
4014
  # request to retrieve the next page of results. On first call this should be
3502
4015
  # left blank. When paginating, all other parameters provided to
3503
4016
  # conversionWorkspace.describeDatabaseEntities must match the call that
3504
4017
  # provided the page token.
3505
4018
  # @param tree [::Google::Cloud::CloudDMS::V1::DescribeDatabaseEntitiesRequest::DBTreeType]
3506
- # The tree to fetch.
4019
+ # Required. The tree to fetch.
3507
4020
  # @param uncommitted [::Boolean]
3508
- # Whether to retrieve the latest committed version of the entities or the
3509
- # latest version. This field is ignored if a specific commit_id is specified.
4021
+ # Optional. Whether to retrieve the latest committed version of the entities
4022
+ # or the latest version. This field is ignored if a specific commit_id is
4023
+ # specified.
3510
4024
  # @param commit_id [::String]
3511
- # Request a specific commit ID. If not specified, the entities from the
3512
- # latest commit are returned.
4025
+ # Optional. Request a specific commit ID. If not specified, the entities from
4026
+ # the latest commit are returned.
3513
4027
  # @param filter [::String]
3514
- # Filter the returned entities based on AIP-160 standard.
4028
+ # Optional. Filter the returned entities based on AIP-160 standard.
4029
+ # @param view [::Google::Cloud::CloudDMS::V1::DatabaseEntityView]
4030
+ # Optional. Results view based on AIP-157
3515
4031
  #
3516
4032
  # @yield [response, operation] Access the result along with the RPC operation
3517
4033
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::DatabaseEntity>]
@@ -3984,6 +4500,14 @@ module Google
3984
4500
  end
3985
4501
  end
3986
4502
 
4503
+ ##
4504
+ # Configuration for the channel pool
4505
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
4506
+ #
4507
+ def channel_pool
4508
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
4509
+ end
4510
+
3987
4511
  ##
3988
4512
  # Configuration RPC class for the DataMigrationService API.
3989
4513
  #
@@ -4063,6 +4587,11 @@ module Google
4063
4587
  #
4064
4588
  attr_reader :generate_ssh_script
4065
4589
  ##
4590
+ # RPC-specific configuration for `generate_tcp_proxy_script`
4591
+ # @return [::Gapic::Config::Method]
4592
+ #
4593
+ attr_reader :generate_tcp_proxy_script
4594
+ ##
4066
4595
  # RPC-specific configuration for `list_connection_profiles`
4067
4596
  # @return [::Gapic::Config::Method]
4068
4597
  #
@@ -4133,6 +4662,26 @@ module Google
4133
4662
  #
4134
4663
  attr_reader :delete_conversion_workspace
4135
4664
  ##
4665
+ # RPC-specific configuration for `create_mapping_rule`
4666
+ # @return [::Gapic::Config::Method]
4667
+ #
4668
+ attr_reader :create_mapping_rule
4669
+ ##
4670
+ # RPC-specific configuration for `delete_mapping_rule`
4671
+ # @return [::Gapic::Config::Method]
4672
+ #
4673
+ attr_reader :delete_mapping_rule
4674
+ ##
4675
+ # RPC-specific configuration for `list_mapping_rules`
4676
+ # @return [::Gapic::Config::Method]
4677
+ #
4678
+ attr_reader :list_mapping_rules
4679
+ ##
4680
+ # RPC-specific configuration for `get_mapping_rule`
4681
+ # @return [::Gapic::Config::Method]
4682
+ #
4683
+ attr_reader :get_mapping_rule
4684
+ ##
4136
4685
  # RPC-specific configuration for `seed_conversion_workspace`
4137
4686
  # @return [::Gapic::Config::Method]
4138
4687
  #
@@ -4209,6 +4758,8 @@ module Google
4209
4758
  @restart_migration_job = ::Gapic::Config::Method.new restart_migration_job_config
4210
4759
  generate_ssh_script_config = parent_rpcs.generate_ssh_script if parent_rpcs.respond_to? :generate_ssh_script
4211
4760
  @generate_ssh_script = ::Gapic::Config::Method.new generate_ssh_script_config
4761
+ generate_tcp_proxy_script_config = parent_rpcs.generate_tcp_proxy_script if parent_rpcs.respond_to? :generate_tcp_proxy_script
4762
+ @generate_tcp_proxy_script = ::Gapic::Config::Method.new generate_tcp_proxy_script_config
4212
4763
  list_connection_profiles_config = parent_rpcs.list_connection_profiles if parent_rpcs.respond_to? :list_connection_profiles
4213
4764
  @list_connection_profiles = ::Gapic::Config::Method.new list_connection_profiles_config
4214
4765
  get_connection_profile_config = parent_rpcs.get_connection_profile if parent_rpcs.respond_to? :get_connection_profile
@@ -4237,6 +4788,14 @@ module Google
4237
4788
  @update_conversion_workspace = ::Gapic::Config::Method.new update_conversion_workspace_config
4238
4789
  delete_conversion_workspace_config = parent_rpcs.delete_conversion_workspace if parent_rpcs.respond_to? :delete_conversion_workspace
4239
4790
  @delete_conversion_workspace = ::Gapic::Config::Method.new delete_conversion_workspace_config
4791
+ create_mapping_rule_config = parent_rpcs.create_mapping_rule if parent_rpcs.respond_to? :create_mapping_rule
4792
+ @create_mapping_rule = ::Gapic::Config::Method.new create_mapping_rule_config
4793
+ delete_mapping_rule_config = parent_rpcs.delete_mapping_rule if parent_rpcs.respond_to? :delete_mapping_rule
4794
+ @delete_mapping_rule = ::Gapic::Config::Method.new delete_mapping_rule_config
4795
+ list_mapping_rules_config = parent_rpcs.list_mapping_rules if parent_rpcs.respond_to? :list_mapping_rules
4796
+ @list_mapping_rules = ::Gapic::Config::Method.new list_mapping_rules_config
4797
+ get_mapping_rule_config = parent_rpcs.get_mapping_rule if parent_rpcs.respond_to? :get_mapping_rule
4798
+ @get_mapping_rule = ::Gapic::Config::Method.new get_mapping_rule_config
4240
4799
  seed_conversion_workspace_config = parent_rpcs.seed_conversion_workspace if parent_rpcs.respond_to? :seed_conversion_workspace
4241
4800
  @seed_conversion_workspace = ::Gapic::Config::Method.new seed_conversion_workspace_config
4242
4801
  import_mapping_rules_config = parent_rpcs.import_mapping_rules if parent_rpcs.respond_to? :import_mapping_rules