Class: Arcp::Job::Submit
- Inherits:
-
Data
- Object
- Data
- Arcp::Job::Submit
- Defined in:
- lib/arcp/job/submit.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#lease_constraints ⇒ Object
readonly
Returns the value of attribute lease_constraints.
-
#lease_request ⇒ Object
readonly
Returns the value of attribute lease_request.
-
#max_runtime_sec ⇒ Object
readonly
Returns the value of attribute max_runtime_sec.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent
5 6 7 |
# File 'lib/arcp/job/submit.rb', line 5 def agent @agent end |
#idempotency_key ⇒ Object (readonly)
Returns the value of attribute idempotency_key
5 6 7 |
# File 'lib/arcp/job/submit.rb', line 5 def idempotency_key @idempotency_key end |
#input ⇒ Object (readonly)
Returns the value of attribute input
5 6 7 |
# File 'lib/arcp/job/submit.rb', line 5 def input @input end |
#lease_constraints ⇒ Object (readonly)
Returns the value of attribute lease_constraints
5 6 7 |
# File 'lib/arcp/job/submit.rb', line 5 def lease_constraints @lease_constraints end |
#lease_request ⇒ Object (readonly)
Returns the value of attribute lease_request
5 6 7 |
# File 'lib/arcp/job/submit.rb', line 5 def lease_request @lease_request end |
#max_runtime_sec ⇒ Object (readonly)
Returns the value of attribute max_runtime_sec
5 6 7 |
# File 'lib/arcp/job/submit.rb', line 5 def max_runtime_sec @max_runtime_sec end |
Class Method Details
.from_h(h) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/arcp/job/submit.rb', line 9 def self.from_h(h) h = h.transform_keys(&:to_s) new( agent: h.fetch('agent'), input: h['input'], lease_request: Arcp::Lease::LeaseRequest.from_h(h['lease_request']), lease_constraints: Arcp::Lease::LeaseConstraints.from_h(h['lease_constraints']), idempotency_key: h['idempotency_key'], max_runtime_sec: h['max_runtime_sec'] ) end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/arcp/job/submit.rb', line 21 def to_h out = { 'agent' => agent } out['input'] = input if input out['lease_request'] = lease_request.to_h if lease_request out['lease_constraints'] = lease_constraints.to_h if lease_constraints out['idempotency_key'] = idempotency_key if idempotency_key out['max_runtime_sec'] = max_runtime_sec if max_runtime_sec out end |