leofs_manager_client 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/leofs_manager_client.rb +38 -29
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWYzOTBiYzNjZWQzMDc2M2EyZThiZjkyMTNmMGZiNTQ3ZWJiMWU0MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDA2MTQwOGU0MzVjY2UwMGNiNTRlNzhlNGYyNmNkM2M4NGQ1MmIyYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDIwNmU1NDM5ZjI4ZDk2MWJiYzFhMzY3YTE4OWI2YTI1ODliNzY0NzA4YTA5
|
10
|
+
OWJlYTQ2ZjNiODdkN2U5NDgwZjVlZmU0NzAxZWQ0YzRiYWJjN2FjN2U5OTgz
|
11
|
+
NWI0ZWU2ODJjNDFiNGZlMGQ2NTI5ZmU4MDFiMDU2OGUyMTQ2YmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWIwNDZkZjI1ZGVhYWFkMGU1NWU4NzA1MDVlNDMxZTY4YmZhMDJmYjBiNzg2
|
14
|
+
YTcyNTYxNTFiMzFjMDM1ODYxYzgyZTNjYmQxMzdjNGExMDY4NGExMDYxMmE4
|
15
|
+
ZTdkM2JhOWQ2N2MwZThhNDUwNTU4MzVkYzMxZmYzMjZjZjEyMmE=
|
data/lib/leofs_manager_client.rb
CHANGED
@@ -26,34 +26,35 @@ require "time"
|
|
26
26
|
require_relative "leofs_manager_client/leofs_manager_models"
|
27
27
|
|
28
28
|
module LeoFSManager
|
29
|
-
VERSION = "0.4.
|
29
|
+
VERSION = "0.4.3"
|
30
30
|
|
31
31
|
class Client
|
32
|
-
CMD_VERSION
|
33
|
-
CMD_LOGIN
|
34
|
-
CMD_STATUS
|
35
|
-
CMD_START
|
36
|
-
CMD_DETACH
|
37
|
-
CMD_SUSPEND
|
38
|
-
CMD_RESUME
|
39
|
-
CMD_REBALANCE
|
40
|
-
CMD_WHEREIS
|
41
|
-
CMD_DU
|
42
|
-
CMD_COMPACT_START
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
32
|
+
CMD_VERSION = "version"
|
33
|
+
CMD_LOGIN = "login %s %s"
|
34
|
+
CMD_STATUS = "status %s"
|
35
|
+
CMD_START = "start"
|
36
|
+
CMD_DETACH = "detach %s"
|
37
|
+
CMD_SUSPEND = "suspend %s"
|
38
|
+
CMD_RESUME = "resume %s"
|
39
|
+
CMD_REBALANCE = "rebalance"
|
40
|
+
CMD_WHEREIS = "whereis %s"
|
41
|
+
CMD_DU = "du %s"
|
42
|
+
CMD_COMPACT_START = "compact start %s %s %s"
|
43
|
+
CMD_COMPACT_START_ALL = "compact start %s all"
|
44
|
+
CMD_COMPACT_SUSPEND = "compact suspend %s"
|
45
|
+
CMD_COMPACT_RESUME = "compact resume %s"
|
46
|
+
CMD_COMPACT_STATUS = "compact status %s"
|
47
|
+
CMD_PURGE = "purge %s"
|
48
|
+
CMD_CRE_USER = "create-user %s %s"
|
49
|
+
CMD_UPD_USER_ROLE = "update-user-role %s %s"
|
50
|
+
CMD_UPD_USER_PASS = "update-user-password %s %s"
|
51
|
+
CMD_DEL_USER = "delete-user %s"
|
52
|
+
CMD_GET_USERS = "get-users"
|
53
|
+
CMD_SET_ENDPOINT = "set-endpoint %s"
|
54
|
+
CMD_DEL_ENDPOINT = "delete-endpoint %s"
|
55
|
+
CMD_GET_ENDPOINTS = "get-endpoints"
|
56
|
+
CMD_ADD_BUCKET = "add-bucket %s %s"
|
57
|
+
CMD_GET_BUCKETS = "get-buckets"
|
57
58
|
|
58
59
|
USER_ROLES = RoleDef.invert
|
59
60
|
|
@@ -154,8 +155,14 @@ module LeoFSManager
|
|
154
155
|
# Execute 'compact start'
|
155
156
|
# Return::
|
156
157
|
# _nil_
|
157
|
-
def compact_start(node,
|
158
|
-
|
158
|
+
def compact_start(node, num_of_targets_or_all, num_of_concurrents=nil)
|
159
|
+
case num_of_targets_or_all.to_s
|
160
|
+
when /^all$/i
|
161
|
+
sender(CMD_COMPACT_START_ALL % node)
|
162
|
+
else
|
163
|
+
num_of_concurrents = num_of_concurrents ? Integer(num_of_concurrents) : ""
|
164
|
+
sender(CMD_COMPACT_START % [node, Integer(num_of_targets_or_all), num_of_concurrents])
|
165
|
+
end
|
159
166
|
nil
|
160
167
|
end
|
161
168
|
|
@@ -342,7 +349,9 @@ module LeoFSManager
|
|
342
349
|
begin
|
343
350
|
@mutex.synchronize do
|
344
351
|
@socket.print "#{command}\r\n"
|
345
|
-
|
352
|
+
line = @socket.readline
|
353
|
+
warn line if $DEBUG
|
354
|
+
response = JSON.parse(line, symbolize_names: true)
|
346
355
|
end
|
347
356
|
rescue EOFError => ex
|
348
357
|
warn "EOFError occured (server: #{@current_server})"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leofs_manager_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Matsushita
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03
|
12
|
+
date: 2013-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Client for LeoFS Manager
|
15
15
|
email:
|