Class: Datahen::Client::JobVar
- Inherits:
-
Base
- Object
- Base
- Datahen::Client::JobVar
show all
- Defined in:
- lib/datahen/client/job_var.rb
Constant Summary
Constants inherited
from Base
Base::CHECK_EMPTY_BODY, Base::CHECK_NIL, Base::DEFAULT_RETRY_LIMIT
Instance Method Summary
collapse
Methods inherited from Base
#auth_token, #auth_token=, #default_retry_limit, #env_api_url, env_auth_token, env_ignore_ssl, #ignore_ssl, #initialize, #left_merge, random_delay, #retry
Instance Method Details
#all(job_id, opts = {}) ⇒ Object
9
10
11
12
|
# File 'lib/datahen/client/job_var.rb', line 9
def all(job_id, opts={})
params = @options.merge opts
self.class.get("/jobs/#{job_id}/vars", params)
end
|
#find(job_id, var_name) ⇒ Object
5
6
7
|
# File 'lib/datahen/client/job_var.rb', line 5
def find(job_id, var_name)
self.class.get("/jobs/#{job_id}/vars/#{var_name}", @options)
end
|
#set(job_id, var_name, value, opts = {}) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/datahen/client/job_var.rb', line 14
def set(job_id, var_name, value, opts={})
body = {}
body[:value] = value
body[:secret] = opts[:secret] if opts[:secret]
params = @options.merge({body: body.to_json})
self.class.put("/jobs/#{job_id}/vars/#{var_name}", params)
end
|
#unset(job_id, var_name, opts = {}) ⇒ Object
22
23
24
25
|
# File 'lib/datahen/client/job_var.rb', line 22
def unset(job_id, var_name, opts={})
params = @options.merge(opts)
self.class.delete("/jobs/#{job_id}/vars/#{var_name}", params)
end
|