@@ -141,6 +141,8 @@ def self.configure
141141
142142 default_config . rpcs . remove_resource_policies . timeout = 600.0
143143
144+ default_config . rpcs . report_host_as_faulty . timeout = 600.0
145+
144146 default_config . rpcs . reset . timeout = 600.0
145147
146148 default_config . rpcs . resume . timeout = 600.0
@@ -2143,6 +2145,102 @@ def remove_resource_policies request, options = nil
21432145 raise ::Google ::Cloud ::Error . from_error ( e )
21442146 end
21452147
2148+ ##
2149+ # Mark the host as faulty and try to restart the instance on a new host.
2150+ #
2151+ # @overload report_host_as_faulty(request, options = nil)
2152+ # Pass arguments to `report_host_as_faulty` via a request object, either of type
2153+ # {::Google::Cloud::Compute::V1::ReportHostAsFaultyInstanceRequest} or an equivalent Hash.
2154+ #
2155+ # @param request [::Google::Cloud::Compute::V1::ReportHostAsFaultyInstanceRequest, ::Hash]
2156+ # A request object representing the call parameters. Required. To specify no
2157+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2158+ # @param options [::Gapic::CallOptions, ::Hash]
2159+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2160+ #
2161+ # @overload report_host_as_faulty(instance: nil, instances_report_host_as_faulty_request_resource: nil, project: nil, request_id: nil, zone: nil)
2162+ # Pass arguments to `report_host_as_faulty` via keyword arguments. Note that at
2163+ # least one keyword argument is required. To specify no parameters, or to keep all
2164+ # the default parameter values, pass an empty Hash as a request object (see above).
2165+ #
2166+ # @param instance [::String]
2167+ # Name of the instance scoping this request.
2168+ # @param instances_report_host_as_faulty_request_resource [::Google::Cloud::Compute::V1::InstancesReportHostAsFaultyRequest, ::Hash]
2169+ # The body resource for this request
2170+ # @param project [::String]
2171+ # Project ID for this request.
2172+ # @param request_id [::String]
2173+ # 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).
2174+ # @param zone [::String]
2175+ # The name of the zone for this request.
2176+ # @yield [result, operation] Access the result along with the TransportOperation object
2177+ # @yieldparam result [::Gapic::GenericLRO::Operation]
2178+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2179+ #
2180+ # @return [::Gapic::GenericLRO::Operation]
2181+ #
2182+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2183+ #
2184+ # @example Basic example
2185+ # require "google/cloud/compute/v1"
2186+ #
2187+ # # Create a client object. The client can be reused for multiple calls.
2188+ # client = Google::Cloud::Compute::V1::Instances::Rest::Client.new
2189+ #
2190+ # # Create a request. To set request fields, pass in keyword arguments.
2191+ # request = Google::Cloud::Compute::V1::ReportHostAsFaultyInstanceRequest.new
2192+ #
2193+ # # Call the report_host_as_faulty method.
2194+ # result = client.report_host_as_faulty request
2195+ #
2196+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
2197+ # p result
2198+ #
2199+ def report_host_as_faulty request , options = nil
2200+ raise ::ArgumentError , "request must be provided" if request . nil?
2201+
2202+ request = ::Gapic ::Protobuf . coerce request , to : ::Google ::Cloud ::Compute ::V1 ::ReportHostAsFaultyInstanceRequest
2203+
2204+ # Converts hash and nil to an options object
2205+ options = ::Gapic ::CallOptions . new ( **options . to_h ) if options . respond_to? :to_h
2206+
2207+ # Customize the options with defaults
2208+ call_metadata = @config . rpcs . report_host_as_faulty . metadata . to_h
2209+
2210+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2211+ call_metadata [ :"x-goog-api-client" ] ||= ::Gapic ::Headers . x_goog_api_client \
2212+ lib_name : @config . lib_name , lib_version : @config . lib_version ,
2213+ gapic_version : ::Google ::Cloud ::Compute ::V1 ::VERSION ,
2214+ transports_version_send : [ :rest ]
2215+
2216+ call_metadata [ :"x-goog-api-version" ] = API_VERSION unless API_VERSION . empty?
2217+ call_metadata [ :"x-goog-user-project" ] = @quota_project_id if @quota_project_id
2218+
2219+ options . apply_defaults timeout : @config . rpcs . report_host_as_faulty . timeout ,
2220+ metadata : call_metadata ,
2221+ retry_policy : @config . rpcs . report_host_as_faulty . retry_policy
2222+
2223+ options . apply_defaults timeout : @config . timeout ,
2224+ metadata : @config . metadata ,
2225+ retry_policy : @config . retry_policy
2226+
2227+ @instances_stub . report_host_as_faulty request , options do |result , response |
2228+ result = ::Google ::Cloud ::Compute ::V1 ::ZoneOperations ::Rest ::NonstandardLro . create_operation (
2229+ operation : result ,
2230+ client : zone_operations ,
2231+ request_values : {
2232+ "project" => request . project ,
2233+ "zone" => request . zone
2234+ } ,
2235+ options : options
2236+ )
2237+ yield result , response if block_given?
2238+ throw :response , result
2239+ end
2240+ rescue ::Gapic ::Rest ::Error => e
2241+ raise ::Google ::Cloud ::Error . from_error ( e )
2242+ end
2243+
21462244 ##
21472245 # Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance.
21482246 #
@@ -5046,6 +5144,11 @@ class Rpcs
50465144 #
50475145 attr_reader :remove_resource_policies
50485146 ##
5147+ # RPC-specific configuration for `report_host_as_faulty`
5148+ # @return [::Gapic::Config::Method]
5149+ #
5150+ attr_reader :report_host_as_faulty
5151+ ##
50495152 # RPC-specific configuration for `reset`
50505153 # @return [::Gapic::Config::Method]
50515154 #
@@ -5228,6 +5331,8 @@ def initialize parent_rpcs = nil
52285331 @perform_maintenance = ::Gapic ::Config ::Method . new perform_maintenance_config
52295332 remove_resource_policies_config = parent_rpcs . remove_resource_policies if parent_rpcs . respond_to? :remove_resource_policies
52305333 @remove_resource_policies = ::Gapic ::Config ::Method . new remove_resource_policies_config
5334+ report_host_as_faulty_config = parent_rpcs . report_host_as_faulty if parent_rpcs . respond_to? :report_host_as_faulty
5335+ @report_host_as_faulty = ::Gapic ::Config ::Method . new report_host_as_faulty_config
52315336 reset_config = parent_rpcs . reset if parent_rpcs . respond_to? :reset
52325337 @reset = ::Gapic ::Config ::Method . new reset_config
52335338 resume_config = parent_rpcs . resume if parent_rpcs . respond_to? :resume
0 commit comments