iron_titan 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +100 -29
- data/lib/iron_titan/api/core_api.rb +71 -12
- data/lib/iron_titan/api/images_api.rb +32 -32
- data/lib/iron_titan/api/jobs_api.rb +335 -75
- data/lib/iron_titan/api_client.rb +2 -2
- data/lib/iron_titan/api_error.rb +1 -1
- data/lib/iron_titan/models/error.rb +1 -1
- data/lib/iron_titan/models/error_body.rb +1 -1
- data/lib/iron_titan/models/id_status.rb +182 -0
- data/lib/iron_titan/models/image.rb +8 -8
- data/lib/iron_titan/models/image_wrapper.rb +1 -1
- data/lib/iron_titan/models/images_wrapper.rb +1 -1
- data/lib/iron_titan/models/job.rb +110 -103
- data/lib/iron_titan/models/job_wrapper.rb +1 -1
- data/lib/iron_titan/models/jobs_wrapper.rb +15 -5
- data/lib/iron_titan/models/new_job.rb +27 -50
- data/lib/iron_titan/models/new_job_with_image.rb +249 -0
- data/lib/iron_titan/models/new_jobs_wrapper.rb +2 -2
- data/lib/iron_titan/models/reason.rb +152 -0
- data/lib/iron_titan/version.rb +2 -2
- data/lib/iron_titan.rb +11 -9
- data/spec/api/core_api_spec.rb +21 -5
- data/spec/api/images_api_spec.rb +12 -12
- data/spec/api/jobs_api_spec.rb +92 -24
- data/spec/models/Error_spec.rb +2 -2
- data/spec/models/Job_spec.rb +15 -25
- data/spec/models/error_body_spec.rb +2 -2
- data/spec/models/id_status_spec.rb +56 -0
- data/spec/models/image_spec.rb +3 -3
- data/spec/models/image_wrapper_spec.rb +2 -2
- data/spec/models/images_wrapper_spec.rb +2 -2
- data/spec/models/job_wrapper_spec.rb +2 -2
- data/spec/models/jobs_wrapper_spec.rb +12 -2
- data/spec/models/log_spec.rb +1 -1
- data/spec/models/new_job_spec.rb +3 -33
- data/spec/models/new_job_with_image_spec.rb +116 -0
- data/spec/models/new_jobs_wrapper_spec.rb +2 -2
- data/spec/models/reason_spec.rb +36 -0
- metadata +11 -2
@@ -0,0 +1,182 @@
|
|
1
|
+
=begin
|
2
|
+
Titan API
|
3
|
+
|
4
|
+
The ultimate, language agnostic, container based job processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.2.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module IronTitan
|
16
|
+
class IdStatus
|
17
|
+
# Unique identifier representing a specific job.
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
# States and valid transitions.\n\n +---------+\n +---------> delayed <----------------+\n +----+----+ |\n | |\n | |\n +----v----+ |\n +---------> queued <----------------+\n +----+----+ *\n | *\n | retry * creates new job\n +----v----+ *\n | running | *\n +--+-+-+--+ |\n +---------|-|-|-----+-------------+\n +---|---------+ | +-----|---------+ |\n | | | | | |\n+-----v---^-+ +--v-------^+ +--v---^-+\n| succeeded | | cancelled | | failed |\n+-----------+ +-----------+ +--------+\n\n* delayed - has a delay.\n* queued - Ready to be consumed when it's turn comes.\n* running - Currently consumed by a runner which will attempt to process it.\n* succeeded - (or complete? success/error is common javascript terminology)\n* failed - Something went wrong. In this case more information can be obtained\n by inspecting the \"reason\" field.\n - timeout\n - killed - forcibly killed by worker due to resource restrictions or access\n violations.\n - bad_exit - exited with non-zero status due to program termination/crash.\n* cancelled - cancelled via API. More information in the reason field.\n - client_request - Request was cancelled by a client. See \"details\" for any\n details.
|
21
|
+
attr_accessor :status
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
|
27
|
+
:'id' => :'id',
|
28
|
+
|
29
|
+
:'status' => :'status'
|
30
|
+
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.swagger_types
|
36
|
+
{
|
37
|
+
:'id' => :'String',
|
38
|
+
:'status' => :'String'
|
39
|
+
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
def initialize(attributes = {})
|
44
|
+
return unless attributes.is_a?(Hash)
|
45
|
+
|
46
|
+
# convert string to symbol for hash key
|
47
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
48
|
+
|
49
|
+
|
50
|
+
if attributes[:'id']
|
51
|
+
self.id = attributes[:'id']
|
52
|
+
end
|
53
|
+
|
54
|
+
if attributes[:'status']
|
55
|
+
self.status = attributes[:'status']
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
# Custom attribute writer method checking allowed values (enum).
|
61
|
+
def status=(status)
|
62
|
+
allowed_values = ["delayed", "queued", "running", "succeeded", "failed", "cancelled"]
|
63
|
+
if status && !allowed_values.include?(status)
|
64
|
+
fail "invalid value for 'status', must be one of #{allowed_values}"
|
65
|
+
end
|
66
|
+
@status = status
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check equality by comparing each attribute.
|
70
|
+
def ==(o)
|
71
|
+
return true if self.equal?(o)
|
72
|
+
self.class == o.class &&
|
73
|
+
id == o.id &&
|
74
|
+
status == o.status
|
75
|
+
end
|
76
|
+
|
77
|
+
# @see the `==` method
|
78
|
+
def eql?(o)
|
79
|
+
self == o
|
80
|
+
end
|
81
|
+
|
82
|
+
# Calculate hash code according to all attributes.
|
83
|
+
def hash
|
84
|
+
[id, status].hash
|
85
|
+
end
|
86
|
+
|
87
|
+
# build the object from hash
|
88
|
+
def build_from_hash(attributes)
|
89
|
+
return nil unless attributes.is_a?(Hash)
|
90
|
+
self.class.swagger_types.each_pair do |key, type|
|
91
|
+
if type =~ /^Array<(.*)>/i
|
92
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
93
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
94
|
+
else
|
95
|
+
#TODO show warning in debug mode
|
96
|
+
end
|
97
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
98
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
99
|
+
else
|
100
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
self
|
105
|
+
end
|
106
|
+
|
107
|
+
def _deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :DateTime
|
110
|
+
DateTime.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :BOOLEAN
|
120
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
_model = IronTitan.const_get(type).new
|
141
|
+
_model.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def to_s
|
146
|
+
to_hash.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
# to_body is an alias to to_body (backward compatibility))
|
150
|
+
def to_body
|
151
|
+
to_hash
|
152
|
+
end
|
153
|
+
|
154
|
+
# return the object in the form of hash
|
155
|
+
def to_hash
|
156
|
+
hash = {}
|
157
|
+
self.class.attribute_map.each_pair do |attr, param|
|
158
|
+
value = self.send(attr)
|
159
|
+
next if value.nil?
|
160
|
+
hash[param] = _to_hash(value)
|
161
|
+
end
|
162
|
+
hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Method to output non-array value in the form of hash
|
166
|
+
# For object, use to_hash. Otherwise, just return the value
|
167
|
+
def _to_hash(value)
|
168
|
+
if value.is_a?(Array)
|
169
|
+
value.compact.map{ |v| _to_hash(v) }
|
170
|
+
elsif value.is_a?(Hash)
|
171
|
+
{}.tap do |hash|
|
172
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
173
|
+
end
|
174
|
+
elsif value.respond_to? :to_hash
|
175
|
+
value.to_hash
|
176
|
+
else
|
177
|
+
value
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
end
|
182
|
+
end
|
@@ -3,7 +3,7 @@ Titan API
|
|
3
3
|
|
4
4
|
The ultimate, language agnostic, container based job processing framework.
|
5
5
|
|
6
|
-
OpenAPI spec version: 0.
|
6
|
+
OpenAPI spec version: 0.2.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
|
@@ -15,7 +15,7 @@ require 'date'
|
|
15
15
|
module IronTitan
|
16
16
|
class Image
|
17
17
|
# Docker image to use for job.
|
18
|
-
attr_accessor :
|
18
|
+
attr_accessor :image
|
19
19
|
|
20
20
|
# Time when image first used/created.
|
21
21
|
attr_accessor :created_at
|
@@ -24,7 +24,7 @@ module IronTitan
|
|
24
24
|
def self.attribute_map
|
25
25
|
{
|
26
26
|
|
27
|
-
:'
|
27
|
+
:'image' => :'image',
|
28
28
|
|
29
29
|
:'created_at' => :'created_at'
|
30
30
|
|
@@ -34,7 +34,7 @@ module IronTitan
|
|
34
34
|
# Attribute type mapping.
|
35
35
|
def self.swagger_types
|
36
36
|
{
|
37
|
-
:'
|
37
|
+
:'image' => :'String',
|
38
38
|
:'created_at' => :'DateTime'
|
39
39
|
|
40
40
|
}
|
@@ -47,8 +47,8 @@ module IronTitan
|
|
47
47
|
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
48
48
|
|
49
49
|
|
50
|
-
if attributes[:'
|
51
|
-
self.
|
50
|
+
if attributes[:'image']
|
51
|
+
self.image = attributes[:'image']
|
52
52
|
end
|
53
53
|
|
54
54
|
if attributes[:'created_at']
|
@@ -61,7 +61,7 @@ module IronTitan
|
|
61
61
|
def ==(o)
|
62
62
|
return true if self.equal?(o)
|
63
63
|
self.class == o.class &&
|
64
|
-
|
64
|
+
image == o.image &&
|
65
65
|
created_at == o.created_at
|
66
66
|
end
|
67
67
|
|
@@ -72,7 +72,7 @@ module IronTitan
|
|
72
72
|
|
73
73
|
# Calculate hash code according to all attributes.
|
74
74
|
def hash
|
75
|
-
[
|
75
|
+
[image, created_at].hash
|
76
76
|
end
|
77
77
|
|
78
78
|
# build the object from hash
|
@@ -3,7 +3,7 @@ Titan API
|
|
3
3
|
|
4
4
|
The ultimate, language agnostic, container based job processing framework.
|
5
5
|
|
6
|
-
OpenAPI spec version: 0.
|
6
|
+
OpenAPI spec version: 0.2.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
|
@@ -14,89 +14,83 @@ require 'date'
|
|
14
14
|
|
15
15
|
module IronTitan
|
16
16
|
class Job
|
17
|
-
#
|
18
|
-
attr_accessor :
|
17
|
+
# Payload for the job. This is what you pass into each job to make it do something.
|
18
|
+
attr_accessor :payload
|
19
19
|
|
20
|
-
#
|
21
|
-
attr_accessor :
|
20
|
+
# Number of seconds to wait before queueing the job for consumption for the first time. Must be a positive integer. Jobs with a delay start in state \"delayed\" and transition to \"running\" after delay seconds.
|
21
|
+
attr_accessor :delay
|
22
22
|
|
23
|
-
#
|
24
|
-
attr_accessor :
|
23
|
+
# Maximum runtime in seconds. If a consumer retrieves the job, but does not change it's status within timeout seconds, the job is considered failed, with reason timeout (Titan may allow a small grace period). The consumer should also kill the job after timeout seconds. If a consumer tries to change status after Titan has already timed out the job, the consumer will be ignored.
|
24
|
+
attr_accessor :timeout
|
25
25
|
|
26
|
-
# Priority of the job. 3 levels from 0-2.
|
26
|
+
# Priority of the job. Higher has more priority. 3 levels from 0-2. Jobs at same priority are processed in FIFO order.
|
27
27
|
attr_accessor :priority
|
28
28
|
|
29
|
-
#
|
30
|
-
attr_accessor :
|
29
|
+
# Number of automatic retries this job is allowed. A retry will be attempted if a task fails. Max 25.\nAutomatic retries are performed by titan when a task reaches a failed state and has `max_retries` > 0. A retry is performed by queueing a new job with the same image id and payload. The new job's max_retries is one less than the original. The new job's `retry_of` field is set to the original Job ID. Titan will delay the new job for retries_delay seconds before queueing it. Cancelled or successful tasks are never automatically retried.
|
30
|
+
attr_accessor :max_retries
|
31
31
|
|
32
|
-
#
|
33
|
-
attr_accessor :
|
32
|
+
# Time in seconds to wait before retrying the job. Must be a non-negative integer.
|
33
|
+
attr_accessor :retries_delay
|
34
34
|
|
35
|
-
#
|
36
|
-
attr_accessor :
|
35
|
+
# Unique identifier representing a specific job.
|
36
|
+
attr_accessor :id
|
37
37
|
|
38
|
-
#
|
39
|
-
attr_accessor :
|
38
|
+
# States and valid transitions.\n\n +---------+\n +---------> delayed <----------------+\n +----+----+ |\n | |\n | |\n +----v----+ |\n +---------> queued <----------------+\n +----+----+ *\n | *\n | retry * creates new job\n +----v----+ *\n | running | *\n +--+-+-+--+ |\n +---------|-|-|-----+-------------+\n +---|---------+ | +-----|---------+ |\n | | | | | |\n+-----v---^-+ +--v-------^+ +--v---^-+\n| succeeded | | cancelled | | failed |\n+-----------+ +-----------+ +--------+\n\n* delayed - has a delay.\n* queued - Ready to be consumed when it's turn comes.\n* running - Currently consumed by a runner which will attempt to process it.\n* succeeded - (or complete? success/error is common javascript terminology)\n* failed - Something went wrong. In this case more information can be obtained\n by inspecting the \"reason\" field.\n - timeout\n - killed - forcibly killed by worker due to resource restrictions or access\n violations.\n - bad_exit - exited with non-zero status due to program termination/crash.\n* cancelled - cancelled via API. More information in the reason field.\n - client_request - Request was cancelled by a client. See \"details\" for any\n details.
|
39
|
+
attr_accessor :status
|
40
40
|
|
41
|
-
#
|
42
|
-
attr_accessor :
|
41
|
+
# Image to execute to run this Job. Get details via the /image/{id} endpoint.
|
42
|
+
attr_accessor :image_id
|
43
43
|
|
44
|
-
|
45
|
-
attr_accessor :delay
|
44
|
+
attr_accessor :reason
|
46
45
|
|
47
|
-
#
|
48
|
-
attr_accessor :
|
46
|
+
# Some description of the reason this Job is in current state. Used only for presentation purposes. Should be human-readable.
|
47
|
+
attr_accessor :details
|
49
48
|
|
50
|
-
#
|
51
|
-
attr_accessor :
|
49
|
+
# Time when job was submitted. Always in UTC.
|
50
|
+
attr_accessor :created_at
|
52
51
|
|
53
|
-
# Time when job started execution.
|
52
|
+
# Time when job started execution. Always in UTC.
|
54
53
|
attr_accessor :started_at
|
55
54
|
|
56
|
-
#
|
57
|
-
attr_accessor :
|
58
|
-
|
59
|
-
# If this field is set, then this job was retried and RetryId points to new job.
|
60
|
-
attr_accessor :retry_id
|
55
|
+
# Time when job completed, whether it was successul or failed. Always in UTC.
|
56
|
+
attr_accessor :completed_at
|
61
57
|
|
62
|
-
#
|
63
|
-
attr_accessor :
|
58
|
+
# If this field is set, then this job is a retry of the ID in this field.
|
59
|
+
attr_accessor :retry_of
|
64
60
|
|
65
61
|
# Attribute mapping from ruby-style variable name to JSON key.
|
66
62
|
def self.attribute_map
|
67
63
|
{
|
68
64
|
|
69
|
-
:'
|
65
|
+
:'payload' => :'payload',
|
70
66
|
|
71
|
-
:'
|
67
|
+
:'delay' => :'delay',
|
72
68
|
|
73
|
-
:'
|
69
|
+
:'timeout' => :'timeout',
|
74
70
|
|
75
71
|
:'priority' => :'priority',
|
76
72
|
|
77
|
-
:'
|
73
|
+
:'max_retries' => :'max_retries',
|
78
74
|
|
79
|
-
:'
|
75
|
+
:'retries_delay' => :'retries_delay',
|
80
76
|
|
81
|
-
:'
|
77
|
+
:'id' => :'id',
|
82
78
|
|
83
|
-
:'
|
79
|
+
:'status' => :'status',
|
84
80
|
|
85
|
-
:'
|
81
|
+
:'image_id' => :'image_id',
|
86
82
|
|
87
|
-
:'
|
83
|
+
:'reason' => :'reason',
|
88
84
|
|
89
|
-
:'
|
85
|
+
:'details' => :'details',
|
90
86
|
|
91
|
-
:'
|
87
|
+
:'created_at' => :'created_at',
|
92
88
|
|
93
89
|
:'started_at' => :'started_at',
|
94
90
|
|
95
|
-
:'
|
96
|
-
|
97
|
-
:'retry_id' => :'retry_id',
|
91
|
+
:'completed_at' => :'completed_at',
|
98
92
|
|
99
|
-
:'
|
93
|
+
:'retry_of' => :'retry_of'
|
100
94
|
|
101
95
|
}
|
102
96
|
end
|
@@ -104,22 +98,21 @@ module IronTitan
|
|
104
98
|
# Attribute type mapping.
|
105
99
|
def self.swagger_types
|
106
100
|
{
|
107
|
-
:'
|
108
|
-
:'
|
109
|
-
:'
|
101
|
+
:'payload' => :'String',
|
102
|
+
:'delay' => :'Integer',
|
103
|
+
:'timeout' => :'Integer',
|
110
104
|
:'priority' => :'Integer',
|
105
|
+
:'max_retries' => :'Integer',
|
111
106
|
:'retries_delay' => :'Integer',
|
112
|
-
:'error' => :'String',
|
113
|
-
:'timeout' => :'Integer',
|
114
|
-
:'retries' => :'Integer',
|
115
|
-
:'completed_at' => :'DateTime',
|
116
|
-
:'delay' => :'Integer',
|
117
|
-
:'payload' => :'String',
|
118
|
-
:'name' => :'String',
|
119
|
-
:'started_at' => :'DateTime',
|
120
107
|
:'id' => :'String',
|
121
|
-
:'
|
122
|
-
:'
|
108
|
+
:'status' => :'String',
|
109
|
+
:'image_id' => :'String',
|
110
|
+
:'reason' => :'Reason',
|
111
|
+
:'details' => :'String',
|
112
|
+
:'created_at' => :'DateTime',
|
113
|
+
:'started_at' => :'DateTime',
|
114
|
+
:'completed_at' => :'DateTime',
|
115
|
+
:'retry_of' => :'String'
|
123
116
|
|
124
117
|
}
|
125
118
|
end
|
@@ -131,92 +124,106 @@ module IronTitan
|
|
131
124
|
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
132
125
|
|
133
126
|
|
134
|
-
if attributes[:'
|
135
|
-
self.
|
127
|
+
if attributes[:'payload']
|
128
|
+
self.payload = attributes[:'payload']
|
136
129
|
end
|
137
130
|
|
138
|
-
if attributes[:'
|
139
|
-
self.
|
131
|
+
if attributes[:'delay']
|
132
|
+
self.delay = attributes[:'delay']
|
133
|
+
else
|
134
|
+
self.delay = 0
|
140
135
|
end
|
141
136
|
|
142
|
-
if attributes[:'
|
143
|
-
self.
|
137
|
+
if attributes[:'timeout']
|
138
|
+
self.timeout = attributes[:'timeout']
|
139
|
+
else
|
140
|
+
self.timeout = 60
|
144
141
|
end
|
145
142
|
|
146
143
|
if attributes[:'priority']
|
147
144
|
self.priority = attributes[:'priority']
|
145
|
+
else
|
146
|
+
self.priority = 0
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes[:'max_retries']
|
150
|
+
self.max_retries = attributes[:'max_retries']
|
151
|
+
else
|
152
|
+
self.max_retries = 3
|
148
153
|
end
|
149
154
|
|
150
155
|
if attributes[:'retries_delay']
|
151
156
|
self.retries_delay = attributes[:'retries_delay']
|
157
|
+
else
|
158
|
+
self.retries_delay = 60
|
152
159
|
end
|
153
160
|
|
154
|
-
if attributes[:'
|
155
|
-
self.
|
161
|
+
if attributes[:'id']
|
162
|
+
self.id = attributes[:'id']
|
156
163
|
end
|
157
164
|
|
158
|
-
if attributes[:'
|
159
|
-
self.
|
165
|
+
if attributes[:'status']
|
166
|
+
self.status = attributes[:'status']
|
160
167
|
end
|
161
168
|
|
162
|
-
if attributes[:'
|
163
|
-
self.
|
169
|
+
if attributes[:'image_id']
|
170
|
+
self.image_id = attributes[:'image_id']
|
164
171
|
end
|
165
172
|
|
166
|
-
if attributes[:'
|
167
|
-
self.
|
173
|
+
if attributes[:'reason']
|
174
|
+
self.reason = attributes[:'reason']
|
168
175
|
end
|
169
176
|
|
170
|
-
if attributes[:'
|
171
|
-
self.
|
177
|
+
if attributes[:'details']
|
178
|
+
self.details = attributes[:'details']
|
172
179
|
end
|
173
180
|
|
174
|
-
if attributes[:'
|
175
|
-
self.
|
176
|
-
end
|
177
|
-
|
178
|
-
if attributes[:'name']
|
179
|
-
self.name = attributes[:'name']
|
181
|
+
if attributes[:'created_at']
|
182
|
+
self.created_at = attributes[:'created_at']
|
180
183
|
end
|
181
184
|
|
182
185
|
if attributes[:'started_at']
|
183
186
|
self.started_at = attributes[:'started_at']
|
184
187
|
end
|
185
188
|
|
186
|
-
if attributes[:'
|
187
|
-
self.
|
189
|
+
if attributes[:'completed_at']
|
190
|
+
self.completed_at = attributes[:'completed_at']
|
188
191
|
end
|
189
192
|
|
190
|
-
if attributes[:'
|
191
|
-
self.
|
193
|
+
if attributes[:'retry_of']
|
194
|
+
self.retry_of = attributes[:'retry_of']
|
192
195
|
end
|
193
196
|
|
194
|
-
|
195
|
-
|
197
|
+
end
|
198
|
+
|
199
|
+
# Custom attribute writer method checking allowed values (enum).
|
200
|
+
def status=(status)
|
201
|
+
allowed_values = ["delayed", "queued", "running", "succeeded", "failed", "cancelled"]
|
202
|
+
if status && !allowed_values.include?(status)
|
203
|
+
fail "invalid value for 'status', must be one of #{allowed_values}"
|
196
204
|
end
|
197
|
-
|
205
|
+
@status = status
|
198
206
|
end
|
199
207
|
|
200
208
|
# Check equality by comparing each attribute.
|
201
209
|
def ==(o)
|
202
210
|
return true if self.equal?(o)
|
203
211
|
self.class == o.class &&
|
204
|
-
|
205
|
-
|
206
|
-
|
212
|
+
payload == o.payload &&
|
213
|
+
delay == o.delay &&
|
214
|
+
timeout == o.timeout &&
|
207
215
|
priority == o.priority &&
|
216
|
+
max_retries == o.max_retries &&
|
208
217
|
retries_delay == o.retries_delay &&
|
209
|
-
error == o.error &&
|
210
|
-
timeout == o.timeout &&
|
211
|
-
retries == o.retries &&
|
212
|
-
completed_at == o.completed_at &&
|
213
|
-
delay == o.delay &&
|
214
|
-
payload == o.payload &&
|
215
|
-
name == o.name &&
|
216
|
-
started_at == o.started_at &&
|
217
218
|
id == o.id &&
|
218
|
-
|
219
|
-
|
219
|
+
status == o.status &&
|
220
|
+
image_id == o.image_id &&
|
221
|
+
reason == o.reason &&
|
222
|
+
details == o.details &&
|
223
|
+
created_at == o.created_at &&
|
224
|
+
started_at == o.started_at &&
|
225
|
+
completed_at == o.completed_at &&
|
226
|
+
retry_of == o.retry_of
|
220
227
|
end
|
221
228
|
|
222
229
|
# @see the `==` method
|
@@ -226,7 +233,7 @@ module IronTitan
|
|
226
233
|
|
227
234
|
# Calculate hash code according to all attributes.
|
228
235
|
def hash
|
229
|
-
[
|
236
|
+
[payload, delay, timeout, priority, max_retries, retries_delay, id, status, image_id, reason, details, created_at, started_at, completed_at, retry_of].hash
|
230
237
|
end
|
231
238
|
|
232
239
|
# build the object from hash
|