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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 255c5975409e8adb2747f071011e65100567c4330d95dcdd33b4e4910e96cdc9
4
- data.tar.gz: 68f59df2ebfa8cb406318e0f6dd1a2d5d8153fccd779ebead9b6ae265d1b16eb
3
+ metadata.gz: 472d7137c8d99e2982af8b606566f275309691acf6bc0684b630b89af6366eef
4
+ data.tar.gz: 62cfc73652b8f5a7bf6040c16110ea1164354270faa2330b99caa7907ef103a6
5
5
  SHA512:
6
- metadata.gz: 2793df347cecc3f7cda19a7947385749f22d43aaece3c7ff88a4709ed04a2685b43ccf608cc5fc49179fd25360bf131e5c2bcdadd1a1c38101263c6ed768965a
7
- data.tar.gz: 1581024302918a1c134b60183f93d4f5a828874b8d5f8faf65759ce9aa2cbaaa7d118f9504b344c5f6041e64d8ff95f782c5b576fbcc1dfc05128fe0b331b4cb
6
+ metadata.gz: 52c3b637f2e69c169f2f49361bf094a5121438579299a188bc11443eb5aefb1e412ac3f41799c67c79fe2542e9e141c65a4dbfef635276d2034e7393e76015a2
7
+ data.tar.gz: 554508520ef6b3a06590453bdcf6c22b52a84dc1606c58690e4de19e64d8a39bf1e1c5f0b9f362698c1285a4ae77544575437649939dbd2b548eb89cf38da892
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## HCloud v1.7.0 (2023-06-30)
4
+
5
+ - Add load balancer actions
6
+
3
7
  ## HCloud v1.6.1 (2023-06-22)
4
8
 
5
9
  - 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) | Not implemented |
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
@@ -3,8 +3,8 @@
3
3
  module HCloud
4
4
  module Version
5
5
  MAJOR = 1
6
- MINOR = 6
7
- PATCH = 1
6
+ MINOR = 7
7
+ PATCH = 0
8
8
  PRE = nil
9
9
 
10
10
  VERSION = [MAJOR, MINOR, PATCH].compact.join(".")
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.6.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-22 00:00:00.000000000 Z
11
+ date: 2023-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel