lib/fastly/models/healthcheck.rb in fastly-4.0.0.alpha4 vs lib/fastly/models/healthcheck.rb in fastly-4.0.0
- old
+ new
@@ -11,19 +11,22 @@
require 'date'
require 'time'
module Fastly
class Healthcheck
- # How often to run the healthcheck in milliseconds.
+ # How often to run the health check in milliseconds.
attr_accessor :check_interval
# A freeform descriptive note.
attr_accessor :comment
# The status code expected from the host.
attr_accessor :expected_response
+ # Array of custom headers that will be added to the health check probes.
+ attr_accessor :headers
+
# Which host to check.
attr_accessor :host
# Whether to use version 1.0 or 1.1 HTTP.
attr_accessor :http_version
@@ -32,31 +35,32 @@
attr_accessor :initial
# Which HTTP method to use.
attr_accessor :method
- # The name of the healthcheck.
+ # The name of the health check.
attr_accessor :name
# The path to check.
attr_accessor :path
- # How many healthchecks must succeed to be considered healthy.
+ # How many health checks must succeed to be considered healthy.
attr_accessor :threshold
# Timeout in milliseconds.
attr_accessor :timeout
- # The number of most recent healthcheck queries to keep for this healthcheck.
+ # The number of most recent health check queries to keep for this health check.
attr_accessor :window
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'check_interval' => :'check_interval',
:'comment' => :'comment',
:'expected_response' => :'expected_response',
+ :'headers' => :'headers',
:'host' => :'host',
:'http_version' => :'http_version',
:'initial' => :'initial',
:'method' => :'method',
:'name' => :'name',
@@ -76,10 +80,11 @@
def self.fastly_types
{
:'check_interval' => :'Integer',
:'comment' => :'String',
:'expected_response' => :'Integer',
+ :'headers' => :'Array<String>',
:'host' => :'String',
:'http_version' => :'String',
:'initial' => :'Integer',
:'method' => :'String',
:'name' => :'String',
@@ -122,10 +127,16 @@
if attributes.key?(:'expected_response')
self.expected_response = attributes[:'expected_response']
end
+ if attributes.key?(:'headers')
+ if (value = attributes[:'headers']).is_a?(Array)
+ self.headers = value
+ end
+ end
+
if attributes.key?(:'host')
self.host = attributes[:'host']
end
if attributes.key?(:'http_version')
@@ -180,10 +191,11 @@
return true if self.equal?(o)
self.class == o.class &&
check_interval == o.check_interval &&
comment == o.comment &&
expected_response == o.expected_response &&
+ headers == o.headers &&
host == o.host &&
http_version == o.http_version &&
initial == o.initial &&
method == o.method &&
name == o.name &&
@@ -200,10 +212,10 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [check_interval, comment, expected_response, host, http_version, initial, method, name, path, threshold, timeout, window].hash
+ [check_interval, comment, expected_response, headers, host, http_version, initial, method, name, path, threshold, timeout, window].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself