aptible-api 1.10.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 451d4c1dda3a83ffea21ffbaf33d2385ef2ef8448633dcf283f75e517b1d8a03
4
- data.tar.gz: b96ca05454acffa9e91c7376763741472a921c15d7f78bb1a25714966c9bda04
3
+ metadata.gz: 3fda12c54dc7cba1dd90ff4fdfb14e03cb0dbc1b61c763a095e505510f72de30
4
+ data.tar.gz: bce7f98684c73e22d92632646c1b2c556918c332e67898211156a155bc95ad90
5
5
  SHA512:
6
- metadata.gz: d5a9b9f0ae9c6e879f599a82196b4bf8a086a3766e1cbcdfe2333d34d005f5997373bf13d36244886108faa23fb15fd336a7f140d390bce501477a52c40d9bfe
7
- data.tar.gz: 64af4b64434d12c06606caed8becbb5b9c5081c14603f24cfd200fc54f09e8e9237a4bbd192121f084e40d08649c8abf1c8ce03040f94bf4ad5379b17e6b6577
6
+ metadata.gz: 8270645847647f22457f05a4cb8ad865b435f1234fb87af3f88f2bf2d7e9b18a36b0f8c6708a63cfc23d77206d8f26360b9e8e51c096051c114117d0ca0016e7
7
+ data.tar.gz: c99d860a1153c4c24c6360aa285cab54842ac150609be252e8506a48714533b752a2971685948f9fefa1005c1ff272c6aaa8a71aeffbe7b784198361c8ab1944
@@ -17,24 +17,17 @@ jobs:
17
17
  strategy:
18
18
  fail-fast: false
19
19
  matrix:
20
- RUBY_VERSION: [2.1, 2.2, 2.3, 2.4, 2.5, 2.6]
20
+ RUBY_VERSION: [2.3, 2.4, 2.5, 2.6, 2.7, 3.1, 3.2, 3.3, 3.4]
21
+ env:
22
+ RUBY_VERSION: ${{ matrix.RUBY_VERSION }}
21
23
  steps:
22
24
  - name: Check out code
23
25
  uses: actions/checkout@v4
24
26
  with:
25
27
  persist-credentials: false
26
28
 
27
- - name: Install Ruby
28
- uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
29
- with:
30
- ruby-version: ${{ matrix.RUBY_VERSION }}
31
- bundler: 1.17.3
32
-
33
- - name: Bundle install
34
- run: bundle install
35
-
36
29
  - name: Rubocop
37
- run: bundle exec rake rubocop
30
+ run: make lint
38
31
 
39
32
  - name: Rspec
40
- run: bundle exec rspec
33
+ run: make test
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ /docker/ruby-*/
data/Dockerfile ADDED
@@ -0,0 +1,20 @@
1
+ ARG RUBY_VERSION=2.3.1
2
+ FROM ruby:${RUBY_VERSION}
3
+
4
+ ARG BUNDLER_VERSION=1.17.3
5
+ ENV BUNDLER_VERSION=${BUNDLER_VERSION}
6
+ RUN if [ "${BUNDLER_VERSION}" != "" ] ; then \
7
+ gem install bundler -v "${BUNDLER_VERSION}" ; \
8
+ fi
9
+
10
+ WORKDIR /app
11
+ COPY Gemfile /app/
12
+ COPY aptible-api.gemspec /app/
13
+ RUN mkdir -p /app/lib/aptible/api/
14
+ COPY lib/aptible/api/version.rb /app/lib/aptible/api/
15
+
16
+ RUN bundle install
17
+
18
+ COPY . /app
19
+
20
+ CMD ["bash"]
data/Gemfile CHANGED
@@ -1,10 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'pry',
4
- git: 'https://github.com/fancyremarker/pry.git',
5
- branch: 'aptible'
6
-
7
- gem 'activesupport', '~> 4.0'
3
+ # ActiveSupport version depends on Ruby version for compatibility
4
+ # ActiveSupport 4.x is incompatible with Ruby 2.7+ (BigDecimal.new removed)
5
+ if RUBY_VERSION < '2.7'
6
+ gem 'activesupport', '~> 4.0'
7
+ else
8
+ gem 'activesupport', '>= 5.2'
9
+ end
10
+ gem "irb", "~> 1.1"
8
11
 
9
12
  # Specify your gem's dependencies in aptible-api.gemspec
10
13
  gemspec
