hetznercloud 1.7.2 → 2.1.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 +12 -0
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/lib/hcloud/collection.rb +1 -1
- data/lib/hcloud/concerns/creatable.rb +1 -1
- data/lib/hcloud/entities/floating_ip_prices.rb +1 -1
- data/lib/hcloud/entities/price.rb +2 -0
- data/lib/hcloud/entities/primary_ip_prices.rb +1 -1
- data/lib/hcloud/errors.rb +1 -1
- data/lib/hcloud/resource.rb +10 -0
- data/lib/hcloud/resources/iso.rb +1 -2
- data/lib/hcloud/resources/pricing.rb +1 -1
- data/lib/hcloud/resources/server_type.rb +6 -2
- data/lib/hcloud/version.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c90b55b1202ba500b10d67653c2c0bf7d4af7b2045f257a58d973da7d73501db
|
4
|
+
data.tar.gz: f752ab64cb5d2208aed1cae8d5312aafee5314a54d27929e67f38978439d7b36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99a1bd26d8f9e2f4f0c4bfffdc3f01233cd5e3616594c15144a3c3f6ee3f268f6fd47c18c57a8073118d8630832d15ace0c89c8af355a31602eb7d78221ce6c9
|
7
|
+
data.tar.gz: 9db2511d57761816e5a02051f0c9e3ab817074056c05ce33d079ad0dfb34173da239f97cf14342dd9c8986ce65770b621c2568d762ef8647d8dc1335b573ca80
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## HCloud v2.1.0 (2024-07-28)
|
4
|
+
|
5
|
+
- Add `included_traffic` attribute to `ServerType#prices` and `LoadBalancerType#prices`
|
6
|
+
- Add `price_per_tb_traffic` attribute to `ServerType#prices` and `LoadBalancerType#prices`
|
7
|
+
- Add deprecation warning for `Pricing#traffic`
|
8
|
+
- Add deprecation warning for `ServerType#included_traffic`
|
9
|
+
- Fix crash on prices when using `Pricing` API
|
10
|
+
|
11
|
+
## HCloud v2.0.0 (2024-01-10)
|
12
|
+
|
13
|
+
- Remove `deprecated` attribute from `ISO`
|
14
|
+
|
3
15
|
## HCloud v1.7.2 (2023-10-16)
|
4
16
|
|
5
17
|
- Add `deprecation` attribute to `ISO`
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# HCloud
|
2
2
|
|
3
|
-
![Continuous Integration](https://github.com/floriandejonckheere/hcloud/workflows/
|
3
|
+
![Continuous Integration](https://github.com/floriandejonckheere/hcloud/actions/workflows/ci.yml/badge.svg)
|
4
4
|
![Release](https://img.shields.io/github/v/release/floriandejonckheere/hcloud?label=Latest%20release)
|
5
5
|
|
6
6
|
Unofficial Ruby integration with the [Hetzner Cloud API](https://docs.hetzner.cloud/).
|
data/lib/hcloud/collection.rb
CHANGED
@@ -55,7 +55,7 @@ module HCloud
|
|
55
55
|
|
56
56
|
def count
|
57
57
|
# Fetch total_entries if not present
|
58
|
-
@count ||=
|
58
|
+
@count ||= total_entries || proc.call(params.merge(page: 1)).last.dig(:pagination, :total_entries)
|
59
59
|
end
|
60
60
|
|
61
61
|
def empty?
|
@@ -33,7 +33,7 @@ module HCloud
|
|
33
33
|
attributes
|
34
34
|
.slice(*simple_attributes.map(&:to_s))
|
35
35
|
.transform_values { |v| v&.send_wrap { |o| o.try(:to_h) || o } || v&.send_wrap(:to_s) }
|
36
|
-
.merge(nested_attributes.reduce(&:merge)
|
36
|
+
.merge(nested_attributes.reduce(&:merge).to_h { |k, v| [k.to_s, Array(v).filter_map { |w| send(k)&.send_wrap(w) }.first] })
|
37
37
|
.compact_blank
|
38
38
|
end
|
39
39
|
# rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
data/lib/hcloud/errors.rb
CHANGED
data/lib/hcloud/resource.rb
CHANGED
@@ -30,6 +30,16 @@ module HCloud
|
|
30
30
|
id && id == other.id
|
31
31
|
end
|
32
32
|
|
33
|
+
def self.attribute(name, *args, deprecated: false, **kwargs)
|
34
|
+
super(name, *args, **kwargs)
|
35
|
+
|
36
|
+
define_method(name) do |**params|
|
37
|
+
warn "[DEPRECATION] Field \"#{name}\" on #{self.class.name} is deprecated." if deprecated
|
38
|
+
|
39
|
+
super(**params)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
33
43
|
def self.resource_name
|
34
44
|
name.demodulize.underscore
|
35
45
|
end
|
data/lib/hcloud/resources/iso.rb
CHANGED
@@ -30,16 +30,20 @@ module HCloud
|
|
30
30
|
attribute :cores, :integer
|
31
31
|
attribute :disk, :integer
|
32
32
|
attribute :memory, :integer
|
33
|
-
|
33
|
+
|
34
|
+
# FIXME: Attribute will return null on 2024-08-05
|
35
|
+
# FIXME: Attribute will be removed on 2024-11-05
|
36
|
+
attribute :included_traffic, :integer, deprecated: true
|
34
37
|
|
35
38
|
attribute :cpu_type
|
36
39
|
attribute :storage_type
|
37
40
|
|
38
41
|
attribute :prices, :price, array: true, default: -> { [] }
|
39
42
|
|
40
|
-
attribute :deprecated, :boolean
|
41
43
|
attribute :deprecation, :deprecation
|
42
44
|
|
45
|
+
attribute :deprecated, :boolean, deprecated: true
|
46
|
+
|
43
47
|
alias deprecated? deprecated
|
44
48
|
end
|
45
49
|
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: 2.1.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:
|
11
|
+
date: 2024-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -179,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
179
|
requirements:
|
180
180
|
- - ">="
|
181
181
|
- !ruby/object:Gem::Version
|
182
|
-
version: '
|
182
|
+
version: '3.0'
|
183
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - ">="
|