aptible-cli 0.24.7 → 0.24.9

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: 6eb51d67be8b4afcf1d4c56bcf323b44b0f866cb7a0d6de8825cd4bf6c59e152
4
+ data.tar.gz: 4f79b328a9db799239eb1f9390dd8ff99525351b9003b687c3eefce086333bbb
5
5
  SHA512:
6
- metadata.gz: e7e93267050ad6cda388ec1ee5ccb1973ad04fa1c7d6bc864a93efa1cd180e077c7b6be7679f917ca28d567660491f32fa5d47132bbe497d16b6b1f443bbfd66
7
- data.tar.gz: a42372d8e19d161069042486f41336f7e315749a40fcfacc9520e07acd3de37d6f1b4af50822accc4d2dd3a87e9e197bb4b69260524d8041c0accbccfb4369f0
6
+ metadata.gz: e8c872499c77e46408a857a590995f88e4444b1c70c2965ea2737209055fdfdf68f460757b82f9699188fda5e7c178319f575a7f7c9bb29e009b8d5c1848e05a
7
+ data.tar.gz: 8f0a4c1652ad64dd978ebd56bb768f1404d32e44db93b6072a204202b8000605116d9a8109c922e05cbeae2be6f2ee584ac6a46792c4989e59303a9d0e65dadb
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.9)
5
5
  activesupport (>= 4.0, < 6.0)
6
6
  aptible-api (~> 1.8.0)
7
7
  aptible-auth (~> 1.2.5)
@@ -11,6 +11,8 @@ module Aptible
11
11
  tls
12
12
  ports
13
13
  port
14
+ alb
15
+ shared
14
16
  ).freeze
15
17
 
16
18
  def initialize(&block)
@@ -51,6 +53,17 @@ module Aptible
51
53
  desc: 'A port to expose on this Endpoint'
52
54
  )
53
55
  end
56
+
57
+ if builder.alb?
58
+ option(
59
+ :load_balancing_algorithm_type,
60
+ type: :string,
61
+ desc: 'The load balancing algorithm for this Endpoint.' \
62
+ 'valid options are round_robin, ' \
63
+ 'least_outstanding_requests, and ' \
64
+ 'weighted_random'
65
+ )
66
+ end
54
67
  end
55
68
 
56
69
  if builder.create?
@@ -110,6 +123,15 @@ module Aptible
110
123
  'on this Endpoint'
111
124
  )
112
125
  end
126
+
127
+ if builder.shared?
128
+ option(
129
+ :shared,
130
+ type: :boolean,
131
+ desc: "Share this Endpoint's load balancer with other " \
132
+ 'Endpoints'
133
+ )
134
+ end
113
135
  end
114
136
  end
115
137
 
@@ -168,6 +190,26 @@ module Aptible
168
190
 
169
191
  process_tls(account, options, params) if tls?
170
192
 
193
+ if alb?
194
+ lba_type = options.delete(:load_balancing_algorithm_type)
195
+ if lba_type
196
+ valid_types = %w(round_robin least_outstanding_requests
197
+ weighted_random)
198
+ unless valid_types.include?(lba_type)
199
+ e = "Invalid load balancing algorithm type: #{lba_type}. " \
200
+ "Valid options are: #{valid_types.join(', ')}"
201
+ raise Thor::Error, e
202
+ end
203
+ params[:load_balancing_algorithm_type] = lba_type
204
+ end
205
+
206
+ if shared?
207
+ params[:shared] = options.delete(:shared) do
208
+ create? ? false : nil
209
+ end
210
+ end
211
+ end
212
+
171
213
  options.delete(:environment)
172
214
 
173
215
  # NOTE: This is here to ensure that specs don't test for options
@@ -202,6 +202,9 @@ 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)
207
+ node.value('shared', vhost.shared)
205
208
  end
206
209
 
207
210
  node.value('internal', vhost.internal)
@@ -159,6 +159,8 @@ module Aptible
159
159
  create!
160
160
  port!
161
161
  tls!
162
+ alb!
163
+ shared!
162
164
  end
163
165
 
164
166
  desc 'endpoints:https:create [--app APP] SERVICE',
@@ -177,6 +179,8 @@ module Aptible
177
179
  app!
178
180
  port!
179
181
  tls!
182
+ alb!
183
+ shared!
180
184
  end
181
185
 
182
186
  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.9'.freeze
4
4
  end
5
5
  end
@@ -20,7 +20,9 @@ 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',
25
+ shared: false
24
26
  )
25
27
 
26
28
  expected = [
@@ -30,6 +32,8 @@ describe Aptible::CLI::ResourceFormatter do
30
32
  "Created At: #{fmt_time(service.created_at)}",
31
33
  'Type: https',
32
34
  'Port: default',
35
+ 'Load Balancing Algorithm Type: least_outstanding_requests',
36
+ 'Shared: false',
33
37
  'Internal: false',
34
38
  'IP Whitelist: all traffic',
35
39
  '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.9
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-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -586,7 +586,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
586
586
  - !ruby/object:Gem::Version
587
587
  version: '0'
588
588
  requirements: []
589
- rubygems_version: 3.1.6
589
+ rubygems_version: 3.0.3.1
590
590
  signing_key:
591
591
  specification_version: 4
592
592
  summary: Command-line interface for Aptible services