data/Makefile ADDED
@@ -0,0 +1,68 @@
1
+
2
+ export COMPOSE_IGNORE_ORPHANS ?= true
3
+ export RUBY_VERSION ?= 2.3.1
4
+ RUBY_VERSION_MAJOR = $(word 1,$(subst ., ,$(RUBY_VERSION)))
5
+ export BUNDLER_VERSION ?=
6
+ ifeq ($(BUNDLER_VERSION),)
7
+ ifeq ($(RUBY_VERSION_MAJOR),2)
8
+ export BUNDLER_VERSION = 1.17.3
9
+ endif
10
+ endif
11
+ PROJECT_NAME = $(shell ls *.gemspec | sed 's/\.gemspec//')
12
+ export COMPOSE_PROJECT_NAME ?= $(PROJECT_NAME)-$(subst .,_,$(RUBY_VERSION))
13
+
14
+ default: help
15
+
16
+ ## Show this help message
17
+ help:
18
+ @echo "\n\033[1;34mAvailable targets:\033[0m\n"
19
+ @awk 'BEGIN {FS = ":"; prev = ""} \
20
+ /^## / {prev = substr($$0, 4); next} \
21
+ /^[a-zA-Z_-]+:/ {if (prev != "") printf " \033[1;36m%-20s\033[0m %s\n", $$1, prev; prev = ""} \
22
+ {prev = ""}' $(MAKEFILE_LIST) | sort
23
+ @echo
24
+
25
+ BUILD_ARGS ?=
26
+ ## Build and pull docker compose images
27
+ build: gemfile-lock
28
+ docker compose build --pull $(BUILD_ARGS)
29
+
30
+ ## Create a Gemfile.lock specific to the container (i.e., for the ruby version)
31
+ gemfile-lock:
32
+ mkdir -pv ./docker/ruby-$(RUBY_VERSION)/ && \
33
+ echo '' > ./docker/ruby-$(RUBY_VERSION)/Gemfile.lock
34
+
35
+ ## Open shell in a docker container, supports CMD=
36
+ bash: build
37
+ $(MAKE) run CMD=bash
38
+
39
+ CMD ?= bash
40
+ ## Run command in a docker container, supports CMD=
41
+ run:
42
+ docker compose run --rm runner $(CMD)
43
+
44
+ ## Run tests in a docker container, supports ARGS=
45
+ test: build
46
+ $(MAKE) test-direct ARGS="$(ARGS)"
47
+
48
+ ## Run tests in a docker container without building, supports ARGS=
49
+ test-direct:
50
+ $(MAKE) run CMD="bundle exec rspec $(ARGS)"
51
+
52
+ ## Run rubocop in a docker container, supports ARGS=
53
+ lint: build
54
+ $(MAKE) lint-direct ARGS="$(ARGS)"
55
+
56
+ ## Run rubocop in a docker container without building, supports ARGS=
57
+ lint-direct:
58
+ $(MAKE) run CMD="bundle exec rake rubocop $(ARGS)"
59
+
60
+ ## Clean up docker compose resources
61
+ clean: clean-gemfile-lock
62
+ docker compose down --remove-orphans --volumes
63
+
64
+ ## Clean up the container specific Gemfile.lock
65
+ clean-gemfile-lock:
66
+ rm -v ./docker/ruby-$(RUBY_VERSION)/Gemfile.lock ||:
67
+
68
+ .PHONY: build bash test
data/Procfile CHANGED
@@ -1 +1 @@
1
- console: bundle exec pry -r aptible/api -r aptible/auth
1
+ console: bundle exec irb -r aptible/api -r aptible/auth
data/aptible-api.gemspec CHANGED
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_development_dependency 'activesupport'
29
29
  spec.add_development_dependency 'aptible-tasks', '>= 0.2.0'
30
- spec.add_development_dependency 'bundler', '~> 1.3'
31
30
  spec.add_development_dependency 'foreman'
32
31
  spec.add_development_dependency 'pry'
33
32
  spec.add_development_dependency 'rake', '~> 12.3.3'
@@ -0,0 +1,12 @@
1
+ services:
2
+ runner:
3
+ build:
4
+ context: .
5
+ args:
6
+ RUBY_VERSION: ${RUBY_VERSION:-2.3.1}
7
+ BUNDLER_VERSION: ${BUNDLER_VERSION:-}
8
+ volumes:
9
+ - type: bind
10
+ source: .
11
+ target: /app
12
+ - ./docker/ruby-${RUBY_VERSION}/Gemfile.lock:/app/Gemfile.lock
@@ -18,6 +18,7 @@ module Aptible
18
18
  has_many :vhosts
19
19
  has_many :service_sizing_policies
20
20
  has_many :backup_retention_policies
21
+ has_many :operations
21
22
  embeds_many :log_drains
22
23
 
23
24
  field :id
@@ -20,6 +20,7 @@ module Aptible
20
20
  has_many :service_definitions
21
21
  has_many :code_scan_results
22
22
  embeds_many :services
23
+ has_many :app_external_aws_rds_connections
23
24
 
24
25
  field :id
25
26
  field :handle
