class OvirtSDK4::GroupsService

Constants

ADD
LIST

Public Instance Methods

add(group, opts = {}) click to toggle source

Add group from a directory service. Please note that domain name is name of the authorization provider.

For example, to add the `Developers` group from the `internal-authz` authorization provider send a request like this:

source

POST /ovirt-engine/api/groups


With a request body like this:

source,xml

<group>

<name>Developers</name>
<domain>
  <name>internal-authz</name>
</domain>

</group>


@param group [Group] The group to be added.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [Group]

# File lib/ovirtsdk4/services.rb, line 11983
def add(group, opts = {})
  internal_add(group, Group, ADD, opts)
end
group_service(id) click to toggle source

Reference to the service that manages a specific group.

@param id [String] The identifier of the `group`.

@return [GroupService] A reference to the `group` service.

# File lib/ovirtsdk4/services.rb, line 12062
def group_service(id)
  GroupService.new(self, id)
end
list(opts = {}) click to toggle source

List all the groups in the system.

Usage:

.… GET /ovirt-engine/api/groups .…

Will return the list of groups:

source,xml

<groups>

<group href="/ovirt-engine/api/groups/123" id="123">
  <name>mygroup</name>
  <link href="/ovirt-engine/api/groups/123/roles" rel="roles"/>
  <link href="/ovirt-engine/api/groups/123/permissions" rel="permissions"/>
  <link href="/ovirt-engine/api/groups/123/tags" rel="tags"/>
  <domain_entry_id>476652557A382F67696B6D2B32762B37796E46476D513D3D</domain_entry_id>
  <namespace>DC=example,DC=com</namespace>
  <domain href="/ovirt-engine/api/domains/ABCDEF" id="ABCDEF">
    <name>myextension-authz</name>
  </domain>
</group>
...

</groups>


The order of the returned list of groups isn't guaranteed.

@param opts [Hash] Additional options.

@option opts [Boolean] :case_sensitive Indicates if the search performed using the `search` parameter should be performed taking case into

account. The default value is `true`, which means that case is taken into account. If you want to search
ignoring case set it to `false`.

@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part

of the current request. See <<documents/003_common_concepts/follow, here>> for details.

@option opts [Integer] :max Sets the maximum number of groups to return. If not specified all the groups are returned.

@option opts [String] :search A query string used to restrict the returned groups.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [Array<Group>]

# File lib/ovirtsdk4/services.rb, line 12051
def list(opts = {})
  internal_get(LIST, opts)
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# File lib/ovirtsdk4/services.rb, line 12073
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return group_service(path)
  end
  return group_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end