rabbit_swift 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39963e45fd183eca61bb3ab443a8ef18c396424c
4
- data.tar.gz: 50a027e4738e68276e808ac6e8f4a47d96450253
3
+ metadata.gz: 6a4204659e66ca66e7c59bfbed294b9196c94098
4
+ data.tar.gz: 2e55781dc9bf5cc9eefecc00cf317b2b78de3ca7
5
5
  SHA512:
6
- metadata.gz: f1644fae715b829e70220ac574243ec3ed3f49aa7eba2dcf678e3ad6f0c053f0d5ace0b1e05e00e649d2c5251667e11613ea7974570d61c6296a12105185d77a
7
- data.tar.gz: f5a03d16eff1ffb8e9b8aade26fa3712ac81cfa313fa0a00eb9f1ba023a18c15f6ffc2098e41add1e914c8790731452e6ba9d56f32932946f12f3996930766a8
6
+ metadata.gz: ef793438a4a3a599fc8fb291d11c3b4cbc1e2602058b5823c541c89c81dfa4bb70e9d4aa5d414c6d27cc1b3f29498153016f3240fcd678c98d8d92f206ded887
7
+ data.tar.gz: 5c4d64762afe5d8d0ff99cb4ca79bce0fd261903a0cd191b1e3aed6fc3243fc50657847de258946d2376174a2b15ec84f7ff5811b7379bcc2ef6227d778c9d17
data/README.md CHANGED
@@ -41,11 +41,11 @@ Or install it yourself as:
41
41
  dest_url = "https://objectstore-r1nd1111.cnode.jp/v1/XXXXXXXXXXX/container_name"
42
42
  status = rabbit_swift_client.upload(token, dest_url, src_file_path)
43
43
 
44
- ### Check Result
44
+ #### Check Result
45
45
  if (status == RabbitSwift::Client::UPLOAD_SUCCESS_HTTP_STATUS_CODE)
46
46
  puts "upload success!"
47
47
  end
48
-
48
+
49
49
  ### Support Static Large Object
50
50
 
51
51
  #### When object size 5BG over. Auto change mode SLO
@@ -53,13 +53,20 @@ Or install it yourself as:
53
53
  rabbit_swift_client.upload(token, dest_url, 5GB_over_file.zip) --> static large object upload
54
54
 
55
55
  #### SLO Flow
56
- 1. split File
56
+ 1. split file
57
57
  2. upload split files
58
58
  3. upload manifest file
59
+ 4. delete split files
60
+
61
+ ### bin utils
59
62
 
63
+ #### List Container
64
+ bundle exec ruby -I./lib bin/container_list.rb -l /test -c ../chino/conf/conf.json
60
65
  #### SLO Client
61
66
  bundle exec ruby -I./lib bin/slo_client.rb -s ~/Downloads/test.zip -d /test -c ../chino/conf/conf.json -l 100MB
62
67
 
68
+
69
+
63
70
  ## Contributing
64
71
 
65
72
  1. Fork it ( https://github.com/AKB428/rabbit_swift/fork )
data/RELEASE.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # リリース履歴
2
2
 
3
+ ## 0.3.2
4
+
5
+ (2015/02/18)
6
+
7
+ add List Container Method
8
+
3
9
  ## 0.3.1
4
10
 
5
11
  (2015/02/15)
@@ -0,0 +1,29 @@
1
+ require 'json'
2
+ require 'optparse'
3
+ require 'rabbit_swift'
4
+
5
+ #bundle exec ruby -I./lib bin/container_list.rb -l /test -c ../chino/conf/conf.json
6
+
7
+ opt = OptionParser.new
8
+ Version = '1.0.0'
9
+
10
+ conf_path = nil
11
+ url = nil
12
+ swift_conf_json = nil
13
+ opt.on('-c CONF_PATH', 'conf_path') {|v| conf_path = v}
14
+ opt.on('-l LIST_CONTAINER_TARGET', 'list container target') {|v| url = v}
15
+ opt.parse!(ARGV)
16
+ File.open conf_path do |file|
17
+ conf = JSON.load(file.read)
18
+ swift_conf_json = conf['swift']
19
+
20
+ if url =~ /^\//
21
+ url = swift_conf_json['endPoint'] + url
22
+ end
23
+ end
24
+
25
+ rabbit_swift_client = RabbitSwift::Client.new(swift_conf_json)
26
+ token = rabbit_swift_client.get_token
27
+ response = rabbit_swift_client.list(token, url)
28
+
29
+ puts response
@@ -55,6 +55,18 @@ module RabbitSwift
55
55
  header
56
56
  end
57
57
 
58
+ def list(token, url)
59
+ auth_header = {
60
+ 'X-Auth-Token' => token
61
+ }
62
+ query = {
63
+ 'format' => 'json'
64
+ }
65
+ http_client = HTTPClient.new
66
+ response = http_client.get(URI.parse(URI.encode(url)), query, auth_header)
67
+ JSON.load(response.body)
68
+ end
69
+
58
70
  def get_meta_data(token, url)
59
71
  response = head(token, url)
60
72
  meta_data = {}
@@ -1,3 +1,3 @@
1
1
  module RabbitSwift
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbit_swift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AKB428
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-15 00:00:00.000000000 Z
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,6 +84,7 @@ description: OpenStack Object Storage Simple Client
84
84
  email:
85
85
  - otoraru@gmail.com
86
86
  executables:
87
+ - container_list.rb
87
88
  - slo_client.rb
88
89
  extensions: []
89
90
  extra_rdoc_files: []
@@ -94,6 +95,7 @@ files:
94
95
  - README.md
95
96
  - RELEASE.md
96
97
  - Rakefile
98
+ - bin/container_list.rb
97
99
  - bin/slo_client.rb
98
100
  - lib/rabbit_swift.rb
99
101
  - lib/rabbit_swift/account/.gitkeep