hetznercloud 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -2
- data/lib/hcloud/errors.rb +2 -0
- data/lib/hcloud/resources/load_balancer.rb +113 -0
- data/lib/hcloud/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 472d7137c8d99e2982af8b606566f275309691acf6bc0684b630b89af6366eef
|
4
|
+
data.tar.gz: 62cfc73652b8f5a7bf6040c16110ea1164354270faa2330b99caa7907ef103a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52c3b637f2e69c169f2f49361bf094a5121438579299a188bc11443eb5aefb1e412ac3f41799c67c79fe2542e9e141c65a4dbfef635276d2034e7393e76015a2
|
7
|
+
data.tar.gz: 554508520ef6b3a06590453bdcf6c22b52a84dc1606c58690e4de19e64d8a39bf1e1c5f0b9f362698c1285a4ae77544575437649939dbd2b548eb89cf38da892
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -83,7 +83,7 @@ The following table lists the Hetzner Cloud API endpoints that are currently imp
|
|
83
83
|
| [Image Actions](lib/hcloud/resources/image.rb) | Implemented |
|
84
84
|
| [ISOs](lib/hcloud/resources/iso.rb) | Implemented |
|
85
85
|
| [Load Balancers](lib/hcloud/resources/load_balancer.rb) | Implemented |
|
86
|
-
| [Load Balancer Actions](lib/hcloud/resources/load_balancer.rb) |
|
86
|
+
| [Load Balancer Actions](lib/hcloud/resources/load_balancer.rb) | Implemented |
|
87
87
|
| [Load Balancer Types](lib/hcloud/resources/load_balancer.rb) | Implemented |
|
88
88
|
| [Locations](lib/hcloud/resources/location.rb) | Implemented |
|
89
89
|
| [Primary IPs](lib/hcloud/resources/primary_ip.rb) | Implemented |
|
@@ -98,7 +98,6 @@ The following table lists the Hetzner Cloud API endpoints that are currently imp
|
|
98
98
|
| [SSH Keys](lib/hcloud/resources/ssh_key.rb) | Implemented |
|
99
99
|
| [Volumes](lib/hcloud/resources/volume.rb) | Implemented |
|
100
100
|
| [Volume Actions](lib/hcloud/resources/volume.rb) | Implemented |
|
101
|
-
| | |
|
102
101
|
| [Metadata](lib/hcloud/resources/metadata.rb) | Implemented |
|
103
102
|
|
104
103
|
### Pagination
|
data/lib/hcloud/errors.rb
CHANGED
@@ -32,6 +32,7 @@ module HCloud
|
|
32
32
|
class IPNotAvailable < Error; end
|
33
33
|
class IPNotOwned < Error; end
|
34
34
|
class IncompatibleNetworkType < Error; end
|
35
|
+
class InvalidLoadBalancerType < Error; end
|
35
36
|
class InvalidInput < Error; end
|
36
37
|
class JSONError < Error; end
|
37
38
|
class LoadBalancerNotAttachedToNetwork < Error; end
|
@@ -64,6 +65,7 @@ module HCloud
|
|
64
65
|
class ServiceError < Error; end
|
65
66
|
class SourcePortAlreadyUsed < Error; end
|
66
67
|
class TargetAlreadyDefined < Error; end
|
68
|
+
class TargetsWithoutUsePrivateIP < Error; end
|
67
69
|
class TokenReadonly < Error; end
|
68
70
|
class Unauthorized < Error; end
|
69
71
|
class Unavailable < Error; end
|
@@ -62,7 +62,101 @@ module HCloud
|
|
62
62
|
# load_balancer.metrics(type: [:connections_per_second, :requests_per_second], from: 2.minutes.ago, to: 1.minute.ago, step: 60)
|
63
63
|
# # => #<HCloud::Metrics ...>
|
64
64
|
#
|
65
|
+
# = Actions
|
66
|
+
# == List actions
|
67
|
+
#
|
68
|
+
# actions = HCloud::LoadBalancer.find(1).actions
|
69
|
+
# # => [#<HCloud::Action id: 1, ...>, ...]
|
70
|
+
#
|
71
|
+
# == Sort actions
|
72
|
+
#
|
73
|
+
# HCloud::LoadBalancer.find(1).actions.sort(finished: :desc)
|
74
|
+
# # => [#<HCloud::Action id: 1, ...>, ...]
|
75
|
+
#
|
76
|
+
# HCloud::LoadBalancer.find(1).actions.sort(:command, finished: :asc)
|
77
|
+
# # => [#<HCloud::Actions id: 1, ...>, ...]
|
78
|
+
#
|
79
|
+
# == Search actions
|
80
|
+
#
|
81
|
+
# HCloud::LoadBalancer.find(1).actions.where(command: "add_service")
|
82
|
+
# # => #<HCloud::Action id: 1, ...>
|
83
|
+
#
|
84
|
+
# HCloud::LoadBalancer.find(1).actions.where(status: "success")
|
85
|
+
# # => #<HCloud::Action id: 1, ...>
|
86
|
+
#
|
87
|
+
# == Find action by ID
|
88
|
+
#
|
89
|
+
# HCloud::LoadBalancer.find(1).actions.find(1)
|
90
|
+
# # => #<HCloud::Action id: 1, ...>
|
91
|
+
#
|
92
|
+
# = Resource-specific actions
|
93
|
+
# == Add service
|
94
|
+
#
|
95
|
+
# HCloud::LoadBalancer.find(1).add_service(destination_port: 80, health_check: { ... })
|
96
|
+
# # => #<HCloud::Action id: 1, ...>
|
97
|
+
#
|
98
|
+
# == Update service
|
99
|
+
#
|
100
|
+
# HCloud::LoadBalancer.find(1).update_service(destination_port: 80, health_check: { ... })
|
101
|
+
# # => #<HCloud::Action id: 1, ...>
|
102
|
+
#
|
103
|
+
# == Delete service
|
104
|
+
#
|
105
|
+
# HCloud::LoadBalancer.find(1).delete_service(listen_port: 4711)
|
106
|
+
# # => #<HCloud::Action id: 1, ...>
|
107
|
+
#
|
108
|
+
# == Add target
|
109
|
+
#
|
110
|
+
# HCloud::LoadBalancer.find(1).add_target(type: "server", ip: { ip: "203.0.113.1" })
|
111
|
+
# # => #<HCloud::Action id: 1, ...>
|
112
|
+
#
|
113
|
+
# == Remove target
|
114
|
+
#
|
115
|
+
# HCloud::LoadBalancer.find(1).remove_target(type: "server", ip: { ip: "203.0.113.1" })
|
116
|
+
# # => #<HCloud::Action id: 1, ...>
|
117
|
+
#
|
118
|
+
# == Attach to network
|
119
|
+
#
|
120
|
+
# HCloud::LoadBalancer.find(1).attach_to_network(ip: "10.0.1.1", network: 4711)
|
121
|
+
# # => #<HCloud::Action id: 1, ...>
|
122
|
+
#
|
123
|
+
# == Detach from network
|
124
|
+
#
|
125
|
+
# HCloud::LoadBalancer.find(1).detach_from_network(network: 4711)
|
126
|
+
# # => #<HCloud::Action id: 1, ...>
|
127
|
+
#
|
128
|
+
# == Change algorithm
|
129
|
+
#
|
130
|
+
# HCloud::LoadBalancer.find(1).change_algorithm(type: "round_robin")
|
131
|
+
# # => #<HCloud::Action id: 1, ...>
|
132
|
+
#
|
133
|
+
# == Change DNS pointer
|
134
|
+
#
|
135
|
+
# HCloud::LoadBalancer.find(1).change_dns_ptr(dns_ptr: "lb1.example.com", ip: "1.2.3.4")
|
136
|
+
# # => #<HCloud::Action id: 1, ...>
|
137
|
+
#
|
138
|
+
# == Change load balancer type
|
139
|
+
#
|
140
|
+
# HCloud::LoadBalancer.find(1).change_type(load_balancer_type: "lb21")
|
141
|
+
# # => #<HCloud::Action id: 1, ...>
|
142
|
+
#
|
143
|
+
# == Change protection
|
144
|
+
#
|
145
|
+
# HCloud::LoadBalancer.find(1).change_protection(delete: true)
|
146
|
+
# # => #<HCloud::Action id: 1, ...>
|
147
|
+
#
|
148
|
+
# == Enable public interface
|
149
|
+
#
|
150
|
+
# HCloud::LoadBalancer.find(1).enable_public_interface
|
151
|
+
# # => #<HCloud::Action id: 1, ...>
|
152
|
+
#
|
153
|
+
# == Disable public interface
|
154
|
+
#
|
155
|
+
# HCloud::LoadBalancer.find(1).disable_public_interface
|
156
|
+
# # => #<HCloud::Action id: 1, ...>
|
157
|
+
#
|
65
158
|
class LoadBalancer < Resource
|
159
|
+
actionable
|
66
160
|
queryable
|
67
161
|
creatable
|
68
162
|
updatable
|
@@ -98,6 +192,25 @@ module HCloud
|
|
98
192
|
|
99
193
|
attribute :protection, :protection
|
100
194
|
|
195
|
+
action :add_service
|
196
|
+
action :update_service
|
197
|
+
action :delete_service
|
198
|
+
|
199
|
+
action :add_target
|
200
|
+
action :remove_target
|
201
|
+
|
202
|
+
action :attach_to_network
|
203
|
+
action :detach_from_network
|
204
|
+
|
205
|
+
action :change_algorithm
|
206
|
+
action :change_dns_ptr
|
207
|
+
action :change_type
|
208
|
+
|
209
|
+
action :change_protection
|
210
|
+
|
211
|
+
action :enable_public_interface
|
212
|
+
action :disable_public_interface
|
213
|
+
|
101
214
|
def creatable_attributes
|
102
215
|
[:name, :labels, :algorithm, :network_zone, :public_interface, :services, :targets, load_balancer_type: [:id, :name], location: [:id, :name], network: [:id, :name]]
|
103
216
|
end
|
data/lib/hcloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hetznercloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Dejonckheere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|