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
.
18051 18052 18053 |
# File 'lib/ovirtsdk4/services.rb', line 18051 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.
18085 18086 18087 |
# File 'lib/ovirtsdk4/services.rb', line 18085 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
18107 18108 18109 18110 18111 18112 18113 18114 18115 18116 |
# File 'lib/ovirtsdk4/services.rb', line 18107 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.
18096 18097 18098 |
# File 'lib/ovirtsdk4/services.rb', line 18096 def subnet_service(id) OpenstackSubnetService.new(self, id) end |