iron_titan 0.0.1 → 0.0.2

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.
@@ -0,0 +1,158 @@
1
+ =begin
2
+ Titan API
3
+
4
+ The ultimate, language agnostic, container based job processing framework.
5
+
6
+ OpenAPI spec version: 0.0.2
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 Log
17
+ attr_accessor :log
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+
23
+ :'log' => :'log'
24
+
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'log' => :'String'
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[:'log']
44
+ self.log = attributes[:'log']
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
+ log == o.log
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
+ [log].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 /\AArray<(?<inner_type>.+)>\z/
105
+ inner_type = Regexp.last_match[:inner_type]
106
+ value.map { |v| _deserialize(inner_type, v) }
107
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
108
+ k_type = Regexp.last_match[:k_type]
109
+ v_type = Regexp.last_match[:v_type]
110
+ {}.tap do |hash|
111
+ value.each do |k, v|
112
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
113
+ end
114
+ end
115
+ else # model
116
+ _model = IronTitan.const_get(type).new
117
+ _model.build_from_hash(value)
118
+ end
119
+ end
120
+
121
+ def to_s
122
+ to_hash.to_s
123
+ end
124
+
125
+ # to_body is an alias to to_body (backward compatibility))
126
+ def to_body
127
+ to_hash
128
+ end
129
+
130
+ # return the object in the form of hash
131
+ def to_hash
132
+ hash = {}
133
+ self.class.attribute_map.each_pair do |attr, param|
134
+ value = self.send(attr)
135
+ next if value.nil?
136
+ hash[param] = _to_hash(value)
137
+ end
138
+ hash
139
+ end
140
+
141
+ # Method to output non-array value in the form of hash
142
+ # For object, use to_hash. Otherwise, just return the value
143
+ def _to_hash(value)
144
+ if value.is_a?(Array)
145
+ value.compact.map{ |v| _to_hash(v) }
146
+ elsif value.is_a?(Hash)
147
+ {}.tap do |hash|
148
+ value.each { |k, v| hash[k] = _to_hash(v) }
149
+ end
150
+ elsif value.respond_to? :to_hash
151
+ value.to_hash
152
+ else
153
+ value
154
+ end
155
+ end
156
+
157
+ end
158
+ 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.0.1
6
+ OpenAPI spec version: 0.0.2
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -57,8 +57,8 @@ module IronTitan
57
57
  :'name' => :'String',
58
58
  :'image' => :'String',
59
59
  :'payload' => :'String',
60
- :'delay' => :'Float',
61
- :'timeout' => :'Float',
60
+ :'delay' => :'Integer',
61
+ :'timeout' => :'Integer',
62
62
  :'retries' => :'Integer'
63
63
 
64
64
  }
@@ -85,6 +85,8 @@ module IronTitan
85
85
 
86
86
  if attributes[:'delay']
87
87
  self.delay = attributes[:'delay']
88
+ else
89
+ self.delay = 0
88
90
  end
89
91
 
90
92
  if attributes[:'timeout']
@@ -152,7 +154,7 @@ module IronTitan
152
154
  when :Float
153
155
  value.to_f
154
156
  when :BOOLEAN
155
- if value =~ /^(true|t|yes|y|1)$/i
157
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
156
158
  true
157
159
  else
158
160
  false
@@ -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.0.1
6
+ OpenAPI spec version: 0.0.2
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -98,7 +98,7 @@ module IronTitan
98
98
  when :Float
99
99
  value.to_f
100
100
  when :BOOLEAN
101
- if value =~ /^(true|t|yes|y|1)$/i
101
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
102
102
  true
103
103
  else
104
104
  false
@@ -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.0.1
6
+ OpenAPI spec version: 0.0.2
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -11,5 +11,5 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
11
  =end
12
12
 
13
13
  module IronTitan
14
- VERSION = "0.0.1"
14
+ VERSION = "0.0.2"
15
15
  end
data/lib/iron_titan.rb CHANGED
@@ -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.0.1
6
+ OpenAPI spec version: 0.0.2
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -17,13 +17,14 @@ require 'iron_titan/version'
17
17
  require 'iron_titan/configuration'
18
18
 
19
19
  # Models
20
- require 'iron_titan/models/job'
21
- require 'iron_titan/models/new_job'
22
- require 'iron_titan/models/new_job_array'
23
20
  require 'iron_titan/models/job_array'
24
- require 'iron_titan/models/job_wrapper'
25
21
  require 'iron_titan/models/error_body'
22
+ require 'iron_titan/models/log'
26
23
  require 'iron_titan/models/error'
24
+ require 'iron_titan/models/new_job_array'
25
+ require 'iron_titan/models/job_wrapper'
26
+ require 'iron_titan/models/job'
27
+ require 'iron_titan/models/new_job'
27
28
 
