aptible-api 1.2.8 → 1.2.13

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
- SHA1:
3
- metadata.gz: db84b979622af74b9365022a3b08e14ed210f0f4
4
- data.tar.gz: 2cf8c8fb5f07350d1ce0c63de7a83f6ba7d22629
2
+ SHA256:
3
+ metadata.gz: 0b57c1a6d2049fb2e1edb9bcd14afecd8502ca142e78dec0114ef685bfd6fd72
4
+ data.tar.gz: 0666abf930478a16660e70cc5f57c51b9be693bc6da976fa25e11eb1502e0580
5
5
  SHA512:
6
- metadata.gz: 5280782ffc9b2c1f5b2247802dc06737fe42c42f86aedf5264cb5e756af0299994591c2fca54aa98821b35025245c72aa0ed115b6d5590ac1d32c643fc5c037a
7
- data.tar.gz: 3291d012de8f5a10cf5732ecd9ed965121cd607e612932cf370a08e4fd2d7ffed3f9ede72b7e66833162b0d7bbf37f170406b5e0de59a76a6f506fa3b185ebb0
6
+ metadata.gz: 60453213ffcd4ad145b09782f7249e23cc66d5574cd73f58949340c0b905bfb0625977d3858b5e4de7af8e41420a961fbb308f08c1619008f47b7651f2ea8ae1
7
+ data.tar.gz: 98cc67ff26b323b7cd00363224bfa2739b2411f41806725c4fa492ddc5fed7e3b7aa381bddc4f19bedb922b459ce8c71ab048960f653abf58016e9f1c00157a7
@@ -0,0 +1,13 @@
1
+ module Aptible
2
+ module Api
3
+ class Ami < Resource
4
+ belongs_to :ami_release
5
+
6
+ field :id
7
+ field :ami_id
8
+ field :region
9
+ field :created_at, type: Time
10
+ field :updated_at, type: Time
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Aptible
2
+ module Api
3
+ class AmiRelease < Resource
4
+ embeds_many :amis
5
+
6
+ field :id
7
+ field :channel
8
+ field :current, type: Aptible::Resource::Boolean
9
+ field :created_at, type: Time
10
+ field :updated_at, type: Time
11
+ end
12
+ end
13
+ end
@@ -2,18 +2,31 @@ module Aptible
2
2
  module Api
3
3
  class AwsInstance < Resource
4
4
  belongs_to :stack
5
+ belongs_to :ami
5
6
  has_many :operations
7
+ has_many :instance_layer_memberships
6
8
  embeds_many :databases
7
9
 
8
10
  field :id
9
11
  field :instance_id
10
- field :ami
11
12
  field :instance_type
12
13
  field :availability_zone
13
14
  field :name
14
- field :layers
15
+ field :status
15
16
  field :created_at, type: Time
16
17
  field :updated_at, type: Time
18
+
19
+ def stack_layers
20
+ instance_layer_memberships.map(&:links)
21
+ .map(&:stack_layer)
22
+ .uniq(&:href)
23
+ .map(&:get)
24
+ end
25
+
26
+ # Layers as an array of strings
27
+ def layers
28
+ stack_layers.map(&:name)
29
+ end
17
30
  end
18
31
  end
19
32
  end
@@ -4,8 +4,9 @@ module Aptible
4
4
  belongs_to :account
5
5
  belongs_to :database
6
6
  belongs_to :database_image
7
- has_many :operations
7
+ belongs_to :created_from_operation
8
8
 
9
+ has_many :operations
9
10
  has_one :copied_from
10
11
  has_many :copies
11
12
 
@@ -0,0 +1,8 @@
1
+ module Aptible
2
+ module Api
3
+ class InstanceLayerMembership < Resource
4
+ belongs_to :stack_layer
5
+ belongs_to :aws_instance
6
+ end
7
+ end
8
+ end
@@ -8,6 +8,7 @@ module Aptible
8
8
 
9
9
  field :id
10
10
  field :handle
11
+ field :backend
11
12
  field :drain_type
12
13
  field :drain_host
13
14
  field :drain_port
@@ -15,6 +15,8 @@ module Aptible
15
15
  end
16
16
 
17
17
  require 'aptible/api/account'
18
+ require 'aptible/api/ami'
19
+ require 'aptible/api/ami_release'
18
20
  require 'aptible/api/app'
19
21
  require 'aptible/api/aws_instance'
20
22
  require 'aptible/api/backup'
@@ -25,6 +27,7 @@ require 'aptible/api/database'
25
27
  require 'aptible/api/database_image'
26
28
  require 'aptible/api/disk'
