worker_ruby 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +118 -0
- data/VERSION +1 -0
- data/VERSION.txt +1 -0
- data/docs/Complete.md +10 -0
- data/docs/CoreApi.md +200 -0
- data/docs/Error.md +8 -0
- data/docs/ErrorBody.md +9 -0
- data/docs/Group.md +12 -0
- data/docs/GroupWrapper.md +8 -0
- data/docs/GroupsApi.md +197 -0
- data/docs/GroupsWrapper.md +8 -0
- data/docs/IdStatus.md +9 -0
- data/docs/Image.md +10 -0
- data/docs/ImageWrapper.md +8 -0
- data/docs/ImagesApi.md +98 -0
- data/docs/ImagesWrapper.md +8 -0
- data/docs/Job.md +25 -0
- data/docs/JobWrapper.md +8 -0
- data/docs/JobsApi.md +684 -0
- data/docs/JobsWrapper.md +10 -0
- data/docs/Log.md +8 -0
- data/docs/NewJob.md +14 -0
- data/docs/NewJobWithImage.md +15 -0
- data/docs/NewJobsWrapper.md +8 -0
- data/docs/NewTask.md +14 -0
- data/docs/NewTasksWrapper.md +8 -0
- data/docs/Reason.md +7 -0
- data/docs/RunnerApi.md +170 -0
- data/docs/Start.md +8 -0
- data/docs/Task.md +25 -0
- data/docs/TaskWrapper.md +8 -0
- data/docs/TasksApi.md +684 -0
- data/docs/TasksWrapper.md +10 -0
- data/git_push.sh +67 -0
- data/iron_ruby.gemspec +55 -0
- data/iron_titan.gemspec +32 -0
- data/lib/iron_ruby.rb +66 -0
- data/lib/iron_ruby/api/groups_api.rb +262 -0
- data/lib/iron_ruby/api/runner_api.rb +229 -0
- data/lib/iron_ruby/api/tasks_api.rb +842 -0
- data/lib/iron_ruby/api_client.rb +378 -0
- data/lib/iron_ruby/api_error.rb +47 -0
- data/lib/iron_ruby/configuration.rb +207 -0
- data/lib/iron_ruby/models/complete.rb +220 -0
- data/lib/iron_ruby/models/error.rb +199 -0
- data/lib/iron_ruby/models/error_body.rb +208 -0
- data/lib/iron_ruby/models/group.rb +242 -0
- data/lib/iron_ruby/models/group_wrapper.rb +200 -0
- data/lib/iron_ruby/models/groups_wrapper.rb +202 -0
- data/lib/iron_ruby/models/id_status.rb +243 -0
- data/lib/iron_ruby/models/new_task.rb +270 -0
- data/lib/iron_ruby/models/new_tasks_wrapper.rb +202 -0
- data/lib/iron_ruby/models/start.rb +200 -0
- data/lib/iron_ruby/models/task.rb +427 -0
- data/lib/iron_ruby/models/task_wrapper.rb +200 -0
- data/lib/iron_ruby/models/tasks_wrapper.rb +221 -0
- data/lib/iron_ruby/version.rb +26 -0
- data/lib/iron_titan.rb +66 -0
- data/lib/iron_titan/api/core_api.rb +260 -0
- data/lib/iron_titan/api/groups_api.rb +262 -0
- data/lib/iron_titan/api/images_api.rb +138 -0
- data/lib/iron_titan/api/jobs_api.rb +842 -0
- data/lib/iron_titan/api/runner_api.rb +229 -0
- data/lib/iron_titan/api_client.rb +372 -0
- data/lib/iron_titan/api_error.rb +47 -0
- data/lib/iron_titan/configuration.rb +186 -0
- data/lib/iron_titan/models/complete.rb +220 -0
- data/lib/iron_titan/models/error.rb +199 -0
- data/lib/iron_titan/models/error_body.rb +208 -0
- data/lib/iron_titan/models/group.rb +242 -0
- data/lib/iron_titan/models/group_wrapper.rb +200 -0
- data/lib/iron_titan/models/groups_wrapper.rb +202 -0
- data/lib/iron_titan/models/id_status.rb +243 -0
- data/lib/iron_titan/models/image.rb +184 -0
- data/lib/iron_titan/models/image_wrapper.rb +161 -0
- data/lib/iron_titan/models/images_wrapper.rb +163 -0
- data/lib/iron_titan/models/job.rb +427 -0
- data/lib/iron_titan/models/job_array.rb +160 -0
- data/lib/iron_titan/models/job_wrapper.rb +200 -0
- data/lib/iron_titan/models/jobs_wrapper.rb +221 -0
- data/lib/iron_titan/models/log.rb +161 -0
- data/lib/iron_titan/models/new_job.rb +270 -0
- data/lib/iron_titan/models/new_job_array.rb +160 -0
- data/lib/iron_titan/models/new_job_with_image.rb +249 -0
- data/lib/iron_titan/models/new_jobs_wrapper.rb +202 -0
- data/lib/iron_titan/models/reason.rb +164 -0
- data/lib/iron_titan/models/start.rb +200 -0
- data/lib/iron_titan/version.rb +26 -0
- data/lib/worker_ruby.rb +66 -0
- data/lib/worker_ruby/api/groups_api.rb +262 -0
- data/lib/worker_ruby/api/runner_api.rb +229 -0
- data/lib/worker_ruby/api/tasks_api.rb +842 -0
- data/lib/worker_ruby/api_client.rb +378 -0
- data/lib/worker_ruby/api_error.rb +47 -0
- data/lib/worker_ruby/configuration.rb +207 -0
- data/lib/worker_ruby/models/complete.rb +220 -0
- data/lib/worker_ruby/models/error.rb +199 -0
- data/lib/worker_ruby/models/error_body.rb +208 -0
- data/lib/worker_ruby/models/group.rb +242 -0
- data/lib/worker_ruby/models/group_wrapper.rb +200 -0
- data/lib/worker_ruby/models/groups_wrapper.rb +202 -0
- data/lib/worker_ruby/models/id_status.rb +243 -0
- data/lib/worker_ruby/models/new_task.rb +270 -0
- data/lib/worker_ruby/models/new_tasks_wrapper.rb +202 -0
- data/lib/worker_ruby/models/start.rb +200 -0
- data/lib/worker_ruby/models/task.rb +427 -0
- data/lib/worker_ruby/models/task_wrapper.rb +200 -0
- data/lib/worker_ruby/models/tasks_wrapper.rb +221 -0
- data/lib/worker_ruby/version.rb +26 -0
- data/spec/api/CoreApi_spec.rb +99 -0
- data/spec/api/JobsApi_spec.rb +131 -0
- data/spec/api/core_api_spec.rb +99 -0
- data/spec/api/groups_api_spec.rb +94 -0
- data/spec/api/images_api_spec.rb +66 -0
- data/spec/api/jobs_api_spec.rb +220 -0
- data/spec/api/runner_api_spec.rb +88 -0
- data/spec/api/tasks_api_spec.rb +220 -0
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/models/ErrorBody_spec.rb +56 -0
- data/spec/models/JobArray_spec.rb +46 -0
- data/spec/models/JobWrapper_spec.rb +46 -0
- data/spec/models/NewJobArray_spec.rb +46 -0
- data/spec/models/NewJob_spec.rb +96 -0
- data/spec/models/complete_spec.rb +65 -0
- data/spec/models/error_body_spec.rb +59 -0
- data/spec/models/error_spec.rb +53 -0
- data/spec/models/group_spec.rb +77 -0
- data/spec/models/group_wrapper_spec.rb +53 -0
- data/spec/models/groups_wrapper_spec.rb +53 -0
- data/spec/models/id_status_spec.rb +63 -0
- data/spec/models/image_spec.rb +66 -0
- data/spec/models/image_wrapper_spec.rb +46 -0
- data/spec/models/images_wrapper_spec.rb +46 -0
- data/spec/models/job_array_spec.rb +46 -0
- data/spec/models/job_spec.rb +161 -0
- data/spec/models/job_wrapper_spec.rb +53 -0
- data/spec/models/jobs_wrapper_spec.rb +65 -0
- data/spec/models/log_spec.rb +46 -0
- data/spec/models/new_job_array_spec.rb +46 -0
- data/spec/models/new_job_spec.rb +89 -0
- data/spec/models/new_job_with_image_spec.rb +116 -0
- data/spec/models/new_jobs_wrapper_spec.rb +53 -0
- data/spec/models/new_task_spec.rb +89 -0
- data/spec/models/new_tasks_wrapper_spec.rb +53 -0
- data/spec/models/reason_spec.rb +36 -0
- data/spec/models/start_spec.rb +53 -0
- data/spec/models/task_spec.rb +163 -0
- data/spec/models/task_wrapper_spec.rb +53 -0
- data/spec/models/tasks_wrapper_spec.rb +65 -0
- data/spec/spec_helper.rb +122 -0
- data/worker_ruby-0.5.5.gem +0 -0
- data/worker_ruby.gemspec +55 -0
- metadata +420 -0
@@ -0,0 +1,138 @@
|
|
1
|
+
=begin
|
2
|
+
Titan API
|
3
|
+
|
4
|
+
The ultimate, language agnostic, container based job processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.2.17
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module IronTitan
|
16
|
+
class ImagesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Get information for image id.
|
24
|
+
# This gives more details about on image, such as the image name and other statistics.
|
25
|
+
# @param id ID of the image.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [ImageWrapper]
|
28
|
+
def image_id_get(id, opts = {})
|
29
|
+
data, status_code, headers = image_id_get_with_http_info(id, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Get information for image id.
|
34
|
+
# This gives more details about on image, such as the image name and other statistics.
|
35
|
+
# @param id ID of the image.
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(ImageWrapper, Fixnum, Hash)>] ImageWrapper data, response status code and response headers
|
38
|
+
def image_id_get_with_http_info(id, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: ImagesApi#image_id_get ..."
|
41
|
+
end
|
42
|
+
|
43
|
+
# verify the required parameter 'id' is set
|
44
|
+
fail "Missing the required parameter 'id' when calling image_id_get" if id.nil?
|
45
|
+
|
46
|
+
# resource path
|
47
|
+
local_var_path = "/image/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
48
|
+
|
49
|
+
# query parameters
|
50
|
+
query_params = {}
|
51
|
+
|
52
|
+
# header parameters
|
53
|
+
header_params = {}
|
54
|
+
|
55
|
+
# HTTP header 'Accept' (if needed)
|
56
|
+
_header_accept = ['application/json']
|
57
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
58
|
+
|
59
|
+
# HTTP header 'Content-Type'
|
60
|
+
_header_content_type = ['application/json']
|
61
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = nil
|
68
|
+
|
69
|
+
auth_names = []
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => 'ImageWrapper')
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: ImagesApi#image_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
|
83
|
+
# Get all image names.
|
84
|
+
# TODO: Using images for lack of a better term. See https://github.com/iron-io/titan/issues/43 for discussion.
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [ImagesWrapper]
|
87
|
+
def images_get(opts = {})
|
88
|
+
data, status_code, headers = images_get_with_http_info(opts)
|
89
|
+
return data
|
90
|
+
end
|
91
|
+
|
92
|
+
# Get all image names.
|
93
|
+
# TODO: Using images for lack of a better term. See https://github.com/iron-io/titan/issues/43 for discussion.
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [Array<(ImagesWrapper, Fixnum, Hash)>] ImagesWrapper data, response status code and response headers
|
96
|
+
def images_get_with_http_info(opts = {})
|
97
|
+
if @api_client.config.debugging
|
98
|
+
@api_client.config.logger.debug "Calling API: ImagesApi#images_get ..."
|
99
|
+
end
|
100
|
+
|
101
|
+
# resource path
|
102
|
+
local_var_path = "/images".sub('{format}','json')
|
103
|
+
|
104
|
+
# query parameters
|
105
|
+
query_params = {}
|
106
|
+
|
107
|
+
# header parameters
|
108
|
+
header_params = {}
|
109
|
+
|
110
|
+
# HTTP header 'Accept' (if needed)
|
111
|
+
_header_accept = ['application/json']
|
112
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
113
|
+
|
114
|
+
# HTTP header 'Content-Type'
|
115
|
+
_header_content_type = ['application/json']
|
116
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
117
|
+
|
118
|
+
# form parameters
|
119
|
+
form_params = {}
|
120
|
+
|
121
|
+
# http body (model)
|
122
|
+
post_body = nil
|
123
|
+
|
124
|
+
auth_names = []
|
125
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
126
|
+
:header_params => header_params,
|
127
|
+
:query_params => query_params,
|
128
|
+
:form_params => form_params,
|
129
|
+
:body => post_body,
|
130
|
+
:auth_names => auth_names,
|
131
|
+
:return_type => 'ImagesWrapper')
|
132
|
+
if @api_client.config.debugging
|
133
|
+
@api_client.config.logger.debug "API called: ImagesApi#images_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
134
|
+
end
|
135
|
+
return data, status_code, headers
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,842 @@
|
|
1
|
+
=begin
|
2
|
+
Titan API
|
3
|
+
|
4
|
+
The ultimate, language agnostic, container based job processing framework.
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.4.9
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require "uri"
|
25
|
+
|
26
|
+
module IronTitan
|
27
|
+
class JobsApi
|
28
|
+
attr_accessor :api_client
|
29
|
+
|
30
|
+
def initialize(api_client = ApiClient.default)
|
31
|
+
@api_client = api_client
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get job list by group name.
|
35
|
+
# This will list jobs for a particular group.
|
36
|
+
# @param name Name of group for this set of jobs.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [DateTime] :created_after Will return jobs created after this time. In RFC3339 format.
|
39
|
+
# @option opts [Integer] :n Number of jobs to return per page. Default is 50. Max is 1000.
|
40
|
+
# @option opts [String] :cursor Pass this in from a previous query to paginate results.
|
41
|
+
# @return [JobsWrapper]
|
42
|
+
def groups_name_jobs_get(name, opts = {})
|
43
|
+
data, _status_code, _headers = groups_name_jobs_get_with_http_info(name, opts)
|
44
|
+
return data
|
45
|
+
end
|
46
|
+
|
47
|
+
# Get job list by group name.
|
48
|
+
# This will list jobs for a particular group.
|
49
|
+
# @param name Name of group for this set of jobs.
|
50
|
+
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [DateTime] :created_after Will return jobs created after this time. In RFC3339 format.
|
52
|
+
# @option opts [Integer] :n Number of jobs to return per page. Default is 50. Max is 1000.
|
53
|
+
# @option opts [String] :cursor Pass this in from a previous query to paginate results.
|
54
|
+
# @return [Array<(JobsWrapper, Fixnum, Hash)>] JobsWrapper data, response status code and response headers
|
55
|
+
def groups_name_jobs_get_with_http_info(name, opts = {})
|
56
|
+
if @api_client.config.debugging
|
57
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_get ..."
|
58
|
+
end
|
59
|
+
# verify the required parameter 'name' is set
|
60
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_get" if name.nil?
|
61
|
+
# resource path
|
62
|
+
local_var_path = "/groups/{name}/jobs".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
|
63
|
+
|
64
|
+
# query parameters
|
65
|
+
query_params = {}
|
66
|
+
query_params[:'created_after'] = opts[:'created_after'] if opts[:'created_after']
|
67
|
+
query_params[:'n'] = opts[:'n'] if opts[:'n']
|
68
|
+
query_params[:'cursor'] = opts[:'cursor'] if opts[:'cursor']
|
69
|
+
|
70
|
+
# header parameters
|
71
|
+
header_params = {}
|
72
|
+
|
73
|
+
# HTTP header 'Accept' (if needed)
|
74
|
+
local_header_accept = ['application/json']
|
75
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
76
|
+
|
77
|
+
# HTTP header 'Content-Type'
|
78
|
+
local_header_content_type = ['application/json']
|
79
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
80
|
+
|
81
|
+
# form parameters
|
82
|
+
form_params = {}
|
83
|
+
|
84
|
+
# http body (model)
|
85
|
+
post_body = nil
|
86
|
+
auth_names = []
|
87
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
88
|
+
:header_params => header_params,
|
89
|
+
:query_params => query_params,
|
90
|
+
:form_params => form_params,
|
91
|
+
:body => post_body,
|
92
|
+
:auth_names => auth_names,
|
93
|
+
:return_type => 'JobsWrapper')
|
94
|
+
if @api_client.config.debugging
|
95
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
96
|
+
end
|
97
|
+
return data, status_code, headers
|
98
|
+
end
|
99
|
+
|
100
|
+
# Cancel a job.
|
101
|
+
# Cancels a job in delayed, queued or running status. The worker may continue to run a running job. reason is set to `client_request`. The job's completed_at field is set to the current time on the jobserver.
|
102
|
+
# @param name Name of group for this set of jobs.
|
103
|
+
# @param id Job id
|
104
|
+
# @param [Hash] opts the optional parameters
|
105
|
+
# @return [JobWrapper]
|
106
|
+
def groups_name_jobs_id_cancel_post(name, id, opts = {})
|
107
|
+
data, _status_code, _headers = groups_name_jobs_id_cancel_post_with_http_info(name, id, opts)
|
108
|
+
return data
|
109
|
+
end
|
110
|
+
|
111
|
+
# Cancel a job.
|
112
|
+
# Cancels a job in delayed, queued or running status. The worker may continue to run a running job. reason is set to `client_request`. The job's completed_at field is set to the current time on the jobserver.
|
113
|
+
# @param name Name of group for this set of jobs.
|
114
|
+
# @param id Job id
|
115
|
+
# @param [Hash] opts the optional parameters
|
116
|
+
# @return [Array<(JobWrapper, Fixnum, Hash)>] JobWrapper data, response status code and response headers
|
117
|
+
def groups_name_jobs_id_cancel_post_with_http_info(name, id, opts = {})
|
118
|
+
if @api_client.config.debugging
|
119
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_cancel_post ..."
|
120
|
+
end
|
121
|
+
# verify the required parameter 'name' is set
|
122
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_cancel_post" if name.nil?
|
123
|
+
# verify the required parameter 'id' is set
|
124
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_cancel_post" if id.nil?
|
125
|
+
# resource path
|
126
|
+
local_var_path = "/groups/{name}/jobs/{id}/cancel".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
127
|
+
|
128
|
+
# query parameters
|
129
|
+
query_params = {}
|
130
|
+
|
131
|
+
# header parameters
|
132
|
+
header_params = {}
|
133
|
+
|
134
|
+
# HTTP header 'Accept' (if needed)
|
135
|
+
local_header_accept = ['application/json']
|
136
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
137
|
+
|
138
|
+
# HTTP header 'Content-Type'
|
139
|
+
local_header_content_type = ['application/json']
|
140
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
141
|
+
|
142
|
+
# form parameters
|
143
|
+
form_params = {}
|
144
|
+
|
145
|
+
# http body (model)
|
146
|
+
post_body = nil
|
147
|
+
auth_names = []
|
148
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
149
|
+
:header_params => header_params,
|
150
|
+
:query_params => query_params,
|
151
|
+
:form_params => form_params,
|
152
|
+
:body => post_body,
|
153
|
+
:auth_names => auth_names,
|
154
|
+
:return_type => 'JobWrapper')
|
155
|
+
if @api_client.config.debugging
|
156
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_cancel_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
157
|
+
end
|
158
|
+
return data, status_code, headers
|
159
|
+
end
|
160
|
+
|
161
|
+
# Delete the job.
|
162
|
+
# Delete only succeeds if job status is one of `succeeded | failed | cancelled`. Cancel a job if it is another state and needs to be deleted. All information about the job, including the log, is irretrievably lost when this is invoked.
|
163
|
+
# @param name Name of group for this set of jobs.
|
164
|
+
# @param id Job id
|
165
|
+
# @param [Hash] opts the optional parameters
|
166
|
+
# @return [nil]
|
167
|
+
def groups_name_jobs_id_delete(name, id, opts = {})
|
168
|
+
groups_name_jobs_id_delete_with_http_info(name, id, opts)
|
169
|
+
return nil
|
170
|
+
end
|
171
|
+
|
172
|
+
# Delete the job.
|
173
|
+
# Delete only succeeds if job status is one of `succeeded | failed | cancelled`. Cancel a job if it is another state and needs to be deleted. All information about the job, including the log, is irretrievably lost when this is invoked.
|
174
|
+
# @param name Name of group for this set of jobs.
|
175
|
+
# @param id Job id
|
176
|
+
# @param [Hash] opts the optional parameters
|
177
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
178
|
+
def groups_name_jobs_id_delete_with_http_info(name, id, opts = {})
|
179
|
+
if @api_client.config.debugging
|
180
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_delete ..."
|
181
|
+
end
|
182
|
+
# verify the required parameter 'name' is set
|
183
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_delete" if name.nil?
|
184
|
+
# verify the required parameter 'id' is set
|
185
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_delete" if id.nil?
|
186
|
+
# resource path
|
187
|
+
local_var_path = "/groups/{name}/jobs/{id}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
188
|
+
|
189
|
+
# query parameters
|
190
|
+
query_params = {}
|
191
|
+
|
192
|
+
# header parameters
|
193
|
+
header_params = {}
|
194
|
+
|
195
|
+
# HTTP header 'Accept' (if needed)
|
196
|
+
local_header_accept = ['application/json']
|
197
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
198
|
+
|
199
|
+
# HTTP header 'Content-Type'
|
200
|
+
local_header_content_type = ['application/json']
|
201
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
202
|
+
|
203
|
+
# form parameters
|
204
|
+
form_params = {}
|
205
|
+
|
206
|
+
# http body (model)
|
207
|
+
post_body = nil
|
208
|
+
auth_names = []
|
209
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
210
|
+
:header_params => header_params,
|
211
|
+
:query_params => query_params,
|
212
|
+
:form_params => form_params,
|
213
|
+
:body => post_body,
|
214
|
+
:auth_names => auth_names)
|
215
|
+
if @api_client.config.debugging
|
216
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
217
|
+
end
|
218
|
+
return data, status_code, headers
|
219
|
+
end
|
220
|
+
|
221
|
+
# Mark job as failed.
|
222
|
+
# Job is marked as failed if it was in a valid state. Job's `finished_at` time is initialized.
|
223
|
+
# @param name Name of group for this set of jobs.
|
224
|
+
# @param id Job id
|
225
|
+
# @param body
|
226
|
+
# @param [Hash] opts the optional parameters
|
227
|
+
# @return [JobWrapper]
|
228
|
+
def groups_name_jobs_id_error_post(name, id, body, opts = {})
|
229
|
+
data, _status_code, _headers = groups_name_jobs_id_error_post_with_http_info(name, id, body, opts)
|
230
|
+
return data
|
231
|
+
end
|
232
|
+
|
233
|
+
# Mark job as failed.
|
234
|
+
# Job is marked as failed if it was in a valid state. Job's `finished_at` time is initialized.
|
235
|
+
# @param name Name of group for this set of jobs.
|
236
|
+
# @param id Job id
|
237
|
+
# @param body
|
238
|
+
# @param [Hash] opts the optional parameters
|
239
|
+
# @return [Array<(JobWrapper, Fixnum, Hash)>] JobWrapper data, response status code and response headers
|
240
|
+
def groups_name_jobs_id_error_post_with_http_info(name, id, body, opts = {})
|
241
|
+
if @api_client.config.debugging
|
242
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_error_post ..."
|
243
|
+
end
|
244
|
+
# verify the required parameter 'name' is set
|
245
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_error_post" if name.nil?
|
246
|
+
# verify the required parameter 'id' is set
|
247
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_error_post" if id.nil?
|
248
|
+
# verify the required parameter 'body' is set
|
249
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_id_error_post" if body.nil?
|
250
|
+
# resource path
|
251
|
+
local_var_path = "/groups/{name}/jobs/{id}/error".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
252
|
+
|
253
|
+
# query parameters
|
254
|
+
query_params = {}
|
255
|
+
|
256
|
+
# header parameters
|
257
|
+
header_params = {}
|
258
|
+
|
259
|
+
# HTTP header 'Accept' (if needed)
|
260
|
+
local_header_accept = ['application/json']
|
261
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
262
|
+
|
263
|
+
# HTTP header 'Content-Type'
|
264
|
+
local_header_content_type = ['application/json']
|
265
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
266
|
+
|
267
|
+
# form parameters
|
268
|
+
form_params = {}
|
269
|
+
|
270
|
+
# http body (model)
|
271
|
+
post_body = @api_client.object_to_http_body(body)
|
272
|
+
auth_names = []
|
273
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
274
|
+
:header_params => header_params,
|
275
|
+
:query_params => query_params,
|
276
|
+
:form_params => form_params,
|
277
|
+
:body => post_body,
|
278
|
+
:auth_names => auth_names,
|
279
|
+
:return_type => 'JobWrapper')
|
280
|
+
if @api_client.config.debugging
|
281
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_error_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
282
|
+
end
|
283
|
+
return data, status_code, headers
|
284
|
+
end
|
285
|
+
|
286
|
+
# Gets job by id
|
287
|
+
# Gets a job by id.
|
288
|
+
# @param name Name of group for this set of jobs.
|
289
|
+
# @param id Job id
|
290
|
+
# @param [Hash] opts the optional parameters
|
291
|
+
# @return [JobWrapper]
|
292
|
+
def groups_name_jobs_id_get(name, id, opts = {})
|
293
|
+
data, _status_code, _headers = groups_name_jobs_id_get_with_http_info(name, id, opts)
|
294
|
+
return data
|
295
|
+
end
|
296
|
+
|
297
|
+
# Gets job by id
|
298
|
+
# Gets a job by id.
|
299
|
+
# @param name Name of group for this set of jobs.
|
300
|
+
# @param id Job id
|
301
|
+
# @param [Hash] opts the optional parameters
|
302
|
+
# @return [Array<(JobWrapper, Fixnum, Hash)>] JobWrapper data, response status code and response headers
|
303
|
+
def groups_name_jobs_id_get_with_http_info(name, id, opts = {})
|
304
|
+
if @api_client.config.debugging
|
305
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_get ..."
|
306
|
+
end
|
307
|
+
# verify the required parameter 'name' is set
|
308
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_get" if name.nil?
|
309
|
+
# verify the required parameter 'id' is set
|
310
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_get" if id.nil?
|
311
|
+
# resource path
|
312
|
+
local_var_path = "/groups/{name}/jobs/{id}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
313
|
+
|
314
|
+
# query parameters
|
315
|
+
query_params = {}
|
316
|
+
|
317
|
+
# header parameters
|
318
|
+
header_params = {}
|
319
|
+
|
320
|
+
# HTTP header 'Accept' (if needed)
|
321
|
+
local_header_accept = ['application/json']
|
322
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
323
|
+
|
324
|
+
# HTTP header 'Content-Type'
|
325
|
+
local_header_content_type = ['application/json']
|
326
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
327
|
+
|
328
|
+
# form parameters
|
329
|
+
form_params = {}
|
330
|
+
|
331
|
+
# http body (model)
|
332
|
+
post_body = nil
|
333
|
+
auth_names = []
|
334
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
335
|
+
:header_params => header_params,
|
336
|
+
:query_params => query_params,
|
337
|
+
:form_params => form_params,
|
338
|
+
:body => post_body,
|
339
|
+
:auth_names => auth_names,
|
340
|
+
:return_type => 'JobWrapper')
|
341
|
+
if @api_client.config.debugging
|
342
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
343
|
+
end
|
344
|
+
return data, status_code, headers
|
345
|
+
end
|
346
|
+
|
347
|
+
# Get the log of a completed job.
|
348
|
+
# Retrieves the log from log storage.
|
349
|
+
# @param name Name of group for this set of jobs.
|
350
|
+
# @param id Job id
|
351
|
+
# @param [Hash] opts the optional parameters
|
352
|
+
# @return [String]
|
353
|
+
def groups_name_jobs_id_log_get(name, id, opts = {})
|
354
|
+
data, _status_code, _headers = groups_name_jobs_id_log_get_with_http_info(name, id, opts)
|
355
|
+
return data
|
356
|
+
end
|
357
|
+
|
358
|
+
# Get the log of a completed job.
|
359
|
+
# Retrieves the log from log storage.
|
360
|
+
# @param name Name of group for this set of jobs.
|
361
|
+
# @param id Job id
|
362
|
+
# @param [Hash] opts the optional parameters
|
363
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
364
|
+
def groups_name_jobs_id_log_get_with_http_info(name, id, opts = {})
|
365
|
+
if @api_client.config.debugging
|
366
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_log_get ..."
|
367
|
+
end
|
368
|
+
# verify the required parameter 'name' is set
|
369
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_log_get" if name.nil?
|
370
|
+
# verify the required parameter 'id' is set
|
371
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_log_get" if id.nil?
|
372
|
+
# resource path
|
373
|
+
local_var_path = "/groups/{name}/jobs/{id}/log".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
374
|
+
|
375
|
+
# query parameters
|
376
|
+
query_params = {}
|
377
|
+
|
378
|
+
# header parameters
|
379
|
+
header_params = {}
|
380
|
+
|
381
|
+
# HTTP header 'Accept' (if needed)
|
382
|
+
local_header_accept = ['text/plain']
|
383
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
384
|
+
|
385
|
+
# HTTP header 'Content-Type'
|
386
|
+
local_header_content_type = ['application/json']
|
387
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
388
|
+
|
389
|
+
# form parameters
|
390
|
+
form_params = {}
|
391
|
+
|
392
|
+
# http body (model)
|
393
|
+
post_body = nil
|
394
|
+
auth_names = []
|
395
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
396
|
+
:header_params => header_params,
|
397
|
+
:query_params => query_params,
|
398
|
+
:form_params => form_params,
|
399
|
+
:body => post_body,
|
400
|
+
:auth_names => auth_names,
|
401
|
+
:return_type => 'String')
|
402
|
+
if @api_client.config.debugging
|
403
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_log_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
404
|
+
end
|
405
|
+
return data, status_code, headers
|
406
|
+
end
|
407
|
+
|
408
|
+
# Send in a log for storage.
|
409
|
+
# Logs are sent after a job completes since they may be very large and the runner can process the next job.
|
410
|
+
# @param name Name of group for this set of jobs.
|
411
|
+
# @param id Job id
|
412
|
+
# @param log Output log for the job. Content-Type must be \"text/plain; charset=utf-8\".
|
413
|
+
# @param [Hash] opts the optional parameters
|
414
|
+
# @return [JobWrapper]
|
415
|
+
def groups_name_jobs_id_log_post(name, id, log, opts = {})
|
416
|
+
data, _status_code, _headers = groups_name_jobs_id_log_post_with_http_info(name, id, log, opts)
|
417
|
+
return data
|
418
|
+
end
|
419
|
+
|
420
|
+
# Send in a log for storage.
|
421
|
+
# Logs are sent after a job completes since they may be very large and the runner can process the next job.
|
422
|
+
# @param name Name of group for this set of jobs.
|
423
|
+
# @param id Job id
|
424
|
+
# @param log Output log for the job. Content-Type must be \"text/plain; charset=utf-8\".
|
425
|
+
# @param [Hash] opts the optional parameters
|
426
|
+
# @return [Array<(JobWrapper, Fixnum, Hash)>] JobWrapper data, response status code and response headers
|
427
|
+
def groups_name_jobs_id_log_post_with_http_info(name, id, log, opts = {})
|
428
|
+
if @api_client.config.debugging
|
429
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_log_post ..."
|
430
|
+
end
|
431
|
+
# verify the required parameter 'name' is set
|
432
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_log_post" if name.nil?
|
433
|
+
# verify the required parameter 'id' is set
|
434
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_log_post" if id.nil?
|
435
|
+
# verify the required parameter 'log' is set
|
436
|
+
fail ArgumentError, "Missing the required parameter 'log' when calling JobsApi.groups_name_jobs_id_log_post" if log.nil?
|
437
|
+
# resource path
|
438
|
+
local_var_path = "/groups/{name}/jobs/{id}/log".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
439
|
+
|
440
|
+
# query parameters
|
441
|
+
query_params = {}
|
442
|
+
|
443
|
+
# header parameters
|
444
|
+
header_params = {}
|
445
|
+
|
446
|
+
# HTTP header 'Accept' (if needed)
|
447
|
+
local_header_accept = ['application/json']
|
448
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
449
|
+
|
450
|
+
# HTTP header 'Content-Type'
|
451
|
+
local_header_content_type = ['multipart/form-data']
|
452
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
453
|
+
|
454
|
+
# form parameters
|
455
|
+
form_params = {}
|
456
|
+
form_params["log"] = log
|
457
|
+
|
458
|
+
# http body (model)
|
459
|
+
post_body = nil
|
460
|
+
auth_names = []
|
461
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
462
|
+
:header_params => header_params,
|
463
|
+
:query_params => query_params,
|
464
|
+
:form_params => form_params,
|
465
|
+
:body => post_body,
|
466
|
+
:auth_names => auth_names,
|
467
|
+
:return_type => 'JobWrapper')
|
468
|
+
if @api_client.config.debugging
|
469
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_log_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
470
|
+
end
|
471
|
+
return data, status_code, headers
|
472
|
+
end
|
473
|
+
|
474
|
+
# Retry a job.
|
475
|
+
# \"The /retry endpoint can be used to force a retry of jobs with status succeeded or cancelled. It can also be used to retry jobs that in the failed state, but whose max_retries field is 0. The retried job will continue to have max_retries = 0.\"
|
476
|
+
# @param name Name of group for this set of jobs.
|
477
|
+
# @param id Job id
|
478
|
+
# @param [Hash] opts the optional parameters
|
479
|
+
# @return [JobWrapper]
|
480
|
+
def groups_name_jobs_id_retry_post(name, id, opts = {})
|
481
|
+
data, _status_code, _headers = groups_name_jobs_id_retry_post_with_http_info(name, id, opts)
|
482
|
+
return data
|
483
|
+
end
|
484
|
+
|
485
|
+
# Retry a job.
|
486
|
+
# \"The /retry endpoint can be used to force a retry of jobs with status succeeded or cancelled. It can also be used to retry jobs that in the failed state, but whose max_retries field is 0. The retried job will continue to have max_retries = 0.\"
|
487
|
+
# @param name Name of group for this set of jobs.
|
488
|
+
# @param id Job id
|
489
|
+
# @param [Hash] opts the optional parameters
|
490
|
+
# @return [Array<(JobWrapper, Fixnum, Hash)>] JobWrapper data, response status code and response headers
|
491
|
+
def groups_name_jobs_id_retry_post_with_http_info(name, id, opts = {})
|
492
|
+
if @api_client.config.debugging
|
493
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_retry_post ..."
|
494
|
+
end
|
495
|
+
# verify the required parameter 'name' is set
|
496
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_retry_post" if name.nil?
|
497
|
+
# verify the required parameter 'id' is set
|
498
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_retry_post" if id.nil?
|
499
|
+
# resource path
|
500
|
+
local_var_path = "/groups/{name}/jobs/{id}/retry".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
501
|
+
|
502
|
+
# query parameters
|
503
|
+
query_params = {}
|
504
|
+
|
505
|
+
# header parameters
|
506
|
+
header_params = {}
|
507
|
+
|
508
|
+
# HTTP header 'Accept' (if needed)
|
509
|
+
local_header_accept = ['application/json']
|
510
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
511
|
+
|
512
|
+
# HTTP header 'Content-Type'
|
513
|
+
local_header_content_type = ['application/json']
|
514
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
515
|
+
|
516
|
+
# form parameters
|
517
|
+
form_params = {}
|
518
|
+
|
519
|
+
# http body (model)
|
520
|
+
post_body = nil
|
521
|
+
auth_names = []
|
522
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
523
|
+
:header_params => header_params,
|
524
|
+
:query_params => query_params,
|
525
|
+
:form_params => form_params,
|
526
|
+
:body => post_body,
|
527
|
+
:auth_names => auth_names,
|
528
|
+
:return_type => 'JobWrapper')
|
529
|
+
if @api_client.config.debugging
|
530
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_retry_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
531
|
+
end
|
532
|
+
return data, status_code, headers
|
533
|
+
end
|
534
|
+
|
535
|
+
# Mark job as started, ie: status = 'running'
|
536
|
+
# Job status is changed to 'running' if it was in a valid state before. Job's `started_at` time is initialized.
|
537
|
+
# @param name Name of group for this set of jobs.
|
538
|
+
# @param id Job id
|
539
|
+
# @param body
|
540
|
+
# @param [Hash] opts the optional parameters
|
541
|
+
# @return [JobWrapper]
|
542
|
+
def groups_name_jobs_id_start_post(name, id, body, opts = {})
|
543
|
+
data, _status_code, _headers = groups_name_jobs_id_start_post_with_http_info(name, id, body, opts)
|
544
|
+
return data
|
545
|
+
end
|
546
|
+
|
547
|
+
# Mark job as started, ie: status = 'running'
|
548
|
+
# Job status is changed to 'running' if it was in a valid state before. Job's `started_at` time is initialized.
|
549
|
+
# @param name Name of group for this set of jobs.
|
550
|
+
# @param id Job id
|
551
|
+
# @param body
|
552
|
+
# @param [Hash] opts the optional parameters
|
553
|
+
# @return [Array<(JobWrapper, Fixnum, Hash)>] JobWrapper data, response status code and response headers
|
554
|
+
def groups_name_jobs_id_start_post_with_http_info(name, id, body, opts = {})
|
555
|
+
if @api_client.config.debugging
|
556
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_start_post ..."
|
557
|
+
end
|
558
|
+
# verify the required parameter 'name' is set
|
559
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_start_post" if name.nil?
|
560
|
+
# verify the required parameter 'id' is set
|
561
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_start_post" if id.nil?
|
562
|
+
# verify the required parameter 'body' is set
|
563
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_id_start_post" if body.nil?
|
564
|
+
# resource path
|
565
|
+
local_var_path = "/groups/{name}/jobs/{id}/start".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
566
|
+
|
567
|
+
# query parameters
|
568
|
+
query_params = {}
|
569
|
+
|
570
|
+
# header parameters
|
571
|
+
header_params = {}
|
572
|
+
|
573
|
+
# HTTP header 'Accept' (if needed)
|
574
|
+
local_header_accept = ['application/json']
|
575
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
576
|
+
|
577
|
+
# HTTP header 'Content-Type'
|
578
|
+
local_header_content_type = ['application/json']
|
579
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
580
|
+
|
581
|
+
# form parameters
|
582
|
+
form_params = {}
|
583
|
+
|
584
|
+
# http body (model)
|
585
|
+
post_body = @api_client.object_to_http_body(body)
|
586
|
+
auth_names = []
|
587
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
588
|
+
:header_params => header_params,
|
589
|
+
:query_params => query_params,
|
590
|
+
:form_params => form_params,
|
591
|
+
:body => post_body,
|
592
|
+
:auth_names => auth_names,
|
593
|
+
:return_type => 'JobWrapper')
|
594
|
+
if @api_client.config.debugging
|
595
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_start_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
596
|
+
end
|
597
|
+
return data, status_code, headers
|
598
|
+
end
|
599
|
+
|
600
|
+
# Mark job as succeeded.
|
601
|
+
# Job status is changed to succeeded if it was in a valid state before. Job's `completed_at` time is initialized.
|
602
|
+
# @param name Name of group for this set of jobs.
|
603
|
+
# @param id Job id
|
604
|
+
# @param body
|
605
|
+
# @param [Hash] opts the optional parameters
|
606
|
+
# @return [JobWrapper]
|
607
|
+
def groups_name_jobs_id_success_post(name, id, body, opts = {})
|
608
|
+
data, _status_code, _headers = groups_name_jobs_id_success_post_with_http_info(name, id, body, opts)
|
609
|
+
return data
|
610
|
+
end
|
611
|
+
|
612
|
+
# Mark job as succeeded.
|
613
|
+
# Job status is changed to succeeded if it was in a valid state before. Job's `completed_at` time is initialized.
|
614
|
+
# @param name Name of group for this set of jobs.
|
615
|
+
# @param id Job id
|
616
|
+
# @param body
|
617
|
+
# @param [Hash] opts the optional parameters
|
618
|
+
# @return [Array<(JobWrapper, Fixnum, Hash)>] JobWrapper data, response status code and response headers
|
619
|
+
def groups_name_jobs_id_success_post_with_http_info(name, id, body, opts = {})
|
620
|
+
if @api_client.config.debugging
|
621
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_success_post ..."
|
622
|
+
end
|
623
|
+
# verify the required parameter 'name' is set
|
624
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_success_post" if name.nil?
|
625
|
+
# verify the required parameter 'id' is set
|
626
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_success_post" if id.nil?
|
627
|
+
# verify the required parameter 'body' is set
|
628
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_id_success_post" if body.nil?
|
629
|
+
# resource path
|
630
|
+
local_var_path = "/groups/{name}/jobs/{id}/success".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
631
|
+
|
632
|
+
# query parameters
|
633
|
+
query_params = {}
|
634
|
+
|
635
|
+
# header parameters
|
636
|
+
header_params = {}
|
637
|
+
|
638
|
+
# HTTP header 'Accept' (if needed)
|
639
|
+
local_header_accept = ['application/json']
|
640
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
641
|
+
|
642
|
+
# HTTP header 'Content-Type'
|
643
|
+
local_header_content_type = ['application/json']
|
644
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
645
|
+
|
646
|
+
# form parameters
|
647
|
+
form_params = {}
|
648
|
+
|
649
|
+
# http body (model)
|
650
|
+
post_body = @api_client.object_to_http_body(body)
|
651
|
+
auth_names = []
|
652
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
653
|
+
:header_params => header_params,
|
654
|
+
:query_params => query_params,
|
655
|
+
:form_params => form_params,
|
656
|
+
:body => post_body,
|
657
|
+
:auth_names => auth_names,
|
658
|
+
:return_type => 'JobWrapper')
|
659
|
+
if @api_client.config.debugging
|
660
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_success_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
661
|
+
end
|
662
|
+
return data, status_code, headers
|
663
|
+
end
|
664
|
+
|
665
|
+
# Extend job timeout.
|
666
|
+
# Consumers can sometimes take a while to run the task after accepting it. An example is when the runner does not have the docker image locally, it can spend a significant time downloading the image. If the timeout is small, the job may never get to run, or run but not be accepted by Titan. Consumers can touch the job before it times out. Titan will reset the timeout, giving the consumer another timeout seconds to run the job. Touch is only valid while the job is in a running state. If touch fails, the runner may stop running the job.
|
667
|
+
# @param name Name of group for this set of jobs.
|
668
|
+
# @param id Job id
|
669
|
+
# @param [Hash] opts the optional parameters
|
670
|
+
# @return [nil]
|
671
|
+
def groups_name_jobs_id_touch_post(name, id, opts = {})
|
672
|
+
groups_name_jobs_id_touch_post_with_http_info(name, id, opts)
|
673
|
+
return nil
|
674
|
+
end
|
675
|
+
|
676
|
+
# Extend job timeout.
|
677
|
+
# Consumers can sometimes take a while to run the task after accepting it. An example is when the runner does not have the docker image locally, it can spend a significant time downloading the image. If the timeout is small, the job may never get to run, or run but not be accepted by Titan. Consumers can touch the job before it times out. Titan will reset the timeout, giving the consumer another timeout seconds to run the job. Touch is only valid while the job is in a running state. If touch fails, the runner may stop running the job.
|
678
|
+
# @param name Name of group for this set of jobs.
|
679
|
+
# @param id Job id
|
680
|
+
# @param [Hash] opts the optional parameters
|
681
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
682
|
+
def groups_name_jobs_id_touch_post_with_http_info(name, id, opts = {})
|
683
|
+
if @api_client.config.debugging
|
684
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_touch_post ..."
|
685
|
+
end
|
686
|
+
# verify the required parameter 'name' is set
|
687
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_touch_post" if name.nil?
|
688
|
+
# verify the required parameter 'id' is set
|
689
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_touch_post" if id.nil?
|
690
|
+
# resource path
|
691
|
+
local_var_path = "/groups/{name}/jobs/{id}/touch".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
|
692
|
+
|
693
|
+
# query parameters
|
694
|
+
query_params = {}
|
695
|
+
|
696
|
+
# header parameters
|
697
|
+
header_params = {}
|
698
|
+
|
699
|
+
# HTTP header 'Accept' (if needed)
|
700
|
+
local_header_accept = ['application/json']
|
701
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
702
|
+
|
703
|
+
# HTTP header 'Content-Type'
|
704
|
+
local_header_content_type = ['application/json']
|
705
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
706
|
+
|
707
|
+
# form parameters
|
708
|
+
form_params = {}
|
709
|
+
|
710
|
+
# http body (model)
|
711
|
+
post_body = nil
|
712
|
+
auth_names = []
|
713
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
714
|
+
:header_params => header_params,
|
715
|
+
:query_params => query_params,
|
716
|
+
:form_params => form_params,
|
717
|
+
:body => post_body,
|
718
|
+
:auth_names => auth_names)
|
719
|
+
if @api_client.config.debugging
|
720
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_touch_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
721
|
+
end
|
722
|
+
return data, status_code, headers
|
723
|
+
end
|
724
|
+
|
725
|
+
# Enqueue Job
|
726
|
+
# Enqueues job(s). If any of the jobs is invalid, none of the jobs are enqueued.
|
727
|
+
# @param name name of the group.
|
728
|
+
# @param body Array of jobs to post.
|
729
|
+
# @param [Hash] opts the optional parameters
|
730
|
+
# @return [JobsWrapper]
|
731
|
+
def groups_name_jobs_post(name, body, opts = {})
|
732
|
+
data, _status_code, _headers = groups_name_jobs_post_with_http_info(name, body, opts)
|
733
|
+
return data
|
734
|
+
end
|
735
|
+
|
736
|
+
# Enqueue Job
|
737
|
+
# Enqueues job(s). If any of the jobs is invalid, none of the jobs are enqueued.
|
738
|
+
# @param name name of the group.
|
739
|
+
# @param body Array of jobs to post.
|
740
|
+
# @param [Hash] opts the optional parameters
|
741
|
+
# @return [Array<(JobsWrapper, Fixnum, Hash)>] JobsWrapper data, response status code and response headers
|
742
|
+
def groups_name_jobs_post_with_http_info(name, body, opts = {})
|
743
|
+
if @api_client.config.debugging
|
744
|
+
@api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_post ..."
|
745
|
+
end
|
746
|
+
# verify the required parameter 'name' is set
|
747
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_post" if name.nil?
|
748
|
+
# verify the required parameter 'body' is set
|
749
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_post" if body.nil?
|
750
|
+
# resource path
|
751
|
+
local_var_path = "/groups/{name}/jobs".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
|
752
|
+
|
753
|
+
# query parameters
|
754
|
+
query_params = {}
|
755
|
+
|
756
|
+
# header parameters
|
757
|
+
header_params = {}
|
758
|
+
|
759
|
+
# HTTP header 'Accept' (if needed)
|
760
|
+
local_header_accept = ['application/json']
|
761
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
762
|
+
|
763
|
+
# HTTP header 'Content-Type'
|
764
|
+
local_header_content_type = ['application/json']
|
765
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
766
|
+
|
767
|
+
# form parameters
|
768
|
+
form_params = {}
|
769
|
+
|
770
|
+
# http body (model)
|
771
|
+
post_body = @api_client.object_to_http_body(body)
|
772
|
+
auth_names = []
|
773
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
774
|
+
:header_params => header_params,
|
775
|
+
:query_params => query_params,
|
776
|
+
:form_params => form_params,
|
777
|
+
:body => post_body,
|
778
|
+
:auth_names => auth_names,
|
779
|
+
:return_type => 'JobsWrapper')
|
780
|
+
if @api_client.config.debugging
|
781
|
+
@api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
782
|
+
end
|
783
|
+
return data, status_code, headers
|
784
|
+
end
|
785
|
+
|
786
|
+
# Get next job.
|
787
|
+
# Gets the next job in the queue, ready for processing. Titan may return <=n jobs. Consumers should start processing jobs in order. Each returned job is set to `status` \"running\" and `started_at` is set to the current time. No other consumer can retrieve this job.
|
788
|
+
# @param [Hash] opts the optional parameters
|
789
|
+
# @option opts [Integer] :n Number of jobs to return. (default to 1)
|
790
|
+
# @return [JobsWrapper]
|
791
|
+
def jobs_get(opts = {})
|
792
|
+
data, _status_code, _headers = jobs_get_with_http_info(opts)
|
793
|
+
return data
|
794
|
+
end
|
795
|
+
|
796
|
+
# Get next job.
|
797
|
+
# Gets the next job in the queue, ready for processing. Titan may return <=n jobs. Consumers should start processing jobs in order. Each returned job is set to `status` \"running\" and `started_at` is set to the current time. No other consumer can retrieve this job.
|
798
|
+
# @param [Hash] opts the optional parameters
|
799
|
+
# @option opts [Integer] :n Number of jobs to return.
|
800
|
+
# @return [Array<(JobsWrapper, Fixnum, Hash)>] JobsWrapper data, response status code and response headers
|
801
|
+
def jobs_get_with_http_info(opts = {})
|
802
|
+
if @api_client.config.debugging
|
803
|
+
@api_client.config.logger.debug "Calling API: JobsApi.jobs_get ..."
|
804
|
+
end
|
805
|
+
# resource path
|
806
|
+
local_var_path = "/jobs".sub('{format}','json')
|
807
|
+
|
808
|
+
# query parameters
|
809
|
+
query_params = {}
|
810
|
+
query_params[:'n'] = opts[:'n'] if opts[:'n']
|
811
|
+
|
812
|
+
# header parameters
|
813
|
+
header_params = {}
|
814
|
+
|
815
|
+
# HTTP header 'Accept' (if needed)
|
816
|
+
local_header_accept = ['application/json']
|
817
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
818
|
+
|
819
|
+
# HTTP header 'Content-Type'
|
820
|
+
local_header_content_type = ['application/json']
|
821
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
822
|
+
|
823
|
+
# form parameters
|
824
|
+
form_params = {}
|
825
|
+
|
826
|
+
# http body (model)
|
827
|
+
post_body = nil
|
828
|
+
auth_names = []
|
829
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
830
|
+
:header_params => header_params,
|
831
|
+
:query_params => query_params,
|
832
|
+
:form_params => form_params,
|
833
|
+
:body => post_body,
|
834
|
+
:auth_names => auth_names,
|
835
|
+
:return_type => 'JobsWrapper')
|
836
|
+
if @api_client.config.debugging
|
837
|
+
@api_client.config.logger.debug "API called: JobsApi#jobs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
838
|
+
end
|
839
|
+
return data, status_code, headers
|
840
|
+
end
|
841
|
+
end
|
842
|
+
end
|