Class: Squall::User
Overview
OnApp User
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) activate(id)
(also: #unsuspend)
Activate a user.
-
- (Object) create(options = {})
Create a new User.
-
- (Object) data_store_zones(id)
List data store zones associated with user.
-
- (Object) delete(id)
Delete a user.
-
- (Object) edit(id, options = {})
Edit a user.
-
- (Object) generate_api_key(id)
Create a new API Key for a user.
-
- (Object) hypervisors(id)
List Hypervisors for a User's VirtualMachines.
-
- (Object) limits(id)
Show resources available to a user for creating a virtual machine.
-
- (Object) list
Lists all users.
-
- (Object) monthly_bills(id)
List a User's bills.
-
- (Object) network_zones(id)
List network zones associated with user.
-
- (Object) show(id)
Get info for a user.
-
- (Object) stats(id)
Get the stats for each of a User's VirtualMachines.
-
- (Object) suspend(id)
Suspend a user.
-
- (Object) virtual_machines(id)
List User's VirtualMachines.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) activate(id) Also known as: unsuspend
Activate a user.
97 98 99 100 |
# File 'lib/squall/user.rb', line 97 def activate(id) response = request(:get, "/users/#{id}/activate_user.json") response["user"] end |
- (Object) create(options = {})
Create a new User
48 49 50 |
# File 'lib/squall/user.rb', line 48 def create( = {}) request(:post, '/users.json', default_params()) end |
- (Object) data_store_zones(id)
List data store zones associated with user.
159 160 161 162 |
# File 'lib/squall/user.rb', line 159 def data_store_zones(id) response = request(:get, "/users/#{id}/data_store_zones.json") response.collect { |vm| vm['data-store-group']} end |
- (Object) delete(id)
this does not delete remove a user from the database. First, their status will be set to “Deleted.” If you call this method again, the user will be completely removed.
Delete a user.
112 113 114 |
# File 'lib/squall/user.rb', line 112 def delete(id) request(:delete, "/users/#{id}.json") end |
- (Object) edit(id, options = {})
Edit a user
58 59 60 |
# File 'lib/squall/user.rb', line 58 def edit(id, = {}) request(:put, "/users/#{id}.json", default_params()) end |
- (Object) generate_api_key(id)
Create a new API Key for a user.
77 78 79 80 |
# File 'lib/squall/user.rb', line 77 def generate_api_key(id) response = request(:post, "/users/#{id}/make_new_api_key.json") response["user"] end |
- (Object) hypervisors(id)
List Hypervisors for a User's VirtualMachines.
149 150 151 152 |
# File 'lib/squall/user.rb', line 149 def hypervisors(id) response = request(:get, "/users/#{id}/hypervisors.json") response.collect { |vm| vm['hypervisor']} end |
- (Object) limits(id)
Show resources available to a user for creating a virtual machine.
179 180 181 182 |
# File 'lib/squall/user.rb', line 179 def limits(id) response = request(:get, "/users/#{id}/limits.json") response["limits"] end |
- (Object) list
Lists all users.
7 8 9 10 |
# File 'lib/squall/user.rb', line 7 def list response = request(:get, '/users.json') response.collect { |user| user['user'] } end |
- (Object) monthly_bills(id)
List a User's bills.
130 131 132 |
# File 'lib/squall/user.rb', line 130 def monthly_bills(id) request(:get, "/users/#{id}/monthly_bills.json") end |
- (Object) network_zones(id)
List network zones associated with user.
169 170 171 172 |
# File 'lib/squall/user.rb', line 169 def network_zones(id) response = request(:get, "/users/#{id}/network_zones.json") response.collect { |vm| vm['network_group']} end |
- (Object) show(id)
Get info for a user.
67 68 69 70 |
# File 'lib/squall/user.rb', line 67 def show(id) response = request(:get, "/users/#{id}.json") response["user"] end |
- (Object) stats(id)
Get the stats for each of a User's VirtualMachines
121 122 123 |
# File 'lib/squall/user.rb', line 121 def stats(id) request(:get, "/users/#{id}/vm_stats.json") end |
- (Object) suspend(id)
Suspend a user.
87 88 89 90 |
# File 'lib/squall/user.rb', line 87 def suspend(id) response = request(:get, "/users/#{id}/suspend.json") response["user"] end |
- (Object) virtual_machines(id)
List User's VirtualMachines.
139 140 141 142 |
# File 'lib/squall/user.rb', line 139 def virtual_machines(id) response = request(:get, "/users/#{id}/virtual_machines.json") response.collect { |vm| vm['virtual_machine']} end |