hcloud 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42e5e0786794e6040e88021aeec5ea8d0c3da4d8
4
- data.tar.gz: b2368e1557cecb9e16089cc9a850979b85faae7e
3
+ metadata.gz: c42658a4a5f9d2281b65fa47b5827e24fff49f5a
4
+ data.tar.gz: 3f08e48f07f9a04c59b24fd32ac9b095624ea936
5
5
  SHA512:
6
- metadata.gz: 0e885d2e44be9a4bc6750b55c859de56d02059de3611c63c684f7bff51931f8d8ba677f430e7b74fa48b7f1adea837cefd0fb2607d209682b3ba81035b426b41
7
- data.tar.gz: b582dc6e91e9dccb04cc5469d83a28795f55d3f7ce7d5da0826fe6c8035a58bbc89ef17cf2163b164a1577c6aba4fde4b0d03b6eb325b2a0cca87efd0a4b0f03
6
+ metadata.gz: 1f51009f3bbd40127585b309dcdf94fac193942f6f05a68f4ab4f71d474f86f705b9ebc9e313c87935d03cd8c85dded7180550d379ddb50728f1c0b6cbd6a424
7
+ data.tar.gz: c0a192eee47abd50cdc62bdfb22c98e929a129d15129c70ea4996ec9827eb59ade9909acb81a8d43c395060369fb574347103213524471674c772cb849330589
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/tonobo/hcloud-ruby.svg?branch=master)](https://travis-ci.org/tonobo/hcloud-ruby)
4
4
  [![codecov](https://codecov.io/gh/tonobo/hcloud-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/tonobo/hcloud-ruby)
5
+ [![Gem Version](https://badge.fury.io/rb/hcloud.svg)](https://badge.fury.io/rb/hcloud)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/aa67f9d590d86845822f/maintainability)](https://codeclimate.com/github/tonobo/hcloud-ruby/maintainability)
5
7
 
6
8
  This is an unoffical ruby client for HetznerCloud Api service.
7
9
 
@@ -34,12 +36,33 @@ Or install it yourself as:
34
36
  c = Hcloud::Client.new(token: "<your project token>")
35
37
  ```
36
38
 
39
+ * Create a client instance which fully handles concurrent pagination
40
+
41
+ ```ruby
42
+ c = Hcloud::Client.new(
43
+ token: "<your project token>",
44
+ auto_pagination: true,
45
+ concurrency: 50 # default 20
46
+ )
47
+ ```
48
+
37
49
  ### Server Resource
38
50
 
39
- * List servers
51
+ * List servers (basic client)
52
+
53
+ ```ruby
54
+ # default page(1)
55
+ # default per_page(50)
56
+ c.servers.page(2).per_page(40).each do |server|
57
+ server.datacenter.location.id #=> 1
58
+ end
59
+ ```
60
+
61
+ * List servers (auto pagination client)
40
62
 
41
63
  ```ruby
42
- c.servers.each do |server|
64
+ # default nolimit
65
+ c.servers.limit(80).each do |server|
43
66
  server.datacenter.location.id #=> 1
44
67
  end
45
68
  ```
@@ -6,6 +6,7 @@ module Hcloud
6
6
  ip: nil,
7
7
  type: nil,
8
8
  dns_ptr: nil,
9
+ server: nil,
9
10
  home_location: Location,
10
11
  blocked: nil,
11
12
  }
@@ -14,7 +14,7 @@ module Hcloud
14
14
  end
15
15
  j = Oj.load(request("floating_ips", j: query, code: 200).run.body)
16
16
  [
17
- Action.new(j["action"], self, client),
17
+ j.key?("action") ? Action.new(j["action"], self, client) : nil,
18
18
  FloatingIP.new(j["floating_ip"], self, client),
19
19
  ]
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module Hcloud
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Foerster
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-25 00:00:00.000000000 Z
11
+ date: 2018-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler