Class: OvirtSDK4::UserService

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 = {}) ⇒ User

Gets the system user information.

Usage:

GET /ovirt-engine/api/users/1234

Will return the user information:

<user href="/ovirt-engine/api/users/1234" id="1234">
  <name>admin</name>
  <link href="/ovirt-engine/api/users/1234/sshpublickeys" rel="sshpublickeys"/>
  <link href="/ovirt-engine/api/users/1234/roles" rel="roles"/>
  <link href="/ovirt-engine/api/users/1234/permissions" rel="permissions"/>
  <link href="/ovirt-engine/api/users/1234/tags" rel="tags"/>
  <department></department>
  <domain_entry_id>23456</domain_entry_id>
  <email>[email protected]</email>
  <last_name>Lastname</last_name>
  <namespace>*</namespace>
  <principal>user1</principal>
  <user_name>user1@domain-authz</user_name>
  <domain href="/ovirt-engine/api/domains/45678" id="45678">
    <name>domain-authz</name>
  </domain>
</user>

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:



27255
27256
27257
# File 'lib/ovirtsdk4/services.rb', line 27255

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

#permissions_serviceAssignedPermissionsService

Locates the permissions service.

Returns:



27295
27296
27297
# File 'lib/ovirtsdk4/services.rb', line 27295

def permissions_service
  @permissions_service ||= AssignedPermissionsService.new(self, 'permissions')
end

#remove(opts = {}) ⇒ Object

Removes the system user.

Usage:

DELETE /ovirt-engine/api/users/1234

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.



27286
27287
27288
# File 'lib/ovirtsdk4/services.rb', line 27286

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

#roles_serviceAssignedRolesService

Locates the roles service.

Returns:



27304
27305
27306
# File 'lib/ovirtsdk4/services.rb', line 27304

def roles_service
  @roles_service ||= AssignedRolesService.new(self, 'roles')
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:



27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
# File 'lib/ovirtsdk4/services.rb', line 27333

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'permissions'
    return permissions_service
  end
  if path.start_with?('permissions/')
    return permissions_service.service(path[12..-1])
  end
  if path == 'roles'
    return roles_service
  end
  if path.start_with?('roles/')
    return roles_service.service(path[6..-1])
  end
  if path == 'sshpublickeys'
    return ssh_public_keys_service
  end
  if path.start_with?('sshpublickeys/')
    return ssh_public_keys_service.service(path[14..-1])
  end
  if path == 'tags'
    return tags_service
  end
  if path.start_with?('tags/')
    return tags_service.service(path[5..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#ssh_public_keys_serviceSshPublicKeysService

Locates the ssh_public_keys service.

Returns:



27313
27314
27315
# File 'lib/ovirtsdk4/services.rb', line 27313

def ssh_public_keys_service
  @ssh_public_keys_service ||= SshPublicKeysService.new(self, 'sshpublickeys')
end

#tags_serviceAssignedTagsService

Locates the tags service.

Returns:



27322
27323
27324
# File 'lib/ovirtsdk4/services.rb', line 27322

def tags_service
  @tags_service ||= AssignedTagsService.new(self, 'tags')
end