zcloudjp 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -2
- data/lib/zcloudjp/machine.rb +2 -0
- data/lib/zcloudjp/version.rb +1 -1
- data/zcloudjp.gemspec +4 -4
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9da3b715732839b8590c5520a3747fdfffeb783
|
4
|
+
data.tar.gz: f5786b041a14cc619b8f7384846832dda7043749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52bb98d7434dab10d16ecbb84f1d4c9fd3907dbbae4a29200bacdff29caa698836425b1ba7df85b1d69ab93e163fdb6bbce36430a146d702a61a04b09f7e7483
|
7
|
+
data.tar.gz: 1f8b80be5e00648aee2227950ab7865eddf75c8843e6d83a0d155c4fc68762c109fa13229c544bc7840cbd8a34b2ab029d5f1977298eec2416a205a19069fe9a
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Zcloudjp
|
2
2
|
|
3
|
-
|
3
|
+
A Ruby interface to the [Z Cloud](http://z-cloud.jp/) API.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,27 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
```
|
22
|
+
$ export ZCLOUDJP_API_KEY=abc
|
23
|
+
$ pry
|
24
|
+
> require 'zcloudjp'
|
25
|
+
=> true
|
26
|
+
> @client = Zcloudjp.new
|
27
|
+
.. snip ..
|
28
|
+
> @machine = @client.machine.create(dataset: "sdc:sdc:base64:13.1.0", package: "Small_1GB")
|
29
|
+
=> #<OpenStruct request_options={:base_uri=>"https://my.z-cloud.jp", :headers=>{"X-API-KEY"=>"abc", "Content-Type"=>"application/json; charset=utf-8", "Accept"=>"application/json", "User-Agent"=>"zcloudjp-gem/0.1.0 (x86_64-darwin11.4.2) ruby/1.9.3"}, :body=>"{\"dataset\":\"sdc:sdc:base64:13.1.0\",\"package\":\"Small_1GB\"}"}, id="9796d336-f249-440f-a440-454fab97d602", name=nil, type="smartmachine", state="provisioning", dataset="sdc:sdc:base64:13.1.0", memory=1024, disk=30720, ips=["192.168.137.196"], metadata={}, created="2013-07-09T06:08:46+00:00", updated="2013-07-09T06:08:47+00:00", account_id=723, os="SmartOS", kind="SmartOS", package="Small_1GB", subdomain=nil, alert=nil>
|
30
|
+
> @machine.metadata.list
|
31
|
+
=> {"metadata"=> {}}
|
32
|
+
> @machine.metadata.create(nick: 'fuubar')
|
33
|
+
=> {"metadata"=> {
|
34
|
+
"nick"=>"fuubar"}}
|
35
|
+
> @machine.state
|
36
|
+
=> "running"
|
37
|
+
> @machine.stop
|
38
|
+
> @machine.reload.state
|
39
|
+
=> "stopped"
|
40
|
+
> @machine.delete
|
41
|
+
```
|
22
42
|
|
23
43
|
## Contributing
|
24
44
|
|
data/lib/zcloudjp/machine.rb
CHANGED
@@ -20,6 +20,7 @@ module Zcloudjp
|
|
20
20
|
update_attributes(response.parsed_response)
|
21
21
|
end
|
22
22
|
alias :find_by :show
|
23
|
+
alias :reload :show
|
23
24
|
|
24
25
|
# POST /machines.json
|
25
26
|
def create(params={})
|
@@ -34,6 +35,7 @@ module Zcloudjp
|
|
34
35
|
response = Zcloudjp::Client.delete("/machines/#{id}", self.request_options)
|
35
36
|
update_attributes(response.parsed_response)
|
36
37
|
end
|
38
|
+
alias :destroy :delete
|
37
39
|
|
38
40
|
# POST /machines/:id/start.json
|
39
41
|
def start(params={})
|
data/lib/zcloudjp/version.rb
CHANGED
data/zcloudjp.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'zcloudjp/version'
|
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
|
24
|
-
spec.add_runtime_dependency 'activesupport'
|
25
|
-
spec.add_runtime_dependency 'httparty'
|
26
|
-
spec.add_runtime_dependency 'multi_json'
|
24
|
+
spec.add_runtime_dependency 'activesupport', "~> 4.0"
|
25
|
+
spec.add_runtime_dependency 'httparty', "~> 0.11"
|
26
|
+
spec.add_runtime_dependency 'multi_json', "~> 1.7"
|
27
27
|
|
28
28
|
spec.add_development_dependency 'rspec'
|
29
29
|
spec.add_development_dependency 'simplecov'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zcloudjp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azukiwasher
|
@@ -42,44 +42,44 @@ dependencies:
|
|
42
42
|
name: activesupport
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '4.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: '4.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: httparty
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.11'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.11'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: multi_json
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '1.7'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '1.7'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|