Class: OvirtSDK4::DomainService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::DomainService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Domain) get(opts = {})
Returns the representation of the object managed by this service.
-
- (DomainGroupsService) groups_service
Locates the
groups
service. -
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
-
- (DomainUsersService) users_service
Locates the
users
service.
Instance Method Details
- (Domain) get(opts = {})
Returns the representation of the object managed by this service.
6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 |
# File 'lib/ovirtsdk4/services.rb', line 6060 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 DomainReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (DomainGroupsService) groups_service
Locates the groups
service.
6081 6082 6083 |
# File 'lib/ovirtsdk4/services.rb', line 6081 def groups_service return DomainGroupsService.new(@connection, "#{@path}/groups") end |
- (Service) service(path)
Locates the service corresponding to the given path.
6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 |
# File 'lib/ovirtsdk4/services.rb', line 6100 def service(path) if path.nil? || path == '' return self end if path == 'groups' return groups_service end if path.start_with?('groups/') return groups_service.service(path[7..-1]) end if path == 'users' return users_service end if path.start_with?('users/') return users_service.service(path[6..-1]) end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
- (String) to_s
Returns an string representation of this service.
6124 6125 6126 |
# File 'lib/ovirtsdk4/services.rb', line 6124 def to_s return "#<#{DomainService}:#{@path}>" end |
- (DomainUsersService) users_service
Locates the users
service.
6089 6090 6091 |
# File 'lib/ovirtsdk4/services.rb', line 6089 def users_service return DomainUsersService.new(@connection, "#{@path}/users") end |