hetznercloud 1.6.1 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -2
- data/lib/hcloud/errors.rb +2 -0
- data/lib/hcloud/resources/action.rb +8 -0
- data/lib/hcloud/resources/load_balancer.rb +113 -0
- data/lib/hcloud/version.rb +1 -1
- 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: 186a93045de45b6cf305dda61558933994de8a109e319e2c5fe6454f56be667f
|
4
|
+
data.tar.gz: b36eb396bb305052e67e5eda6b2f21a615013cdedcb57d8eceaae0ead59ca421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ff10c4bae59a8e32695d52546d3ca42121578ea79468e046d61d162d6e3055edcc2608ae2acb3fe99717f74a78ab4fe6fab89233ca2160e94a0fc99788d791
|
7
|
+
data.tar.gz: 3bd2eb8a1960b9a417e0405d0f5653d56542a1d282308972f39d50451bd67c3dc3f7f5e36c358c315e6146babe2b390490f211c27de65a02a0615fd17570d351
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## HCloud v1.7.1 (2023-07-25)
|
4
|
+
|
5
|
+
- Add deprecation warning for `HCloud::Action.all`
|
6
|
+
|
7
|
+
## HCloud v1.7.0 (2023-06-30)
|
8
|
+
|
9
|
+
- Add load balancer actions
|
10
|
+
|
3
11
|
## HCloud v1.6.1 (2023-06-22)
|
4
12
|
|
5
13
|
- Add `expose_routes_to_vswitch` attribute to `Network`
|
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
|
@@ -44,5 +44,13 @@ module HCloud
|
|
44
44
|
attribute :error, :error
|
45
45
|
|
46
46
|
attribute :resources, :resource, array: true, default: -> { [] }
|
47
|
+
|
48
|
+
class << self
|
49
|
+
def all
|
50
|
+
warn "[DEPRECATION] Starting on 1 October 2023, this endpoint will no longer be available. After that, it won't be possible anymore to list all actions across all resources. As an alternative, you can use the action endpoints of a specific resource to list all actions (e.g. of all servers or of all Load Balancers)."
|
51
|
+
|
52
|
+
super
|
53
|
+
end
|
54
|
+
end
|
47
55
|
end
|
48
56
|
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.1
|
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-
|
11
|
+
date: 2023-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|