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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/aptible/cli/helpers/vhost/option_set_builder.rb +26 -0
- data/lib/aptible/cli/resource_formatter.rb +2 -0
- data/lib/aptible/cli/subcommands/endpoints.rb +2 -0
- data/lib/aptible/cli/version.rb +1 -1
- data/spec/aptible/cli/resource_formatter_spec.rb +3 -1
- data/spec/aptible/cli/subcommands/endpoints_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17e219de14f5b6f2cb8e24fc06259e8b113069957fb2726a678e6cf027f59b76
|
4
|
+
data.tar.gz: aa138fa1a35e9ddde06720a524f0f09f143a9a81a97041e9a46140726f4f8c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5135d3bb2b8c9e17e4a4eba7e2c7ad089a164dfec3a64010a2c0e509353a352a4190afa7f1c1fa4919c5b9bd00785ec00b1f6ee8dd7bf6c270b836d3a894861
|
7
|
+
data.tar.gz: 36376e1366bf23b5ab545c47ed0fbf85b139201d7d6d7198acf6f551208e9b93971e81230772d05fc9511ea3aa687b4eae3c35849f20a06f083ad41c0766d1b7
|
data/Gemfile.lock
CHANGED
@@ -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',
|
data/lib/aptible/cli/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2025-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|