aptible-cli 0.24.7 → 0.24.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4dc2738ea7b57ea51a48e40af6d8aa05b48156a7f5a06c93d08e7ae9918f9ed6
4
- data.tar.gz: cfb52fe2bf1d9327c8cde52c374f9d831ceebdb7ab1065b89920b3e9e8136c00
3
+ metadata.gz: 17e219de14f5b6f2cb8e24fc06259e8b113069957fb2726a678e6cf027f59b76
4
+ data.tar.gz: aa138fa1a35e9ddde06720a524f0f09f143a9a81a97041e9a46140726f4f8c57
5
5
  SHA512:
6
- metadata.gz: e7e93267050ad6cda388ec1ee5ccb1973ad04fa1c7d6bc864a93efa1cd180e077c7b6be7679f917ca28d567660491f32fa5d47132bbe497d16b6b1f443bbfd66
7
- data.tar.gz: a42372d8e19d161069042486f41336f7e315749a40fcfacc9520e07acd3de37d6f1b4af50822accc4d2dd3a87e9e197bb4b69260524d8041c0accbccfb4369f0
6
+ metadata.gz: f5135d3bb2b8c9e17e4a4eba7e2c7ad089a164dfec3a64010a2c0e509353a352a4190afa7f1c1fa4919c5b9bd00785ec00b1f6ee8dd7bf6c270b836d3a894861
7
+ data.tar.gz: 36376e1366bf23b5ab545c47ed0fbf85b139201d7d6d7198acf6f551208e9b93971e81230772d05fc9511ea3aa687b4eae3c35849f20a06f083ad41c0766d1b7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aptible-cli (0.24.7)
4
+ aptible-cli (0.24.8)
5
5
  activesupport (>= 4.0, < 6.0)
6
6
  aptible-api (~> 1.8.0)
7
7
  aptible-auth (~> 1.2.5)
@@ -11,6 +11,7 @@ module Aptible
11
11
  tls
12
12
  ports
13
13
  port
14
+ alb
14
15
  ).freeze
15
16
 
16
17
  def initialize(&block)
@@ -51,6 +52,17 @@ module Aptible
51
52
  desc: 'A port to expose on this Endpoint'
52
53
  )
53
54
  end
55
+
56
+ if builder.alb?
57
+ option(
58
+ :load_balancing_algorithm_type,
59
+ type: :string,
60
+ desc: 'The load balancing algorithm for this Endpoint.' \
61
+ 'valid options are round_robin, ' \
62
+ 'least_outstanding_requests, and ' \
63
+ 'weighted_random'
64
+ )
65
+ end
54
66
  end
55
67
 
56
68
  if builder.create?
@@ -168,6 +180,20 @@ module Aptible
168
180
 
169
181
  process_tls(account, options, params) if tls?
170
182
 
183
+ if alb?
184
+ lba_type = options.delete(:load_balancing_algorithm_type)
185
+ if lba_type
186
+ valid_types = %w(round_robin least_outstanding_requests
187
+ weighted_random)
188
+ unless valid_types.include?(lba_type)
189
+ e = "Invalid load balancing algorithm type: #{lba_type}. " \
190
+ "Valid options are: #{valid_types.join(', ')}"
191
+ raise Thor::Error, e
192
+ end
193
+ params[:load_balancing_algorithm_type] = lba_type
194
+ end
195
+ end
196
+
171
197
  options.delete(:environment)
172
198
 
173
199
  # NOTE: This is here to ensure that specs don't test for options
@@ -202,6 +202,8 @@ module Aptible
202
202
  port = vhost.container_port ? vhost.container_port : 'default'
203
203
  node.value('type', 'https')
204
204
  node.value('port', port)
205
+ node.value('load_balancing_algorithm_type', vhost
206
+ .load_balancing_algorithm_type)
205
207
  end
206
208
 
207
209
  node.value('internal', vhost.internal)
@@ -159,6 +159,7 @@ module Aptible
159
159
  create!
160
160
  port!
161
161
  tls!
162
+ alb!
162
163
  end
163
164
 
164
165
  desc 'endpoints:https:create [--app APP] SERVICE',
@@ -177,6 +178,7 @@ module Aptible
177
178
  app!
178
179
  port!
179
180
  tls!
181
+ alb!
180
182
  end
181
183
 
182
184
  desc 'endpoints:https:modify [--app APP] ENDPOINT_HOSTNAME',
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module CLI
3
- VERSION = '0.24.7'.freeze
3
+ VERSION = '0.24.8'.freeze
4
4
  end
5
5
  end
@@ -20,7 +20,8 @@ describe Aptible::CLI::ResourceFormatter do
20
20
  internal: false,
21
21
  ip_whitelist: [],
22
22
  default: false,
23
- acme: false
23
+ acme: false,
24
+ load_balancing_algorithm_type: 'least_outstanding_requests'
24
25
  )
25
26
 
26
27
  expected = [
@@ -30,6 +31,7 @@ describe Aptible::CLI::ResourceFormatter do
30
31
  "Created At: #{fmt_time(service.created_at)}",
31
32
  'Type: https',
32
33
  'Port: default',
34
+ 'Load Balancing Algorithm Type: least_outstanding_requests',
33
35
  'Internal: false',
34
36
  'IP Whitelist: all traffic',
35
37
  'Default Domain Enabled: false',
@@ -486,6 +486,14 @@ describe Aptible::CLI::Agent do
486
486
  stub_options(port: 10)
487
487
  subject.send(m, 'web')
488
488
  end
489
+ it 'creates an Endpoint with a load balancing algorithm' do
490
+ expect_create_vhost(service,
491
+ load_balancing_algorithm_type:
492
+ 'least_outstanding_requests')
493
+ stub_options(load_balancing_algorithm_type:
494
+ 'least_outstanding_requests')
495
+ subject.send(m, 'web')
496
+ end
489
497
  end
490
498
 
491
499
  describe 'endpoints:grpc:create' do
@@ -637,6 +645,14 @@ describe Aptible::CLI::Agent do
637
645
  stub_options(port: 10)
638
646
  subject.send(m, v.external_host)
639
647
  end
648
+ it 'allows updating the load balancing algorithm' do
649
+ v = Fabricate(:vhost, service: service)
650
+ expect_modify_vhost(v, load_balancing_algorithm_type:
651
+ 'least_outstanding_requests')
652
+ stub_options(load_balancing_algorithm_type:
653
+ 'least_outstanding_requests')
654
+ subject.send(m, v.external_host)
655
+ end
640
656
  end
641
657
 
642
658
  describe 'endpoints:grpc:modify' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.7
4
+ version: 0.24.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-18 00:00:00.000000000 Z
11
+ date: 2025-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport