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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/leofs_manager_client.rb +38 -29
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2NlNmI4ZDZlYzg3M2FlNGMyZGQ5ODIxZjliMTkzZDY1MDhlNmU5Nw==
4
+ MWYzOTBiYzNjZWQzMDc2M2EyZThiZjkyMTNmMGZiNTQ3ZWJiMWU0MA==
5
5
  data.tar.gz: !binary |-
6
- ZWEzOGM1ZDk4NGQzY2U4MWM0NzAwYzBlMTkwNjk4ODFkNWE2YTc3OQ==
6
+ ZDA2MTQwOGU0MzVjY2UwMGNiNTRlNzhlNGYyNmNkM2M4NGQ1MmIyYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzBlNTE5NDM3NTM0ZTE1NWI0ZTUzOTAzZjIxMmE0NjcxZTNmNDZiZmVlZDYx
10
- M2MwYTk2NGY5MGI5YzdmZGYxZTAyN2UyYmNkNGQ1OGJmYWFiY2Y5ZjcxM2Ex
11
- NTRkMTI3OTRkNTdiN2UwYjAwNDhhNjQzNzM5MzY4NGE2MDBmZTk=
9
+ NDIwNmU1NDM5ZjI4ZDk2MWJiYzFhMzY3YTE4OWI2YTI1ODliNzY0NzA4YTA5
10
+ OWJlYTQ2ZjNiODdkN2U5NDgwZjVlZmU0NzAxZWQ0YzRiYWJjN2FjN2U5OTgz
11
+ NWI0ZWU2ODJjNDFiNGZlMGQ2NTI5ZmU4MDFiMDU2OGUyMTQ2YmE=
12
12
  data.tar.gz: !binary |-
13
- NDY5YmI3MDZmNDU2ZjhjNzVjZTY5ZDZkMWY3YmMzYjVjMTcxM2YxYjBkOTgy
14
- NmI3ZTkzMGEwNzg2NTgyMjI4MjZiNmE0MjVkYmQ1OWIyOWQzZGFjMmFmOGRi
15
- MTcyMDA3MThiOTlkMTFjOGRhNDRkY2ZjMjhlMWMwM2VlYTI0Nzc=
13
+ ZWIwNDZkZjI1ZGVhYWFkMGU1NWU4NzA1MDVlNDMxZTY4YmZhMDJmYjBiNzg2
14
+ YTcyNTYxNTFiMzFjMDM1ODYxYzgyZTNjYmQxMzdjNGExMDY4NGExMDYxMmE4
15
+ ZTdkM2JhOWQ2N2MwZThhNDUwNTU4MzVkYzMxZmYzMjZjZjEyMmE=
@@ -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.2"
29
+ VERSION = "0.4.3"
30
30
 
31
31
  class Client
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_SUSPEND = "compact suspend %s"
44
- CMD_COMPACT_RESUME = "compact resume %s"
45
- CMD_COMPACT_STATUS = "compact status %s"
46
- CMD_PURGE = "purge %s"
47
- CMD_CRE_USER = "create-user %s %s"
48
- CMD_UPD_USER_ROLE = "update-user-role %s %s"
49
- CMD_UPD_USER_PASS = "update-user-password %s %s"
50
- CMD_DEL_USER = "delete-user %s"
51
- CMD_GET_USERS = "get-users"
52
- CMD_SET_ENDPOINT = "set-endpoint %s"
53
- CMD_DEL_ENDPOINT = "delete-endpoint %s"
54
- CMD_GET_ENDPOINTS = "get-endpoints"
55
- CMD_ADD_BUCKET = "add-bucket %s %s"
56
- CMD_GET_BUCKETS = "get-buckets"
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, num_of_targets, num_of_concurrents)
158
- sender(CMD_COMPACT_START % [node, num_of_targets, num_of_concurrents])
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
- response = JSON.parse(@socket.readline, symbolize_names: true)
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.2
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-19 00:00:00.000000000 Z
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Client for LeoFS Manager
15
15
  email: