aptible-cli 0.24.6 → 0.24.7
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/README.md +81 -81
- data/lib/aptible/cli/resource_formatter.rb +1 -0
- data/lib/aptible/cli/subcommands/services.rb +32 -3
- data/lib/aptible/cli/version.rb +1 -1
- data/spec/aptible/cli/subcommands/services_spec.rb +18 -1
- 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: 4dc2738ea7b57ea51a48e40af6d8aa05b48156a7f5a06c93d08e7ae9918f9ed6
|
4
|
+
data.tar.gz: cfb52fe2bf1d9327c8cde52c374f9d831ceebdb7ab1065b89920b3e9e8136c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7e93267050ad6cda388ec1ee5ccb1973ad04fa1c7d6bc864a93efa1cd180e077c7b6be7679f917ca28d567660491f32fa5d47132bbe497d16b6b1f443bbfd66
|
7
|
+
data.tar.gz: a42372d8e19d161069042486f41336f7e315749a40fcfacc9520e07acd3de37d6f1b4af50822accc4d2dd3a87e9e197bb4b69260524d8041c0accbccfb4369f0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -26,87 +26,87 @@ From `aptible help`:
|
|
26
26
|
<!-- BEGIN USAGE -->
|
27
27
|
```
|
28
28
|
Commands:
|
29
|
-
aptible apps
|
30
|
-
aptible apps:create HANDLE
|
31
|
-
aptible apps:deprovision
|
32
|
-
aptible apps:rename OLD_HANDLE NEW_HANDLE [--environment ENVIRONMENT_HANDLE]
|
33
|
-
aptible apps:scale SERVICE [--container-count COUNT] [--container-size SIZE_MB] [--container-profile PROFILE]
|
34
|
-
aptible backup:list DB_HANDLE
|
35
|
-
aptible backup:orphaned
|
36
|
-
aptible backup:purge BACKUP_ID
|
37
|
-
aptible backup:restore BACKUP_ID [--environment ENVIRONMENT_HANDLE] [--handle HANDLE] [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--key-arn KEY_ARN]
|
38
|
-
aptible backup_retention_policy [ENVIRONMENT_HANDLE]
|
39
|
-
aptible backup_retention_policy:set [ENVIRONMENT_HANDLE] [--daily DAILY_BACKUPS] [--monthly MONTHLY_BACKUPS] [--yearly YEARLY_BACKUPS] [--make-copy|--no-make-copy] [--keep-final|--no-keep-final] [--force]
|
40
|
-
aptible config
|
41
|
-
aptible config:add [VAR1=VAL1] [VAR2=VAL2] [...]
|
42
|
-
aptible config:get [VAR1]
|
43
|
-
aptible config:rm [VAR1] [VAR2] [...]
|
44
|
-
aptible config:set [VAR1=VAL1] [VAR2=VAL2] [...]
|
45
|
-
aptible config:unset [VAR1] [VAR2] [...]
|
46
|
-
aptible db:backup HANDLE
|
47
|
-
aptible db:clone SOURCE DEST
|
48
|
-
aptible db:create HANDLE [--type TYPE] [--version VERSION] [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--key-arn KEY_ARN]
|
49
|
-
aptible db:deprovision HANDLE
|
50
|
-
aptible db:dump HANDLE [pg_dump options]
|
51
|
-
aptible db:execute HANDLE SQL_FILE [--on-error-stop]
|
52
|
-
aptible db:list
|
53
|
-
aptible db:modify HANDLE [--iops IOPS] [--volume-type [gp2, gp3]]
|
54
|
-
aptible db:reload HANDLE
|
55
|
-
aptible db:rename OLD_HANDLE NEW_HANDLE [--environment ENVIRONMENT_HANDLE]
|
56
|
-
aptible db:replicate HANDLE REPLICA_HANDLE [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--logical --version VERSION] [--key-arn KEY_ARN]
|
57
|
-
aptible db:restart HANDLE [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--volume-type [gp2, gp3]]
|
58
|
-
aptible db:tunnel HANDLE
|
59
|
-
aptible db:url HANDLE
|
60
|
-
aptible db:versions
|
61
|
-
aptible deploy [OPTIONS] [VAR1=VAL1] [VAR2=VAL2] [...]
|
62
|
-
aptible endpoints:database:create DATABASE
|
63
|
-
aptible endpoints:database:modify --database DATABASE ENDPOINT_HOSTNAME
|
64
|
-
aptible endpoints:deprovision [--app APP | --database DATABASE] ENDPOINT_HOSTNAME
|
65
|
-
aptible endpoints:grpc:create [--app APP] SERVICE
|
66
|
-
aptible endpoints:grpc:modify [--app APP] ENDPOINT_HOSTNAME
|
67
|
-
aptible endpoints:https:create [--app APP] SERVICE
|
68
|
-
aptible endpoints:https:modify [--app APP] ENDPOINT_HOSTNAME
|
69
|
-
aptible endpoints:list [--app APP | --database DATABASE]
|
70
|
-
aptible endpoints:renew [--app APP] ENDPOINT_HOSTNAME
|
71
|
-
aptible endpoints:tcp:create [--app APP] SERVICE
|
72
|
-
aptible endpoints:tcp:modify [--app APP] ENDPOINT_HOSTNAME
|
73
|
-
aptible endpoints:tls:create [--app APP] SERVICE
|
74
|
-
aptible endpoints:tls:modify [--app APP] ENDPOINT_HOSTNAME
|
75
|
-
aptible environment:ca_cert
|
76
|
-
aptible environment:list
|
77
|
-
aptible environment:rename OLD_HANDLE NEW_HANDLE
|
78
|
-
aptible help [COMMAND]
|
79
|
-
aptible log_drain:create:datadog HANDLE --url DATADOG_URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies]
|
80
|
-
aptible log_drain:create:elasticsearch HANDLE --db DATABASE_HANDLE --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies]
|
81
|
-
aptible log_drain:create:https HANDLE --url URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies]
|
82
|
-
aptible log_drain:create:logdna HANDLE --url LOGDNA_URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies]
|
83
|
-
aptible log_drain:create:papertrail HANDLE --host PAPERTRAIL_HOST --port PAPERTRAIL_PORT --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies]
|
84
|
-
aptible log_drain:create:sumologic HANDLE --url SUMOLOGIC_URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies]
|
85
|
-
aptible log_drain:create:syslog HANDLE --host SYSLOG_HOST --port SYSLOG_PORT [--token TOKEN] --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies]
|
86
|
-
aptible log_drain:deprovision HANDLE --environment ENVIRONMENT
|
87
|
-
aptible log_drain:list
|
88
|
-
aptible login
|
89
|
-
aptible logs [--app APP | --database DATABASE]
|
90
|
-
aptible logs_from_archive --bucket NAME --region REGION --stack NAME [ --decryption-keys ONE [OR MORE] ] [ --download-location LOCATION ] [ [ --string-matches ONE [OR MORE] ] | [ --app-id ID | --database-id ID | --endpoint-id ID | --container-id ID ] [ --start-date YYYY-MM-DD --end-date YYYY-MM-DD ] ] --bucket=BUCKET --region=REGION --stack=STACK
|
91
|
-
aptible maintenance:apps
|
92
|
-
aptible maintenance:dbs
|
93
|
-
aptible metric_drain:create:datadog HANDLE --api_key DATADOG_API_KEY --site DATADOG_SITE --environment ENVIRONMENT
|
94
|
-
aptible metric_drain:create:influxdb HANDLE --db DATABASE_HANDLE --environment ENVIRONMENT
|
95
|
-
aptible metric_drain:create:influxdb:custom HANDLE --username USERNAME --password PASSWORD --url URL_INCLUDING_PORT --db INFLUX_DATABASE_NAME --environment ENVIRONMENT
|
96
|
-
aptible metric_drain:create:influxdb:customv2 HANDLE --org ORGANIZATION --token INFLUX_TOKEN --url URL_INCLUDING_PORT --bucket INFLUX_BUCKET_NAME --environment ENVIRONMENT
|
97
|
-
aptible metric_drain:deprovision HANDLE --environment ENVIRONMENT
|
98
|
-
aptible metric_drain:list
|
99
|
-
aptible operation:cancel OPERATION_ID
|
100
|
-
aptible operation:follow OPERATION_ID
|
101
|
-
aptible operation:logs OPERATION_ID
|
102
|
-
aptible rebuild
|
103
|
-
aptible restart
|
104
|
-
aptible services
|
105
|
-
aptible services:autoscaling_policy SERVICE
|
106
|
-
aptible services:autoscaling_policy:set SERVICE --autoscaling-type (horizontal|vertical) [--metric-lookback-seconds SECONDS] [--percentile PERCENTILE] [--post-scale-up-cooldown-seconds SECONDS] [--post-scale-down-cooldown-seconds SECONDS] [--post-release-cooldown-seconds SECONDS] [--mem-cpu-ratio-r-threshold RATIO] [--mem-cpu-ratio-c-threshold RATIO] [--mem-scale-up-threshold THRESHOLD] [--mem-scale-down-threshold THRESHOLD] [--minimum-memory MEMORY] [--maximum-memory MEMORY] [--min-cpu-threshold THRESHOLD] [--max-cpu-threshold THRESHOLD] [--min-containers CONTAINERS] [--max-containers CONTAINERS] [--scale-up-step STEPS] [--scale-down-step STEPS] # Sets the sizing (autoscaling) policy for a service. This is not incremental, all arguments must be sent at once or they will be set to defaults.
|
107
|
-
aptible services:settings SERVICE [--force-zero-downtime|--no-force-zero-downtime] [--simple-health-check|--no-simple-health-check] [--stop-timeout SECONDS]
|
108
|
-
aptible ssh [COMMAND]
|
109
|
-
aptible version
|
29
|
+
aptible apps # List all applications
|
30
|
+
aptible apps:create HANDLE # Create a new application
|
31
|
+
aptible apps:deprovision # Deprovision an app
|
32
|
+
aptible apps:rename OLD_HANDLE NEW_HANDLE [--environment ENVIRONMENT_HANDLE] # Rename an app handle. In order for the new app handle to appear in log drain and metric drain destinations, you must restart the app.
|
33
|
+
aptible apps:scale SERVICE [--container-count COUNT] [--container-size SIZE_MB] [--container-profile PROFILE] # Scale a service
|
34
|
+
aptible backup:list DB_HANDLE # List backups for a database
|
35
|
+
aptible backup:orphaned # List backups associated with deprovisioned databases
|
36
|
+
aptible backup:purge BACKUP_ID # Permanently delete a backup and any copies of it
|
37
|
+
aptible backup:restore BACKUP_ID [--environment ENVIRONMENT_HANDLE] [--handle HANDLE] [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--key-arn KEY_ARN] # Restore a backup
|
38
|
+
aptible backup_retention_policy [ENVIRONMENT_HANDLE] # Show the current backup retention policy for the environment
|
39
|
+
aptible backup_retention_policy:set [ENVIRONMENT_HANDLE] [--daily DAILY_BACKUPS] [--monthly MONTHLY_BACKUPS] [--yearly YEARLY_BACKUPS] [--make-copy|--no-make-copy] [--keep-final|--no-keep-final] [--force] # Change the environment's backup retention policy
|
40
|
+
aptible config # Print an app's current configuration
|
41
|
+
aptible config:add [VAR1=VAL1] [VAR2=VAL2] [...] # Add an ENV variable to an app
|
42
|
+
aptible config:get [VAR1] # Print a specific key within an app's current configuration
|
43
|
+
aptible config:rm [VAR1] [VAR2] [...] # Remove an ENV variable from an app
|
44
|
+
aptible config:set [VAR1=VAL1] [VAR2=VAL2] [...] # Add an ENV variable to an app
|
45
|
+
aptible config:unset [VAR1] [VAR2] [...] # Remove an ENV variable from an app
|
46
|
+
aptible db:backup HANDLE # Backup a database
|
47
|
+
aptible db:clone SOURCE DEST # Clone a database to create a new one
|
48
|
+
aptible db:create HANDLE [--type TYPE] [--version VERSION] [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--key-arn KEY_ARN] # Create a new database
|
49
|
+
aptible db:deprovision HANDLE # Deprovision a database
|
50
|
+
aptible db:dump HANDLE [pg_dump options] # Dump a remote database to file
|
51
|
+
aptible db:execute HANDLE SQL_FILE [--on-error-stop] # Executes sql against a database
|
52
|
+
aptible db:list # List all databases
|
53
|
+
aptible db:modify HANDLE [--iops IOPS] [--volume-type [gp2, gp3]] # Modify a database disk
|
54
|
+
aptible db:reload HANDLE # Reload a database
|
55
|
+
aptible db:rename OLD_HANDLE NEW_HANDLE [--environment ENVIRONMENT_HANDLE] # Rename a database handle. In order for the new database handle to appear in log drain and metric drain destinations, you must reload the database.
|
56
|
+
aptible db:replicate HANDLE REPLICA_HANDLE [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--logical --version VERSION] [--key-arn KEY_ARN] # Create a replica/follower of a database
|
57
|
+
aptible db:restart HANDLE [--container-size SIZE_MB] [--disk-size SIZE_GB] [--container-profile PROFILE] [--iops IOPS] [--volume-type [gp2, gp3]] # Restart a database
|
58
|
+
aptible db:tunnel HANDLE # Create a local tunnel to a database
|
59
|
+
aptible db:url HANDLE # Display a database URL
|
60
|
+
aptible db:versions # List available database versions
|
61
|
+
aptible deploy [OPTIONS] [VAR1=VAL1] [VAR2=VAL2] [...] # Deploy an app
|
62
|
+
aptible endpoints:database:create DATABASE # Create a Database Endpoint
|
63
|
+
aptible endpoints:database:modify --database DATABASE ENDPOINT_HOSTNAME # Modify a Database Endpoint
|
64
|
+
aptible endpoints:deprovision [--app APP | --database DATABASE] ENDPOINT_HOSTNAME # Deprovision an App or Database Endpoint
|
65
|
+
aptible endpoints:grpc:create [--app APP] SERVICE # Create an App gRPC Endpoint
|
66
|
+
aptible endpoints:grpc:modify [--app APP] ENDPOINT_HOSTNAME # Modify an App gRPC Endpoint
|
67
|
+
aptible endpoints:https:create [--app APP] SERVICE # Create an App HTTPS Endpoint
|
68
|
+
aptible endpoints:https:modify [--app APP] ENDPOINT_HOSTNAME # Modify an App HTTPS Endpoint
|
69
|
+
aptible endpoints:list [--app APP | --database DATABASE] # List Endpoints for an App or Database
|
70
|
+
aptible endpoints:renew [--app APP] ENDPOINT_HOSTNAME # Renew an App Managed TLS Endpoint
|
71
|
+
aptible endpoints:tcp:create [--app APP] SERVICE # Create an App TCP Endpoint
|
72
|
+
aptible endpoints:tcp:modify [--app APP] ENDPOINT_HOSTNAME # Modify an App TCP Endpoint
|
73
|
+
aptible endpoints:tls:create [--app APP] SERVICE # Create an App TLS Endpoint
|
74
|
+
aptible endpoints:tls:modify [--app APP] ENDPOINT_HOSTNAME # Modify an App TLS Endpoint
|
75
|
+
aptible environment:ca_cert # Retrieve the CA certificate associated with the environment
|
76
|
+
aptible environment:list # List all environments
|
77
|
+
aptible environment:rename OLD_HANDLE NEW_HANDLE # Rename an environment handle. In order for the new environment handle to appear in log drain/metric destinations, you must restart the apps/databases in this environment.
|
78
|
+
aptible help [COMMAND] # Describe available commands or one specific command
|
79
|
+
aptible log_drain:create:datadog HANDLE --url DATADOG_URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies] # Create a Datadog Log Drain. By default, App, Database, Ephemeral Session, and Proxy logs will be sent to your chosen destination.
|
80
|
+
aptible log_drain:create:elasticsearch HANDLE --db DATABASE_HANDLE --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies] # Create an Elasticsearch Log Drain. By default, App, Database, Ephemeral Session, and Proxy logs will be sent to your chosen destination.
|
81
|
+
aptible log_drain:create:https HANDLE --url URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies] # Create a HTTPS Drain
|
82
|
+
aptible log_drain:create:logdna HANDLE --url LOGDNA_URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies] # Create a LogDNA/Mezmo Log Drain. By default, App, Database, Ephemeral Session, and Proxy logs will be sent to your chosen destination.
|
83
|
+
aptible log_drain:create:papertrail HANDLE --host PAPERTRAIL_HOST --port PAPERTRAIL_PORT --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies] # Create a Papertrail Log Drain. By default, App, Database, Ephemeral Session, and Proxy logs will be sent to your chosen destination.
|
84
|
+
aptible log_drain:create:sumologic HANDLE --url SUMOLOGIC_URL --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies] # Create a Sumologic Drain. By default, App, Database, Ephemeral Session, and Proxy logs will be sent to your chosen destination.
|
85
|
+
aptible log_drain:create:syslog HANDLE --host SYSLOG_HOST --port SYSLOG_PORT [--token TOKEN] --environment ENVIRONMENT [--drain-apps|--no-drain-apps] [--drain-databases|--no-drain-databases] [--drain-ephemeral-sessions|--no-drain-ephemeral-sessions] [--drain_proxies|--no-drain-proxies] # Create a Syslog Log Drain. By default, App, Database, Ephemeral Session, and Proxy logs will be sent to your chosen destination.
|
86
|
+
aptible log_drain:deprovision HANDLE --environment ENVIRONMENT # Deprovisions a log drain
|
87
|
+
aptible log_drain:list # List all Log Drains
|
88
|
+
aptible login # Log in to Aptible
|
89
|
+
aptible logs [--app APP | --database DATABASE] # Follows logs from a running app or database
|
90
|
+
aptible logs_from_archive --bucket NAME --region REGION --stack NAME [ --decryption-keys ONE [OR MORE] ] [ --download-location LOCATION ] [ [ --string-matches ONE [OR MORE] ] | [ --app-id ID | --database-id ID | --endpoint-id ID | --container-id ID ] [ --start-date YYYY-MM-DD --end-date YYYY-MM-DD ] ] --bucket=BUCKET --region=REGION --stack=STACK # Retrieves container logs from an S3 archive in your own AWS account. You must provide your AWS credentials via the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
|
91
|
+
aptible maintenance:apps # List Apps impacted by maintenance schedules where restarts are required
|
92
|
+
aptible maintenance:dbs # List Databases impacted by maintenance schedules where restarts are required
|
93
|
+
aptible metric_drain:create:datadog HANDLE --api_key DATADOG_API_KEY --site DATADOG_SITE --environment ENVIRONMENT # Create a Datadog Metric Drain
|
94
|
+
aptible metric_drain:create:influxdb HANDLE --db DATABASE_HANDLE --environment ENVIRONMENT # Create an InfluxDB Metric Drain
|
95
|
+
aptible metric_drain:create:influxdb:custom HANDLE --username USERNAME --password PASSWORD --url URL_INCLUDING_PORT --db INFLUX_DATABASE_NAME --environment ENVIRONMENT # Create an InfluxDB Metric Drain
|
96
|
+
aptible metric_drain:create:influxdb:customv2 HANDLE --org ORGANIZATION --token INFLUX_TOKEN --url URL_INCLUDING_PORT --bucket INFLUX_BUCKET_NAME --environment ENVIRONMENT # Create an InfluxDB v2 Metric Drain
|
97
|
+
aptible metric_drain:deprovision HANDLE --environment ENVIRONMENT # Deprovisions a Metric Drain
|
98
|
+
aptible metric_drain:list # List all Metric Drains
|
99
|
+
aptible operation:cancel OPERATION_ID # Cancel a running operation
|
100
|
+
aptible operation:follow OPERATION_ID # Follow logs of a running operation
|
101
|
+
aptible operation:logs OPERATION_ID # View logs for given operation
|
102
|
+
aptible rebuild # Rebuild an app, and restart its services
|
103
|
+
aptible restart # Restart all services associated with an app
|
104
|
+
aptible services # List Services for an App
|
105
|
+
aptible services:autoscaling_policy SERVICE # Returns the associated sizing policy, if any
|
106
|
+
aptible services:autoscaling_policy:set SERVICE --autoscaling-type (horizontal|vertical) [--metric-lookback-seconds SECONDS] [--percentile PERCENTILE] [--post-scale-up-cooldown-seconds SECONDS] [--post-scale-down-cooldown-seconds SECONDS] [--post-release-cooldown-seconds SECONDS] [--mem-cpu-ratio-r-threshold RATIO] [--mem-cpu-ratio-c-threshold RATIO] [--mem-scale-up-threshold THRESHOLD] [--mem-scale-down-threshold THRESHOLD] [--minimum-memory MEMORY] [--maximum-memory MEMORY] [--min-cpu-threshold THRESHOLD] [--max-cpu-threshold THRESHOLD] [--min-containers CONTAINERS] [--max-containers CONTAINERS] [--scale-up-step STEPS] [--scale-down-step STEPS] [--restart-free-scale|--no-restart-free-scale] # Sets the sizing (autoscaling) policy for a service. This is not incremental, all arguments must be sent at once or they will be set to defaults.
|
107
|
+
aptible services:settings SERVICE [--force-zero-downtime|--no-force-zero-downtime] [--simple-health-check|--no-simple-health-check] [--stop-timeout SECONDS] # Modifies the deployment settings for a service
|
108
|
+
aptible ssh [COMMAND] # Run a command against an app
|
109
|
+
aptible version # Print Aptible CLI version
|
110
110
|
```
|
111
111
|
<!-- END USAGE -->
|
112
112
|
|
@@ -317,6 +317,7 @@ module Aptible
|
|
317
317
|
node.value('max_containers', policy.max_containers)
|
318
318
|
node.value('scale_up_step', policy.scale_up_step)
|
319
319
|
node.value('scale_down_step', policy.scale_down_step)
|
320
|
+
node.value('restart_free_scale', policy.use_horizontal_scale)
|
320
321
|
|
321
322
|
attach_service(node, service)
|
322
323
|
end
|
@@ -105,7 +105,8 @@ module Aptible
|
|
105
105
|
'[--min-containers CONTAINERS] '\
|
106
106
|
'[--max-containers CONTAINERS] '\
|
107
107
|
'[--scale-up-step STEPS] '\
|
108
|
-
'[--scale-down-step STEPS] '
|
108
|
+
'[--scale-down-step STEPS] '\
|
109
|
+
'[--restart-free-scale|--no-restart-free-scale]',
|
109
110
|
'Sets the sizing (autoscaling) policy for a service.'\
|
110
111
|
' This is not incremental, all arguments must be sent'\
|
111
112
|
' at once or they will be set to defaults.'
|
@@ -200,17 +201,45 @@ module Aptible
|
|
200
201
|
'the amount of containers to remove when autoscaling (ex:'\
|
201
202
|
' a value of 2 will go from 4->2->1). Container count '\
|
202
203
|
'will never exceed the configured minimum.'
|
204
|
+
option :restart_free_scale,
|
205
|
+
type: :boolean,
|
206
|
+
default: false,
|
207
|
+
desc: 'Horizontal autoscaling only - Sets the '\
|
208
|
+
'autoscaling to use a restart-free scale.'
|
203
209
|
define_method 'services:autoscaling_policy:set' do |service|
|
204
210
|
telemetry(__method__, options.merge(service: service))
|
205
211
|
|
206
212
|
service = ensure_service(options, service)
|
207
|
-
ignored_attrs = %i(
|
213
|
+
ignored_attrs = %i(
|
214
|
+
autoscaling_type app environment remote restart_free_scale
|
215
|
+
)
|
208
216
|
args = options.except(*ignored_attrs)
|
209
217
|
args[:autoscaling] = options[:autoscaling_type]
|
210
218
|
|
219
|
+
# Some options are conditionally required based on the autoscaling
|
220
|
+
# type. These probably should be separate commands namespaces by
|
221
|
+
# type to avoid validating by hand here.
|
222
|
+
if options[:autoscaling_type] == 'horizontal'
|
223
|
+
if options[:min_containers].nil? ||
|
224
|
+
options[:max_containers].nil?
|
225
|
+
raise Thor::Error, 'min_containers and max_containers are ' \
|
226
|
+
'required for horizontal autoscaling'
|
227
|
+
end
|
228
|
+
if options[:min_cpu_threshold].nil? ||
|
229
|
+
options[:max_cpu_threshold].nil?
|
230
|
+
raise Thor::Error, 'min_cpu_threshold and ' \
|
231
|
+
'max_cpu_threshold are required for horizontal autoscaling'
|
232
|
+
end
|
233
|
+
|
234
|
+
args[:use_horizontal_scale] = options[:restart_free_scale]
|
235
|
+
elsif options[:autoscaling_type] != 'vertical'
|
236
|
+
raise Thor::Error, 'Invalid autoscaling type: ' \
|
237
|
+
"#{options[:autoscaling_type]}"
|
238
|
+
end
|
239
|
+
|
211
240
|
sizing_policy = service.service_sizing_policy
|
212
241
|
if sizing_policy
|
213
|
-
sizing_policy.update!(
|
242
|
+
sizing_policy.update!(args.merge(service_id: service.id))
|
214
243
|
else
|
215
244
|
service.create_service_sizing_policy!(**args)
|
216
245
|
end
|
data/lib/aptible/cli/version.rb
CHANGED
@@ -175,6 +175,23 @@ describe Aptible::CLI::Agent do
|
|
175
175
|
}
|
176
176
|
end
|
177
177
|
|
178
|
+
it 'raises an error if the autoscaling type is invalid' do
|
179
|
+
stub_options(autoscaling_type: 'invalid')
|
180
|
+
Fabricate(:service, app: app, process_type: 'foo')
|
181
|
+
expect { subject.send('services:sizing_policy:set', 'foo') }
|
182
|
+
.to raise_error(/Invalid autoscaling type: invalid/)
|
183
|
+
end
|
184
|
+
|
185
|
+
it 'raises an error if the autoscaling type is horizontal '\
|
186
|
+
'and min_containers is not set' do
|
187
|
+
stub_options(autoscaling_type: 'horizontal', min_containers: nil)
|
188
|
+
Fabricate(:service, app: app, process_type: 'foo')
|
189
|
+
expect { subject.send('services:sizing_policy:set', 'foo') }
|
190
|
+
.to raise_error(
|
191
|
+
/min_containers and max_containers are required for horizontal autos/
|
192
|
+
)
|
193
|
+
end
|
194
|
+
|
178
195
|
it 'updates existing sizing policy' do
|
179
196
|
stub_options(**args)
|
180
197
|
service = Fabricate(:service, app: app, process_type: 'foo')
|
@@ -186,7 +203,7 @@ describe Aptible::CLI::Agent do
|
|
186
203
|
api_args[:autoscaling] = args[:autoscaling_type]
|
187
204
|
|
188
205
|
expect(sizing_policy).to receive(:update!)
|
189
|
-
.with(**api_args)
|
206
|
+
.with(**api_args.update(service_id: service.id))
|
190
207
|
|
191
208
|
subject.send('services:sizing_policy:set', 'foo')
|
192
209
|
end
|
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.7
|
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-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|