Class: OvirtSDK4::DomainUsersService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::DomainUsersService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<User>) 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.
-
- (DomainUserService) user_service(id)
Locates the
user
service.
Instance Method Details
- (Array<User>) list(opts = {})
Returns the representation of the object managed by this service.
6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 |
# File 'lib/ovirtsdk4/services.rb', line 6393 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 UserReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 |
# File 'lib/ovirtsdk4/services.rb', line 6442 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return user_service(path) end return user_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
6458 6459 6460 |
# File 'lib/ovirtsdk4/services.rb', line 6458 def to_s return "#<#{DomainUsersService}:#{@path}>" end |
- (DomainUserService) user_service(id)
Locates the user
service.
6431 6432 6433 |
# File 'lib/ovirtsdk4/services.rb', line 6431 def user_service(id) return DomainUserService.new(@connection, "#{@path}/#{id}") end |