oc 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -3
- data/lib/oc/version.rb +1 -1
- data/lib/system/run/commands/droplets.rb +62 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8c675dab6b5a469592212d2cae2bf838c2479c8
|
4
|
+
data.tar.gz: 69ac67a33df1cb23a73c062071a0f6c71b6095a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdd475186317b967f0291b0ad00a290f669319cd68174ecb363b77324a2935412aa73fb3b94d29d1fc1cde83ee2e759999f46ff5fd1acff3ee60ffecc3413fa9
|
7
|
+
data.tar.gz: 06509921c99148cfa94ddfa46f029779dac2da30950e3d3dc83ca9a100d9bbe8b2f113f18d18fac6a4dd34e5644e3f469297e675e23f1c192d95dd34ccecc03f
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Oc
|
2
2
|
|
3
|
-
DigitalOcean
|
3
|
+
DigitalOcean commandline tools
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -45,8 +45,11 @@ Or install it yourself as:
|
|
45
45
|
Resize Droplet
|
46
46
|
$ oc droplets resize [DROPLET_ID] [SIZE_ID]
|
47
47
|
|
48
|
-
Snapshot
|
49
|
-
$ oc droplets snaphot [DROPLET_ID] [SNAPSHOT_NAME]
|
48
|
+
Create Snapshot
|
49
|
+
$ oc droplets create-snaphot [DROPLET_ID] [SNAPSHOT_NAME]
|
50
|
+
|
51
|
+
Show droplet snapshots
|
52
|
+
$ oc droplets snapshots [DROPLET_ID]
|
50
53
|
|
51
54
|
Restore Droplet
|
52
55
|
$ oc droplets restore [DROPLET_ID] [IMAGE_ID]
|
@@ -56,6 +59,10 @@ Or install it yourself as:
|
|
56
59
|
|
57
60
|
Rename Droplet
|
58
61
|
$ oc droplets rename [DROPLET_ID] [NEW_NAME]
|
62
|
+
|
63
|
+
Enable IPv6 for a droplet
|
64
|
+
$ oc droplets enable-ipv6 [DROPLET_ID]
|
65
|
+
|
59
66
|
</pre>
|
60
67
|
## SSH
|
61
68
|
<pre>
|
data/lib/oc/version.rb
CHANGED
@@ -206,8 +206,8 @@ module Oc::Run
|
|
206
206
|
end
|
207
207
|
|
208
208
|
description "This method allows you to take a snapshot of the droplet once it has been powered off, which can later be restored or used to create a new droplet from the same image. Please be aware this may cause a reboot."
|
209
|
-
syntax "oc droplets snaphot [DROPLET_ID] [SNAPSHOT_NAME]"
|
210
|
-
def
|
209
|
+
syntax "oc droplets create-snaphot [DROPLET_ID] [SNAPSHOT_NAME]"
|
210
|
+
def create_snapshot(*args)
|
211
211
|
id = args[0]
|
212
212
|
name = args[1]
|
213
213
|
if id.nil? or name.nil?
|
@@ -225,6 +225,46 @@ module Oc::Run
|
|
225
225
|
end
|
226
226
|
end
|
227
227
|
|
228
|
+
description "Show droplet snapshots"
|
229
|
+
syntax "oc droplets snaphots [DROPLET_ID]"
|
230
|
+
def snapshots(*args)
|
231
|
+
id = args[0]
|
232
|
+
if id.nil?
|
233
|
+
puts "Argument Error".red
|
234
|
+
puts "Usage".yellow
|
235
|
+
puts "$ oc droplets snaphots [DROPLET_ID] ".yellow
|
236
|
+
else
|
237
|
+
raise ArgumentError, "Argument Error - #{id}" unless id =~ /\A[-+]?[0-9]*\.?[0-9]+\Z/
|
238
|
+
result = barge.droplet.snapshots(id)
|
239
|
+
if !result.success?
|
240
|
+
puts "#{result.message}".red
|
241
|
+
else
|
242
|
+
puts "Your Droplets".yellow
|
243
|
+
snapshots = []
|
244
|
+
|
245
|
+
snapshots << [
|
246
|
+
'Name',
|
247
|
+
'Distribution',
|
248
|
+
'Public',
|
249
|
+
'Created At'
|
250
|
+
]
|
251
|
+
|
252
|
+
result.snapshots.each do |snapshot|
|
253
|
+
snapshots << [
|
254
|
+
snapshot.name.to_s.red,
|
255
|
+
snapshot.distribution.to_s.red,
|
256
|
+
snapshot.status.to_s == "active" ? "Active".green : "Deactive".red,
|
257
|
+
snapshot.created_at
|
258
|
+
]
|
259
|
+
end
|
260
|
+
table = Terminal::Table.new :rows => snapshots
|
261
|
+
puts table
|
262
|
+
end
|
263
|
+
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
|
228
268
|
description "This method allows you to restore a droplet with a previous image or snapshot. This will be a mirror copy of the image or snapshot to your droplet. Be sure you have backed up any necessary information prior to restore."
|
229
269
|
syntax "oc droplets restore [DROPLET_ID] [IMAGE_ID]"
|
230
270
|
|
@@ -292,6 +332,26 @@ module Oc::Run
|
|
292
332
|
end
|
293
333
|
end
|
294
334
|
|
335
|
+
description "Enable IPv6 for a droplet"
|
336
|
+
syntax "oc droplets enable-ipv6 [DROPLET_ID]"
|
337
|
+
def enable_ipv6(*args)
|
338
|
+
id = args[0]
|
339
|
+
if id.nil?
|
340
|
+
puts "Argument Error".red
|
341
|
+
puts "Usage".yellow
|
342
|
+
puts "$ oc droplets enable-ipv6 [DROPLET_ID]"
|
343
|
+
else
|
344
|
+
raise ArgumentError, "Argument Error - #{id}" unless id =~ /\A[-+]?[0-9]*\.?[0-9]+\Z/
|
345
|
+
|
346
|
+
result = barge.droplet.enable_ipv6(id)
|
347
|
+
if !result.success?
|
348
|
+
puts "#{result.message}".red
|
349
|
+
else
|
350
|
+
puts "IPv6 Enabled".green
|
351
|
+
end
|
352
|
+
end
|
353
|
+
end
|
354
|
+
|
295
355
|
def barge
|
296
356
|
puts "I'm thinking, please wait..".blue
|
297
357
|
Oc::Get.get_barge
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sedat Ciftci
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|