hetznercloud 1.6.0 → 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: cc1e6087fa61d27ee8763b0f9f128bc26d9e162f5355a965d462136ee5a2e244
4
- data.tar.gz: 7750141e35af391668ac9d94de7958060fc00ebdea4e0a668f89d05dec484ece
3
+ metadata.gz: 472d7137c8d99e2982af8b606566f275309691acf6bc0684b630b89af6366eef
4
+ data.tar.gz: 62cfc73652b8f5a7bf6040c16110ea1164354270faa2330b99caa7907ef103a6
5
5
  SHA512:
6
- metadata.gz: b99b994d194dda71ed3957786348bbe4bf0afb83872373fbb313c2ba10535fcfa7055a2ceb3f492b4f3dd7100e506175a787d11a68049b1d3cd0d4c0204daac4
7
- data.tar.gz: fa5c8eb4c9c7c6998653a2387b3e935f1f5148e02de29bc9d1b1338b589e8d7e9403d966302f882ede4e1e3548b6350d282ba69950873b87a6ecb2bbc892423c
6
+ metadata.gz: 52c3b637f2e69c169f2f49361bf094a5121438579299a188bc11443eb5aefb1e412ac3f41799c67c79fe2542e9e141c65a4dbfef635276d2034e7393e76015a2
7
+ data.tar.gz: 554508520ef6b3a06590453bdcf6c22b52a84dc1606c58690e4de19e64d8a39bf1e1c5f0b9f362698c1285a4ae77544575437649939dbd2b548eb89cf38da892
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## HCloud v1.7.0 (2023-06-30)
4
+
5
+ - Add load balancer actions
6
+
7
+ ## HCloud v1.6.1 (2023-06-22)
8
+
9
+ - Add `expose_routes_to_vswitch` attribute to `Network`
10
+
3
11
  ## HCloud v1.6.0 (2023-06-07)
4
12
 
5
13
  - Add `deprecation` attribute to `ServerType`
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
@@ -116,6 +116,8 @@ module HCloud
116
116
 
117
117
  attribute :ip_range
118
118
 
119
+ attribute :expose_routes_to_vswitch, :boolean
120
+
119
121
  attribute :routes, :route, array: true, default: -> { [] }
120
122
  attribute :subnets, :subnet, array: true, default: -> { [] }
121
123
 
@@ -134,11 +136,11 @@ module HCloud
134
136
  action :delete_subnet
135
137
 
136
138
  def creatable_attributes
137
- [:name, :labels, :ip_range, :routes, :subnets]
139
+ [:name, :labels, :ip_range, :expose_routes_to_vswitch, :routes, :subnets]
138
140
  end
139
141
 
140
142
  def updatable_attributes
141
- [:name, :labels]
143
+ [:name, :expose_routes_to_vswitch, :labels]
142
144
  end
143
145
  end
144
146
  end
@@ -3,7 +3,7 @@
3
3
  module HCloud
4
4
  module Version
5
5
  MAJOR = 1
6
- MINOR = 6
6
+ MINOR = 7
7
7
  PATCH = 0
8
8
  PRE = nil
9
9
 
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.0
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-07 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