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_poolservice. -
#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 HTTP/1.1
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>
15500 15501 15502 |
# File 'lib/ovirtsdk4/services.rb', line 15500 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.
15534 15535 15536 |
# File 'lib/ovirtsdk4/services.rb', line 15534 def list(opts = {}) internal_get(LIST, opts) end |
#mac_pool_service(id) ⇒ MacPoolService
Locates the mac_pool service.
15545 15546 15547 |
# File 'lib/ovirtsdk4/services.rb', line 15545 def mac_pool_service(id) MacPoolService.new(self, id) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 |
# File 'lib/ovirtsdk4/services.rb', line 15556 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 |