27
29
  require 'aptible/api/image'
30
+ require 'aptible/api/instance_layer_membership'
28
31
  require 'aptible/api/log_drain'
29
32
  require 'aptible/api/operation'
30
33
  require 'aptible/api/permission'
@@ -33,6 +36,7 @@ require 'aptible/api/service'
33
36
  require 'aptible/api/vhost'
34
37
  require 'aptible/api/ssh_portal_connection'
35
38
  require 'aptible/api/stack'
39
+ require 'aptible/api/stack_layer'
36
40
  require 'aptible/api/database_credential'
37
41
  require 'aptible/api/ephemeral_session'
38
42
  require 'aptible/api/ephemeral_container'
@@ -2,6 +2,8 @@ module Aptible
2
2
  module Api
3
3
  class Stack < Resource
4
4
  has_many :aws_instances
5
+ has_many :stack_layers
6
+ has_many :operations
5
7
 
6
8
  field :id
7
9
  field :type
@@ -16,6 +18,10 @@ module Aptible
16
18
  field :ssh_portal_port
17
19
  field :created_at, type: Time
18
20
  field :updated_at, type: Time
21
+
22
+ def dns_layers
23
+ stack_layers.reject! { |l| l.dns_name.blank? }
24
+ end
19
25
  end
20
26
  end
21
27
  end
@@ -0,0 +1,27 @@
1
+ module Aptible
2
+ module Api
3
+ class StackLayer < Resource
4
+ belongs_to :stack
5
+ belongs_to :lead_instance
6
+ has_many :instance_layer_memberships
7
+
8
+ field :id
9
+ field :name
10
+ field :opsworks_layer_id
11
+ field :lead_instance_hostname
12
+ field :dns, type: Aptible::Resource::Boolean
13
+ field :internal_only_dns, type: Aptible::Resource::Boolean
14
+ field :dns_name
15
+ field :dns_provisioned_instance_id
16
+ field :outbound, type: Aptible::Resource::Boolean
17
+ field :created_at, type: Time
18
+ field :updated_at, type: Time
19
+
20
+ def dns_provisioned?
21
+ !dns_provisioned_instance_id.nil? &&
22
+ !lead_instance.nil? &&
23
+ lead_instance.id == dns_provisioned_instance_id
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Api
3
- VERSION = '1.2.8'.freeze
3
+ VERSION = '1.2.13'.freeze
4
4
  end
5
5
  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.2.8
4
+ version: 1.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2021-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-auth
@@ -184,6 +184,8 @@ files:
184
184
  - lib/aptible/api.rb
185
185
  - lib/aptible/api/account.rb
186
186
  - lib/aptible/api/agent.rb
187
+ - lib/aptible/api/ami.rb
188
+ - lib/aptible/api/ami_release.rb
187
189
  - lib/aptible/api/app.rb
188
190
  - lib/aptible/api/aws_instance.rb
189
191
  - lib/aptible/api/backup.rb
@@ -198,6 +200,7 @@ files:
198
200
  - lib/aptible/api/ephemeral_container.rb
199
201
  - lib/aptible/api/ephemeral_session.rb
200
202
  - lib/aptible/api/image.rb
203
+ - lib/aptible/api/instance_layer_membership.rb
201
204
  - lib/aptible/api/log_drain.rb
202
205
  - lib/aptible/api/metric_drain.rb
203
206
  - lib/aptible/api/operation.rb
@@ -207,6 +210,7 @@ files:
207
210
  - lib/aptible/api/service.rb
208
211
  - lib/aptible/api/ssh_portal_connection.rb
209
212
  - lib/aptible/api/stack.rb
213
+ - lib/aptible/api/stack_layer.rb
210
214
  - lib/aptible/api/version.rb
211
215
  - lib/aptible/api/vhost.rb
212
216
  - spec/aptible/api/agent_spec.rb
@@ -219,7 +223,7 @@ homepage: https://github.com/aptible/aptible-api-ruby
219
223
  licenses:
220
224
  - MIT
221
225
  metadata: {}
222
- post_install_message:
226
+ post_install_message:
223
227
  rdoc_options: []
224
228
  require_paths:
225
229
  - lib
@@ -234,9 +238,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
238
  - !ruby/object:Gem::Version
235
239
  version: '0'
236
240
  requirements: []
237
- rubyforge_project:
238
- rubygems_version: 2.4.5.5
239
- signing_key:
241
+ rubygems_version: 3.0.9
242
+ signing_key:
240
243
  specification_version: 4
241
244
  summary: Ruby client for api.aptible.com
242
245
  test_files: