Skip to content

Commit

Permalink
load-balancers: add support for size_unit field (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
dikshant authored Oct 21, 2021
1 parent b62a2ef commit d39c400
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Version 3.16.0

- #266 load balancers: add new field disable_lets_encrypt_dns_records - @dikshant
- #286 load balancers: add new field disable_lets_encrypt_dns_records - @dikshant
- #287 load balancers: add new field size_unit - @dikshant

## Version 3.15.0

Expand Down
2 changes: 2 additions & 0 deletions lib/droplet_kit/mappings/load_balancer_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class LoadBalancerMapping
property :created_at
property :region, include: RegionMapping
property :size
property :size_unit
property :vpc_uuid
end

Expand All @@ -33,6 +34,7 @@ class LoadBalancerMapping
scoped :update, :create do
property :region
property :size
property :size_unit
end

scoped :create do
Expand Down
1 change: 1 addition & 0 deletions lib/droplet_kit/models/load_balancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class LoadBalancer < BaseModel
attribute :tag
attribute :region
attribute :size
attribute :size_unit
attribute :redirect_http_to_https, Boolean, :default => false
attribute :enable_proxy_protocol, Boolean, :default => false
attribute :enable_backend_keepalive, Boolean, :default => false
Expand Down
3 changes: 3 additions & 0 deletions spec/fixtures/load_balancers/all.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"cookie_ttl_seconds": 5
},
"size": "lb-small",
"size_unit": 1,
"region": {
"name": "New York 3",
"slug": "nyc3",
Expand Down Expand Up @@ -93,6 +94,7 @@
"cookie_ttl_seconds": 5
},
"size": "lb-small",
"size_unit": 1,
"region": {
"name": "New York 3",
"slug": "nyc3",
Expand Down Expand Up @@ -160,6 +162,7 @@
"cookie_ttl_seconds": 5
},
"size": "lb-medium",
"size_unit": 1,
"region": {
"name": "New York 3",
"slug": "nyc3",
Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/load_balancers/find.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"cookie_ttl_seconds": 5
},
"size": "lb-small",
"size_unit": 1,
"region": {
"name": "New York 3",
"slug": "nyc3",
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
expect(load_balancer.created_at).to eq('2017-02-01T22:22:58Z')
expect(load_balancer.tag).to be_blank
expect(load_balancer.size).to eq('lb-small')
expect(load_balancer.size_unit).to eq(1)
expect(load_balancer.region).to be_kind_of(DropletKit::Region)
expect(load_balancer.region.attributes)
.to match(a_hash_including(slug: 'nyc3', name: 'New York 3',
Expand Down Expand Up @@ -82,6 +83,7 @@
enable_backend_keepalive: true,
region: 'nyc1',
size: 'lb-small',
size_unit: 1,
disable_lets_encrypt_dns_records: true,
forwarding_rules: [
DropletKit::ForwardingRule.new(
Expand Down

0 comments on commit d39c400

Please sign in to comment.