Class: OvirtSDK4::AssignedVnicProfileService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::AssignedVnicProfileService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (VnicProfile) 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.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (VnicProfile) get(opts = {})
Returns the representation of the object managed by this service.
3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 |
# File 'lib/ovirtsdk4/services.rb', line 3080 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 VnicProfileReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (AssignedPermissionsService) permissions_service
Locates the permissions
service.
3122 3123 3124 |
# File 'lib/ovirtsdk4/services.rb', line 3122 def return AssignedPermissionsService.new(@connection, "#{@path}/permissions") end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 |
# File 'lib/ovirtsdk4/services.rb', line 3104 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 |
- (Service) service(path)
Locates the service corresponding to the given path.
3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 |
# File 'lib/ovirtsdk4/services.rb', line 3133 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 raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
- (String) to_s
Returns an string representation of this service.
3151 3152 3153 |
# File 'lib/ovirtsdk4/services.rb', line 3151 def to_s return "#<#{AssignedVnicProfileService}:#{@path}>" end |