Class: Rubineti::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/rubineti/job.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Job

Returns a new instance of Job.



3
4
5
# File 'lib/rubineti/job.rb', line 3

def initialize connection
  @connection = connection
end

Instance Method Details

#allObject

Returns an Array of all jobs.



10
11
12
# File 'lib/rubineti/job.rb', line 10

def all
  @connection.get "/#{Ganeti::Version}/jobs"
end

#delete(job_id) ⇒ Object

Cancel a not-yet-started job.

job_id: A String of the ‘job id’.



28
29
30
31
# File 'lib/rubineti/job.rb', line 28

def delete job_id
  warn "WARNING: Job#job_delete not implemented."
  # delete "/#{Ganeti::Version}/jobs/#{job_id}/delete"
end

#list(job_id) ⇒ Object

Returns a jobs status.

job_id: A String of the ‘job id’.



19
20
21
# File 'lib/rubineti/job.rb', line 19

def list job_id
  @connection.get "/#{Ganeti::Version}/jobs/#{job_id}"
end

#wait(job_id, params = {}) ⇒ Object

Waits for changes on a job.

job_id: A String of the ‘job id’.

Body parameters:

- http://docs.ganeti.org/ganeti/#{Ganeti::Version}.1/html/rapi.html#jobs-job-id-wait


41
42
43
44
# File 'lib/rubineti/job.rb', line 41

def wait job_id, params = {}
  warn "WARNING: Job#job_wait not implemented."
  # get "/#{Ganeti::Version}/jobs/#{job_id}/wait", params
end