barge 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/barge/resource/base.rb +4 -1
- data/lib/barge/resource/droplet.rb +8 -0
- data/lib/barge/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 812d968b6233cf86946ddba0aadd71b5d7daa6c5
|
4
|
+
data.tar.gz: 70cbacbf6cc75e8dddfd70a7255248204c880282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23349a278ef256a21002afbf8ff94a6056f25ecef565705a5819e1bf683b3d3b6de103533083fd63d65c247b8b95e3281250603b9fa093330d1bdc5d0b56b856
|
7
|
+
data.tar.gz: 6c68c3c554d0c1b71e36721df1742f3018104af7f365ef4b37de42c4e1c99fbac64e86da6c36136d9e7dea0cfe0df2ebc5cb05e34bb7dec83d5c9a6c01c67b09
|
data/README.md
CHANGED
@@ -123,6 +123,12 @@ barge.droplet.show(droplet_id)
|
|
123
123
|
barge.droplet.backups(droplet_id)
|
124
124
|
```
|
125
125
|
|
126
|
+
### Show droplet kernels
|
127
|
+
|
128
|
+
``` ruby
|
129
|
+
barge.droplet.kernels(droplet_id)
|
130
|
+
```
|
131
|
+
|
126
132
|
### Show droplet snapshots
|
127
133
|
|
128
134
|
``` ruby
|
@@ -197,6 +203,12 @@ barge.droplet.restore(droplet_id, image_id)
|
|
197
203
|
barge.droplet.password_reset(droplet_id)
|
198
204
|
```
|
199
205
|
|
206
|
+
### Show droplet actions
|
207
|
+
|
208
|
+
``` ruby
|
209
|
+
barge.droplet.actions(droplet_id)
|
210
|
+
```
|
211
|
+
|
200
212
|
### Show droplet action
|
201
213
|
|
202
214
|
``` ruby
|
data/lib/barge/resource/base.rb
CHANGED
@@ -3,6 +3,8 @@ module Barge
|
|
3
3
|
module Base
|
4
4
|
attr_reader :faraday
|
5
5
|
|
6
|
+
PER_PAGE = 999
|
7
|
+
|
6
8
|
def initialize(faraday)
|
7
9
|
@faraday = faraday
|
8
10
|
end
|
@@ -16,7 +18,8 @@ module Barge
|
|
16
18
|
end
|
17
19
|
|
18
20
|
def request(verb, *args)
|
19
|
-
|
21
|
+
options = { per_page: PER_PAGE } if verb == :get
|
22
|
+
response = faraday.public_send(verb, *args, options)
|
20
23
|
response.body.tap do |r|
|
21
24
|
r.define_singleton_method(:response) { response }
|
22
25
|
r.define_singleton_method(:success?) { response.success? }
|
@@ -19,6 +19,10 @@ module Barge
|
|
19
19
|
get("droplets/#{droplet_id}/backups")
|
20
20
|
end
|
21
21
|
|
22
|
+
def kernels(droplet_id)
|
23
|
+
get("droplets/#{droplet_id}/kernels")
|
24
|
+
end
|
25
|
+
|
22
26
|
def snapshots(droplet_id)
|
23
27
|
get("droplets/#{droplet_id}/snapshots")
|
24
28
|
end
|
@@ -67,6 +71,10 @@ module Barge
|
|
67
71
|
action(droplet_id, __method__)
|
68
72
|
end
|
69
73
|
|
74
|
+
def actions(droplet_id)
|
75
|
+
get("droplets/#{droplet_id}/actions")
|
76
|
+
end
|
77
|
+
|
70
78
|
def show_action(droplet_id, action_id)
|
71
79
|
get("droplets/#{droplet_id}/actions/#{action_id}")
|
72
80
|
end
|
data/lib/barge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Ørjan Blom"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.1'
|
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: '3.
|
54
|
+
version: '3.1'
|
55
55
|
description: Ruby library for version 2 of DigitalOcean's API
|
56
56
|
email:
|
57
57
|
- blom@blom.tv
|