Class: OvirtSDK4::UserService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::UserService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (User) get(opts = {})
Returns the representation of the object managed by this service.
-
- (AssignedPermissionsService) permissions_service
Locates the
permissions
service. -
- (Object) remove(opts = {})
Deletes the object managed by this service.
-
- (AssignedRolesService) roles_service
Locates the
roles
service. -
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (SshPublicKeysService) ssh_public_keys_service
Locates the
ssh_public_keys
service. -
- (AssignedTagsService) tags_service
Locates the
tags
service. -
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (User) get(opts = {})
Returns the representation of the object managed by this service.
22882 22883 22884 22885 22886 22887 22888 22889 22890 22891 22892 22893 22894 22895 22896 22897 |
# File 'lib/ovirtsdk4/services.rb', line 22882 def get(opts = {}) query = {} 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_one(reader) ensure reader.close end else check_fault(response) end end |
- (AssignedPermissionsService) permissions_service
Locates the permissions
service.
22924 22925 22926 |
# File 'lib/ovirtsdk4/services.rb', line 22924 def return AssignedPermissionsService.new(@connection, "#{@path}/permissions") end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 |
# File 'lib/ovirtsdk4/services.rb', line 22906 def remove(opts = {}) query = {} value = opts[:async] unless value.nil? value = Writer.render_boolean(value) query['async'] = value end request = Request.new(:method => :DELETE, :path => @path, :query => query) response = @connection.send(request) unless response.code == 200 check_fault(response) end end |
- (AssignedRolesService) roles_service
Locates the roles
service.
22932 22933 22934 |
# File 'lib/ovirtsdk4/services.rb', line 22932 def roles_service return AssignedRolesService.new(@connection, "#{@path}/roles") end |
- (Service) service(path)
Locates the service corresponding to the given path.
22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 |
# File 'lib/ovirtsdk4/services.rb', line 22959 def service(path) if path.nil? || path == '' return self end if path == 'permissions' return end if path.start_with?('permissions/') return .service(path[12..-1]) end if path == 'roles' return roles_service end if path.start_with?('roles/') return roles_service.service(path[6..-1]) end if path == 'sshpublickeys' return ssh_public_keys_service end if path.start_with?('sshpublickeys/') return ssh_public_keys_service.service(path[14..-1]) end if path == 'tags' return end if path.start_with?('tags/') return .service(path[5..-1]) end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
- (SshPublicKeysService) ssh_public_keys_service
Locates the ssh_public_keys
service.
22940 22941 22942 |
# File 'lib/ovirtsdk4/services.rb', line 22940 def ssh_public_keys_service return SshPublicKeysService.new(@connection, "#{@path}/sshpublickeys") end |
- (AssignedTagsService) tags_service
Locates the tags
service.
22948 22949 22950 |
# File 'lib/ovirtsdk4/services.rb', line 22948 def return AssignedTagsService.new(@connection, "#{@path}/tags") end |
- (String) to_s
Returns an string representation of this service.
22995 22996 22997 |
# File 'lib/ovirtsdk4/services.rb', line 22995 def to_s return "#<#{UserService}:#{@path}>" end |