28
29
  # APIs
29
30
  require 'iron_titan/api/jobs_api'
@@ -0,0 +1,100 @@
1
+ =begin
2
+ Titan API
3
+
4
+ The ultimate, language agnostic, container based job processing framework.
5
+
6
+ OpenAPI spec version: 0.0.2
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for IronTitan::CoreApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'CoreApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = IronTitan::CoreApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of CoreApi' do
30
+ it 'should create an instact of CoreApi' do
31
+ @instance.should be_a(IronTitan::CoreApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for job_id_get
36
+ # Gets job by id
37
+ # Gets a job by id.
38
+ # @param id Job id
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [JobWrapper]
41
+ describe 'job_id_get test' do
42
+ it "should work" do
43
+ # assertion here
44
+ # should be_a()
45
+ # should be_nil
46
+ # should ==
47
+ # should_not ==
48
+ end
49
+ end
50
+
51
+ # unit tests for job_id_patch
52
+ # Update a job
53
+ # Typically used to update status on error/completion. TODO: only allow &#39;status&#39; field.
54
+ # @param id Job id
55
+ # @param body Job data to post
56
+ # @param [Hash] opts the optional parameters
57
+ # @return [JobWrapper]
58
+ describe 'job_id_patch test' do
59
+ it "should work" do
60
+ # assertion here
61
+ # should be_a()
62
+ # should be_nil
63
+ # should ==
64
+ # should_not ==
65
+ end
66
+ end
67
+
68
+ # unit tests for jobs_get
69
+ # Get next job.
70
+ # Gets the next job in the queue, ready for processing.
71
+ # @param [Hash] opts the optional parameters
72
+ # @option opts [Integer] :n Number of jobs to return.
73
+ # @return [Array<JobArray>]
74
+ describe 'jobs_get test' do
75
+ it "should work" do
76
+ # assertion here
77
+ # should be_a()
78
+ # should be_nil
79
+ # should ==
80
+ # should_not ==
81
+ end
82
+ end
83
+
84
+ # unit tests for jobs_post
85
+ # Enqueue Job
86
+ # Enqueues a job.
87
+ # @param body Array of jobs to post.
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [JobArray]
90
+ describe 'jobs_post test' do
91
+ it "should work" do
92
+ # assertion here
93
+ # should be_a()
94
+ # should be_nil
95
+ # should ==
96
+ # should_not ==
97
+ end
98
+ end
99
+
100
+ end
@@ -0,0 +1,148 @@
1
+ =begin
2
+ Titan API
3
+
4
+ The ultimate, language agnostic, container based job processing framework.
5
+
6
+ OpenAPI spec version: 0.0.2
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for IronTitan::JobsApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'JobsApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = IronTitan::JobsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of JobsApi' do
30
+ it 'should create an instact of JobsApi' do
31
+ @instance.should be_a(IronTitan::JobsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for job_id_get
36
+ # Gets job by id
37
+ # Gets a job by id.
38
+ # @param id Job id
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [JobWrapper]
41
+ describe 'job_id_get test' do
42
+ it "should work" do
43
+ # assertion here
44
+ # should be_a()
45
+ # should be_nil
46
+ # should ==
47
+ # should_not ==
48
+ end
49
+ end
50
+
51
+ # unit tests for job_id_patch
52
+ # Update a job
53
+ # Typically used to update status on error/completion. TODO: only allow &#39;status&#39; field.
54
+ # @param id Job id
55
+ # @param body Job data to post
56
+ # @param [Hash] opts the optional parameters
57
+ # @return [JobWrapper]
58
+ describe 'job_id_patch test' do
59
+ it "should work" do
60
+ # assertion here
61
+ # should be_a()
62
+ # should be_nil
63
+ # should ==
64
+ # should_not ==
65
+ end
66
+ end
67
+
68
+ # unit tests for job_id_cancel_post
69
+ # Cancel a job.
70
+ # This will prevent a job from running. TODO: should we attempt to kill a running job?
71
+ # @param id Job id
72
+ # @param [Hash] opts the optional parameters
73
+ # @return [JobWrapper]
74
+ describe 'job_id_cancel_post test' do
75
+ it "should work" do
76
+ # assertion here
77
+ # should be_a()
78
+ # should be_nil
79
+ # should ==
80
+ # should_not ==
81
+ end
82
+ end
83
+
84
+ # unit tests for job_id_log_get
85
+ # Get the log of a completed job.
86
+ # Retrieves the log from log storage.
87
+ # @param id Job id
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [Log]
90
+ describe 'job_id_log_get test' do
91
+ it "should work" do
92
+ # assertion here
93
+ # should be_a()
94
+ # should be_nil
95
+ # should ==
96
+ # should_not ==
97
+ end
98
+ end
99
+
100
+ # unit tests for job_id_retry_post
101
+ # Retry a job.
102
+ # If a job fails, you can retry the job with the original payload.
103
+ # @param id Job id
104
+ # @param [Hash] opts the optional parameters
105
+ # @return [JobWrapper]
106
+ describe 'job_id_retry_post test' do
107
+ it "should work" do
108
+ # assertion here
109
+ # should be_a()
110
+ # should be_nil
111
+ # should ==
112
+ # should_not ==
113
+ end
114
+ end
115
+
116
+ # unit tests for jobs_get
117
+ # Get next job.
118
+ # Gets the next job in the queue, ready for processing.
119
+ # @param [Hash] opts the optional parameters
120
+ # @option opts [Integer] :n Number of jobs to return.
121
+ # @return [Array<JobArray>]
122
+ describe 'jobs_get test' do
123
+ it "should work" do
124
+ # assertion here
125
+ # should be_a()
126
+ # should be_nil
127
+ # should ==
128
+ # should_not ==
129
+ end
130
+ end
131
+
132
+ # unit tests for jobs_post
133
+ # Enqueue Job
134
+ # Enqueues a job.
135
+ # @param body Array of jobs to post.
136
+ # @param [Hash] opts the optional parameters
137
+ # @return [JobArray]
138
+ describe 'jobs_post test' do
139
+ it "should work" do
140
+ # assertion here
141
+ # should be_a()
142
+ # should be_nil
143
+ # should ==
144
+ # should_not ==
145
+ end
146
+ end
147
+
148
+ 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.0.1
6
+ OpenAPI spec version: 0.0.2
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -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.0.1
6
+ OpenAPI spec version: 0.0.2
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -122,6 +122,16 @@ describe 'Job' do
122
122
  end
123
123
  end
124
124
 
125
+ describe 'test attribute "error"' do
126
+ it 'should work' do
127
+ # assertion here
128
+ # should be_a()
129
+ # should be_nil
130
+ # should ==
131
+ # should_not ==
132
+ end
133
+ end
134
+
125
135
  describe 'test attribute "timeout"' do
126
136
  it 'should work' do
127
137
  # assertion here
@@ -0,0 +1,56 @@
1
+ =begin
2
+ Titan API
3
+
4
+ The ultimate, language agnostic, container based job processing framework.
5
+
6
+ OpenAPI spec version: 0.0.2
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for IronTitan::
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'ErrorBody' do
21
+ before do
22
+ # run before each test
23
+ @instance = IronTitan::ErrorBody.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ErrorBody' do
31
+ it 'should create an instact of ErrorBody' do
32
+ @instance.should be_a(IronTitan::ErrorBody)
33
+ end
34
+ end
35
+ describe 'test attribute "message"' do
36
+ it 'should work' do
37
+ # assertion here
38
+ # should be_a()
39
+ # should be_nil
40
+ # should ==
41
+ # should_not ==
42
+ end
43
+ end
44
+
45
+ describe 'test attribute "fields"' do
46
+ it 'should work' do
47
+ # assertion here
48
+ # should be_a()
49
+ # should be_nil
50
+ # should ==
51
+ # should_not ==
52
+ end
53
+ end
54
+
55
+ end
56
+
@@ -0,0 +1,46 @@
1
+ =begin
2
+ Titan API
3
+
4
+ The ultimate, language agnostic, container based job processing framework.
5
+
6
+ OpenAPI spec version: 0.0.2
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for IronTitan::
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'JobArray' do
21
+ before do
22
+ # run before each test
23
+ @instance = IronTitan::JobArray.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of JobArray' do
31
+ it 'should create an instact of JobArray' do
32
+ @instance.should be_a(IronTitan::JobArray)
33
+ end
34
+ end
35
+ describe 'test attribute "jobs"' do
36
+ it 'should work' do
37
+ # assertion here
38
+ # should be_a()
39
+ # should be_nil
40
+ # should ==
41
+ # should_not ==
42
+ end
43
+ end
44
+
45
+ end
46
+
@@ -0,0 +1,46 @@
1
+ =begin
2
+ Titan API
3
+
4
+ The ultimate, language agnostic, container based job processing framework.
5
+
6
+ OpenAPI spec version: 0.0.2
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for IronTitan::
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'JobWrapper' do
21
+ before do
22
+ # run before each test
23
+ @instance = IronTitan::JobWrapper.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of JobWrapper' do
31
+ it 'should create an instact of JobWrapper' do
32
+ @instance.should be_a(IronTitan::JobWrapper)
33
+ end
34
+ end
35
+ describe 'test attribute "job"' do
36
+ it 'should work' do
37
+ # assertion here
38
+ # should be_a()
39
+ # should be_nil
40
+ # should ==
41
+ # should_not ==
42
+ end
43
+ end
44
+
45
+ end
46
+