hcloud 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 +25 -2
- data/lib/hcloud/floating_ip.rb +1 -0
- data/lib/hcloud/floating_ip_resource.rb +1 -1
- data/lib/hcloud/version.rb +1 -1
- 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: c42658a4a5f9d2281b65fa47b5827e24fff49f5a
|
4
|
+
data.tar.gz: 3f08e48f07f9a04c59b24fd32ac9b095624ea936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
64
|
+
# default nolimit
|
65
|
+
c.servers.limit(80).each do |server|
|
43
66
|
server.datacenter.location.id #=> 1
|
44
67
|
end
|
45
68
|
```
|
data/lib/hcloud/floating_ip.rb
CHANGED
@@ -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
|
data/lib/hcloud/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|