Class: OvirtSDK4::StepsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(step, opts = {}) ⇒ Step
Add an external step to an existing job or to an existing step.
-
#list(opts = {}) ⇒ Array<Step>
Retrieves the representation of the steps.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#step_service(id) ⇒ StepService
Reference to the step service.
Methods inherited from Service
Instance Method Details
#add(step, opts = {}) ⇒ Step
Add an external step to an existing job or to an existing step.
For example, to add a step to job
with identifier 123
send the
following request:
POST /ovirt-engine/api/jobs/123/steps
With the following request body:
<step>
<description>Validating</description>
<start_time>2016-12-12T23:07:26.605+02:00</start_time>
<status>started</status>
<type>validating</type>
</step>
The response should look like:
<step href="/ovirt-engine/api/jobs/123/steps/456" id="456">
<actions>
<link href="/ovirt-engine/api/jobs/123/steps/456/end" rel="end"/>
</actions>
<description>Validating</description>
<link href="/ovirt-engine/api/jobs/123/steps/456/statistics" rel="statistics"/>
<external>true</external>
<number>2</number>
<start_time>2016-12-13T01:06:15.380+02:00</start_time>
<status>started</status>
<type>validating</type>
<job href="/ovirt-engine/api/jobs/123" id="123"/>
</step>
22118 22119 22120 |
# File 'lib/ovirtsdk4/services.rb', line 22118 def add(step, opts = {}) internal_add(step, Step, ADD, opts) end |
#list(opts = {}) ⇒ Array<Step>
Retrieves the representation of the steps.
GET /ovirt-engine/api/job/123/steps
You will receive response in XML like this one:
<steps>
<step href="/ovirt-engine/api/jobs/123/steps/456" id="456">
<actions>
<link href="/ovirt-engine/api/jobs/123/steps/456/end" rel="end"/>
</actions>
<description>Validating</description>
<link href="/ovirt-engine/api/jobs/123/steps/456/statistics" rel="statistics"/>
<external>true</external>
<number>2</number>
<start_time>2016-12-13T01:06:15.380+02:00</start_time>
<status>started</status>
<type>validating</type>
<job href="/ovirt-engine/api/jobs/123" id="123"/>
</step>
...
</steps>
The order of the returned list of steps isn’t guaranteed.
22179 22180 22181 |
# File 'lib/ovirtsdk4/services.rb', line 22179 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
22201 22202 22203 22204 22205 22206 22207 22208 22209 22210 |
# File 'lib/ovirtsdk4/services.rb', line 22201 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return step_service(path) end return step_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |
#step_service(id) ⇒ StepService
Reference to the step service.
22190 22191 22192 |
# File 'lib/ovirtsdk4/services.rb', line 22190 def step_service(id) StepService.new(self, id) end |