Class: OvirtSDK4::AssignedTagService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::AssignedTagService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Tag) get(opts = {})
Returns the representation of the object managed by this 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
- (Tag) get(opts = {})
Returns the representation of the object managed by this service.
2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 |
# File 'lib/ovirtsdk4/services.rb', line 2874 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 TagReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 |
# File 'lib/ovirtsdk4/services.rb', line 2898 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.
2919 2920 2921 2922 2923 2924 |
# File 'lib/ovirtsdk4/services.rb', line 2919 def service(path) if path.nil? || path == '' return self end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
- (String) to_s
Returns an string representation of this service.
2931 2932 2933 |
# File 'lib/ovirtsdk4/services.rb', line 2931 def to_s return "#<#{AssignedTagService}:#{@path}>" end |