Class: OvirtSDK4::GroupService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::GroupService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Group) 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.
-
- (AssignedTagsService) tags_service
Locates the
tags
service. -
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Group) get(opts = {})
Returns the representation of the object managed by this service.
9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 |
# File 'lib/ovirtsdk4/services.rb', line 9238 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 GroupReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (AssignedPermissionsService) permissions_service
Locates the permissions
service.
9280 9281 9282 |
# File 'lib/ovirtsdk4/services.rb', line 9280 def return AssignedPermissionsService.new(@connection, "#{@path}/permissions") end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 |
# File 'lib/ovirtsdk4/services.rb', line 9262 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.
9288 9289 9290 |
# File 'lib/ovirtsdk4/services.rb', line 9288 def roles_service return AssignedRolesService.new(@connection, "#{@path}/roles") end |
- (Service) service(path)
Locates the service corresponding to the given path.
9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 |
# File 'lib/ovirtsdk4/services.rb', line 9307 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 == '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 |
- (AssignedTagsService) tags_service
Locates the tags
service.
9296 9297 9298 |
# File 'lib/ovirtsdk4/services.rb', line 9296 def return AssignedTagsService.new(@connection, "#{@path}/tags") end |
- (String) to_s
Returns an string representation of this service.
9337 9338 9339 |
# File 'lib/ovirtsdk4/services.rb', line 9337 def to_s return "#<#{GroupService}:#{@path}>" end |