packethost 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4af7994c743b41680d9c33fff01f92970d4dda6f
4
- data.tar.gz: fca57312b2494d3525d941a81f6a25c49e989660
3
+ metadata.gz: e54b47c7216bd8556fa0215a865f9b0feacf2e9d
4
+ data.tar.gz: 41aaa27fac205a0ffeb3b426fbff1d6b55675106
5
5
  SHA512:
6
- metadata.gz: 5079c86b48f40a3b392d3b0560c24faf9c2e759644140ef5dd49eb6c25bcee42f56db0edee4546af7bd70f136e7896748596a1161fab6c10b7ed39db40fb6560
7
- data.tar.gz: 27979e3a9907f9ce8ed30b75d47b4750943bacba85ebb155dfae325e5d57241daec3c4374baa8f286acb5383d9b601e0893a17fe58d0f768779798ed9d00c597
6
+ metadata.gz: 0ec38f6188ad1e3b3be42f556f3f7c511d22091e120a34fe45980838afd1157ba9260a26ff0ff3c9d7cd501ab002a1580ab0590ae5c3f9ac0c8906d1fe115715
7
+ data.tar.gz: 509bb18f8a4aab9c6d261b81f84ae6165439181ea0a97fc13a1579e74fbc125b8ebe0c6f96b16d56f167b785376807b1d6a9f8f7127c00ab2bc934d6215507d8
@@ -1,6 +1,11 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ v0.0.7
5
+ ------
6
+
7
+ * [Add power/rescue actions for devices](https://github.com/packethost/packet-rb/pull/9) (thanks again, @kke)
8
+
4
9
  v0.0.6
5
10
  ------
6
11
 
@@ -21,6 +21,22 @@ module Packet
21
21
  end
22
22
  end
23
23
 
24
+ def reboot_device(device)
25
+ action(device, 'reboot')
26
+ end
27
+
28
+ def rescue_device(device)
29
+ action(device, 'rescue')
30
+ end
31
+
32
+ def power_on_device(device)
33
+ action(device, 'power_on')
34
+ end
35
+
36
+ def power_off_device(device)
37
+ action(device, 'power_off')
38
+ end
39
+
24
40
  def delete_device(device_or_id)
25
41
  id = if device_or_id.is_a?(Packet::Device)
26
42
  device_or_id.id
@@ -29,6 +45,12 @@ module Packet
29
45
  end
30
46
  delete("devices/#{id}")
31
47
  end
48
+
49
+ private
50
+
51
+ def action(device, action_type)
52
+ post("devices/#{device.id}/actions", type: action_type).success?
53
+ end
32
54
  end
33
55
  end
34
56
  end
@@ -1,3 +1,3 @@
1
1
  module Packet
2
- VERSION = '0.0.6'.freeze
2
+ VERSION = '0.0.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packethost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bell
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-25 00:00:00.000000000 Z
13
+ date: 2016-05-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport