Object
Add an Bucket in the system
bucket_name :: a bucket name access_key_id :: access key id
Result
# File lib/leo_manager_client.rb, line 306 def add_bucket(bucket_name, access_key_id) Result.new(call(CMD_ADD_BUCKET % [bucket_name, access_key_id])) end
Execute ‘compact suspend’
node :: a storage node
Result
# File lib/leo_manager_client.rb, line 201 def compact_resume(node) Result.new(call(CMD_COMPACT_RESUME % node)) end
Execute data comaction in a storage node
node :: a storage node num_of_targets_or_all :: a number of targets - [integer | all] num_of_concurrents :: a number of concurrents
Result
# File lib/leo_manager_client.rb, line 177 def compact_start(node, num_of_targets_or_all, num_of_concurrents=nil) case num_of_targets_or_all.to_s when /^all$/ Result.new(call(CMD_COMPACT_START_ALL % node)) else num_of_concurrents = num_of_concurrents ? Integer(num_of_concurrents) : "" Result.new(call(CMD_COMPACT_START % [node, Integer(num_of_targets_or_all), num_of_concurrents])) end end
Execute ‘compact status’
node :: a storage node
CompactionStatus
# File lib/leo_manager_client.rb, line 210 def compact_status(node) compaction = call(CMD_COMPACT_STATUS % node)[:compaction_status] CompactionStatus.new(compaction) end
Execute ‘compact suspend’
node :: a storage node
Result
# File lib/leo_manager_client.rb, line 192 def compact_suspend(node) Result.new(call(CMD_COMPACT_SUSPEND % node)) end
Generate credential of a user
user_id :: user id password :: password
Credential
# File lib/leo_manager_client.rb, line 230 def create_user(user_id, password=nil) Credential.new(call(CMD_CRE_USER % [user_id, password])) end
Delete an Bucket in the system
bucket_name :: a bucket name access_key_id :: access key id
Result
# File lib/leo_manager_client.rb, line 316 def delete_bucket(bucket_name, access_key_id) Result.new(call(CMD_DELETE_BUCKET % [bucket_name, access_key_id])) end
Remove an endpoint from the system
endpoint :: an endpoint
nil
# File lib/leo_manager_client.rb, line 287 def delete_endpoint(endpoint) Result.new(call(CMD_DEL_ENDPOINT % endpoint)) end
Delete a user
user_id :: user id
Result
# File lib/leo_manager_client.rb, line 261 def delete_user(user_id) Result.new(call(CMD_DEL_USER % user_id)) end
Leave a node from the storage cluster
node :: a storage node
Result
# File lib/leo_manager_client.rb, line 122 def detach(node) Result.new(call(CMD_DETACH % node)) end
Disconnect to LeoFS Manager explicitly
Result
# File lib/leo_manager_client.rb, line 370 def disconnect! disconnect end
Retrieve storage status from the storage
node :: a storage node
StorageStat
# File lib/leo_manager_client.rb, line 166 def du(node) StorageStat.new(call(CMD_DU % node)) end
Retrieve all buckets from the system
Array of Bucket
# File lib/leo_manager_client.rb, line 323 def get_buckets buckets = call(CMD_GET_BUCKETS)[:buckets] buckets.map {|bucket| Bucket.new(bucket) } end
Retrieve an endpoint in the system
Array of Endpoint
# File lib/leo_manager_client.rb, line 295 def get_endpoints endpoints = call(CMD_GET_ENDPOINTS)[:endpoints] endpoints.map {|endpoint| Endpoint.new(endpoint) } end
Retrieve a user
Map
# File lib/leo_manager_client.rb, line 268 def get_users users = call(CMD_GET_USERS)[:users] users.map {|account| User.new(account) } end
Login as specifies user
user_id :: user id password :: password
LoginInfo
# File lib/leo_manager_client.rb, line 106 def login(user_id, password) LoginInfo.new(call(CMD_LOGIN % [user_id, password])) end
Purge a cache in the gateways
path :: an object path
Result
# File lib/leo_manager_client.rb, line 220 def purge(path) Result.new(call(CMD_PURGE % path)) end
Execute relocate of objects - “rebalance” in the storage cluster
Result
# File lib/leo_manager_client.rb, line 147 def rebalance Result.new(call(CMD_REBALANCE)) end
Recover file
path :: an object path
Result
# File lib/leo_manager_client.rb, line 344 def recover_file(path) Result.new(call(CMD_RECOVER_FILE % path)) end
Recover node
node :: a storage node
Result
# File lib/leo_manager_client.rb, line 353 def recover_node(node) Result.new(call(CMD_RECOVER_NODE % node)) end
Recover ring
node :: a storage node
Result
# File lib/leo_manager_client.rb, line 362 def recover_ring(node) Result.new(call(CMD_RECOVER_RING % node)) nil end
Resume a node in the storage cluster
node :: a storage node
Result
# File lib/leo_manager_client.rb, line 140 def resume(node) Result.new(call(CMD_RESUME % node)) end
Insert an endpoint in the system
endpoint :: an endpoint
Result
# File lib/leo_manager_client.rb, line 278 def set_endpoint(endpoint) Result.new(call(CMD_SET_ENDPOINT % endpoint)) end
Launch LeoFS’s storage cluster
Result
# File lib/leo_manager_client.rb, line 113 def start Result.new(call(CMD_START)) end
Retrieve LeoFS’s system status from LeoFS Manager
node :: Node
Status
# File lib/leo_manager_client.rb, line 96 def status(node=nil) Status.new(call(CMD_STATUS % node)) end
Suspend a node in the storage cluster
node :: a storage node
Result
# File lib/leo_manager_client.rb, line 131 def suspend(node) Result.new(call(CMD_SUSPEND % node)) end
Update acl of a bucket
bucket_name :: a bucket name access_key_id :: access key id acl :: acl of a bucket
Result
# File lib/leo_manager_client.rb, line 335 def update_acl(bucket, accesskey, acl) Result.new(call(CMD_UPDATE_ACL % [bucket, accesskey, acl])) end
Update password of a user
user_id :: user id new_password :: new password
Result
# File lib/leo_manager_client.rb, line 252 def update_user_password(user_id, new_password) Result.new(call(CMD_UPD_USER_PASS % [user_id, new_password])) end
Update role of a user
user_id :: user id role :: operation role of a user
Result
# File lib/leo_manager_client.rb, line 240 def update_user_role(user_id, role) role = role.to_sym if role.is_a? String role = USER_ROLES[role] if role.is_a? Symbol Result.new(call(CMD_UPD_USER_ROLE % [user_id, role])) end
Generated with the Darkfish Rdoc Generator 2.