Class: SmplkitGeneratedClient::Jobs::RunsApi
- Inherits:
-
Object
- Object
- SmplkitGeneratedClient::Jobs::RunsApi
- Defined in:
- lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#cancel_run(run_id, opts = {}) ⇒ RunResponse
Cancel Run Cancel a pending or running run.
-
#cancel_run_with_http_info(run_id, opts = {}) ⇒ Array<(RunResponse, Integer, Hash)>
Cancel Run Cancel a pending or running run.
-
#get_run(run_id, opts = {}) ⇒ RunResponse
Get Run Retrieve a single run by its id.
-
#get_run_with_http_info(run_id, opts = {}) ⇒ Array<(RunResponse, Integer, Hash)>
Get Run Retrieve a single run by its id.
-
#initialize(api_client = ApiClient.default) ⇒ RunsApi
constructor
A new instance of RunsApi.
-
#list_runs(opts = {}) ⇒ RunListResponse
List Runs List runs for this account (cursor paginated).
-
#list_runs_with_http_info(opts = {}) ⇒ Array<(RunListResponse, Integer, Hash)>
List Runs List runs for this account (cursor paginated).
-
#rerun_run(run_id, opts = {}) ⇒ RunResponse
Rerun Run Spawn a new run from a prior run, using the job’s current configuration.
-
#rerun_run_with_http_info(run_id, opts = {}) ⇒ Array<(RunResponse, Integer, Hash)>
Rerun Run Spawn a new run from a prior run, using the job's current configuration.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#cancel_run(run_id, opts = {}) ⇒ RunResponse
Cancel Run Cancel a pending or running run. Returns ‘409` if the run is already in a terminal state. Canceling a running run stops us tracking it, but the HTTP request may already be in flight — cancel means "stop tracking," not "guaranteed it didn’t happen."
27 28 29 30 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 27 def cancel_run(run_id, opts = {}) data, _status_code, _headers = cancel_run_with_http_info(run_id, opts) data end |
#cancel_run_with_http_info(run_id, opts = {}) ⇒ Array<(RunResponse, Integer, Hash)>
Cancel Run Cancel a pending or running run. Returns `409` if the run is already in a terminal state. Canceling a running run stops us tracking it, but the HTTP request may already be in flight — cancel means "stop tracking," not "guaranteed it didn't happen."
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 37 def cancel_run_with_http_info(run_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RunsApi.cancel_run ...' end # verify the required parameter 'run_id' is set if @api_client.config.client_side_validation && run_id.nil? fail ArgumentError, "Missing the required parameter 'run_id' when calling RunsApi.cancel_run" end # resource path local_var_path = '/api/v1/runs/{run_id}/actions/cancel'.sub('{run_id}', CGI.escape(run_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RunResponse' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"RunsApi.cancel_run", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RunsApi#cancel_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_run(run_id, opts = {}) ⇒ RunResponse
Get Run Retrieve a single run by its id.
90 91 92 93 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 90 def get_run(run_id, opts = {}) data, _status_code, _headers = get_run_with_http_info(run_id, opts) data end |
#get_run_with_http_info(run_id, opts = {}) ⇒ Array<(RunResponse, Integer, Hash)>
Get Run Retrieve a single run by its id.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 100 def get_run_with_http_info(run_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RunsApi.get_run ...' end # verify the required parameter 'run_id' is set if @api_client.config.client_side_validation && run_id.nil? fail ArgumentError, "Missing the required parameter 'run_id' when calling RunsApi.get_run" end # resource path local_var_path = '/api/v1/runs/{run_id}'.sub('{run_id}', CGI.escape(run_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RunResponse' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"RunsApi.get_run", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RunsApi#get_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_runs(opts = {}) ⇒ RunListResponse
List Runs List runs for this account (cursor paginated). Default sort is ‘-created_at` (newest first). Sort by `created_at`, `started_at`, `finished_at`, `scheduled_for`, `status`, `job`, or `total_duration_ms`, ascending or descending (prefix `-` for descending). Keep the same `sort` value across paginated requests so the cursor stays consistent. Runs that have not reached the relevant lifecycle point (`started_at`, `finished_at`, `scheduled_for`, `total_duration_ms` unset) sort to the end regardless of direction. Filters compose with AND: - `filter=id` — a single job’s run history. - ‘filter` — one state or a comma-separated list (any-of). - `filter` / `filter` / `filter` / `filter` — half-open `[start,end)` date ranges (see each parameter for the interval syntax).
161 162 163 164 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 161 def list_runs(opts = {}) data, _status_code, _headers = list_runs_with_http_info(opts) data end |
#list_runs_with_http_info(opts = {}) ⇒ Array<(RunListResponse, Integer, Hash)>
List Runs List runs for this account (cursor paginated). Default sort is `-created_at` (newest first). Sort by `created_at`, `started_at`, `finished_at`, `scheduled_for`, `status`, `job`, or `total_duration_ms`, ascending or descending (prefix `-` for descending). Keep the same `sort` value across paginated requests so the cursor stays consistent. Runs that have not reached the relevant lifecycle point (`started_at`, `finished_at`, `scheduled_for`, `total_duration_ms` unset) sort to the end regardless of direction. Filters compose with AND: - `filter=id` — a single job's run history. - `filter` — one state or a comma-separated list (any-of). - `filter` / `filter` / `filter` / `filter` — half-open `[start,end)` date ranges (see each parameter for the interval syntax).
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 179 def list_runs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RunsApi.list_runs ...' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling RunsApi.list_runs, must be greater than or equal to 1.' end allowable_values = ["created_at", "-created_at", "finished_at", "-finished_at", "job", "-job", "scheduled_for", "-scheduled_for", "started_at", "-started_at", "status", "-status", "total_duration_ms", "-total_duration_ms"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/v1/runs' # query parameters query_params = opts[:query_params] || {} query_params[:'filter[job]'] = opts[:'filter_job'] if !opts[:'filter_job'].nil? query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil? query_params[:'filter[created_at]'] = opts[:'filter_created_at'] if !opts[:'filter_created_at'].nil? query_params[:'filter[started_at]'] = opts[:'filter_started_at'] if !opts[:'filter_started_at'].nil? query_params[:'filter[finished_at]'] = opts[:'filter_finished_at'] if !opts[:'filter_finished_at'].nil? query_params[:'filter[scheduled_for]'] = opts[:'filter_scheduled_for'] if !opts[:'filter_scheduled_for'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RunListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"RunsApi.list_runs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RunsApi#list_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#rerun_run(run_id, opts = {}) ⇒ RunResponse
Rerun Run Spawn a new run from a prior run, using the job’s current configuration. Returns ‘409` if the run’s parent job has been deleted.
245 246 247 248 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 245 def rerun_run(run_id, opts = {}) data, _status_code, _headers = rerun_run_with_http_info(run_id, opts) data end |
#rerun_run_with_http_info(run_id, opts = {}) ⇒ Array<(RunResponse, Integer, Hash)>
Rerun Run Spawn a new run from a prior run, using the job's current configuration. Returns `409` if the run's parent job has been deleted.
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb', line 255 def rerun_run_with_http_info(run_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RunsApi.rerun_run ...' end # verify the required parameter 'run_id' is set if @api_client.config.client_side_validation && run_id.nil? fail ArgumentError, "Missing the required parameter 'run_id' when calling RunsApi.rerun_run" end # resource path local_var_path = '/api/v1/runs/{run_id}/actions/rerun'.sub('{run_id}', CGI.escape(run_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RunResponse' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"RunsApi.rerun_run", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RunsApi#rerun_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |