Class: OvirtSDK4::AssignedRolesService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::AssignedRolesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<Role>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (RoleService) role_service(id)
Sub-resource locator method, returns individual role resource on which the remainder of the URI is dispatched.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Array<Role>) list(opts = {})
Returns the representation of the object managed by this service.
2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 |
# File 'lib/ovirtsdk4/services.rb', line 2789 def list(opts = {}) query = {} value = opts[:max] unless value.nil? value = Writer.render_integer(value) query['max'] = 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 RoleReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (RoleService) role_service(id)
Sub-resource locator method, returns individual role resource on which the remainder of the URI is dispatched.
2818 2819 2820 |
# File 'lib/ovirtsdk4/services.rb', line 2818 def role_service(id) return RoleService.new(@connection, "#{@path}/#{id}") end |
- (Service) service(path)
Locates the service corresponding to the given path.
2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 |
# File 'lib/ovirtsdk4/services.rb', line 2829 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return role_service(path) end return role_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
2845 2846 2847 |
# File 'lib/ovirtsdk4/services.rb', line 2845 def to_s return "#<#{AssignedRolesService}:#{@path}>" end |