Class: OvirtSDK4::MacPoolsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(pool, opts = {}) ⇒ MacPool
Creates a new MAC address pool.
-
#list(opts = {}) ⇒ Array<MacPool>
Return the list of MAC address pools of the system.
-
#mac_pool_service(id) ⇒ MacPoolService
Locates the
mac_pool
service. -
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(pool, opts = {}) ⇒ MacPool
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:
POST /ovirt-engine/api/macpools
With a request body like this:
<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>
15707 15708 15709 |
# File 'lib/ovirtsdk4/services.rb', line 15707 def add(pool, opts = {}) internal_add(pool, MacPool, ADD, opts) end |
#list(opts = {}) ⇒ Array<MacPool>
Return the list of MAC address pools of the system.
The returned list of MAC address pools isn’t guaranteed.
15741 15742 15743 |
# File 'lib/ovirtsdk4/services.rb', line 15741 def list(opts = {}) internal_get(LIST, opts) end |
#mac_pool_service(id) ⇒ MacPoolService
Locates the mac_pool
service.
15752 15753 15754 |
# File 'lib/ovirtsdk4/services.rb', line 15752 def mac_pool_service(id) MacPoolService.new(self, id) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 |
# 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 |