aptible-cli 0.24.5 → 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 +15 -8
- data/README.md +81 -81
- data/aptible-cli.gemspec +9 -2
- data/lib/aptible/cli/agent.rb +21 -0
- data/lib/aptible/cli/helpers/vhost.rb +10 -0
- data/lib/aptible/cli/resource_formatter.rb +1 -0
- data/lib/aptible/cli/subcommands/services.rb +41 -5
- data/lib/aptible/cli/version.rb +1 -1
- data/spec/aptible/cli/agent_spec.rb +152 -5
- data/spec/aptible/cli/subcommands/endpoints_spec.rb +31 -1
- data/spec/aptible/cli/subcommands/services_spec.rb +37 -1
- data/spec/fabricators/database_fabricator.rb +5 -3
- metadata +110 -12
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
@@ -1,20 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
aptible-cli (0.24.
|
4
|
+
aptible-cli (0.24.7)
|
5
5
|
activesupport (>= 4.0, < 6.0)
|
6
|
-
aptible-api (~> 1.8)
|
6
|
+
aptible-api (~> 1.8.0)
|
7
7
|
aptible-auth (~> 1.2.5)
|
8
8
|
aptible-billing (~> 1.0)
|
9
9
|
aptible-resource (~> 1.1)
|
10
|
+
aws-eventstream (~> 1.1.1)
|
10
11
|
aws-sdk (~> 2.0)
|
12
|
+
aws-sigv4 (~> 1.2.4)
|
11
13
|
bigdecimal (~> 1.3.5)
|
12
14
|
cbor
|
13
15
|
chronic_duration (~> 0.10.6)
|
14
16
|
concurrent-ruby (< 1.1.10)
|
15
|
-
|
17
|
+
connection_pool (< 2.2.4)
|
18
|
+
faraday (~> 0.17.6)
|
19
|
+
git (~> 1.7.0)
|
20
|
+
httpclient (~> 2.8.0)
|
21
|
+
json (~> 2.5.0)
|
16
22
|
jwt (~> 2.3.0)
|
17
23
|
rack (~> 1.0)
|
24
|
+
stripe (< 5.0)
|
18
25
|
term-ansicolor (~> 1.8.0)
|
19
26
|
thor (~> 0.20.0)
|
20
27
|
|
@@ -28,7 +35,7 @@ GEM
|
|
28
35
|
tzinfo (~> 1.1)
|
29
36
|
addressable (2.8.0)
|
30
37
|
public_suffix (>= 2.0.2, < 5.0)
|
31
|
-
aptible-api (1.8)
|
38
|
+
aptible-api (1.8.1)
|
32
39
|
aptible-auth
|
33
40
|
aptible-resource
|
34
41
|
gem_config
|
@@ -42,7 +49,7 @@ GEM
|
|
42
49
|
activesupport (>= 4.0, < 6.0)
|
43
50
|
aptible-resource (~> 1.0)
|
44
51
|
stripe (>= 1.13.0)
|
45
|
-
aptible-resource (1.1.
|
52
|
+
aptible-resource (1.1.3)
|
46
53
|
activesupport
|
47
54
|
fridge
|
48
55
|
gem_config (~> 0.3.1)
|
@@ -79,9 +86,9 @@ GEM
|
|
79
86
|
fabrication (2.15.2)
|
80
87
|
faraday (0.17.6)
|
81
88
|
multipart-post (>= 1.2, < 3)
|
82
|
-
fridge (0.
|
89
|
+
fridge (1.0.0)
|
83
90
|
gem_config
|
84
|
-
jwt
|
91
|
+
jwt (~> 2.3.0)
|
85
92
|
gem_config (0.3.2)
|
86
93
|
git (1.7.0)
|
87
94
|
rchardet (~> 1.8)
|
@@ -147,7 +154,7 @@ GEM
|
|
147
154
|
tins (~> 1.0)
|
148
155
|
thor (0.20.3)
|
149
156
|
thread_safe (0.3.6)
|
150
|
-
tins (1.
|
157
|
+
tins (1.38.0)
|
151
158
|
bigdecimal
|
152
159
|
sync
|
153
160
|
tzinfo (1.2.11)
|
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]
|
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
|
|
data/aptible-cli.gemspec
CHANGED
@@ -21,18 +21,25 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
23
|
spec.add_dependency 'activesupport', '>= 4.0', '< 6.0'
|
24
|
-
spec.add_dependency 'aptible-api', '~> 1.8'
|
24
|
+
spec.add_dependency 'aptible-api', '~> 1.8.0'
|
25
25
|
spec.add_dependency 'aptible-auth', '~> 1.2.5'
|
26
26
|
spec.add_dependency 'aptible-billing', '~> 1.0'
|
27
27
|
spec.add_dependency 'aptible-resource', '~> 1.1'
|
28
|
+
spec.add_dependency 'aws-eventstream', '~> 1.1.1'
|
28
29
|
spec.add_dependency 'aws-sdk', '~> 2.0'
|
30
|
+
spec.add_dependency 'aws-sigv4', '~> 1.2.4'
|
29
31
|
spec.add_dependency 'bigdecimal', '~> 1.3.5' # https://github.com/ruby/bigdecimal#which-version-should-you-select
|
30
32
|
spec.add_dependency 'cbor'
|
31
33
|
spec.add_dependency 'chronic_duration', '~> 0.10.6'
|
32
34
|
spec.add_dependency 'concurrent-ruby', '< 1.1.10'
|
35
|
+
spec.add_dependency 'connection_pool', '< 2.2.4'
|
36
|
+
spec.add_dependency 'faraday', '~> 0.17.6'
|
37
|
+
spec.add_dependency 'git', '~> 1.7.0'
|
38
|
+
spec.add_dependency 'httpclient', '~> 2.8.0'
|
39
|
+
spec.add_dependency 'json', '~> 2.5.0'
|
33
40
|
spec.add_dependency 'jwt', '~> 2.3.0'
|
34
|
-
spec.add_dependency 'git', '< 1.10'
|
35
41
|
spec.add_dependency 'rack', '~> 1.0'
|
42
|
+
spec.add_dependency 'stripe', '< 5.0'
|
36
43
|
spec.add_dependency 'term-ansicolor', '~> 1.8.0'
|
37
44
|
spec.add_dependency 'thor', '~> 0.20.0'
|
38
45
|
|
data/lib/aptible/cli/agent.rb
CHANGED
@@ -349,9 +349,30 @@ module Aptible
|
|
349
349
|
"v#{Aptible::CLI::VERSION}"
|
350
350
|
]
|
351
351
|
bits << 'toolbelt' if toolbelt?
|
352
|
+
bits << "(#{ci_string})" if ci?
|
352
353
|
bits.join ' '
|
353
354
|
end
|
354
355
|
|
356
|
+
def ci_string
|
357
|
+
if ENV['GITHUB_ACTIONS'] == 'true'
|
358
|
+
'GitHub Actions'
|
359
|
+
elsif ENV['CIRCLECI'] == 'true'
|
360
|
+
'CircleCI'
|
361
|
+
elsif ENV['TRAVIS'] == 'true'
|
362
|
+
'Travis CI'
|
363
|
+
elsif ENV['GITLAB_CI'] == 'true'
|
364
|
+
'GitLab CI'
|
365
|
+
elsif ENV['DRONE'] == 'true'
|
366
|
+
'Harness'
|
367
|
+
else
|
368
|
+
'CI'
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
def ci?
|
373
|
+
ENV['CI'] == 'true'
|
374
|
+
end
|
375
|
+
|
355
376
|
def toolbelt?
|
356
377
|
ENV['APTIBLE_TOOLBELT']
|
357
378
|
end
|
@@ -33,8 +33,18 @@ module Aptible
|
|
33
33
|
klass = resource.class
|
34
34
|
|
35
35
|
if klass == Aptible::Api::App
|
36
|
+
# We could also raise the error here, but it would technically be a
|
37
|
+
# breaking change:we currently return an empty list if the App is
|
38
|
+
# not provisioned.
|
39
|
+
# if resource.services.empty?
|
40
|
+
# raise Thor::Error, 'App is not provisioned'
|
41
|
+
# end
|
36
42
|
resource.each_service(&block)
|
37
43
|
elsif klass == Aptible::Api::Database
|
44
|
+
if resource.service.nil?
|
45
|
+
raise Thor::Error, 'Database is not provisioned'
|
46
|
+
end
|
47
|
+
|
38
48
|
[resource.service].each(&block)
|
39
49
|
else
|
40
50
|
raise "Unexpected resource: #{klass}"
|
@@ -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
|
@@ -27,8 +27,9 @@ module Aptible
|
|
27
27
|
|
28
28
|
desc 'services:settings SERVICE'\
|
29
29
|
' [--force-zero-downtime|--no-force-zero-downtime]'\
|
30
|
-
' [--simple-health-check|--no-simple-health-check]'
|
31
|
-
|
30
|
+
' [--simple-health-check|--no-simple-health-check]'\
|
31
|
+
' [--stop-timeout SECONDS]',
|
32
|
+
'Modifies the deployment settings for a service'
|
32
33
|
app_options
|
33
34
|
option :force_zero_downtime,
|
34
35
|
type: :boolean, default: false,
|
@@ -37,6 +38,10 @@ module Aptible
|
|
37
38
|
option :simple_health_check,
|
38
39
|
type: :boolean, default: false,
|
39
40
|
desc: 'Use a simple uptime healthcheck during deployments'
|
41
|
+
option :stop_timeout,
|
42
|
+
type: :numeric,
|
43
|
+
desc: 'The number of seconds to wait for the service '\
|
44
|
+
'containers to stop gracefully on release before killing it.'
|
40
45
|
define_method 'services:settings' do |service|
|
41
46
|
telemetry(__method__, options.merge(service: service))
|
42
47
|
|
@@ -46,6 +51,8 @@ module Aptible
|
|
46
51
|
options[:force_zero_downtime] if options[:force_zero_downtime]
|
47
52
|
updates[:naive_health_check] =
|
48
53
|
options[:simple_health_check] if options[:simple_health_check]
|
54
|
+
updates[:stop_timeout] =
|
55
|
+
options[:stop_timeout] if options[:stop_timeout]
|
49
56
|
|
50
57
|
service.update!(**updates) if updates.any?
|
51
58
|
end
|
@@ -98,7 +105,8 @@ module Aptible
|
|
98
105
|
'[--min-containers CONTAINERS] '\
|
99
106
|
'[--max-containers CONTAINERS] '\
|
100
107
|
'[--scale-up-step STEPS] '\
|
101
|
-
'[--scale-down-step STEPS] '
|
108
|
+
'[--scale-down-step STEPS] '\
|
109
|
+
'[--restart-free-scale|--no-restart-free-scale]',
|
102
110
|
'Sets the sizing (autoscaling) policy for a service.'\
|
103
111
|
' This is not incremental, all arguments must be sent'\
|
104
112
|
' at once or they will be set to defaults.'
|
@@ -193,17 +201,45 @@ module Aptible
|
|
193
201
|
'the amount of containers to remove when autoscaling (ex:'\
|
194
202
|
' a value of 2 will go from 4->2->1). Container count '\
|
195
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.'
|
196
209
|
define_method 'services:autoscaling_policy:set' do |service|
|
197
210
|
telemetry(__method__, options.merge(service: service))
|
198
211
|
|
199
212
|
service = ensure_service(options, service)
|
200
|
-
ignored_attrs = %i(
|
213
|
+
ignored_attrs = %i(
|
214
|
+
autoscaling_type app environment remote restart_free_scale
|
215
|
+
)
|
201
216
|
args = options.except(*ignored_attrs)
|
202
217
|
args[:autoscaling] = options[:autoscaling_type]
|
203
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
|
+
|
204
240
|
sizing_policy = service.service_sizing_policy
|
205
241
|
if sizing_policy
|
206
|
-
sizing_policy.update!(
|
242
|
+
sizing_policy.update!(args.merge(service_id: service.id))
|
207
243
|
else
|
208
244
|
service.create_service_sizing_policy!(**args)
|
209
245
|
end
|
data/lib/aptible/cli/version.rb
CHANGED
@@ -8,12 +8,21 @@ describe Aptible::CLI::Agent do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe '#version' do
|
11
|
+
before do
|
12
|
+
# Reset CI-related environment variables before each test
|
13
|
+
ENV['APTIBLE_TOOLBELT'] = nil
|
14
|
+
ENV['CI'] = nil
|
15
|
+
ENV['GITHUB_ACTIONS'] = nil
|
16
|
+
ENV['CIRCLECI'] = nil
|
17
|
+
ENV['TRAVIS'] = nil
|
18
|
+
ENV['GITLAB_CI'] = nil
|
19
|
+
ENV['DRONE'] = nil
|
20
|
+
end
|
21
|
+
|
11
22
|
it 'should print the version' do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
expect(captured_output_text).to eq("aptible-cli v#{version}\n")
|
16
|
-
end
|
23
|
+
version = Aptible::CLI::VERSION
|
24
|
+
subject.version
|
25
|
+
expect(captured_output_text).to eq("aptible-cli v#{version}\n")
|
17
26
|
end
|
18
27
|
|
19
28
|
it 'should print the version (with toolbelt)' do
|
@@ -23,6 +32,144 @@ describe Aptible::CLI::Agent do
|
|
23
32
|
expect(captured_output_text).to eq("aptible-cli v#{version} toolbelt\n")
|
24
33
|
end
|
25
34
|
end
|
35
|
+
|
36
|
+
it 'should print the version with CI suffix' do
|
37
|
+
ClimateControl.modify(CI: 'true') do
|
38
|
+
version = Aptible::CLI::VERSION
|
39
|
+
subject.version
|
40
|
+
expect(captured_output_text).to eq("aptible-cli v#{version} (CI)\n")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should print the version (with toolbelt and CI)' do
|
45
|
+
ClimateControl.modify(APTIBLE_TOOLBELT: '1', CI: 'true') do
|
46
|
+
version = Aptible::CLI::VERSION
|
47
|
+
subject.version
|
48
|
+
expect(captured_output_text).to eq(
|
49
|
+
"aptible-cli v#{version} toolbelt (CI)\n"
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should print the version with GHA suffix' do
|
55
|
+
ClimateControl.modify(CI: 'true', GITHUB_ACTIONS: 'true') do
|
56
|
+
version = Aptible::CLI::VERSION
|
57
|
+
subject.version
|
58
|
+
expect(captured_output_text).to eq(
|
59
|
+
"aptible-cli v#{version} (GitHub Actions)\n"
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should print the version (with toolbelt and GHA)' do
|
65
|
+
ClimateControl.modify(
|
66
|
+
APTIBLE_TOOLBELT: '1',
|
67
|
+
CI: 'true',
|
68
|
+
GITHUB_ACTIONS: 'true'
|
69
|
+
) do
|
70
|
+
version = Aptible::CLI::VERSION
|
71
|
+
subject.version
|
72
|
+
expect(captured_output_text).to eq(
|
73
|
+
"aptible-cli v#{version} toolbelt (GitHub Actions)\n"
|
74
|
+
)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'should print the version with Circle suffix' do
|
79
|
+
ClimateControl.modify(CI: 'true', CIRCLECI: 'true') do
|
80
|
+
version = Aptible::CLI::VERSION
|
81
|
+
subject.version
|
82
|
+
expect(captured_output_text).to eq(
|
83
|
+
"aptible-cli v#{version} (CircleCI)\n"
|
84
|
+
)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'should print the version (with toolbelt and Circle)' do
|
89
|
+
ClimateControl.modify(
|
90
|
+
APTIBLE_TOOLBELT: '1',
|
91
|
+
CI: 'true',
|
92
|
+
CIRCLECI: 'true'
|
93
|
+
) do
|
94
|
+
version = Aptible::CLI::VERSION
|
95
|
+
subject.version
|
96
|
+
expect(captured_output_text).to eq(
|
97
|
+
"aptible-cli v#{version} toolbelt (CircleCI)\n"
|
98
|
+
)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'should print the version with Travis suffix' do
|
103
|
+
ClimateControl.modify(CI: 'true', TRAVIS: 'true') do
|
104
|
+
version = Aptible::CLI::VERSION
|
105
|
+
subject.version
|
106
|
+
expect(captured_output_text).to eq(
|
107
|
+
"aptible-cli v#{version} (Travis CI)\n"
|
108
|
+
)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'should print the version (with toolbelt and Travis)' do
|
113
|
+
ClimateControl.modify(
|
114
|
+
APTIBLE_TOOLBELT: '1',
|
115
|
+
CI: 'true',
|
116
|
+
TRAVIS: 'true'
|
117
|
+
) do
|
118
|
+
version = Aptible::CLI::VERSION
|
119
|
+
subject.version
|
120
|
+
expect(captured_output_text).to eq(
|
121
|
+
"aptible-cli v#{version} toolbelt (Travis CI)\n"
|
122
|
+
)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'should print the version with GitLab suffix' do
|
127
|
+
ClimateControl.modify(CI: 'true', GITLAB_CI: 'true') do
|
128
|
+
version = Aptible::CLI::VERSION
|
129
|
+
subject.version
|
130
|
+
expect(captured_output_text).to eq(
|
131
|
+
"aptible-cli v#{version} (GitLab CI)\n"
|
132
|
+
)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'should print the version (with toolbelt and GitLab)' do
|
137
|
+
ClimateControl.modify(
|
138
|
+
APTIBLE_TOOLBELT: '1',
|
139
|
+
CI: 'true',
|
140
|
+
GITLAB_CI: 'true'
|
141
|
+
) do
|
142
|
+
version = Aptible::CLI::VERSION
|
143
|
+
subject.version
|
144
|
+
expect(captured_output_text).to eq(
|
145
|
+
"aptible-cli v#{version} toolbelt (GitLab CI)\n"
|
146
|
+
)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should print the version with Harness suffix' do
|
151
|
+
ClimateControl.modify(CI: 'true', DRONE: 'true') do
|
152
|
+
version = Aptible::CLI::VERSION
|
153
|
+
subject.version
|
154
|
+
expect(captured_output_text).to eq(
|
155
|
+
"aptible-cli v#{version} (Harness)\n"
|
156
|
+
)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
it 'should print the version (with toolbelt and Harness)' do
|
161
|
+
ClimateControl.modify(
|
162
|
+
APTIBLE_TOOLBELT: '1',
|
163
|
+
CI: 'true',
|
164
|
+
DRONE: 'true'
|
165
|
+
) do
|
166
|
+
version = Aptible::CLI::VERSION
|
167
|
+
subject.version
|
168
|
+
expect(captured_output_text).to eq(
|
169
|
+
"aptible-cli v#{version} toolbelt (Harness)\n"
|
170
|
+
)
|
171
|
+
end
|
172
|
+
end
|
26
173
|
end
|
27
174
|
|
28
175
|
describe '#login' do
|
@@ -60,13 +60,19 @@ describe Aptible::CLI::Agent do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
let!(:db) { Fabricate(:database, handle: 'mydb', account: a1) }
|
63
|
+
let!(:incomplete) do
|
64
|
+
Fabricate(:database, handle: 'incomplete',
|
65
|
+
status: 'provisioning',
|
66
|
+
account: a1)
|
67
|
+
end
|
63
68
|
|
64
69
|
before do
|
65
70
|
allow(Aptible::Api::Database)
|
66
71
|
.to receive(:all)
|
67
72
|
.with(token: token, href: '/databases?per_page=5000&no_embed=true')
|
68
|
-
.and_return([db])
|
73
|
+
.and_return([db, incomplete])
|
69
74
|
allow(db).to receive(:class).and_return(Aptible::Api::Database)
|
75
|
+
allow(incomplete).to receive(:class).and_return(Aptible::Api::Database)
|
70
76
|
stub_options
|
71
77
|
end
|
72
78
|
|
@@ -76,6 +82,12 @@ describe Aptible::CLI::Agent do
|
|
76
82
|
.to raise_error(/could not find database some/im)
|
77
83
|
end
|
78
84
|
|
85
|
+
it 'returns an error if the database is not fully provisioned' do
|
86
|
+
stub_options(database: incomplete.handle)
|
87
|
+
expect { subject.send('endpoints:database:create', 'incomplete') }
|
88
|
+
.to raise_error(/database is not provisioned/im)
|
89
|
+
end
|
90
|
+
|
79
91
|
it 'fails if the DB is not in the account' do
|
80
92
|
stub_options(environment: 'bar')
|
81
93
|
expect { subject.send('endpoints:database:create', 'mydb') }
|
@@ -137,6 +149,12 @@ describe Aptible::CLI::Agent do
|
|
137
149
|
expect { subject.send('endpoints:database:modify', v.external_host) }
|
138
150
|
.to raise_error(/conflicting.*no-ip-whitelist.*ip-whitelist/im)
|
139
151
|
end
|
152
|
+
|
153
|
+
it 'returns an error if the database is not fully provisioned' do
|
154
|
+
stub_options(database: incomplete.handle)
|
155
|
+
expect { subject.send('endpoints:database:modify', 'something') }
|
156
|
+
.to raise_error(/database is not provisioned/im)
|
157
|
+
end
|
140
158
|
end
|
141
159
|
|
142
160
|
describe 'endpoints:list' do
|
@@ -156,6 +174,12 @@ describe Aptible::CLI::Agent do
|
|
156
174
|
expect(lines[0]).not_to eq("\n")
|
157
175
|
expect(lines[-1]).not_to eq("\n")
|
158
176
|
end
|
177
|
+
|
178
|
+
it 'returns an error if the database is not fully provisioned' do
|
179
|
+
stub_options(database: incomplete.handle)
|
180
|
+
expect { subject.send('endpoints:list') }
|
181
|
+
.to raise_error(/database is not provisioned/im)
|
182
|
+
end
|
159
183
|
end
|
160
184
|
|
161
185
|
describe 'endpoints:deprovison' do
|
@@ -176,6 +200,12 @@ describe Aptible::CLI::Agent do
|
|
176
200
|
expect { subject.send('endpoints:deprovision', 'foo.io') }
|
177
201
|
.to raise_error(/endpoint.*foo\.io.*does not exist/im)
|
178
202
|
end
|
203
|
+
|
204
|
+
it 'returns an error if the database is not fully provisioned' do
|
205
|
+
stub_options(database: incomplete.handle)
|
206
|
+
expect { subject.send('endpoints:deprovision', 'foo') }
|
207
|
+
.to raise_error(/database is not provisioned/im)
|
208
|
+
end
|
179
209
|
end
|
180
210
|
end
|
181
211
|
|
@@ -87,6 +87,25 @@ describe Aptible::CLI::Agent do
|
|
87
87
|
|
88
88
|
subject.send('services:settings', 'foo')
|
89
89
|
end
|
90
|
+
|
91
|
+
it 'allows setting stop timeout' do
|
92
|
+
stub_options(stop_timeout: 30)
|
93
|
+
service = Fabricate(:service, app: app, process_type: 'foo')
|
94
|
+
|
95
|
+
expect(service).to receive(:update!).with(stop_timeout: 30)
|
96
|
+
|
97
|
+
subject.send('services:settings', 'foo')
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'allows setting stop timeout with other options' do
|
101
|
+
stub_options(stop_timeout: 30, force_zero_downtime: true)
|
102
|
+
service = Fabricate(:service, app: app, process_type: 'foo')
|
103
|
+
|
104
|
+
expect(service).to receive(:update!)
|
105
|
+
.with(stop_timeout: 30, force_zero_downtime: true)
|
106
|
+
|
107
|
+
subject.send('services:settings', 'foo')
|
108
|
+
end
|
90
109
|
end
|
91
110
|
|
92
111
|
describe '#services:sizing_policy' do
|
@@ -156,6 +175,23 @@ describe Aptible::CLI::Agent do
|
|
156
175
|
}
|
157
176
|
end
|
158
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
|
+
|
159
195
|
it 'updates existing sizing policy' do
|
160
196
|
stub_options(**args)
|
161
197
|
service = Fabricate(:service, app: app, process_type: 'foo')
|
@@ -167,7 +203,7 @@ describe Aptible::CLI::Agent do
|
|
167
203
|
api_args[:autoscaling] = args[:autoscaling_type]
|
168
204
|
|
169
205
|
expect(sizing_policy).to receive(:update!)
|
170
|
-
.with(**api_args)
|
206
|
+
.with(**api_args.update(service_id: service.id))
|
171
207
|
|
172
208
|
subject.send('services:sizing_policy:set', 'foo')
|
173
209
|
end
|
@@ -34,8 +34,10 @@ Fabricator(:database, from: :stub_database) do
|
|
34
34
|
|
35
35
|
after_create do |database, transients|
|
36
36
|
database.account.databases << database
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
unless status == 'provisioning'
|
38
|
+
database.service = transients[:service] || Fabricate(
|
39
|
+
:service, app: nil, database: database
|
40
|
+
)
|
41
|
+
end
|
40
42
|
end
|
41
43
|
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
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 1.8.0
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 1.8.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: aptible-auth
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '1.1'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: aws-eventstream
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 1.1.1
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.1.1
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
104
|
name: aws-sdk
|
91
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,6 +114,20 @@ dependencies:
|
|
100
114
|
- - "~>"
|
101
115
|
- !ruby/object:Gem::Version
|
102
116
|
version: '2.0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: aws-sigv4
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 1.2.4
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 1.2.4
|
103
131
|
- !ruby/object:Gem::Dependency
|
104
132
|
name: bigdecimal
|
105
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,33 +185,89 @@ dependencies:
|
|
157
185
|
- !ruby/object:Gem::Version
|
158
186
|
version: 1.1.10
|
159
187
|
- !ruby/object:Gem::Dependency
|
160
|
-
name:
|
188
|
+
name: connection_pool
|
189
|
+
requirement: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - "<"
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: 2.2.4
|
194
|
+
type: :runtime
|
195
|
+
prerelease: false
|
196
|
+
version_requirements: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - "<"
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: 2.2.4
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: faraday
|
161
203
|
requirement: !ruby/object:Gem::Requirement
|
162
204
|
requirements:
|
163
205
|
- - "~>"
|
164
206
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
207
|
+
version: 0.17.6
|
166
208
|
type: :runtime
|
167
209
|
prerelease: false
|
168
210
|
version_requirements: !ruby/object:Gem::Requirement
|
169
211
|
requirements:
|
170
212
|
- - "~>"
|
171
213
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
214
|
+
version: 0.17.6
|
173
215
|
- !ruby/object:Gem::Dependency
|
174
216
|
name: git
|
175
217
|
requirement: !ruby/object:Gem::Requirement
|
176
218
|
requirements:
|
177
|
-
- - "
|
219
|
+
- - "~>"
|
178
220
|
- !ruby/object:Gem::Version
|
179
|
-
version:
|
221
|
+
version: 1.7.0
|
180
222
|
type: :runtime
|
181
223
|
prerelease: false
|
182
224
|
version_requirements: !ruby/object:Gem::Requirement
|
183
225
|
requirements:
|
184
|
-
- - "
|
226
|
+
- - "~>"
|
185
227
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
228
|
+
version: 1.7.0
|
229
|
+
- !ruby/object:Gem::Dependency
|
230
|
+
name: httpclient
|
231
|
+
requirement: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - "~>"
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: 2.8.0
|
236
|
+
type: :runtime
|
237
|
+
prerelease: false
|
238
|
+
version_requirements: !ruby/object:Gem::Requirement
|
239
|
+
requirements:
|
240
|
+
- - "~>"
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: 2.8.0
|
243
|
+
- !ruby/object:Gem::Dependency
|
244
|
+
name: json
|
245
|
+
requirement: !ruby/object:Gem::Requirement
|
246
|
+
requirements:
|
247
|
+
- - "~>"
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
version: 2.5.0
|
250
|
+
type: :runtime
|
251
|
+
prerelease: false
|
252
|
+
version_requirements: !ruby/object:Gem::Requirement
|
253
|
+
requirements:
|
254
|
+
- - "~>"
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: 2.5.0
|
257
|
+
- !ruby/object:Gem::Dependency
|
258
|
+
name: jwt
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - "~>"
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: 2.3.0
|
264
|
+
type: :runtime
|
265
|
+
prerelease: false
|
266
|
+
version_requirements: !ruby/object:Gem::Requirement
|
267
|
+
requirements:
|
268
|
+
- - "~>"
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: 2.3.0
|
187
271
|
- !ruby/object:Gem::Dependency
|
188
272
|
name: rack
|
189
273
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +282,20 @@ dependencies:
|
|
198
282
|
- - "~>"
|
199
283
|
- !ruby/object:Gem::Version
|
200
284
|
version: '1.0'
|
285
|
+
- !ruby/object:Gem::Dependency
|
286
|
+
name: stripe
|
287
|
+
requirement: !ruby/object:Gem::Requirement
|
288
|
+
requirements:
|
289
|
+
- - "<"
|
290
|
+
- !ruby/object:Gem::Version
|
291
|
+
version: '5.0'
|
292
|
+
type: :runtime
|
293
|
+
prerelease: false
|
294
|
+
version_requirements: !ruby/object:Gem::Requirement
|
295
|
+
requirements:
|
296
|
+
- - "<"
|
297
|
+
- !ruby/object:Gem::Version
|
298
|
+
version: '5.0'
|
201
299
|
- !ruby/object:Gem::Dependency
|
202
300
|
name: term-ansicolor
|
203
301
|
requirement: !ruby/object:Gem::Requirement
|
@@ -488,7 +586,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
488
586
|
- !ruby/object:Gem::Version
|
489
587
|
version: '0'
|
490
588
|
requirements: []
|
491
|
-
rubygems_version: 3.
|
589
|
+
rubygems_version: 3.1.6
|
492
590
|
signing_key:
|
493
591
|
specification_version: 4
|
494
592
|
summary: Command-line interface for Aptible services
|