@@ -0,0 +1,15 @@
1
+ module Aptible
2
+ module Api
3
+ class AppExternalAwsRdsConnection < Resource
4
+ belongs_to :app
5
+ belongs_to :external_aws_resource
6
+ belongs_to :external_aws_account
7
+
8
+ field :id
9
+ field :database_name
10
+ field :database_user
11
+ field :created_at, type: Time
12
+ field :updated_at, type: Time
13
+ end
14
+ end
15
+ end
@@ -2,6 +2,7 @@ module Aptible
2
2
  module Api
3
3
  class ExternalAwsAccount < Resource
4
4
  has_many :external_aws_resources
5
+ has_many :app_external_aws_rds_connections
5
6
 
6
7
  field :id
7
8
  field :organization_id
@@ -0,0 +1,15 @@
1
+ module Aptible
2
+ module Api
3
+ class ExternalAwsDatabaseCredential < Resource
4
+ belongs_to :external_aws_resource
5
+ has_many :operations
6
+
7
+ field :id
8
+ field :type
9
+ field :default, type: Aptible::Resource::Boolean
10
+ field :connection_url
11
+ field :created_at, type: Time
12
+ field :updated_at, type: Time
13
+ end
14
+ end
15
+ end
@@ -2,6 +2,8 @@ module Aptible
2
2
  module Api
3
3
  class ExternalAwsResource < Resource
4
4
  belongs_to :external_aws_account
5
+ has_many :external_aws_database_credentials
6
+ has_many :app_external_aws_rds_connections
5
7
 
6
8
  field :id
7
9
  field :resource_type
@@ -59,3 +59,5 @@ require 'aptible/api/maintenance'
59
59
  require 'aptible/api/vpn_tunnel'
60
60
  require 'aptible/api/external_aws_account'
61
61
  require 'aptible/api/external_aws_resource'
62
+ require 'aptible/api/external_aws_database_credential'
63
+ require 'aptible/api/app_external_aws_rds_connection'
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Api
3
- VERSION = '1.10.0'.freeze
3
+ VERSION = '1.11.1'.freeze
4
4
  end
5
5
  end
@@ -48,7 +48,6 @@ describe Aptible::Api::Operation do
48
48
 
49
49
  it 'yields usable SSH connection arguments' do
50
50
  expect(subject).to receive(:create_ssh_portal_connection!)
51
- .with(ssh_public_key: 'some public key')
52
51
  .and_return(ssh_portal_connection)
53
52
 
54
53
  has_yielded = false
@@ -100,7 +99,6 @@ describe Aptible::Api::Operation do
100
99
 
101
100
  it 'allows passing a custom host' do
102
101
  expect(subject).to receive(:create_ssh_portal_connection!)
103
- .with(ssh_public_key: 'some public key')
104
102
  .and_return(ssh_portal_connection)
105
103
 
106
104
  has_yielded = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.1
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-05 00:00:00.000000000 Z
11
+ date: 2025-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-auth
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.2.0
97
- - !ruby/object:Gem::Dependency
98
- name: bundler
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '1.3'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '1.3'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: foreman
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -190,13 +176,16 @@ files:
190
176
  - ".github/workflows/zizmor.yaml"
191
177
  - ".gitignore"
192
178
  - ".rspec"
179
+ - Dockerfile
193
180
  - Gemfile
194
181
  - LICENSE.md
182
+ - Makefile
195
183
  - Procfile
196
184
  - README.md
197
185
  - Rakefile
198
186
  - SECURITY.md
199
187
  - aptible-api.gemspec
188
+ - docker-compose.yml
200
189
  - lib/aptible/api.rb
201
190
  - lib/aptible/api/account.rb
202
191
  - lib/aptible/api/active_plan.rb
@@ -204,6 +193,7 @@ files:
204
193
  - lib/aptible/api/ami.rb
205
194
  - lib/aptible/api/ami_release.rb
206
195
  - lib/aptible/api/app.rb
196
+ - lib/aptible/api/app_external_aws_rds_connection.rb
207
197
  - lib/aptible/api/aws_instance.rb
208
198
  - lib/aptible/api/backup.rb
209
199
  - lib/aptible/api/backup_retention_policy.rb
@@ -220,6 +210,7 @@ files:
220
210
  - lib/aptible/api/ephemeral_container.rb
221
211
  - lib/aptible/api/ephemeral_session.rb
222
212
  - lib/aptible/api/external_aws_account.rb
213
+ - lib/aptible/api/external_aws_database_credential.rb
223
214
  - lib/aptible/api/external_aws_resource.rb
224
215
  - lib/aptible/api/image.rb
225
216
  - lib/aptible/api/instance_layer_membership.rb
@@ -271,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
262
  - !ruby/object:Gem::Version
272
263
  version: '0'
273
264
  requirements: []
274
- rubygems_version: 3.1.6
265
+ rubygems_version: 3.5.22
275
266
  signing_key:
276
267
  specification_version: 4
277
268
  summary: Ruby client for api.aptible.com