Class: OvirtSDK4::StepService

Inherits:
MeasurableService show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#end_(opts = {}) ⇒ Object

Marks an external step execution as ended.

For example, to terminate a step with identifier 456 which belongs to a job with identifier 123 send the following request:

POST /ovirt-engine/api/jobs/123/steps/456/end

With the following request body:

<action>
  <force>true</force>
  <succeeded>true</succeeded>
</action>

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the action should be performed asynchronously.

  • :force (Boolean)

    Indicates if the step should be forcibly terminated.

  • :succeeded (Boolean)

    Indicates if the step should be marked as successfully finished or as failed.

    This parameter is optional, and the default value is true.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



20657
20658
20659
# File 'lib/ovirtsdk4/services.rb', line 20657

def end_(opts = {})
  internal_action(:end, nil, END_, opts)
end

#get(opts = {}) ⇒ Step

Retrieves a step.

GET /ovirt-engine/api/jobs/123/steps/456

You will receive response in XML like this one:

<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>
  <end_time>2016-12-12T23:07:26.627+02:00</end_time>
  <external>false</external>
  <number>0</number>
  <start_time>2016-12-12T23:07:26.605+02:00</start_time>
  <status>finished</status>
  <type>validating</type>
  <job href="/ovirt-engine/api/jobs/123" id="123"/>
</step>

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



20710
20711
20712
# File 'lib/ovirtsdk4/services.rb', line 20710

def get(opts = {})
  internal_get(GET, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
# File 'lib/ovirtsdk4/services.rb', line 20730

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'statistics'
    return statistics_service
  end
  if path.start_with?('statistics/')
    return statistics_service.service(path[11..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#statistics_serviceStatisticsService

Locates the statistics service.

Returns:



20719
20720
20721
# File 'lib/ovirtsdk4/services.rb', line 20719

def statistics_service
  @statistics_service ||= StatisticsService.new(self, 'statistics')
end