iron_titan 0.2.17 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +27 -33
- data/lib/iron_titan/api/groups_api.rb +138 -0
- data/lib/iron_titan/api/jobs_api.rb +225 -189
- data/lib/iron_titan/api_client.rb +1 -1
- 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/group.rb +173 -0
- data/lib/iron_titan/models/group_wrapper.rb +161 -0
- data/lib/iron_titan/models/groups_wrapper.rb +163 -0
- data/lib/iron_titan/models/id_status.rb +2 -2
- data/lib/iron_titan/models/job.rb +26 -15
- data/lib/iron_titan/models/job_wrapper.rb +1 -1
- data/lib/iron_titan/models/jobs_wrapper.rb +1 -1
- data/lib/iron_titan/models/new_job.rb +3 -3
- data/lib/iron_titan/models/new_jobs_wrapper.rb +1 -1
- data/lib/iron_titan/models/reason.rb +2 -2
- data/lib/iron_titan/version.rb +2 -2
- data/lib/iron_titan.rb +5 -6
- data/spec/api/groups_api_spec.rb +66 -0
- data/spec/api/jobs_api_spec.rb +61 -53
- data/spec/models/Error_spec.rb +1 -1
- data/spec/models/Job_spec.rb +12 -2
- data/spec/models/error_body_spec.rb +1 -1
- data/spec/models/group_spec.rb +56 -0
- data/spec/models/group_wrapper_spec.rb +46 -0
- data/spec/models/groups_wrapper_spec.rb +46 -0
- data/spec/models/id_status_spec.rb +1 -1
- data/spec/models/job_wrapper_spec.rb +1 -1
- data/spec/models/jobs_wrapper_spec.rb +1 -1
- data/spec/models/new_job_spec.rb +1 -1
- data/spec/models/new_jobs_wrapper_spec.rb +1 -1
- data/spec/models/reason_spec.rb +1 -1
- metadata +14 -2
data/lib/iron_titan/api_error.rb
CHANGED
@@ -0,0 +1,173 @@
|
|
1
|
+
=begin
|
2
|
+
Titan API
|
3
|
+
|
4
|
+
The ultimate, language agnostic, container based job processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.3.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 Group
|
17
|
+
# Name of this group. Must be different than the image name. Can ony contain alphanumeric, -, and _.
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# Time when image first used/created.
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
|
27
|
+
:'name' => :'name',
|
28
|
+
|
29
|
+
:'created_at' => :'created_at'
|
30
|
+
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.swagger_types
|
36
|
+
{
|
37
|
+
:'name' => :'String',
|
38
|
+
:'created_at' => :'DateTime'
|
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[:'name']
|
51
|
+
self.name = attributes[:'name']
|
52
|
+
end
|
53
|
+
|
54
|
+
if attributes[:'created_at']
|
55
|
+
self.created_at = attributes[:'created_at']
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
# Check equality by comparing each attribute.
|
61
|
+
def ==(o)
|
62
|
+
return true if self.equal?(o)
|
63
|
+
self.class == o.class &&
|
64
|
+
name == o.name &&
|
65
|
+
created_at == o.created_at
|
66
|
+
end
|
67
|
+
|
68
|
+
# @see the `==` method
|
69
|
+
def eql?(o)
|
70
|
+
self == o
|
71
|
+
end
|
72
|
+
|
73
|
+
# Calculate hash code according to all attributes.
|
74
|
+
def hash
|
75
|
+
[name, created_at].hash
|
76
|
+
end
|
77
|
+
|
78
|
+
# build the object from hash
|
79
|
+
def build_from_hash(attributes)
|
80
|
+
return nil unless attributes.is_a?(Hash)
|
81
|
+
self.class.swagger_types.each_pair do |key, type|
|
82
|
+
if type =~ /^Array<(.*)>/i
|
83
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
84
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
85
|
+
else
|
86
|
+
#TODO show warning in debug mode
|
87
|
+
end
|
88
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
89
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
90
|
+
else
|
91
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
self
|
96
|
+
end
|
97
|
+
|
98
|
+
def _deserialize(type, value)
|
99
|
+
case type.to_sym
|
100
|
+
when :DateTime
|
101
|
+
DateTime.parse(value)
|
102
|
+
when :Date
|
103
|
+
Date.parse(value)
|
104
|
+
when :String
|
105
|
+
value.to_s
|
106
|
+
when :Integer
|
107
|
+
value.to_i
|
108
|
+
when :Float
|
109
|
+
value.to_f
|
110
|
+
when :BOOLEAN
|
111
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
112
|
+
true
|
113
|
+
else
|
114
|
+
false
|
115
|
+
end
|
116
|
+
when :Object
|
117
|
+
# generic object (usually a Hash), return directly
|
118
|
+
value
|
119
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
120
|
+
inner_type = Regexp.last_match[:inner_type]
|
121
|
+
value.map { |v| _deserialize(inner_type, v) }
|
122
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
123
|
+
k_type = Regexp.last_match[:k_type]
|
124
|
+
v_type = Regexp.last_match[:v_type]
|
125
|
+
{}.tap do |hash|
|
126
|
+
value.each do |k, v|
|
127
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
else # model
|
131
|
+
_model = IronTitan.const_get(type).new
|
132
|
+
_model.build_from_hash(value)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def to_s
|
137
|
+
to_hash.to_s
|
138
|
+
end
|
139
|
+
|
140
|
+
# to_body is an alias to to_body (backward compatibility))
|
141
|
+
def to_body
|
142
|
+
to_hash
|
143
|
+
end
|
144
|
+
|
145
|
+
# return the object in the form of hash
|
146
|
+
def to_hash
|
147
|
+
hash = {}
|
148
|
+
self.class.attribute_map.each_pair do |attr, param|
|
149
|
+
value = self.send(attr)
|
150
|
+
next if value.nil?
|
151
|
+
hash[param] = _to_hash(value)
|
152
|
+
end
|
153
|
+
hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Method to output non-array value in the form of hash
|
157
|
+
# For object, use to_hash. Otherwise, just return the value
|
158
|
+
def _to_hash(value)
|
159
|
+
if value.is_a?(Array)
|
160
|
+
value.compact.map{ |v| _to_hash(v) }
|
161
|
+
elsif value.is_a?(Hash)
|
162
|
+
{}.tap do |hash|
|
163
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
164
|
+
end
|
165
|
+
elsif value.respond_to? :to_hash
|
166
|
+
value.to_hash
|
167
|
+
else
|
168
|
+
value
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,161 @@
|
|
1
|
+
=begin
|
2
|
+
Titan API
|
3
|
+
|
4
|
+
The ultimate, language agnostic, container based job processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.3.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 GroupWrapper
|
17
|
+
attr_accessor :group
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
|
23
|
+
:'group' => :'group'
|
24
|
+
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.swagger_types
|
30
|
+
{
|
31
|
+
:'group' => :'Group'
|
32
|
+
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
41
|
+
|
42
|
+
|
43
|
+
if attributes[:'group']
|
44
|
+
self.group = attributes[:'group']
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
# Check equality by comparing each attribute.
|
50
|
+
def ==(o)
|
51
|
+
return true if self.equal?(o)
|
52
|
+
self.class == o.class &&
|
53
|
+
group == o.group
|
54
|
+
end
|
55
|
+
|
56
|
+
# @see the `==` method
|
57
|
+
def eql?(o)
|
58
|
+
self == o
|
59
|
+
end
|
60
|
+
|
61
|
+
# Calculate hash code according to all attributes.
|
62
|
+
def hash
|
63
|
+
[group].hash
|
64
|
+
end
|
65
|
+
|
66
|
+
# build the object from hash
|
67
|
+
def build_from_hash(attributes)
|
68
|
+
return nil unless attributes.is_a?(Hash)
|
69
|
+
self.class.swagger_types.each_pair do |key, type|
|
70
|
+
if type =~ /^Array<(.*)>/i
|
71
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
72
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
73
|
+
else
|
74
|
+
#TODO show warning in debug mode
|
75
|
+
end
|
76
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
77
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
78
|
+
else
|
79
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
self
|
84
|
+
end
|
85
|
+
|
86
|
+
def _deserialize(type, value)
|
87
|
+
case type.to_sym
|
88
|
+
when :DateTime
|
89
|
+
DateTime.parse(value)
|
90
|
+
when :Date
|
91
|
+
Date.parse(value)
|
92
|
+
when :String
|
93
|
+
value.to_s
|
94
|
+
when :Integer
|
95
|
+
value.to_i
|
96
|
+
when :Float
|
97
|
+
value.to_f
|
98
|
+
when :BOOLEAN
|
99
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
100
|
+
true
|
101
|
+
else
|
102
|
+
false
|
103
|
+
end
|
104
|
+
when :Object
|
105
|
+
# generic object (usually a Hash), return directly
|
106
|
+
value
|
107
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
108
|
+
inner_type = Regexp.last_match[:inner_type]
|
109
|
+
value.map { |v| _deserialize(inner_type, v) }
|
110
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
111
|
+
k_type = Regexp.last_match[:k_type]
|
112
|
+
v_type = Regexp.last_match[:v_type]
|
113
|
+
{}.tap do |hash|
|
114
|
+
value.each do |k, v|
|
115
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
else # model
|
119
|
+
_model = IronTitan.const_get(type).new
|
120
|
+
_model.build_from_hash(value)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def to_s
|
125
|
+
to_hash.to_s
|
126
|
+
end
|
127
|
+
|
128
|
+
# to_body is an alias to to_body (backward compatibility))
|
129
|
+
def to_body
|
130
|
+
to_hash
|
131
|
+
end
|
132
|
+
|
133
|
+
# return the object in the form of hash
|
134
|
+
def to_hash
|
135
|
+
hash = {}
|
136
|
+
self.class.attribute_map.each_pair do |attr, param|
|
137
|
+
value = self.send(attr)
|
138
|
+
next if value.nil?
|
139
|
+
hash[param] = _to_hash(value)
|
140
|
+
end
|
141
|
+
hash
|
142
|
+
end
|
143
|
+
|
144
|
+
# Method to output non-array value in the form of hash
|
145
|
+
# For object, use to_hash. Otherwise, just return the value
|
146
|
+
def _to_hash(value)
|
147
|
+
if value.is_a?(Array)
|
148
|
+
value.compact.map{ |v| _to_hash(v) }
|
149
|
+
elsif value.is_a?(Hash)
|
150
|
+
{}.tap do |hash|
|
151
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
152
|
+
end
|
153
|
+
elsif value.respond_to? :to_hash
|
154
|
+
value.to_hash
|
155
|
+
else
|
156
|
+
value
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|
161
|
+
end
|
@@ -0,0 +1,163 @@
|
|
1
|
+
=begin
|
2
|
+
Titan API
|
3
|
+
|
4
|
+
The ultimate, language agnostic, container based job processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.3.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 GroupsWrapper
|
17
|
+
attr_accessor :groups
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
|
23
|
+
:'groups' => :'groups'
|
24
|
+
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.swagger_types
|
30
|
+
{
|
31
|
+
:'groups' => :'Array<Group>'
|
32
|
+
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
41
|
+
|
42
|
+
|
43
|
+
if attributes[:'groups']
|
44
|
+
if (value = attributes[:'groups']).is_a?(Array)
|
45
|
+
self.groups = value
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
# Check equality by comparing each attribute.
|
52
|
+
def ==(o)
|
53
|
+
return true if self.equal?(o)
|
54
|
+
self.class == o.class &&
|
55
|
+
groups == o.groups
|
56
|
+
end
|
57
|
+
|
58
|
+
# @see the `==` method
|
59
|
+
def eql?(o)
|
60
|
+
self == o
|
61
|
+
end
|
62
|
+
|
63
|
+
# Calculate hash code according to all attributes.
|
64
|
+
def hash
|
65
|
+
[groups].hash
|
66
|
+
end
|
67
|
+
|
68
|
+
# build the object from hash
|
69
|
+
def build_from_hash(attributes)
|
70
|
+
return nil unless attributes.is_a?(Hash)
|
71
|
+
self.class.swagger_types.each_pair do |key, type|
|
72
|
+
if type =~ /^Array<(.*)>/i
|
73
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
74
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
75
|
+
else
|
76
|
+
#TODO show warning in debug mode
|
77
|
+
end
|
78
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
79
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
80
|
+
else
|
81
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
self
|
86
|
+
end
|
87
|
+
|
88
|
+
def _deserialize(type, value)
|
89
|
+
case type.to_sym
|
90
|
+
when :DateTime
|
91
|
+
DateTime.parse(value)
|
92
|
+
when :Date
|
93
|
+
Date.parse(value)
|
94
|
+
when :String
|
95
|
+
value.to_s
|
96
|
+
when :Integer
|
97
|
+
value.to_i
|
98
|
+
when :Float
|
99
|
+
value.to_f
|
100
|
+
when :BOOLEAN
|
101
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
102
|
+
true
|
103
|
+
else
|
104
|
+
false
|
105
|
+
end
|
106
|
+
when :Object
|
107
|
+
# generic object (usually a Hash), return directly
|
108
|
+
value
|
109
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
110
|
+
inner_type = Regexp.last_match[:inner_type]
|
111
|
+
value.map { |v| _deserialize(inner_type, v) }
|
112
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
113
|
+
k_type = Regexp.last_match[:k_type]
|
114
|
+
v_type = Regexp.last_match[:v_type]
|
115
|
+
{}.tap do |hash|
|
116
|
+
value.each do |k, v|
|
117
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
else # model
|
121
|
+
_model = IronTitan.const_get(type).new
|
122
|
+
_model.build_from_hash(value)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def to_s
|
127
|
+
to_hash.to_s
|
128
|
+
end
|
129
|
+
|
130
|
+
# to_body is an alias to to_body (backward compatibility))
|
131
|
+
def to_body
|
132
|
+
to_hash
|
133
|
+
end
|
134
|
+
|
135
|
+
# return the object in the form of hash
|
136
|
+
def to_hash
|
137
|
+
hash = {}
|
138
|
+
self.class.attribute_map.each_pair do |attr, param|
|
139
|
+
value = self.send(attr)
|
140
|
+
next if value.nil?
|
141
|
+
hash[param] = _to_hash(value)
|
142
|
+
end
|
143
|
+
hash
|
144
|
+
end
|
145
|
+
|
146
|
+
# Method to output non-array value in the form of hash
|
147
|
+
# For object, use to_hash. Otherwise, just return the value
|
148
|
+
def _to_hash(value)
|
149
|
+
if value.is_a?(Array)
|
150
|
+
value.compact.map{ |v| _to_hash(v) }
|
151
|
+
elsif value.is_a?(Hash)
|
152
|
+
{}.tap do |hash|
|
153
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
154
|
+
end
|
155
|
+
elsif value.respond_to? :to_hash
|
156
|
+
value.to_hash
|
157
|
+
else
|
158
|
+
value
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
163
|
+
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.3.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
|
@@ -17,7 +17,7 @@ module IronTitan
|
|
17
17
|
# Unique identifier representing a specific job.
|
18
18
|
attr_accessor :id
|
19
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| success | | cancelled | | error |\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* success - (or complete? success/error is common javascript terminology)\n* error - 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.
|
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| success | | cancelled | | error |\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* success - (or complete? success/error is common javascript terminology)\n* error - 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. \n
|
21
21
|
attr_accessor :status
|
22
22
|
|
23
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -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.3.0
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
|
@@ -23,13 +23,13 @@ module IronTitan
|
|
23
23
|
# 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.
|
24
24
|
attr_accessor :delay
|
25
25
|
|
26
|
-
# Maximum runtime in seconds. If a consumer retrieves the
|
26
|
+
# Maximum runtime in seconds. If a consumer retrieves the\njob, but does not change it's status within timeout seconds, the job\nis considered failed, with reason timeout (Titan may allow a small\ngrace period). The consumer should also kill the job after timeout\nseconds. If a consumer tries to change status after Titan has already\ntimed out the job, the consumer will be ignored.\n
|
27
27
|
attr_accessor :timeout
|
28
28
|
|
29
29
|
# Priority of the job. Higher has more priority. 3 levels from 0-2. Jobs at same priority are processed in FIFO order.
|
30
30
|
attr_accessor :priority
|
31
31
|
|
32
|
-
# Number of automatic retries this job is allowed. A retry will be attempted if a task fails. Max 25
|
32
|
+
# \"Number of automatic retries this job is allowed. A retry will be attempted if a task fails. Max 25. Automatic 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.\"\n
|
33
33
|
attr_accessor :max_retries
|
34
34
|
|
35
35
|
# Time in seconds to wait before retrying the job. Must be a non-negative integer.
|
@@ -38,11 +38,11 @@ module IronTitan
|
|
38
38
|
# Unique identifier representing a specific job.
|
39
39
|
attr_accessor :id
|
40
40
|
|
41
|
-
# 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| success | | cancelled | | error |\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* success - (or complete? success/error is common javascript terminology)\n* error - 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.
|
41
|
+
# 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| success | | cancelled | | error |\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* success - (or complete? success/error is common javascript terminology)\n* error - 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. \n
|
42
42
|
attr_accessor :status
|
43
43
|
|
44
|
-
#
|
45
|
-
attr_accessor :
|
44
|
+
# Group this job belongs to.
|
45
|
+
attr_accessor :group_name
|
46
46
|
|
47
47
|
attr_accessor :reason
|
48
48
|
|
@@ -58,6 +58,9 @@ module IronTitan
|
|
58
58
|
# If this field is set, then this job is a retry of the ID in this field.
|
59
59
|
attr_accessor :retry_of
|
60
60
|
|
61
|
+
# If this field is set, then this job was retried by the job referenced in this field.
|
62
|
+
attr_accessor :retry_id
|
63
|
+
|
61
64
|
# Attribute mapping from ruby-style variable name to JSON key.
|
62
65
|
def self.attribute_map
|
63
66
|
{
|
@@ -80,7 +83,7 @@ module IronTitan
|
|
80
83
|
|
81
84
|
:'status' => :'status',
|
82
85
|
|
83
|
-
:'
|
86
|
+
:'group_name' => :'group_name',
|
84
87
|
|
85
88
|
:'reason' => :'reason',
|
86
89
|
|
@@ -90,7 +93,9 @@ module IronTitan
|
|
90
93
|
|
91
94
|
:'completed_at' => :'completed_at',
|
92
95
|
|
93
|
-
:'retry_of' => :'retry_of'
|
96
|
+
:'retry_of' => :'retry_of',
|
97
|
+
|
98
|
+
:'retry_id' => :'retry_id'
|
94
99
|
|
95
100
|
}
|
96
101
|
end
|
@@ -107,12 +112,13 @@ module IronTitan
|
|
107
112
|
:'retries_delay' => :'Integer',
|
108
113
|
:'id' => :'String',
|
109
114
|
:'status' => :'String',
|
110
|
-
:'
|
115
|
+
:'group_name' => :'String',
|
111
116
|
:'reason' => :'Reason',
|
112
117
|
:'created_at' => :'DateTime',
|
113
118
|
:'started_at' => :'DateTime',
|
114
119
|
:'completed_at' => :'DateTime',
|
115
|
-
:'retry_of' => :'String'
|
120
|
+
:'retry_of' => :'String',
|
121
|
+
:'retry_id' => :'String'
|
116
122
|
|
117
123
|
}
|
118
124
|
end
|
@@ -170,8 +176,8 @@ module IronTitan
|
|
170
176
|
self.status = attributes[:'status']
|
171
177
|
end
|
172
178
|
|
173
|
-
if attributes[:'
|
174
|
-
self.
|
179
|
+
if attributes[:'group_name']
|
180
|
+
self.group_name = attributes[:'group_name']
|
175
181
|
end
|
176
182
|
|
177
183
|
if attributes[:'reason']
|
@@ -194,6 +200,10 @@ module IronTitan
|
|
194
200
|
self.retry_of = attributes[:'retry_of']
|
195
201
|
end
|
196
202
|
|
203
|
+
if attributes[:'retry_id']
|
204
|
+
self.retry_id = attributes[:'retry_id']
|
205
|
+
end
|
206
|
+
|
197
207
|
end
|
198
208
|
|
199
209
|
# Custom attribute writer method checking allowed values (enum).
|
@@ -218,12 +228,13 @@ module IronTitan
|
|
218
228
|
retries_delay == o.retries_delay &&
|
219
229
|
id == o.id &&
|
220
230
|
status == o.status &&
|
221
|
-
|
231
|
+
group_name == o.group_name &&
|
222
232
|
reason == o.reason &&
|
223
233
|
created_at == o.created_at &&
|
224
234
|
started_at == o.started_at &&
|
225
235
|
completed_at == o.completed_at &&
|
226
|
-
retry_of == o.retry_of
|
236
|
+
retry_of == o.retry_of &&
|
237
|
+
retry_id == o.retry_id
|
227
238
|
end
|
228
239
|
|
229
240
|
# @see the `==` method
|
@@ -233,7 +244,7 @@ module IronTitan
|
|
233
244
|
|
234
245
|
# Calculate hash code according to all attributes.
|
235
246
|
def hash
|
236
|
-
[image, payload, delay, timeout, priority, max_retries, retries_delay, id, status,
|
247
|
+
[image, payload, delay, timeout, priority, max_retries, retries_delay, id, status, group_name, reason, created_at, started_at, completed_at, retry_of, retry_id].hash
|
237
248
|
end
|
238
249
|
|
239
250
|
# build the object from hash
|