All URIs are relative to http://localhost:8080/v1
Method | HTTP request | Description |
---|---|---|
create_or_update_job | POST /jobs | |
delete_job | DELETE /jobs/{job_name} | |
get_jobs | GET /jobs | |
restore | POST /restore | |
run_job | POST /jobs/{job_name} | |
show_job_by_name | GET /jobs/{job_name} | |
toggle_job | POST /jobs/{job_name}/toggle |
Job create_or_update_job(body, opts)
Create or updates a new job.
# load the gem
require 'dkron-ruby'
api_instance = Dkron::JobsApi.new
body = Dkron::Job.new # Job | Updated job object
opts = {
runoncreate: true # BOOLEAN | If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated.
}
begin
result = api_instance.create_or_update_job(body, opts)
p result
rescue Dkron::ApiError => e
puts "Exception when calling JobsApi->create_or_update_job: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
body | Job | Updated job object | |
runoncreate | BOOLEAN | If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated. | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
Job delete_job(job_name)
Delete a job.
# load the gem
require 'dkron-ruby'
api_instance = Dkron::JobsApi.new
job_name = 'job_name_example' # String | The job that needs to be deleted.
begin
result = api_instance.delete_job(job_name)
p result
rescue Dkron::ApiError => e
puts "Exception when calling JobsApi->delete_job: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
job_name | String | The job that needs to be deleted. |
No authorization required
- Content-Type: application/json
- Accept: application/json
Array<Job> get_jobs(opts)
List jobs.
# load the gem
require 'dkron-ruby'
api_instance = Dkron::JobsApi.new
opts = {
metadata: ['metadata_example'] # Array<String> | Filter jobs by metadata
}
begin
result = api_instance.get_jobs(opts)
p result
rescue Dkron::ApiError => e
puts "Exception when calling JobsApi->get_jobs: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
metadata | Array<String> | Filter jobs by metadata | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
Array<Restore> restore(file)
Restore jobs from json file.
# load the gem
require 'dkron-ruby'
api_instance = Dkron::JobsApi.new
file = File.new('/path/to/file.txt') # File | Json file that needs to be restored.
begin
result = api_instance.restore(file)
p result
rescue Dkron::ApiError => e
puts "Exception when calling JobsApi->restore: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
file | File | Json file that needs to be restored. |
No authorization required
- Content-Type: application/json
- Accept: application/json
Job run_job(job_name)
Executes a job.
# load the gem
require 'dkron-ruby'
api_instance = Dkron::JobsApi.new
job_name = 'job_name_example' # String | The job that needs to be run.
begin
result = api_instance.run_job(job_name)
p result
rescue Dkron::ApiError => e
puts "Exception when calling JobsApi->run_job: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
job_name | String | The job that needs to be run. |
No authorization required
- Content-Type: application/json
- Accept: application/json
Job show_job_by_name(job_name)
Show a job.
# load the gem
require 'dkron-ruby'
api_instance = Dkron::JobsApi.new
job_name = 'job_name_example' # String | The job that needs to be fetched.
begin
result = api_instance.show_job_by_name(job_name)
p result
rescue Dkron::ApiError => e
puts "Exception when calling JobsApi->show_job_by_name: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
job_name | String | The job that needs to be fetched. |
No authorization required
- Content-Type: application/json
- Accept: application/json
Job toggle_job(job_name)
Toggle a job.
# load the gem
require 'dkron-ruby'
api_instance = Dkron::JobsApi.new
job_name = 'job_name_example' # String | The job that needs to be toggled.
begin
result = api_instance.toggle_job(job_name)
p result
rescue Dkron::ApiError => e
puts "Exception when calling JobsApi->toggle_job: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
job_name | String | The job that needs to be toggled. |
No authorization required
- Content-Type: application/json
- Accept: application/json