aptible-api 1.11.2 → 1.12.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 +4 -4
- data/.github/workflows/release.yml +26 -0
- data/Makefile +6 -0
- data/lib/aptible/api/external_aws_account.rb +17 -0
- data/lib/aptible/api/external_aws_account_check_response.rb +22 -0
- data/lib/aptible/api/resource.rb +1 -0
- data/lib/aptible/api/version.rb +1 -1
- data/spec/aptible/api_spec.rb +7 -2
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9910c8efe22b593a4ab715dcea75247f0703d984e864f7f6888d4916c40de30
|
|
4
|
+
data.tar.gz: a446645cac918facfaec2bd9c1fb5369290725ae5fe10f4dc6cce20bf611cd21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f29fdb1ca9418cf3f46d68a8ee40c0cd2f05771ab0dc790ef2f33ecbd34403eec48ba9162309edd09166aeddf0c6add99d7098e2c955035459c3ccfe0c06d6e7
|
|
7
|
+
data.tar.gz: b92c2c3a0990e686528a44922ac1f2cde63edde2c8bf499bccd3510650725c736901b42426cfe9d3ecb523469cf3e271d60c9686ccdebcd6bd5230fb625eb45b
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
on:
|
|
2
|
+
release:
|
|
3
|
+
types: [published]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
push:
|
|
7
|
+
name: Push gem to RubyGems.org
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
id-token: write
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
|
16
|
+
with:
|
|
17
|
+
persist-credentials: false
|
|
18
|
+
- name: Set up Ruby
|
|
19
|
+
uses: ruby/setup-ruby@211ffaaa5f8dda97e9e8bca4e70d0fbaf2f8c41c
|
|
20
|
+
with:
|
|
21
|
+
bundler-cache: false
|
|
22
|
+
ruby-version: "3.3"
|
|
23
|
+
|
|
24
|
+
- run: bundle install
|
|
25
|
+
|
|
26
|
+
- uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b
|
data/Makefile
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
export COMPOSE_IGNORE_ORPHANS ?= true
|
|
3
3
|
export RUBY_VERSION ?= 2.3.1
|
|
4
4
|
RUBY_VERSION_MAJOR = $(word 1,$(subst ., ,$(RUBY_VERSION)))
|
|
5
|
+
RUBY_VERSION_MINOR = $(word 2,$(subst ., ,$(RUBY_VERSION)))
|
|
5
6
|
export BUNDLER_VERSION ?=
|
|
6
7
|
ifeq ($(BUNDLER_VERSION),)
|
|
7
8
|
ifeq ($(RUBY_VERSION_MAJOR),2)
|
|
9
|
+
# Use old bundler for Ruby 2.3-2.6; Ruby 2.7 needs bundler 2.x to avoid resolver bugs
|
|
10
|
+
ifeq ($(RUBY_VERSION_MINOR),7)
|
|
11
|
+
export BUNDLER_VERSION = 2.4.22
|
|
12
|
+
else
|
|
8
13
|
export BUNDLER_VERSION = 1.17.3
|
|
9
14
|
endif
|
|
10
15
|
endif
|
|
16
|
+
endif
|
|
11
17
|
PROJECT_NAME = $(shell ls *.gemspec | sed 's/\.gemspec//')
|
|
12
18
|
export COMPOSE_PROJECT_NAME ?= $(PROJECT_NAME)-$(subst .,_,$(RUBY_VERSION))
|
|
13
19
|
|
|
@@ -27,6 +27,23 @@ module Aptible
|
|
|
27
27
|
auth = Aptible::Auth::Organization.new(token: token, headers: headers)
|
|
28
28
|
@organization = auth.find_by_url(organization_url)
|
|
29
29
|
end
|
|
30
|
+
|
|
31
|
+
def check!
|
|
32
|
+
response = HyperResource::Link.new(
|
|
33
|
+
self,
|
|
34
|
+
'href' => "#{href}/check"
|
|
35
|
+
).get
|
|
36
|
+
ExternalAwsAccountCheckResponse.new(
|
|
37
|
+
state: response.attributes['state'],
|
|
38
|
+
checks: (response.attributes['checks'] || []).map do |c|
|
|
39
|
+
ExternalAwsAccountCheck.new(
|
|
40
|
+
check_name: c['check_name'],
|
|
41
|
+
state: c['state'],
|
|
42
|
+
details: c['details']
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
)
|
|
46
|
+
end
|
|
30
47
|
end
|
|
31
48
|
end
|
|
32
49
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Aptible
|
|
2
|
+
module Api
|
|
3
|
+
class ExternalAwsAccountCheckResponse
|
|
4
|
+
attr_reader :state, :checks
|
|
5
|
+
|
|
6
|
+
def initialize(state:, checks:)
|
|
7
|
+
@state = state
|
|
8
|
+
@checks = checks
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class ExternalAwsAccountCheck
|
|
13
|
+
attr_reader :check_name, :state, :details
|
|
14
|
+
|
|
15
|
+
def initialize(check_name:, state:, details:)
|
|
16
|
+
@check_name = check_name
|
|
17
|
+
@state = state
|
|
18
|
+
@details = details
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/lib/aptible/api/resource.rb
CHANGED
|
@@ -58,6 +58,7 @@ require 'aptible/api/persistent_disk'
|
|
|
58
58
|
require 'aptible/api/disk_attachment'
|
|
59
59
|
require 'aptible/api/maintenance'
|
|
60
60
|
require 'aptible/api/vpn_tunnel'
|
|
61
|
+
require 'aptible/api/external_aws_account_check_response'
|
|
61
62
|
require 'aptible/api/external_aws_account'
|
|
62
63
|
require 'aptible/api/external_aws_resource'
|
|
63
64
|
require 'aptible/api/external_aws_database_credential'
|
data/lib/aptible/api/version.rb
CHANGED
data/spec/aptible/api_spec.rb
CHANGED
|
@@ -6,12 +6,17 @@ describe Aptible::Api do
|
|
|
6
6
|
it 'should have a configurable root_url' do
|
|
7
7
|
config = described_class.configuration
|
|
8
8
|
expect(config).to be_a GemConfig::Configuration
|
|
9
|
-
|
|
9
|
+
with_env 'APTIBLE_API_ROOT_URL', nil do
|
|
10
|
+
load 'aptible/api.rb'
|
|
11
|
+
config.reset
|
|
12
|
+
expect(config.root_url).to eq 'https://api.aptible.com'
|
|
13
|
+
end
|
|
10
14
|
end
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
it 'uses ENV["APTIBLE_API_ROOT_URL"] if defined' do
|
|
13
17
|
config = described_class.configuration
|
|
14
18
|
with_env 'APTIBLE_API_ROOT_URL', 'http://foobar.com' do
|
|
19
|
+
load 'aptible/api.rb'
|
|
15
20
|
config.reset
|
|
16
21
|
expect(config.root_url).to eq 'http://foobar.com'
|
|
17
22
|
end
|
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.
|
|
4
|
+
version: 1.12.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-12-
|
|
11
|
+
date: 2025-12-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aptible-auth
|
|
@@ -173,6 +173,7 @@ extra_rdoc_files: []
|
|
|
173
173
|
files:
|
|
174
174
|
- ".github/CODEOWNERS"
|
|
175
175
|
- ".github/workflows/ci.yml"
|
|
176
|
+
- ".github/workflows/release.yml"
|
|
176
177
|
- ".github/workflows/zizmor.yaml"
|
|
177
178
|
- ".gitignore"
|
|
178
179
|
- ".rspec"
|
|
@@ -211,6 +212,7 @@ files:
|
|
|
211
212
|
- lib/aptible/api/ephemeral_container.rb
|
|
212
213
|
- lib/aptible/api/ephemeral_session.rb
|
|
213
214
|
- lib/aptible/api/external_aws_account.rb
|
|
215
|
+
- lib/aptible/api/external_aws_account_check_response.rb
|
|
214
216
|
- lib/aptible/api/external_aws_database_credential.rb
|
|
215
217
|
- lib/aptible/api/external_aws_resource.rb
|
|
216
218
|
- lib/aptible/api/image.rb
|
|
@@ -263,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
263
265
|
- !ruby/object:Gem::Version
|
|
264
266
|
version: '0'
|
|
265
267
|
requirements: []
|
|
266
|
-
rubygems_version: 3.
|
|
268
|
+
rubygems_version: 3.5.22
|
|
267
269
|
signing_key:
|
|
268
270
|
specification_version: 4
|
|
269
271
|
summary: Ruby client for api.aptible.com
|