hetznercloud 5.0.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/lib/hcloud/action_collection.rb +1 -1
- data/lib/hcloud/concerns/deprecated_attributes.rb +20 -0
- data/lib/hcloud/concerns/deprecated_resource.rb +54 -0
- data/lib/hcloud/concerns/inspect_attributes.rb +21 -0
- data/lib/hcloud/entities/datacenter_server_type.rb +14 -3
- data/lib/hcloud/entities/server_type_location.rb +3 -0
- data/lib/hcloud/entity.rb +4 -4
- data/lib/hcloud/errors.rb +2 -0
- data/lib/hcloud/http.rb +8 -8
- data/lib/hcloud/resource.rb +3 -14
- data/lib/hcloud/resources/action.rb +1 -26
- data/lib/hcloud/resources/datacenter.rb +4 -0
- data/lib/hcloud/resources/load_balancer_type.rb +3 -1
- data/lib/hcloud/version.rb +2 -2
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cb259d9e173161e4ed87cdfbde11c7318e54b13c09a50ab9906ea453278534b
|
|
4
|
+
data.tar.gz: 70a47ad251eb36381d894140210d2cdabd4bba98e45a6530303e46604f030bb7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8413d51176613da3405efc6585f80c1ffd84dfecc3fd06fa95772d8b897efda9945519c3504951e63b0b22411bc66b91b50c08911e448c94ebb51be47c95ba64
|
|
7
|
+
data.tar.gz: e12dd9605bea860120a75ceb2ea1f0fad5c9539e9bb58f4d6567e4b89d3a336b6563a20edf210549509850c49df9e1f08ff0bfc453bf91b4982c9be9625ff822
|
data/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
### Fixed
|
|
12
12
|
|
|
13
|
+
## HCloud v6.0.0 (2026-06-09)
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Add `deprecation` attribute to `HCloud::LoadBalancerType`
|
|
18
|
+
- Add `MustBeUnassigned` error class
|
|
19
|
+
- Add `DeprecatedApiEndpoint` error class
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Deprecate `HCloud::LoadBalancerType#deprecated`
|
|
24
|
+
- Deprecate `HCloud::Datacenter`
|
|
25
|
+
- Replace `GET /<resource>/{id}/actions/{action_id}` with `GET /actions/{action_id}`
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
|
|
29
|
+
- Remove `HCloud::Action.all`, `.first`, `.last`, `.count`, `.where`, `.sort`, `.each`, `.empty?`, `.any?`
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
## HCloud v5.1.0 (2026-03-03)
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Add `recommended` and `available` attributes to `HCloud::ServerTypeLocation`
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- Deprecate `HCloud::DatacenterServerType#available`, `#available_for_migration`, `#supported` and `HCloud::Datacenter.recommendation`
|
|
42
|
+
|
|
13
43
|
## HCloud v5.0.1 (2026-01-15)
|
|
14
44
|
|
|
15
45
|
### Fixed
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HCloud
|
|
4
|
+
# @!visibility private
|
|
5
|
+
module DeprecatedAttributes
|
|
6
|
+
extend ActiveSupport::Concern
|
|
7
|
+
|
|
8
|
+
class_methods do
|
|
9
|
+
def attribute(name, *, deprecated: false, **)
|
|
10
|
+
super(name, *, **)
|
|
11
|
+
|
|
12
|
+
define_method(name) do |**params|
|
|
13
|
+
warn "[DEPRECATION] Field \"#{name}\" on #{self.class.name} is deprecated." if deprecated
|
|
14
|
+
|
|
15
|
+
super(**params)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HCloud
|
|
4
|
+
# @!visibility private
|
|
5
|
+
module DeprecatedResource
|
|
6
|
+
extend ActiveSupport::Concern
|
|
7
|
+
|
|
8
|
+
included do
|
|
9
|
+
class_attribute :_deprecated, default: false
|
|
10
|
+
class_attribute :deprecated_since
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class_methods do # rubocop:disable Metrics/BlockLength
|
|
14
|
+
def deprecated(since: nil)
|
|
15
|
+
self._deprecated = true
|
|
16
|
+
self.deprecated_since = Date.parse(since) if since
|
|
17
|
+
|
|
18
|
+
[:find, :all, :create].each do |method|
|
|
19
|
+
define_singleton_method(method) do |*args, **kwargs, &block|
|
|
20
|
+
warn "[DEPRECATION] Resource \"#{name}\" is deprecated since #{deprecated_since.iso8601}." if deprecated?
|
|
21
|
+
|
|
22
|
+
super(*args, **kwargs, &block)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def deprecated?
|
|
28
|
+
_deprecated
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Wrap instance methods as they are defined (e.g. reload added by queryable)
|
|
32
|
+
def method_added(method_name)
|
|
33
|
+
super
|
|
34
|
+
|
|
35
|
+
return unless _deprecated
|
|
36
|
+
return unless [:reload, :update, :delete].include? method_name
|
|
37
|
+
|
|
38
|
+
return if @_wrapping_deprecated_instance
|
|
39
|
+
|
|
40
|
+
@_wrapping_deprecated_instance = true
|
|
41
|
+
|
|
42
|
+
original = instance_method(method_name)
|
|
43
|
+
|
|
44
|
+
define_method(method_name) do |*args, **kwargs, &block|
|
|
45
|
+
warn "[DEPRECATION] Resource \"#{self.class.name}\" is deprecated since #{self.class.deprecated_since.iso8601}." if self.class.deprecated?
|
|
46
|
+
|
|
47
|
+
original.bind_call(self, *args, **kwargs, &block)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
@_wrapping_deprecated_instance = false
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HCloud
|
|
4
|
+
# @!visibility private
|
|
5
|
+
module InspectAttributes
|
|
6
|
+
extend ActiveSupport::Concern
|
|
7
|
+
|
|
8
|
+
included do
|
|
9
|
+
def inspect
|
|
10
|
+
"#<#{self.class} #{attributes.filter_map do |name, value|
|
|
11
|
+
"#{name}: #{
|
|
12
|
+
if value.is_a?(Resource) || value.is_a?(Entity)
|
|
13
|
+
'<...>'
|
|
14
|
+
else
|
|
15
|
+
value.is_a?(Enumerable) ? '[...]' : value.inspect
|
|
16
|
+
end}"
|
|
17
|
+
end.join(', ')}>"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -2,8 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module HCloud
|
|
4
4
|
class DatacenterServerType < Entity
|
|
5
|
-
attribute :available,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
attribute :available,
|
|
6
|
+
array: true,
|
|
7
|
+
default: -> { [] },
|
|
8
|
+
deprecated: true
|
|
9
|
+
|
|
10
|
+
attribute :available_for_migration,
|
|
11
|
+
array: true,
|
|
12
|
+
default: -> { [] },
|
|
13
|
+
deprecated: true
|
|
14
|
+
|
|
15
|
+
attribute :supported,
|
|
16
|
+
array: true,
|
|
17
|
+
default: -> { [] },
|
|
18
|
+
deprecated: true
|
|
8
19
|
end
|
|
9
20
|
end
|
data/lib/hcloud/entity.rb
CHANGED
|
@@ -6,16 +6,16 @@ module HCloud
|
|
|
6
6
|
include ActiveModel::Attributes
|
|
7
7
|
include ActiveModel::AttributeAssignment
|
|
8
8
|
|
|
9
|
+
include DeprecatedAttributes
|
|
10
|
+
include DynamicAttributes
|
|
11
|
+
include InspectAttributes
|
|
12
|
+
|
|
9
13
|
def initialize(attributes = {})
|
|
10
14
|
super()
|
|
11
15
|
|
|
12
16
|
assign_attributes(attributes) if attributes
|
|
13
17
|
end
|
|
14
18
|
|
|
15
|
-
def inspect
|
|
16
|
-
"#<#{self.class} #{attributes.filter_map { |name, value| "#{name}: #{value.inspect}" }.join(', ')}>"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
19
|
def to_h
|
|
20
20
|
attributes
|
|
21
21
|
.transform_values { |v| v.try(:to_h) || v }
|
data/lib/hcloud/errors.rb
CHANGED
|
@@ -25,6 +25,7 @@ module HCloud
|
|
|
25
25
|
class ActionFailed < Error; end
|
|
26
26
|
class CloudResourceIPNotAllowed < Error; end
|
|
27
27
|
class Conflict < Error; end
|
|
28
|
+
class DeprecatedApiEndpoint < Error; end
|
|
28
29
|
class FirewallAlreadyApplied < Error; end
|
|
29
30
|
class FirewallAlreadyRemoved < Error; end
|
|
30
31
|
class FirewallResourceNotFound < Error; end
|
|
@@ -40,6 +41,7 @@ module HCloud
|
|
|
40
41
|
class LoadBalancerPublicInterfaceDisabled < Error; end
|
|
41
42
|
class Locked < Error; end
|
|
42
43
|
class Maintenance < Error; end
|
|
44
|
+
class MustBeUnassigned < Error; end
|
|
43
45
|
class NetworksOverlap < Error; end
|
|
44
46
|
class NoSpaceLeftInLocation < Error; end
|
|
45
47
|
class NoSubnetAvailable < Error; end
|
data/lib/hcloud/http.rb
CHANGED
|
@@ -107,16 +107,16 @@ module HCloud
|
|
|
107
107
|
def transform_params(params)
|
|
108
108
|
params
|
|
109
109
|
.transform_values do |value|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
# Don't transform if value is single argument: { sort: :id }
|
|
111
|
+
next value unless value.respond_to?(:each)
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
value.map do |element|
|
|
114
|
+
# Don't transform if element is single argument: { sort: [:id] }
|
|
115
|
+
next element unless element.respond_to?(:each)
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
# Join elements with : { sort: [id: :asc] }
|
|
118
|
+
element.to_a.join(":")
|
|
119
|
+
end
|
|
120
120
|
end
|
|
121
121
|
.compact
|
|
122
122
|
end
|
data/lib/hcloud/resource.rb
CHANGED
|
@@ -6,7 +6,10 @@ module HCloud
|
|
|
6
6
|
include ActiveModel::AttributeAssignment
|
|
7
7
|
|
|
8
8
|
include Concerns
|
|
9
|
+
include DeprecatedAttributes
|
|
10
|
+
include DeprecatedResource
|
|
9
11
|
include DynamicAttributes
|
|
12
|
+
include InspectAttributes
|
|
10
13
|
include Subresource
|
|
11
14
|
|
|
12
15
|
def initialize(attributes = {})
|
|
@@ -21,10 +24,6 @@ module HCloud
|
|
|
21
24
|
|
|
22
25
|
delegate :[], to: :attributes
|
|
23
26
|
|
|
24
|
-
def inspect
|
|
25
|
-
"#<#{self.class} #{attributes.filter_map { |name, value| "#{name}: #{value.inspect}" }.join(', ')}>"
|
|
26
|
-
end
|
|
27
|
-
|
|
28
27
|
def to_h
|
|
29
28
|
{
|
|
30
29
|
id: id,
|
|
@@ -35,16 +34,6 @@ module HCloud
|
|
|
35
34
|
id && id == other.id
|
|
36
35
|
end
|
|
37
36
|
|
|
38
|
-
def self.attribute(name, *, deprecated: false, **)
|
|
39
|
-
super(name, *, **)
|
|
40
|
-
|
|
41
|
-
define_method(name) do |**params|
|
|
42
|
-
warn "[DEPRECATION] Field \"#{name}\" on #{self.class.name} is deprecated." if deprecated
|
|
43
|
-
|
|
44
|
-
super(**params)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
37
|
def self.resource_name
|
|
49
38
|
name.demodulize.underscore
|
|
50
39
|
end
|
|
@@ -4,27 +4,6 @@ module HCloud
|
|
|
4
4
|
##
|
|
5
5
|
# Represents an action
|
|
6
6
|
#
|
|
7
|
-
# == List all actions
|
|
8
|
-
#
|
|
9
|
-
# HCloud::Action.all
|
|
10
|
-
# # => [#<HCloud::Action id: 1, ...>, ...]
|
|
11
|
-
#
|
|
12
|
-
# == Sort actions
|
|
13
|
-
#
|
|
14
|
-
# HCloud::Action.sort(command: :desc)
|
|
15
|
-
# # => [#<HCloud::Action id: 1, ...>, ...]
|
|
16
|
-
#
|
|
17
|
-
# HCloud::Action.sort(:id, command: :asc)
|
|
18
|
-
# # => [#<HCloud::Action id: 1, ...>, ...]
|
|
19
|
-
#
|
|
20
|
-
# == Search actions
|
|
21
|
-
#
|
|
22
|
-
# HCloud::Action.where(command: "my_action")
|
|
23
|
-
# # => #<HCloud::Action id: 1, ...>
|
|
24
|
-
#
|
|
25
|
-
# HCloud::Action.where(status: "success")
|
|
26
|
-
# # => #<HCloud::Action id: 1, ...>
|
|
27
|
-
#
|
|
28
7
|
# == Find action by ID
|
|
29
8
|
#
|
|
30
9
|
# HCloud::Action.find(1)
|
|
@@ -46,11 +25,7 @@ module HCloud
|
|
|
46
25
|
attribute :resources, :resource, array: true, default: -> { [] }
|
|
47
26
|
|
|
48
27
|
class << self
|
|
49
|
-
|
|
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
|
|
28
|
+
undef_method :all, :first, :last, :count, :where, :sort, :each, :empty?, :any?
|
|
54
29
|
end
|
|
55
30
|
end
|
|
56
31
|
end
|
|
@@ -33,6 +33,8 @@ module HCloud
|
|
|
33
33
|
# # => #<HCloud::Datacenter id: 2, ...>
|
|
34
34
|
#
|
|
35
35
|
class Datacenter < Resource
|
|
36
|
+
deprecated since: "2026-10-01"
|
|
37
|
+
|
|
36
38
|
queryable
|
|
37
39
|
|
|
38
40
|
attribute :id, :integer
|
|
@@ -43,6 +45,8 @@ module HCloud
|
|
|
43
45
|
attribute :server_types, :datacenter_server_type
|
|
44
46
|
|
|
45
47
|
def self.recommendation
|
|
48
|
+
warn "[DEPRECATION] Field \"recommendation\" on #{self.class.name} is deprecated."
|
|
49
|
+
|
|
46
50
|
find client
|
|
47
51
|
.get(resource_path)
|
|
48
52
|
.fetch(:recommendation)
|
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:
|
|
4
|
+
version: 6.0.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: 2026-
|
|
11
|
+
date: 2026-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -101,7 +101,10 @@ files:
|
|
|
101
101
|
- lib/hcloud/concerns/concerns.rb
|
|
102
102
|
- lib/hcloud/concerns/creatable.rb
|
|
103
103
|
- lib/hcloud/concerns/deletable.rb
|
|
104
|
+
- lib/hcloud/concerns/deprecated_attributes.rb
|
|
105
|
+
- lib/hcloud/concerns/deprecated_resource.rb
|
|
104
106
|
- lib/hcloud/concerns/dynamic_attributes.rb
|
|
107
|
+
- lib/hcloud/concerns/inspect_attributes.rb
|
|
105
108
|
- lib/hcloud/concerns/labelable.rb
|
|
106
109
|
- lib/hcloud/concerns/meterable.rb
|
|
107
110
|
- lib/hcloud/concerns/queryable.rb
|