Class: OCI::LoadBalancer::Models::WorkRequest
- Inherits:
-
Object
- Object
- OCI::LoadBalancer::Models::WorkRequest
- Defined in:
- lib/oci/load_balancer/models/work_request.rb
Overview
Many of the API requests you use to create and configure load balancing do not take effect immediately. In these cases, the request spawns an asynchronous work flow to fulfill the request. WorkRequest objects provide visibility for in-progress work flows. For more information about work requests, see [Viewing the State of a Work Request](docs.cloud.oracle.com/Content/Balance/Tasks/viewingworkrequest.htm).
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_ACCEPTED = 'ACCEPTED'.freeze, LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#error_details ⇒ Array<OCI::LoadBalancer::Models::WorkRequestError>
This attribute is required.
-
#id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request.
-
#lifecycle_state ⇒ String
[Required] The current state of the work request.
-
#load_balancer_id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer with which the work request is associated.
-
#message ⇒ String
[Required] A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure.
-
#time_accepted ⇒ DateTime
[Required] The date and time the work request was created, in the format defined by RFC3339.
-
#time_finished ⇒ DateTime
The date and time the work request was completed, in the format defined by RFC3339.
-
#type ⇒ String
[Required] The type of action the work request represents.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ WorkRequest
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ WorkRequest
Initializes the object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 120 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.id = attributes[:'id'] if attributes[:'id'] self.load_balancer_id = attributes[:'loadBalancerId'] if attributes[:'loadBalancerId'] raise 'You cannot provide both :loadBalancerId and :load_balancer_id' if attributes.key?(:'loadBalancerId') && attributes.key?(:'load_balancer_id') self.load_balancer_id = attributes[:'load_balancer_id'] if attributes[:'load_balancer_id'] self.type = attributes[:'type'] if attributes[:'type'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self. = attributes[:'message'] if attributes[:'message'] self.time_accepted = attributes[:'timeAccepted'] if attributes[:'timeAccepted'] raise 'You cannot provide both :timeAccepted and :time_accepted' if attributes.key?(:'timeAccepted') && attributes.key?(:'time_accepted') self.time_accepted = attributes[:'time_accepted'] if attributes[:'time_accepted'] self.time_finished = attributes[:'timeFinished'] if attributes[:'timeFinished'] raise 'You cannot provide both :timeFinished and :time_finished' if attributes.key?(:'timeFinished') && attributes.key?(:'time_finished') self.time_finished = attributes[:'time_finished'] if attributes[:'time_finished'] self.error_details = attributes[:'errorDetails'] if attributes[:'errorDetails'] raise 'You cannot provide both :errorDetails and :error_details' if attributes.key?(:'errorDetails') && attributes.key?(:'error_details') self.error_details = attributes[:'error_details'] if attributes[:'error_details'] end |
Instance Attribute Details
#error_details ⇒ Array<OCI::LoadBalancer::Models::WorkRequestError>
This attribute is required.
72 73 74 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 72 def error_details @error_details end |
#id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request.
24 25 26 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 24 def id @id end |
#lifecycle_state ⇒ String
[Required] The current state of the work request.
42 43 44 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 42 def lifecycle_state @lifecycle_state end |
#load_balancer_id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer with which the work request is associated.
30 31 32 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 30 def load_balancer_id @load_balancer_id end |
#message ⇒ String
[Required] A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure. Possible data elements include:
-
workflow name
-
event ID
-
work request ID
-
load balancer ID
-
workflow completion message
54 55 56 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 54 def @message end |
#time_accepted ⇒ DateTime
[Required] The date and time the work request was created, in the format defined by RFC3339.
Example: ‘2016-08-25T21:10:29.600Z`
61 62 63 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 61 def time_accepted @time_accepted end |
#time_finished ⇒ DateTime
The date and time the work request was completed, in the format defined by RFC3339.
Example: ‘2016-08-25T21:10:29.600Z`
68 69 70 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 68 def time_finished @time_finished end |
#type ⇒ String
[Required] The type of action the work request represents.
Example: ‘CreateListener`
37 38 39 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 37 def type @type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 75 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'load_balancer_id': :'loadBalancerId', 'type': :'type', 'lifecycle_state': :'lifecycleState', 'message': :'message', 'time_accepted': :'timeAccepted', 'time_finished': :'timeFinished', 'error_details': :'errorDetails' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 91 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'load_balancer_id': :'String', 'type': :'String', 'lifecycle_state': :'String', 'message': :'String', 'time_accepted': :'DateTime', 'time_finished': :'DateTime', 'error_details': :'Array<OCI::LoadBalancer::Models::WorkRequestError>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 183 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && load_balancer_id == other.load_balancer_id && type == other.type && lifecycle_state == other.lifecycle_state && == other. && time_accepted == other.time_accepted && time_finished == other.time_finished && error_details == other.error_details end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 220 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
200 201 202 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 200 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
209 210 211 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 209 def hash [id, load_balancer_id, type, lifecycle_state, , time_accepted, time_finished, error_details].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
253 254 255 256 257 258 259 260 261 262 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 253 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
247 248 249 |
# File 'lib/oci/load_balancer/models/work_request.rb', line 247 def to_s to_hash.to_s end |