Class: Datacentred::Model::User
- Defined in:
- lib/datacentred/model/user.rb
Overview
A user on your DataCentred account.
Users are team members with the ability to log into your DataCentred account.
All users created in your DataCented account are backed by a corresponding user in OpenStack's identity service (Keystone).
Class Method Summary collapse
-
.all ⇒ [User]
List all available users.
-
.create(params) ⇒ Object
Create a new user.
-
.destroy(id) ⇒ Boolean
Permanently remove the specified user.
-
.find(id) ⇒ User
Find a user by unique ID.
-
.update(id, params) ⇒ User
Update a user by unique ID.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Datacentred::Model::Base
Class Method Details
.all ⇒ [User]
List all available users.
@raise [Errors::Unauthorized] Raised if credentials aren't valid.
24 25 26 |
# File 'lib/datacentred/model/user.rb', line 24 def all Request::Users.list.map {|user| new user } end |
.create(params) ⇒ Object
Create a new user.
@return [User] New user.
16 17 18 |
# File 'lib/datacentred/model/user.rb', line 16 def create(params) new Request::Users.create params end |
.destroy(id) ⇒ Boolean
Permanently remove the specified user.
57 58 59 60 |
# File 'lib/datacentred/model/user.rb', line 57 def destroy(id) Request::Users.destroy id true end |