Class: OvirtSDK4::DomainGroupsService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::DomainGroupsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (DomainGroupService) group_service(id)
Locates the
group
service. -
- (Array<Group>) list(opts = {})
Returns the representation of the object managed by this 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
- (DomainGroupService) group_service(id)
Locates the group
service.
6264 6265 6266 |
# File 'lib/ovirtsdk4/services.rb', line 6264 def group_service(id) return DomainGroupService.new(@connection, "#{@path}/#{id}") end |
- (Array<Group>) list(opts = {})
Returns the representation of the object managed by this service.
6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 |
# File 'lib/ovirtsdk4/services.rb', line 6226 def list(opts = {}) query = {} value = opts[:case_sensitive] unless value.nil? value = Writer.render_boolean(value) query['case_sensitive'] = value end value = opts[:max] unless value.nil? value = Writer.render_integer(value) query['max'] = value end value = opts[:search] unless value.nil? query['search'] = 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 GroupReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 |
# File 'lib/ovirtsdk4/services.rb', line 6275 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return group_service(path) end return group_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
6291 6292 6293 |
# File 'lib/ovirtsdk4/services.rb', line 6291 def to_s return "#<#{DomainGroupsService}:#{@path}>" end |