Class: OvirtSDK4::ExternalComputeResourcesService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::ExternalComputeResourcesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<ExternalComputeResource>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (ExternalComputeResourceService) resource_service(id)
Locates the
resource
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<ExternalComputeResource>) list(opts = {})
Returns the representation of the object managed by this service.
6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 |
# File 'lib/ovirtsdk4/services.rb', line 6885 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 ExternalComputeResourceReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (ExternalComputeResourceService) resource_service(id)
Locates the resource
service.
6914 6915 6916 |
# File 'lib/ovirtsdk4/services.rb', line 6914 def resource_service(id) return ExternalComputeResourceService.new(@connection, "#{@path}/#{id}") end |
- (Service) service(path)
Locates the service corresponding to the given path.
6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 |
# File 'lib/ovirtsdk4/services.rb', line 6925 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return resource_service(path) end return resource_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
6941 6942 6943 |
# File 'lib/ovirtsdk4/services.rb', line 6941 def to_s return "#<#{ExternalComputeResourcesService}:#{@path}>" end |