Skip to content

Latest commit

 

History

History
342 lines (206 loc) · 6.17 KB

JobsApi.md

File metadata and controls

342 lines (206 loc) · 6.17 KB

Dkron::JobsApi

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

create_or_update_job

Job create_or_update_job(body, opts)

Create or updates a new job.

Example

# 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

Parameters

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]

Return type

Job

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_job

Job delete_job(job_name)

Delete a job.

Example

# 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

Parameters

Name Type Description Notes
job_name String The job that needs to be deleted.

Return type

Job

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_jobs

Array<Job> get_jobs(opts)

List jobs.

Example

# 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

Parameters

Name Type Description Notes
metadata Array<String> Filter jobs by metadata [optional]

Return type

Array<Job>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

restore

Array<Restore> restore(file)

Restore jobs from json file.

Example

# 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

Parameters

Name Type Description Notes
file File Json file that needs to be restored.

Return type

Array<Restore>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

run_job

Job run_job(job_name)

Executes a job.

Example

# 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

Parameters

Name Type Description Notes
job_name String The job that needs to be run.

Return type

Job

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

show_job_by_name

Job show_job_by_name(job_name)

Show a job.

Example

# 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

Parameters

Name Type Description Notes
job_name String The job that needs to be fetched.

Return type

Job

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

toggle_job

Job toggle_job(job_name)

Toggle a job.

Example

# 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

Parameters

Name Type Description Notes
job_name String The job that needs to be toggled.

Return type

Job

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json