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
subnetservice.
Methods inherited from Service
Instance Method Details
#add(subnet, opts = {}) ⇒ OpenStackSubnet
Adds a new subnet.
17812 17813 17814 |
# File 'lib/ovirtsdk4/services.rb', line 17812 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.
17846 17847 17848 |
# File 'lib/ovirtsdk4/services.rb', line 17846 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 |
# File 'lib/ovirtsdk4/services.rb', line 17868 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.
17857 17858 17859 |
# File 'lib/ovirtsdk4/services.rb', line 17857 def subnet_service(id) OpenstackSubnetService.new(self, id) end |