class OvirtSDK4::MacPoolsService

Constants

ADD
LIST

Public Instance Methods

add(pool, opts = {}) click to toggle source

Creates a new MAC address pool.

Creation of a MAC address pool requires values for the `name` and `ranges` attributes.

For example, to create MAC address pool send a request like this:

source

POST /ovirt-engine/api/macpools


With a request body like this:

source,xml

<mac_pool>

<name>MACPool</name>
<description>A MAC address pool</description>
<allow_duplicates>true</allow_duplicates>
<default_pool>false</default_pool>
<ranges>
  <range>
    <from>00:1A:4A:16:01:51</from>
    <to>00:1A:4A:16:01:e6</to>
  </range>
</ranges>

</mac_pool>


@param pool [MacPool] The `pool` to add.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [MacPool]

# File lib/ovirtsdk4/services.rb, line 15707
def add(pool, opts = {})
  internal_add(pool, MacPool, ADD, opts)
end
list(opts = {}) click to toggle source

Return the list of MAC address pools of the system.

The returned list of MAC address pools isn't guaranteed.

@param opts [Hash] Additional options.

@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part

of the current request. See <<documents/003_common_concepts/follow, here>> for details.

@option opts [Integer] :max Sets the maximum number of pools to return. If not specified all the pools are returned.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [Array<MacPool>]

# File lib/ovirtsdk4/services.rb, line 15741
def list(opts = {})
  internal_get(LIST, opts)
end
mac_pool_service(id) click to toggle source

Locates the `mac_pool` service.

@param id [String] The identifier of the `mac_pool`.

@return [MacPoolService] A reference to the `mac_pool` service.

# File lib/ovirtsdk4/services.rb, line 15752
def mac_pool_service(id)
  MacPoolService.new(self, id)
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# File lib/ovirtsdk4/services.rb, line 15763
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return mac_pool_service(path)
  end
  return mac_pool_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end