Class: Google::Apis::ComputeAlpha::HttpFaultAbort

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/compute_alpha/classes.rb,
lib/google/apis/compute_alpha/representations.rb,
lib/google/apis/compute_alpha/representations.rb

Overview

Specification for how requests are aborted as part of fault injection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ HttpFaultAbort

Returns a new instance of HttpFaultAbort.



13149
13150
13151
# File 'lib/google/apis/compute_alpha/classes.rb', line 13149

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#http_statusFixnum

The HTTP status code used to abort the request. The value must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director. Corresponds to the JSON property httpStatus

Returns:

  • (Fixnum)


13140
13141
13142
# File 'lib/google/apis/compute_alpha/classes.rb', line 13140

def http_status
  @http_status
end

#percentageFloat

The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection. The value must be from 0.0 to 100.0 inclusive. Corresponds to the JSON property percentage

Returns:

  • (Float)


13147
13148
13149
# File 'lib/google/apis/compute_alpha/classes.rb', line 13147

def percentage
  @percentage
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



13154
13155
13156
13157
# File 'lib/google/apis/compute_alpha/classes.rb', line 13154

def update!(**args)
  @http_status = args[:http_status] if args.key?(:http_status)
  @percentage = args[:percentage] if args.key?(:percentage)
end