Class: OvirtSDK4::TagService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#get(opts = {}) ⇒ Tag

Gets the information about the tag.

For example to retrieve the information about the tag with the id 123 send a request like this:

GET /ovirt-engine/api/tags/123
<tag href="/ovirt-engine/api/tags/123" id="123">
  <name>root</name>
  <description>root</description>
</tag>

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



26805
26806
26807
# File 'lib/ovirtsdk4/services.rb', line 26805

def get(opts = {})
  internal_get(GET, opts)
end

#remove(opts = {}) ⇒ Object

Removes the tag from the system.

For example to remove the tag with id 123 send a request like this:

DELETE /ovirt-engine/api/tags/123

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the remove should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



26836
26837
26838
# File 'lib/ovirtsdk4/services.rb', line 26836

def remove(opts = {})
  internal_remove(REMOVE, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



26903
26904
26905
26906
26907
26908
# File 'lib/ovirtsdk4/services.rb', line 26903

def service(path)
  if path.nil? || path == ''
    return self
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#update(tag, opts = {}) ⇒ Tag

Updates the tag entity.

For example to update parent tag to tag with id 456 of the tag with id 123 send a request like this:

PUT /ovirt-engine/api/tags/123

With request body like:

<tag>
  <parent id="456"/>
</tag>

You may also specify a tag name instead of id. For example to update parent tag to tag with name mytag of the tag with id 123 send a request like this:

<tag>
  <parent>
    <name>mytag</name>
  </parent>
</tag>

Parameters:

  • tag (Tag)

    The updated tag.

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the update should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



26892
26893
26894
# File 'lib/ovirtsdk4/services.rb', line 26892

def update(tag, opts = {})
  internal_update(tag, Tag, UPDATE, opts)
end