aptible-cli 0.25.0 → 0.26.2
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/.github/workflows/release.yml +27 -0
- data/.github/workflows/test.yml +1 -1
- data/Dockerfile +8 -5
- data/Gemfile.lock +28 -17
- data/Makefile +53 -2
- data/README.md +83 -82
- data/aptible-cli.gemspec +5 -2
- data/docker-compose.yml +5 -1
- data/lib/aptible/cli/agent.rb +16 -0
- data/lib/aptible/cli/helpers/aws_account.rb +158 -0
- data/lib/aptible/cli/helpers/database.rb +182 -2
- data/lib/aptible/cli/helpers/token.rb +14 -0
- data/lib/aptible/cli/renderer/text.rb +33 -2
- data/lib/aptible/cli/resource_formatter.rb +2 -2
- data/lib/aptible/cli/subcommands/apps.rb +2 -2
- data/lib/aptible/cli/subcommands/aws_accounts.rb +252 -0
- data/lib/aptible/cli/subcommands/config.rb +6 -6
- data/lib/aptible/cli/subcommands/db.rb +67 -3
- data/lib/aptible/cli/subcommands/deploy.rb +46 -12
- data/lib/aptible/cli/subcommands/organizations.rb +55 -0
- data/lib/aptible/cli/subcommands/rebuild.rb +2 -1
- data/lib/aptible/cli/subcommands/restart.rb +2 -1
- data/lib/aptible/cli/subcommands/services.rb +24 -12
- data/lib/aptible/cli/subcommands/ssh.rb +1 -1
- data/lib/aptible/cli/version.rb +1 -1
- data/spec/aptible/cli/agent_spec.rb +70 -0
- data/spec/aptible/cli/helpers/database_spec.rb +118 -0
- data/spec/aptible/cli/helpers/token_spec.rb +70 -0
- data/spec/aptible/cli/subcommands/db_spec.rb +553 -0
- data/spec/aptible/cli/subcommands/deploy_spec.rb +42 -7
- data/spec/aptible/cli/subcommands/external_aws_accounts_spec.rb +737 -0
- data/spec/aptible/cli/subcommands/organizations_spec.rb +90 -0
- data/spec/aptible/cli/subcommands/services_spec.rb +77 -0
- data/spec/fabricators/app_external_aws_rds_connection_fabricator.rb +55 -0
- data/spec/fabricators/external_aws_account_fabricator.rb +49 -0
- data/spec/fabricators/external_aws_database_credential_fabricator.rb +46 -0
- data/spec/fabricators/external_aws_resource_fabricator.rb +72 -0
- metadata +65 -7
data/README.md
CHANGED
|
@@ -26,88 +26,89 @@ From `aptible help`:
|
|
|
26
26
|
<!-- BEGIN USAGE -->
|
|
27
27
|
```
|
|
28
28
|
Commands:
|
|
29
|
-
aptible apps
|
|
30
|
-
aptible apps:create HANDLE
|
|
31
|
-
aptible apps:deprovision # Deprovision an app
|
|
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] # Scale a service
|
|
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 # 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
|
|
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] [...] # Deploy an app
|
|
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:solarwinds HANDLE --host SWO_HOSTNAME --token SWO_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]
|
|
85
|
-
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]
|
|
86
|
-
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]
|
|
87
|
-
aptible log_drain:deprovision HANDLE --environment ENVIRONMENT
|
|
88
|
-
aptible log_drain:list
|
|
89
|
-
aptible login
|
|
90
|
-
aptible logs [--app APP | --database DATABASE]
|
|
91
|
-
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
|
|
92
|
-
aptible maintenance:apps
|
|
93
|
-
aptible maintenance:dbs
|
|
94
|
-
aptible metric_drain:create:datadog HANDLE --api_key DATADOG_API_KEY --site DATADOG_SITE --environment ENVIRONMENT
|
|
95
|
-
aptible metric_drain:create:influxdb HANDLE --db DATABASE_HANDLE --environment ENVIRONMENT
|
|
96
|
-
aptible metric_drain:create:influxdb:custom HANDLE --username USERNAME --password PASSWORD --url URL_INCLUDING_PORT --db INFLUX_DATABASE_NAME --environment ENVIRONMENT
|
|
97
|
-
aptible metric_drain:create:influxdb:customv2 HANDLE --org ORGANIZATION --token INFLUX_TOKEN --url URL_INCLUDING_PORT --bucket INFLUX_BUCKET_NAME --environment ENVIRONMENT
|
|
98
|
-
aptible metric_drain:deprovision HANDLE --environment ENVIRONMENT
|
|
99
|
-
aptible metric_drain:list
|
|
100
|
-
aptible operation:cancel OPERATION_ID
|
|
101
|
-
aptible operation:follow OPERATION_ID
|
|
102
|
-
aptible operation:logs OPERATION_ID
|
|
103
|
-
aptible
|
|
104
|
-
aptible
|
|
105
|
-
aptible
|
|
106
|
-
aptible services
|
|
107
|
-
aptible services:autoscaling_policy
|
|
108
|
-
aptible services:
|
|
109
|
-
aptible
|
|
110
|
-
aptible
|
|
29
|
+
aptible apps # List all applications
|
|
30
|
+
aptible apps:create HANDLE # Create a new application
|
|
31
|
+
aptible apps:deprovision [--app APP] # 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 [--app APP] 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 [--app APP] # Print an app's current configuration
|
|
41
|
+
aptible config:add [--app APP] [VAR1=VAL1] [VAR2=VAL2] [...] # Add an ENV variable to an app
|
|
42
|
+
aptible config:get [--app APP] [VAR1] # Print a specific key within an app's current configuration
|
|
43
|
+
aptible config:rm [--app APP] [VAR1] [VAR2] [...] # Remove an ENV variable from an app
|
|
44
|
+
aptible config:set [--app APP] [VAR1=VAL1] [VAR2=VAL2] [...] # Add an ENV variable to an app
|
|
45
|
+
aptible config:unset [--app APP] [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 [--app APP] [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:solarwinds HANDLE --host SWO_HOSTNAME --token SWO_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 SolarWinds Log Drain. By default, App, Database, Ephemeral Session, and Proxy logs will be sent to your chosen destination.
|
|
85
|
+
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.
|
|
86
|
+
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.
|
|
87
|
+
aptible log_drain:deprovision HANDLE --environment ENVIRONMENT # Deprovisions a log drain
|
|
88
|
+
aptible log_drain:list # List all Log Drains
|
|
89
|
+
aptible login # Log in to Aptible
|
|
90
|
+
aptible logs [--app APP | --database DATABASE] # Follows logs from a running app or database
|
|
91
|
+
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
|
|
92
|
+
aptible maintenance:apps # List Apps impacted by maintenance schedules where restarts are required
|
|
93
|
+
aptible maintenance:dbs # List Databases impacted by maintenance schedules where restarts are required
|
|
94
|
+
aptible metric_drain:create:datadog HANDLE --api_key DATADOG_API_KEY --site DATADOG_SITE --environment ENVIRONMENT # Create a Datadog Metric Drain
|
|
95
|
+
aptible metric_drain:create:influxdb HANDLE --db DATABASE_HANDLE --environment ENVIRONMENT # Create an InfluxDB Metric Drain
|
|
96
|
+
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
|
|
97
|
+
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
|
|
98
|
+
aptible metric_drain:deprovision HANDLE --environment ENVIRONMENT # Deprovisions a Metric Drain
|
|
99
|
+
aptible metric_drain:list # List all Metric Drains
|
|
100
|
+
aptible operation:cancel OPERATION_ID # Cancel a running operation
|
|
101
|
+
aptible operation:follow OPERATION_ID # Follow logs of a running operation
|
|
102
|
+
aptible operation:logs OPERATION_ID # View logs for given operation
|
|
103
|
+
aptible organizations # List all organizations
|
|
104
|
+
aptible rebuild [--app APP] # Rebuild an app, and restart its services
|
|
105
|
+
aptible restart [--app APP] # Restart all services associated with an app
|
|
106
|
+
aptible services [--app APP] # List Services for an App
|
|
107
|
+
aptible services:autoscaling_policy [--app APP] SERVICE # Returns the associated sizing policy, if any
|
|
108
|
+
aptible services:autoscaling_policy:set [--app APP] 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.
|
|
109
|
+
aptible services:settings [--app APP] SERVICE [--force-zero-downtime|--no-force-zero-downtime] [--simple-health-check|--no-simple-health-check] [--restart-free-scaling|--no-restart-free-scaling] [--stop-timeout SECONDS] # Modifies the deployment settings for a service
|
|
110
|
+
aptible ssh [--app APP] [COMMAND] # Run a command against an app
|
|
111
|
+
aptible version # Print Aptible CLI version
|
|
111
112
|
```
|
|
112
113
|
<!-- END USAGE -->
|
|
113
114
|
|
data/aptible-cli.gemspec
CHANGED
|
@@ -21,8 +21,8 @@ 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.
|
|
25
|
-
spec.add_dependency 'aptible-auth', '~> 1.
|
|
24
|
+
spec.add_dependency 'aptible-api', '~> 1.12'
|
|
25
|
+
spec.add_dependency 'aptible-auth', '~> 1.4'
|
|
26
26
|
spec.add_dependency 'aptible-billing', '~> 1.0'
|
|
27
27
|
spec.add_dependency 'aptible-resource', '~> 1.1'
|
|
28
28
|
spec.add_dependency 'aws-eventstream', '~> 1.1.1'
|
|
@@ -54,4 +54,7 @@ Gem::Specification.new do |spec|
|
|
|
54
54
|
spec.add_development_dependency 'pry'
|
|
55
55
|
spec.add_development_dependency 'climate_control', '= 0.0.3'
|
|
56
56
|
spec.add_development_dependency 'fabrication', '~> 2.15.2'
|
|
57
|
+
spec.add_development_dependency 'httplog', '< 1.6'
|
|
58
|
+
spec.add_development_dependency 'minitest', '< 5.16'
|
|
59
|
+
spec.add_development_dependency 'hashie', '< 5.1'
|
|
57
60
|
end
|
data/docker-compose.yml
CHANGED
data/lib/aptible/cli/agent.rb
CHANGED
|
@@ -26,6 +26,7 @@ require_relative 'helpers/metric_drain'
|
|
|
26
26
|
require_relative 'helpers/date_helpers'
|
|
27
27
|
require_relative 'helpers/s3_log_helpers'
|
|
28
28
|
require_relative 'helpers/maintenance'
|
|
29
|
+
require_relative 'helpers/aws_account'
|
|
29
30
|
|
|
30
31
|
require_relative 'subcommands/apps'
|
|
31
32
|
require_relative 'subcommands/config'
|
|
@@ -45,6 +46,8 @@ require_relative 'subcommands/log_drain'
|
|
|
45
46
|
require_relative 'subcommands/metric_drain'
|
|
46
47
|
require_relative 'subcommands/maintenance'
|
|
47
48
|
require_relative 'subcommands/backup_retention_policy'
|
|
49
|
+
require_relative 'subcommands/aws_accounts'
|
|
50
|
+
require_relative 'subcommands/organizations'
|
|
48
51
|
|
|
49
52
|
module Aptible
|
|
50
53
|
module CLI
|
|
@@ -74,6 +77,8 @@ module Aptible
|
|
|
74
77
|
include Subcommands::MetricDrain
|
|
75
78
|
include Subcommands::Maintenance
|
|
76
79
|
include Subcommands::BackupRetentionPolicy
|
|
80
|
+
include Subcommands::AwsAccounts
|
|
81
|
+
include Subcommands::Organizations
|
|
77
82
|
|
|
78
83
|
# Forward return codes on failures.
|
|
79
84
|
def self.exit_on_failure?
|
|
@@ -87,6 +92,10 @@ module Aptible
|
|
|
87
92
|
level = Logger::WARN
|
|
88
93
|
debug_level = ENV['APTIBLE_DEBUG']
|
|
89
94
|
level = debug_level if debug_level
|
|
95
|
+
require 'httplog' if ENV['BUNDLER_VERSION'] && \
|
|
96
|
+
ENV['APTIBLE_LOG_HTTP_REQUEST_RESPONSE'] && \
|
|
97
|
+
!ENV['APTIBLE_LOG_HTTP_REQUEST_RESPONSE'] \
|
|
98
|
+
.downcase.start_with?('f')
|
|
90
99
|
conf.logger.tap { |l| l.level = level }
|
|
91
100
|
end
|
|
92
101
|
warn_sso_enforcement
|
|
@@ -156,6 +165,13 @@ module Aptible
|
|
|
156
165
|
|
|
157
166
|
u2f = (e.response.parsed['exception_context'] || {})['u2f']
|
|
158
167
|
|
|
168
|
+
failed_login_attempt_id = e.response.parsed.dig(
|
|
169
|
+
'exception_context', 'failed_login_attempt_id'
|
|
170
|
+
)
|
|
171
|
+
if failed_login_attempt_id
|
|
172
|
+
token_options[:previous_login_attempt_id] = failed_login_attempt_id
|
|
173
|
+
end
|
|
174
|
+
|
|
159
175
|
q = Queue.new
|
|
160
176
|
mfa_threads = []
|
|
161
177
|
|