lib/google/cloud/compute/v1/projects/rest/client.rb in google-cloud-compute-v1-2.9.0 vs lib/google/cloud/compute/v1/projects/rest/client.rb in google-cloud-compute-v1-2.10.0
- old
+ new
@@ -95,10 +95,12 @@
default_config.rpcs.move_disk.timeout = 600.0
default_config.rpcs.move_instance.timeout = 600.0
+ default_config.rpcs.set_cloud_armor_tier.timeout = 600.0
+
default_config.rpcs.set_common_instance_metadata.timeout = 600.0
default_config.rpcs.set_default_network_tier.timeout = 600.0
default_config.rpcs.set_usage_export_bucket.timeout = 600.0
@@ -740,11 +742,11 @@
# @param page_token [::String]
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
# @param project [::String]
# Project ID for this request.
# @param return_partial_success [::Boolean]
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::XpnResourceId>]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::XpnResourceId>]
@@ -831,11 +833,11 @@
# @param project [::String]
# Project ID for this request.
# @param projects_list_xpn_hosts_request_resource [::Google::Cloud::Compute::V1::ProjectsListXpnHostsRequest, ::Hash]
# The body resource for this request
# @param return_partial_success [::Boolean]
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Project>]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Project>]
@@ -1072,10 +1074,100 @@
rescue ::Gapic::Rest::Error => e
raise ::Google::Cloud::Error.from_error(e)
end
##
+ # Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information.
+ #
+ # @overload set_cloud_armor_tier(request, options = nil)
+ # Pass arguments to `set_cloud_armor_tier` via a request object, either of type
+ # {::Google::Cloud::Compute::V1::SetCloudArmorTierProjectRequest} or an equivalent Hash.
+ #
+ # @param request [::Google::Cloud::Compute::V1::SetCloudArmorTierProjectRequest, ::Hash]
+ # A request object representing the call parameters. Required. To specify no
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
+ # @param options [::Gapic::CallOptions, ::Hash]
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
+ #
+ # @overload set_cloud_armor_tier(project: nil, projects_set_cloud_armor_tier_request_resource: nil, request_id: nil)
+ # Pass arguments to `set_cloud_armor_tier` via keyword arguments. Note that at
+ # least one keyword argument is required. To specify no parameters, or to keep all
+ # the default parameter values, pass an empty Hash as a request object (see above).
+ #
+ # @param project [::String]
+ # Project ID for this request.
+ # @param projects_set_cloud_armor_tier_request_resource [::Google::Cloud::Compute::V1::ProjectsSetCloudArmorTierRequest, ::Hash]
+ # The body resource for this request
+ # @param request_id [::String]
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ # @yield [result, operation] Access the result along with the TransportOperation object
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
+ #
+ # @return [::Gapic::GenericLRO::Operation]
+ #
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
+ #
+ # @example Basic example
+ # require "google/cloud/compute/v1"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Cloud::Compute::V1::Projects::Rest::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Compute::V1::SetCloudArmorTierProjectRequest.new
+ #
+ # # Call the set_cloud_armor_tier method.
+ # result = client.set_cloud_armor_tier request
+ #
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
+ # p result
+ #
+ def set_cloud_armor_tier request, options = nil
+ raise ::ArgumentError, "request must be provided" if request.nil?
+
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetCloudArmorTierProjectRequest
+
+ # Converts hash and nil to an options object
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
+
+ # Customize the options with defaults
+ call_metadata = @config.rpcs.set_cloud_armor_tier.metadata.to_h
+
+ # Set x-goog-api-client and x-goog-user-project headers
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
+ transports_version_send: [:rest]
+
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
+
+ options.apply_defaults timeout: @config.rpcs.set_cloud_armor_tier.timeout,
+ metadata: call_metadata,
+ retry_policy: @config.rpcs.set_cloud_armor_tier.retry_policy
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
+ retry_policy: @config.retry_policy
+
+ @projects_stub.set_cloud_armor_tier request, options do |result, response|
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
+ operation: result,
+ client: global_operations,
+ request_values: {
+ "project" => request.project
+ },
+ options: options
+ )
+ yield result, response if block_given?
+ return result
+ end
+ rescue ::Gapic::Rest::Error => e
+ raise ::Google::Cloud::Error.from_error(e)
+ end
+
+ ##
# Sets metadata common to all instances within the specified project using the data included in the request.
#
# @overload set_common_instance_metadata(request, options = nil)
# Pass arguments to `set_common_instance_metadata` via a request object, either of type
# {::Google::Cloud::Compute::V1::SetCommonInstanceMetadataProjectRequest} or an equivalent Hash.
@@ -1525,10 +1617,15 @@
# RPC-specific configuration for `move_instance`
# @return [::Gapic::Config::Method]
#
attr_reader :move_instance
##
+ # RPC-specific configuration for `set_cloud_armor_tier`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_cloud_armor_tier
+ ##
# RPC-specific configuration for `set_common_instance_metadata`
# @return [::Gapic::Config::Method]
#
attr_reader :set_common_instance_metadata
##
@@ -1562,9 +1659,11 @@
@list_xpn_hosts = ::Gapic::Config::Method.new list_xpn_hosts_config
move_disk_config = parent_rpcs.move_disk if parent_rpcs.respond_to? :move_disk
@move_disk = ::Gapic::Config::Method.new move_disk_config
move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance
@move_instance = ::Gapic::Config::Method.new move_instance_config
+ set_cloud_armor_tier_config = parent_rpcs.set_cloud_armor_tier if parent_rpcs.respond_to? :set_cloud_armor_tier
+ @set_cloud_armor_tier = ::Gapic::Config::Method.new set_cloud_armor_tier_config
set_common_instance_metadata_config = parent_rpcs.set_common_instance_metadata if parent_rpcs.respond_to? :set_common_instance_metadata
@set_common_instance_metadata = ::Gapic::Config::Method.new set_common_instance_metadata_config
set_default_network_tier_config = parent_rpcs.set_default_network_tier if parent_rpcs.respond_to? :set_default_network_tier
@set_default_network_tier = ::Gapic::Config::Method.new set_default_network_tier_config
set_usage_export_bucket_config = parent_rpcs.set_usage_export_bucket if parent_rpcs.respond_to? :set_usage_export_bucket