Class: OvirtSDK4::UserService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#event_subscriptions_service ⇒ EventSubscriptionsService
List of event-subscriptions for this user.
-
#get(opts = {}) ⇒ User
Gets the system user information.
-
#groups_service ⇒ DomainUserGroupsService
Locates the
groupsservice. -
#options_service ⇒ UserOptionsService
Locates the
optionsservice. -
#permissions_service ⇒ AssignedPermissionsService
Locates the
permissionsservice. -
#remove(opts = {}) ⇒ Object
Removes the system user.
-
#roles_service ⇒ AssignedRolesService
Locates the
rolesservice. -
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#ssh_public_keys_service ⇒ SshPublicKeysService
Locates the
ssh_public_keysservice. -
#tags_service ⇒ AssignedTagsService
Locates the
tagsservice. -
#update(user, opts = {}) ⇒ User
Updates information about the user.
Methods inherited from Service
Instance Method Details
#event_subscriptions_service ⇒ EventSubscriptionsService
List of event-subscriptions for this user.
29109 29110 29111 |
# File 'lib/ovirtsdk4/services.rb', line 29109 def event_subscriptions_service @event_subscriptions_service ||= EventSubscriptionsService.new(self, 'eventsubscriptions') end |
#get(opts = {}) ⇒ User
Gets the system user information.
Usage:
GET /ovirt-engine/api/users/1234 HTTP/1.1
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>
29018 29019 29020 |
# File 'lib/ovirtsdk4/services.rb', line 29018 def get(opts = {}) internal_get(GET, opts) end |
#groups_service ⇒ DomainUserGroupsService
Locates the groups service.
29118 29119 29120 |
# File 'lib/ovirtsdk4/services.rb', line 29118 def groups_service @groups_service ||= DomainUserGroupsService.new(self, 'groups') end |
#options_service ⇒ UserOptionsService
Locates the options service.
29127 29128 29129 |
# File 'lib/ovirtsdk4/services.rb', line 29127 def @options_service ||= UserOptionsService.new(self, 'options') end |
#permissions_service ⇒ AssignedPermissionsService
Locates the permissions service.
29136 29137 29138 |
# File 'lib/ovirtsdk4/services.rb', line 29136 def @permissions_service ||= AssignedPermissionsService.new(self, 'permissions') end |
#remove(opts = {}) ⇒ Object
Removes the system user.
Usage:
DELETE /ovirt-engine/api/users/1234
29049 29050 29051 |
# File 'lib/ovirtsdk4/services.rb', line 29049 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#roles_service ⇒ AssignedRolesService
Locates the roles service.
29145 29146 29147 |
# File 'lib/ovirtsdk4/services.rb', line 29145 def roles_service @roles_service ||= AssignedRolesService.new(self, 'roles') end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
29174 29175 29176 29177 29178 29179 29180 29181 29182 29183 29184 29185 29186 29187 29188 29189 29190 29191 29192 29193 29194 29195 29196 29197 29198 29199 29200 29201 29202 29203 29204 29205 29206 29207 29208 29209 29210 29211 29212 29213 29214 29215 29216 29217 29218 29219 29220 29221 |
# File 'lib/ovirtsdk4/services.rb', line 29174 def service(path) if path.nil? || path == '' return self end if path == 'eventsubscriptions' return event_subscriptions_service end if path.start_with?('eventsubscriptions/') return event_subscriptions_service.service(path[19..-1]) end if path == 'groups' return groups_service end if path.start_with?('groups/') return groups_service.service(path[7..-1]) end if path == 'options' return end if path.start_with?('options/') return .service(path[8..-1]) end if path == 'permissions' return end if path.start_with?('permissions/') return .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 end if path.start_with?('tags/') return .service(path[5..-1]) end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
#ssh_public_keys_service ⇒ SshPublicKeysService
Locates the ssh_public_keys service.
29154 29155 29156 |
# File 'lib/ovirtsdk4/services.rb', line 29154 def ssh_public_keys_service @ssh_public_keys_service ||= SshPublicKeysService.new(self, 'sshpublickeys') end |
#tags_service ⇒ AssignedTagsService
Locates the tags service.
29163 29164 29165 |
# File 'lib/ovirtsdk4/services.rb', line 29163 def @tags_service ||= AssignedTagsService.new(self, 'tags') end |
#update(user, opts = {}) ⇒ User
Updates information about the user.
Only the user_options field can be updated.
For example, to update user options:
PUT /ovirt-engine/api/users/123 HTTP/1.1
With a request body like this:
<user>
<user_options>
<property>
<name>test</name>
<value>["any","JSON"]</value>
</property>
</user_options>
</user>
|
Important
|
Since version 4.4.5 of the engine this operation is deprecated, and preserved only for backwards compatibility. It will be removed in the future. Please use the options endpoint instead. |
29100 29101 29102 |
# File 'lib/ovirtsdk4/services.rb', line 29100 def update(user, opts = {}) internal_update(user, User, UPDATE, opts) end |