Class: OvirtSDK4::OpenstackSubnetsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(subnet, opts = {}) ⇒ OpenStackSubnet
Adds a new
subnet
. -
#list(opts = {}) ⇒ Array<OpenStackSubnet>
Returns the list of sub-networks.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#subnet_service(id) ⇒ OpenstackSubnetService
Locates the
subnet
service.
Methods inherited from Service
Instance Method Details
#add(subnet, opts = {}) ⇒ OpenStackSubnet
Adds a new subnet
.
16618 16619 16620 |
# File 'lib/ovirtsdk4/services.rb', line 16618 def add(subnet, opts = {}) internal_add(subnet, OpenStackSubnet, ADD, opts) end |
#list(opts = {}) ⇒ Array<OpenStackSubnet>
Returns the list of sub-networks.
The order of the returned list of sub-networks isn’t guaranteed.
16652 16653 16654 |
# File 'lib/ovirtsdk4/services.rb', line 16652 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 |
# File 'lib/ovirtsdk4/services.rb', line 16674 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return subnet_service(path) end return subnet_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
#subnet_service(id) ⇒ OpenstackSubnetService
Locates the subnet
service.
16663 16664 16665 |
# File 'lib/ovirtsdk4/services.rb', line 16663 def subnet_service(id) OpenstackSubnetService.new(self, id) end |