sakurraform 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +36 -23
- data/lib/sakurraform/cli.rb +3 -3
- data/lib/sakurraform/cli/init.rb +2 -2
- data/lib/sakurraform/cli/{bs.rb → storage.rb} +14 -4
- data/lib/sakurraform/helper.rb +4 -4
- data/lib/sakurraform/templates/credentials.tt +2 -2
- data/lib/sakurraform/version.rb +1 -1
- data/sakurraform.gemspec +3 -3
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed44b5ae49e93dd9302608bf2e5a03548e48edee
|
4
|
+
data.tar.gz: 9671d1bcc4b38ca2d916a454407c835d4feee828
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b31c9e260249834073869a09691157c19bd70668b7d139cc95aa5de094d747b61af9df65add730177784209ed211299e722fe63714a57a25db9ab9895c2670f1
|
7
|
+
data.tar.gz: e88d4041efe29bf4e6df5eef78c6a55445b8115b319f444512739c3dc1f8dc58d052da1fd7b6664ee46609a1c2e8b11e8a3d28cbe1685e59c4d94c442a495363
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/sakurraform.svg)](http://badge.fury.io/rb/sakurraform)
|
5
5
|
|
6
|
-
Manage Infrastructure from Code with Sakura no Cloud and
|
6
|
+
Manage Infrastructure from Code with Sakura no Cloud and Object Storage.
|
7
7
|
|
8
8
|
## TODO
|
9
9
|
|
@@ -29,13 +29,13 @@ And then execute:
|
|
29
29
|
```
|
30
30
|
$ ./bin/sakurraform
|
31
31
|
Commands:
|
32
|
-
sakurraform
|
33
|
-
sakurraform help [COMMAND]
|
34
|
-
sakurraform init
|
35
|
-
sakurraform map
|
36
|
-
sakurraform plan SUBCOMMAND
|
37
|
-
sakurraform status
|
38
|
-
sakurraform version
|
32
|
+
sakurraform storage SUBCOMMAND # Manage Sakura no Object Storage
|
33
|
+
sakurraform help [COMMAND] # Describe available commands or one specific command
|
34
|
+
sakurraform init # initiaize .sakuracloud/credentials
|
35
|
+
sakurraform map # open sakura cloud map!
|
36
|
+
sakurraform plan SUBCOMMAND # Manage plan
|
37
|
+
sakurraform status # show status
|
38
|
+
sakurraform version # show version
|
39
39
|
|
40
40
|
```
|
41
41
|
|
@@ -137,32 +137,34 @@ $ ./bin/sakurraform status
|
|
137
137
|
|
138
138
|
### sakurraform map
|
139
139
|
|
140
|
-
open map page by
|
140
|
+
open map page by browser...
|
141
141
|
|
142
142
|
|
143
|
-
### sakurraform
|
143
|
+
### sakurraform storage SUBCOMMAND
|
144
144
|
|
145
|
+
Note: Renamed from bs subcommand since v0.2.0.
|
145
146
|
|
146
147
|
```
|
147
|
-
$ ./bin/sakurraform
|
148
|
+
$ ./bin/sakurraform storage
|
148
149
|
Commands:
|
149
|
-
sakurraform
|
150
|
-
sakurraform
|
151
|
-
sakurraform
|
152
|
-
sakurraform
|
153
|
-
sakurraform
|
150
|
+
sakurraform storage cat PATH # cat object entry
|
151
|
+
sakurraform storage create # Create bucket(..just open browser)
|
152
|
+
sakurraform storage delete PATH # delete object entry
|
153
|
+
sakurraform storage help [COMMAND] # Describe subcommands or one specific subcommand
|
154
|
+
sakurraform storage ls # list object entries
|
155
|
+
sakurraform storage put FILE [KEY] # put file to key. use filename to key by default.
|
154
156
|
```
|
155
157
|
|
156
|
-
#### sakurraform
|
158
|
+
#### sakurraform storage create
|
157
159
|
|
158
160
|
Create bucket(..just open browser)
|
159
161
|
|
160
|
-
#### sakurraform
|
162
|
+
#### sakurraform storage ls
|
161
163
|
|
162
164
|
list object entries.
|
163
165
|
|
164
166
|
```
|
165
|
-
$ ./bin/sakurraform
|
167
|
+
$ ./bin/sakurraform storage ls
|
166
168
|
+----------+----------------+---------------------+---------------------------+-------------------------------------------------------+
|
167
169
|
| key | content_length | content_type | last_modified | public_url |
|
168
170
|
+----------+----------------+---------------------+---------------------------+-------------------------------------------------------+
|
@@ -172,17 +174,28 @@ $ ./bin/sakurraform bs ls
|
|
172
174
|
+----------+----------------+---------------------+---------------------------+-------------------------------------------------------+
|
173
175
|
```
|
174
176
|
|
175
|
-
#### sakurraform
|
177
|
+
#### sakurraform storage put
|
176
178
|
|
177
179
|
```
|
178
|
-
$ ./bin/sakurraform
|
180
|
+
$ ./bin/sakurraform storage put install.sh
|
181
|
+
File install.sh was put to install.sh.
|
182
|
+
|
183
|
+
|
184
|
+
$ ./bin/sakurraform storage put install.sh myobj-key
|
185
|
+
File install.sh was put to myobj-key.
|
186
|
+
```
|
187
|
+
|
188
|
+
#### sakurraform storage cat
|
189
|
+
|
190
|
+
```
|
191
|
+
$ ./bin/sakurraform storage cat 20140930_debug.out_0
|
179
192
|
{"hoge":"mogemoge","piyo":"piyo"}
|
180
193
|
```
|
181
194
|
|
182
|
-
#### sakurraform
|
195
|
+
#### sakurraform storage delete
|
183
196
|
|
184
197
|
```
|
185
|
-
$ ./bin/sakurraform
|
198
|
+
$ ./bin/sakurraform storage delete 20140930_debug.out_0
|
186
199
|
deleting 20140930_debug.out_0
|
187
200
|
```
|
188
201
|
|
data/lib/sakurraform/cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'sakurraform/cli/version'
|
2
2
|
require 'sakurraform/cli/init'
|
3
3
|
require 'sakurraform/cli/plan'
|
4
|
-
require 'sakurraform/cli/
|
4
|
+
require 'sakurraform/cli/storage'
|
5
5
|
require 'sakurraform/cli/status'
|
6
6
|
require 'sakurraform/cli/map'
|
7
7
|
|
@@ -14,7 +14,7 @@ end
|
|
14
14
|
|
15
15
|
module SakurraForm
|
16
16
|
class CLI < Thor
|
17
|
-
desc "
|
18
|
-
subcommand "
|
17
|
+
desc "storage SUBCOMMAND", 'Manage Sakura no Object Storage (replaced from bs command)'
|
18
|
+
subcommand "storage", SakurraForm::Storage
|
19
19
|
end
|
20
20
|
end
|
data/lib/sakurraform/cli/init.rb
CHANGED
@@ -13,8 +13,8 @@ module SakurraForm
|
|
13
13
|
empty_directory('.sakuracloud')
|
14
14
|
@sakuracloud_api_token = ask("Sakuracloud_api_token(required) ? ")
|
15
15
|
@sakuracloud_api_token_secret = ask("Sakuracloud_api_token_secret(required) ? ")
|
16
|
-
@
|
17
|
-
@
|
16
|
+
@sakura_object_storage_bucket = ask("Sakura Object Storage buket name(optional) ? ")
|
17
|
+
@sakura_object_storage_token = ask("Sakura Object Storage token(optional) ? ")
|
18
18
|
template('templates/credentials.tt', ".sakuracloud/credentials")
|
19
19
|
end
|
20
20
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'aws-sdk'
|
2
2
|
module SakurraForm
|
3
|
-
class
|
3
|
+
class Storage < Thor
|
4
4
|
include Thor::Actions
|
5
5
|
include SakurraForm::Helper
|
6
6
|
|
@@ -17,7 +17,7 @@ module SakurraForm
|
|
17
17
|
def ls
|
18
18
|
s3 = init_s3
|
19
19
|
|
20
|
-
bucket = s3.buckets[Fog.credentials[:
|
20
|
+
bucket = s3.buckets[Fog.credentials[:sakura_object_storage_bucket]]
|
21
21
|
table = bucket.objects.entries.map do |ent|
|
22
22
|
{
|
23
23
|
:key => ent.key,
|
@@ -34,16 +34,26 @@ module SakurraForm
|
|
34
34
|
def cat(path)
|
35
35
|
s3 = init_s3
|
36
36
|
|
37
|
-
bucket = s3.buckets[Fog.credentials[:
|
37
|
+
bucket = s3.buckets[Fog.credentials[:sakura_object_storage_bucket]]
|
38
38
|
obj = bucket.objects.find {|a| a.key == path }
|
39
39
|
say(obj.read) if obj
|
40
40
|
end
|
41
41
|
|
42
|
+
desc 'put FILE [KEY]', 'put file to key. use filename to key by default.'
|
43
|
+
def put(file, key = file)
|
44
|
+
s3 = init_s3
|
45
|
+
|
46
|
+
bucket = s3.buckets[Fog.credentials[:sakura_object_storage_bucket]]
|
47
|
+
obj = bucket.objects[key]
|
48
|
+
obj.write(Pathname.new(file))
|
49
|
+
say("File #{file} was put to #{key}.")
|
50
|
+
end
|
51
|
+
|
42
52
|
desc 'delete PATH', 'delete object entry'
|
43
53
|
def delete(path)
|
44
54
|
s3 = init_s3
|
45
55
|
|
46
|
-
bucket = s3.buckets[Fog.credentials[:
|
56
|
+
bucket = s3.buckets[Fog.credentials[:sakura_object_storage_bucket]]
|
47
57
|
obj = bucket.objects.find {|a| a.key == path }
|
48
58
|
if obj
|
49
59
|
say("deleting #{obj.key}")
|
data/lib/sakurraform/helper.rb
CHANGED
@@ -81,10 +81,10 @@ module SakurraForm
|
|
81
81
|
|
82
82
|
def init_s3
|
83
83
|
AWS::S3.new(
|
84
|
-
:access_key_id => Fog.credentials[:
|
85
|
-
:secret_access_key => Fog.credentials[:
|
86
|
-
:s3_endpoint => 'b.
|
87
|
-
:use_ssl =>
|
84
|
+
:access_key_id => Fog.credentials[:sakura_object_storage_bucket],
|
85
|
+
:secret_access_key => Fog.credentials[:sakura_object_storage_token] ,
|
86
|
+
:s3_endpoint => 'b.sakurastorage.jp',
|
87
|
+
:use_ssl => true
|
88
88
|
)
|
89
89
|
end
|
90
90
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
default:
|
2
2
|
sakuracloud_api_token: <%= @sakuracloud_api_token %>
|
3
3
|
sakuracloud_api_token_secret: <%= @sakuracloud_api_token_secret %>
|
4
|
-
|
5
|
-
|
4
|
+
sakura_object_storage_bucket: <%= @sakura_object_storage_bucket ? @sakura_object_storage_bucket : "null" %>
|
5
|
+
sakura_object_storage_token: <%= @sakura_object_storage_token ? @sakura_object_storage_token : "null" %>
|
data/lib/sakurraform/version.rb
CHANGED
data/sakurraform.gemspec
CHANGED
@@ -20,12 +20,12 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency "thor"
|
22
22
|
spec.add_dependency "uuid"
|
23
|
-
spec.add_dependency "aws-sdk"
|
23
|
+
spec.add_dependency "aws-sdk", "< 2.0"
|
24
24
|
spec.add_dependency "chamber"
|
25
25
|
spec.add_dependency "ipaddress"
|
26
|
-
spec.add_dependency "fog-sakuracloud"
|
26
|
+
spec.add_dependency "fog-sakuracloud"
|
27
27
|
|
28
|
-
spec.add_development_dependency "bundler", "~> 1.
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
30
30
|
spec.add_development_dependency "pry"
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sakurraform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: aws-sdk
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "<"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '2.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: chamber
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,30 +84,30 @@ dependencies:
|
|
84
84
|
name: fog-sakuracloud
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
103
|
+
version: '1.9'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.9'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,11 +153,11 @@ files:
|
|
153
153
|
- bin/sakurraform
|
154
154
|
- lib/sakurraform.rb
|
155
155
|
- lib/sakurraform/cli.rb
|
156
|
-
- lib/sakurraform/cli/bs.rb
|
157
156
|
- lib/sakurraform/cli/init.rb
|
158
157
|
- lib/sakurraform/cli/map.rb
|
159
158
|
- lib/sakurraform/cli/plan.rb
|
160
159
|
- lib/sakurraform/cli/status.rb
|
160
|
+
- lib/sakurraform/cli/storage.rb
|
161
161
|
- lib/sakurraform/cli/version.rb
|
162
162
|
- lib/sakurraform/collections.rb
|
163
163
|
- lib/sakurraform/helper.rb
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.4.
|
195
|
+
rubygems_version: 2.4.8
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: Manage Infrastructure from Code with Sakura no Cloud
|