Class: OvirtSDK4::HostNicsService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::HostNicsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<HostNic>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (HostNicService) nic_service(id)
Locates the
nic
service. -
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Array<HostNic>) list(opts = {})
Returns the representation of the object managed by this service.
9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 |
# File 'lib/ovirtsdk4/services.rb', line 9807 def list(opts = {}) query = {} value = opts[:max] unless value.nil? value = Writer.render_integer(value) query['max'] = value end request = Request.new(:method => :GET, :path => @path, :query => query) response = @connection.send(request) case response.code when 200 begin reader = XmlReader.new(response.body) return HostNicReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (HostNicService) nic_service(id)
Locates the nic
service.
9836 9837 9838 |
# File 'lib/ovirtsdk4/services.rb', line 9836 def nic_service(id) return HostNicService.new(@connection, "#{@path}/#{id}") end |
- (Service) service(path)
Locates the service corresponding to the given path.
9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 |
# File 'lib/ovirtsdk4/services.rb', line 9847 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return nic_service(path) end return nic_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
9863 9864 9865 |
# File 'lib/ovirtsdk4/services.rb', line 9863 def to_s return "#<#{HostNicsService}:#{@path}>" end |