smplkit 3.0.82 → 3.0.83
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/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb +420 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb +281 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/usage_api.rb +82 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_client.rb +441 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_error.rb +58 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_model_base.rb +88 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/configuration.rb +392 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/http_header.rb +220 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job.rb +401 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_create_request.rb +165 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_create_resource.rb +237 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_http_configuration.rb +368 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_list_response.rb +193 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_request.rb +165 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_resource.rb +186 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_response.rb +165 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/list_meta.rb +165 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/pagination_meta.rb +215 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run.rb +405 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_links.rb +149 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_meta.rb +166 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_response.rb +203 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_resource.rb +202 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_response.rb +165 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage.rb +274 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage_resource.rb +187 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage_response.rb +165 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/version.rb +15 -0
- data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client.rb +63 -0
- data/lib/smplkit/_generated/jobs/spec/api/jobs_api_spec.rb +111 -0
- data/lib/smplkit/_generated/jobs/spec/api/runs_api_spec.rb +85 -0
- data/lib/smplkit/_generated/jobs/spec/api/usage_api_spec.rb +47 -0
- data/lib/smplkit/_generated/jobs/spec/models/http_header_spec.rb +42 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_create_request_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_create_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_http_configuration_spec.rb +82 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_list_response_spec.rb +42 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_request_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_resource_spec.rb +48 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_response_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/job_spec.rb +110 -0
- data/lib/smplkit/_generated/jobs/spec/models/list_meta_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/pagination_meta_spec.rb +54 -0
- data/lib/smplkit/_generated/jobs/spec/models/run_list_links_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/run_list_meta_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/run_list_response_spec.rb +48 -0
- data/lib/smplkit/_generated/jobs/spec/models/run_resource_spec.rb +48 -0
- data/lib/smplkit/_generated/jobs/spec/models/run_response_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/run_spec.rb +138 -0
- data/lib/smplkit/_generated/jobs/spec/models/usage_resource_spec.rb +48 -0
- data/lib/smplkit/_generated/jobs/spec/models/usage_response_spec.rb +36 -0
- data/lib/smplkit/_generated/jobs/spec/models/usage_spec.rb +60 -0
- data/lib/smplkit/_generated/jobs/spec/spec_helper.rb +111 -0
- metadata +54 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c306fbb8f49cc593c4988f4717f10ad634ff28c768b87e132ce8a9e15395962
|
|
4
|
+
data.tar.gz: 10ad1f6409a137133bb63f43f856e48022ca3d6cddd398a5d1aa15e6d8b026b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2469ab35543347240453b9e90f8913f638049730052e1b306a139cda51ea6fbc5de85abcc3842bb3dfb1691bc089151205799cdac2feff6027b6eb5c07da860
|
|
7
|
+
data.tar.gz: 5f8aa745f79295e3cb7df2280432a5eae1cacde66ad510b639b7409ccbda84065a73c333255dbf62a464b32123608f9bb5265d708ea79afe4de63c49edb6cae7
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit Jobs API
|
|
3
|
+
|
|
4
|
+
#Scheduled HTTP job execution API for smplkit.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module SmplkitGeneratedClient::Jobs
|
|
16
|
+
class JobsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create Job
|
|
23
|
+
# Create a job for this account. The caller supplies the job's id (a slug) as `data.id`. Slugs are unique within an account and immutable. An enabled job begins scheduling immediately.
|
|
24
|
+
# @param job_create_request [JobCreateRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [JobResponse]
|
|
27
|
+
def create_job(job_create_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_job_with_http_info(job_create_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create Job
|
|
33
|
+
# Create a job for this account. The caller supplies the job's id (a slug) as `data.id`. Slugs are unique within an account and immutable. An enabled job begins scheduling immediately.
|
|
34
|
+
# @param job_create_request [JobCreateRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(JobResponse, Integer, Hash)>] JobResponse data, response status code and response headers
|
|
37
|
+
def create_job_with_http_info(job_create_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.create_job ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'job_create_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && job_create_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'job_create_request' when calling JobsApi.create_job"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/jobs'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(job_create_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'JobResponse'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"JobsApi.create_job",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: JobsApi#create_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Delete Job
|
|
91
|
+
# Delete a job. Its run history is retained; the slug may be reused later.
|
|
92
|
+
# @param job_id [String]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [nil]
|
|
95
|
+
def delete_job(job_id, opts = {})
|
|
96
|
+
delete_job_with_http_info(job_id, opts)
|
|
97
|
+
nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Delete Job
|
|
101
|
+
# Delete a job. Its run history is retained; the slug may be reused later.
|
|
102
|
+
# @param job_id [String]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
105
|
+
def delete_job_with_http_info(job_id, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.delete_job ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'job_id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.delete_job"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/api/v1/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
|
|
122
|
+
# form parameters
|
|
123
|
+
form_params = opts[:form_params] || {}
|
|
124
|
+
|
|
125
|
+
# http body (model)
|
|
126
|
+
post_body = opts[:debug_body]
|
|
127
|
+
|
|
128
|
+
# return_type
|
|
129
|
+
return_type = opts[:debug_return_type]
|
|
130
|
+
|
|
131
|
+
# auth_names
|
|
132
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
133
|
+
|
|
134
|
+
new_options = opts.merge(
|
|
135
|
+
:operation => :"JobsApi.delete_job",
|
|
136
|
+
:header_params => header_params,
|
|
137
|
+
:query_params => query_params,
|
|
138
|
+
:form_params => form_params,
|
|
139
|
+
:body => post_body,
|
|
140
|
+
:auth_names => auth_names,
|
|
141
|
+
:return_type => return_type
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
145
|
+
if @api_client.config.debugging
|
|
146
|
+
@api_client.config.logger.debug "API called: JobsApi#delete_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
147
|
+
end
|
|
148
|
+
return data, status_code, headers
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Get Job
|
|
152
|
+
# Retrieve a single job by its id (slug).
|
|
153
|
+
# @param job_id [String]
|
|
154
|
+
# @param [Hash] opts the optional parameters
|
|
155
|
+
# @return [JobResponse]
|
|
156
|
+
def get_job(job_id, opts = {})
|
|
157
|
+
data, _status_code, _headers = get_job_with_http_info(job_id, opts)
|
|
158
|
+
data
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Get Job
|
|
162
|
+
# Retrieve a single job by its id (slug).
|
|
163
|
+
# @param job_id [String]
|
|
164
|
+
# @param [Hash] opts the optional parameters
|
|
165
|
+
# @return [Array<(JobResponse, Integer, Hash)>] JobResponse data, response status code and response headers
|
|
166
|
+
def get_job_with_http_info(job_id, opts = {})
|
|
167
|
+
if @api_client.config.debugging
|
|
168
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.get_job ...'
|
|
169
|
+
end
|
|
170
|
+
# verify the required parameter 'job_id' is set
|
|
171
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
172
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.get_job"
|
|
173
|
+
end
|
|
174
|
+
# resource path
|
|
175
|
+
local_var_path = '/api/v1/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))
|
|
176
|
+
|
|
177
|
+
# query parameters
|
|
178
|
+
query_params = opts[:query_params] || {}
|
|
179
|
+
|
|
180
|
+
# header parameters
|
|
181
|
+
header_params = opts[:header_params] || {}
|
|
182
|
+
# HTTP header 'Accept' (if needed)
|
|
183
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
184
|
+
|
|
185
|
+
# form parameters
|
|
186
|
+
form_params = opts[:form_params] || {}
|
|
187
|
+
|
|
188
|
+
# http body (model)
|
|
189
|
+
post_body = opts[:debug_body]
|
|
190
|
+
|
|
191
|
+
# return_type
|
|
192
|
+
return_type = opts[:debug_return_type] || 'JobResponse'
|
|
193
|
+
|
|
194
|
+
# auth_names
|
|
195
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
196
|
+
|
|
197
|
+
new_options = opts.merge(
|
|
198
|
+
:operation => :"JobsApi.get_job",
|
|
199
|
+
:header_params => header_params,
|
|
200
|
+
:query_params => query_params,
|
|
201
|
+
:form_params => form_params,
|
|
202
|
+
:body => post_body,
|
|
203
|
+
:auth_names => auth_names,
|
|
204
|
+
:return_type => return_type
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
208
|
+
if @api_client.config.debugging
|
|
209
|
+
@api_client.config.logger.debug "API called: JobsApi#get_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
210
|
+
end
|
|
211
|
+
return data, status_code, headers
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# List Jobs
|
|
215
|
+
# List this account's jobs, newest first.
|
|
216
|
+
# @param [Hash] opts the optional parameters
|
|
217
|
+
# @option opts [Boolean] :filter_enabled
|
|
218
|
+
# @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
|
|
219
|
+
# @option opts [Integer] :page_size Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
|
|
220
|
+
# @option opts [Boolean] :meta_total When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
|
|
221
|
+
# @return [JobListResponse]
|
|
222
|
+
def list_jobs(opts = {})
|
|
223
|
+
data, _status_code, _headers = list_jobs_with_http_info(opts)
|
|
224
|
+
data
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# List Jobs
|
|
228
|
+
# List this account's jobs, newest first.
|
|
229
|
+
# @param [Hash] opts the optional parameters
|
|
230
|
+
# @option opts [Boolean] :filter_enabled
|
|
231
|
+
# @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
|
|
232
|
+
# @option opts [Integer] :page_size Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
|
|
233
|
+
# @option opts [Boolean] :meta_total When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
|
|
234
|
+
# @return [Array<(JobListResponse, Integer, Hash)>] JobListResponse data, response status code and response headers
|
|
235
|
+
def list_jobs_with_http_info(opts = {})
|
|
236
|
+
if @api_client.config.debugging
|
|
237
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.list_jobs ...'
|
|
238
|
+
end
|
|
239
|
+
# resource path
|
|
240
|
+
local_var_path = '/api/v1/jobs'
|
|
241
|
+
|
|
242
|
+
# query parameters
|
|
243
|
+
query_params = opts[:query_params] || {}
|
|
244
|
+
query_params[:'filter[enabled]'] = opts[:'filter_enabled'] if !opts[:'filter_enabled'].nil?
|
|
245
|
+
query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
|
|
246
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
247
|
+
query_params[:'meta[total]'] = opts[:'meta_total'] if !opts[:'meta_total'].nil?
|
|
248
|
+
|
|
249
|
+
# header parameters
|
|
250
|
+
header_params = opts[:header_params] || {}
|
|
251
|
+
# HTTP header 'Accept' (if needed)
|
|
252
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
253
|
+
|
|
254
|
+
# form parameters
|
|
255
|
+
form_params = opts[:form_params] || {}
|
|
256
|
+
|
|
257
|
+
# http body (model)
|
|
258
|
+
post_body = opts[:debug_body]
|
|
259
|
+
|
|
260
|
+
# return_type
|
|
261
|
+
return_type = opts[:debug_return_type] || 'JobListResponse'
|
|
262
|
+
|
|
263
|
+
# auth_names
|
|
264
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
265
|
+
|
|
266
|
+
new_options = opts.merge(
|
|
267
|
+
:operation => :"JobsApi.list_jobs",
|
|
268
|
+
:header_params => header_params,
|
|
269
|
+
:query_params => query_params,
|
|
270
|
+
:form_params => form_params,
|
|
271
|
+
:body => post_body,
|
|
272
|
+
:auth_names => auth_names,
|
|
273
|
+
:return_type => return_type
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
277
|
+
if @api_client.config.debugging
|
|
278
|
+
@api_client.config.logger.debug "API called: JobsApi#list_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
279
|
+
end
|
|
280
|
+
return data, status_code, headers
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Run Job Now
|
|
284
|
+
# Trigger one immediate run of the job (a `MANUAL` run). The job's schedule and enabled state are untouched. The run is enqueued and executed by the worker; if the account is over its run allotment the run will fail with reason `QUOTA_EXCEEDED` rather than being rejected here.
|
|
285
|
+
# @param job_id [String]
|
|
286
|
+
# @param [Hash] opts the optional parameters
|
|
287
|
+
# @return [RunResponse]
|
|
288
|
+
def run_job_now(job_id, opts = {})
|
|
289
|
+
data, _status_code, _headers = run_job_now_with_http_info(job_id, opts)
|
|
290
|
+
data
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Run Job Now
|
|
294
|
+
# Trigger one immediate run of the job (a `MANUAL` run). The job's schedule and enabled state are untouched. The run is enqueued and executed by the worker; if the account is over its run allotment the run will fail with reason `QUOTA_EXCEEDED` rather than being rejected here.
|
|
295
|
+
# @param job_id [String]
|
|
296
|
+
# @param [Hash] opts the optional parameters
|
|
297
|
+
# @return [Array<(RunResponse, Integer, Hash)>] RunResponse data, response status code and response headers
|
|
298
|
+
def run_job_now_with_http_info(job_id, opts = {})
|
|
299
|
+
if @api_client.config.debugging
|
|
300
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.run_job_now ...'
|
|
301
|
+
end
|
|
302
|
+
# verify the required parameter 'job_id' is set
|
|
303
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
304
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.run_job_now"
|
|
305
|
+
end
|
|
306
|
+
# resource path
|
|
307
|
+
local_var_path = '/api/v1/jobs/{job_id}/actions/run'.sub('{job_id}', CGI.escape(job_id.to_s))
|
|
308
|
+
|
|
309
|
+
# query parameters
|
|
310
|
+
query_params = opts[:query_params] || {}
|
|
311
|
+
|
|
312
|
+
# header parameters
|
|
313
|
+
header_params = opts[:header_params] || {}
|
|
314
|
+
# HTTP header 'Accept' (if needed)
|
|
315
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
316
|
+
|
|
317
|
+
# form parameters
|
|
318
|
+
form_params = opts[:form_params] || {}
|
|
319
|
+
|
|
320
|
+
# http body (model)
|
|
321
|
+
post_body = opts[:debug_body]
|
|
322
|
+
|
|
323
|
+
# return_type
|
|
324
|
+
return_type = opts[:debug_return_type] || 'RunResponse'
|
|
325
|
+
|
|
326
|
+
# auth_names
|
|
327
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
328
|
+
|
|
329
|
+
new_options = opts.merge(
|
|
330
|
+
:operation => :"JobsApi.run_job_now",
|
|
331
|
+
:header_params => header_params,
|
|
332
|
+
:query_params => query_params,
|
|
333
|
+
:form_params => form_params,
|
|
334
|
+
:body => post_body,
|
|
335
|
+
:auth_names => auth_names,
|
|
336
|
+
:return_type => return_type
|
|
337
|
+
)
|
|
338
|
+
|
|
339
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
340
|
+
if @api_client.config.debugging
|
|
341
|
+
@api_client.config.logger.debug "API called: JobsApi#run_job_now\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
342
|
+
end
|
|
343
|
+
return data, status_code, headers
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# Update Job
|
|
347
|
+
# Replace an existing job. Every writable field is overwritten. Enabling a paused job is a `PUT` with `enabled: true`; pausing is `enabled: false`. Editing the schedule recomputes the next fire time.
|
|
348
|
+
# @param job_id [String]
|
|
349
|
+
# @param job_request [JobRequest]
|
|
350
|
+
# @param [Hash] opts the optional parameters
|
|
351
|
+
# @return [JobResponse]
|
|
352
|
+
def update_job(job_id, job_request, opts = {})
|
|
353
|
+
data, _status_code, _headers = update_job_with_http_info(job_id, job_request, opts)
|
|
354
|
+
data
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# Update Job
|
|
358
|
+
# Replace an existing job. Every writable field is overwritten. Enabling a paused job is a `PUT` with `enabled: true`; pausing is `enabled: false`. Editing the schedule recomputes the next fire time.
|
|
359
|
+
# @param job_id [String]
|
|
360
|
+
# @param job_request [JobRequest]
|
|
361
|
+
# @param [Hash] opts the optional parameters
|
|
362
|
+
# @return [Array<(JobResponse, Integer, Hash)>] JobResponse data, response status code and response headers
|
|
363
|
+
def update_job_with_http_info(job_id, job_request, opts = {})
|
|
364
|
+
if @api_client.config.debugging
|
|
365
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.update_job ...'
|
|
366
|
+
end
|
|
367
|
+
# verify the required parameter 'job_id' is set
|
|
368
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
369
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.update_job"
|
|
370
|
+
end
|
|
371
|
+
# verify the required parameter 'job_request' is set
|
|
372
|
+
if @api_client.config.client_side_validation && job_request.nil?
|
|
373
|
+
fail ArgumentError, "Missing the required parameter 'job_request' when calling JobsApi.update_job"
|
|
374
|
+
end
|
|
375
|
+
# resource path
|
|
376
|
+
local_var_path = '/api/v1/jobs/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s))
|
|
377
|
+
|
|
378
|
+
# query parameters
|
|
379
|
+
query_params = opts[:query_params] || {}
|
|
380
|
+
|
|
381
|
+
# header parameters
|
|
382
|
+
header_params = opts[:header_params] || {}
|
|
383
|
+
# HTTP header 'Accept' (if needed)
|
|
384
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
385
|
+
# HTTP header 'Content-Type'
|
|
386
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
387
|
+
if !content_type.nil?
|
|
388
|
+
header_params['Content-Type'] = content_type
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# form parameters
|
|
392
|
+
form_params = opts[:form_params] || {}
|
|
393
|
+
|
|
394
|
+
# http body (model)
|
|
395
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(job_request)
|
|
396
|
+
|
|
397
|
+
# return_type
|
|
398
|
+
return_type = opts[:debug_return_type] || 'JobResponse'
|
|
399
|
+
|
|
400
|
+
# auth_names
|
|
401
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
402
|
+
|
|
403
|
+
new_options = opts.merge(
|
|
404
|
+
:operation => :"JobsApi.update_job",
|
|
405
|
+
:header_params => header_params,
|
|
406
|
+
:query_params => query_params,
|
|
407
|
+
:form_params => form_params,
|
|
408
|
+
:body => post_body,
|
|
409
|
+
:auth_names => auth_names,
|
|
410
|
+
:return_type => return_type
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
414
|
+
if @api_client.config.debugging
|
|
415
|
+
@api_client.config.logger.debug "API called: JobsApi#update_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
416
|
+
end
|
|
417
|
+
return data, status_code, headers
|
|
418
|
+
end
|
|
419
|
+
end
|
|
420
|
+
end
|