aptible-api 1.6.2 → 1.6.4

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: 4b778bf30999354b757f77b34d308aa887247690887200f4c07db535ae3d96d2
4
- data.tar.gz: 0ab7b9c71ad45923e1654cdb67aff645fc48860780249dfcea93b5b0582725b3
3
+ metadata.gz: b0b7e13ed899f14bc07324d8ef60ce88db511ca821057b7051027a4843ad89ba
4
+ data.tar.gz: 3ad1f7b3abf3657ec98740d0f4ff28b898349a286a2d0e98497b01cd9eeafb6c
5
5
  SHA512:
6
- metadata.gz: 919cc38741971674af187de5e0434f5a452a4c0a9274e0291b80ff4d64064723d63718519514237fb84116ed7f4e7c8e690f8cbab8a88ffd5c284c9acebeef88
7
- data.tar.gz: 9b17b4586b01f85842fdc1aea7953495ddf33d6aefa9b1a98b5fefdb1ee53a34f81d794dbfa709fe92dc9e46050abe2ef3fc28d4bdcafdbd4b286d79c56c37fc
6
+ metadata.gz: dafe94ab681bfd13fa0b4fb36d855c44a13fe7c4004d46d93da01f302e0238575050a74f46825eba71204b53dfccb494de7bfdb2f8ace16c0960ed4024d6b8d7
7
+ data.tar.gz: 8cdf5c4c6267ee97a80a5e499f72abba2d95f6a376a04781332e8e9abf068afd51d154c4252357456bef99601e738382a6628a64a0c56f34a4cba2b3279b97d1
@@ -17,6 +17,7 @@ module Aptible
17
17
  has_many :metric_drains
18
18
  has_many :vhosts
19
19
  has_many :backup_retention_policies
20
+ has_many :service_sizing_policies
20
21
  embeds_many :log_drains
21
22
 
22
23
  field :id
@@ -25,6 +25,7 @@ module Aptible
25
25
  field :status
26
26
  field :docker_repo
27
27
  field :port_mapping
28
+ field :logical_replica
28
29
 
29
30
  def failed?
30
31
  # TODO: Add failed status at API level
@@ -35,6 +35,7 @@ require 'aptible/api/operation'
35
35
  require 'aptible/api/permission'
36
36
  require 'aptible/api/release'
37
37
  require 'aptible/api/service'
38
+ require 'aptible/api/service_sizing_policy'
38
39
  require 'aptible/api/source'
39
40
  require 'aptible/api/vhost'
40
41
  require 'aptible/api/ssh_portal_connection'
@@ -9,6 +9,7 @@ module Aptible
9
9
  has_many :operations
10
10
  has_many :releases
11
11
  has_many :disk_attachments
12
+ has_one :service_sizing_policy
12
13
 
13
14
  field :id
14
15
  field :handle
@@ -21,6 +22,21 @@ module Aptible
21
22
  field :instance_class
22
23
  field :created_at, type: Time
23
24
  field :updated_at, type: Time
25
+
26
+ def create_service_sizing_policy!(params)
27
+ params = { token: token }.merge(params)
28
+
29
+ # First create a link object so we know where to go
30
+ link = HyperResource::Link.new(
31
+ self,
32
+ 'href' => "#{href}/service_sizing_policies"
33
+ )
34
+
35
+ # Now create the policy
36
+ link.create(
37
+ self.class.normalize_params(params)
38
+ )
39
+ end
24
40
  end
25
41
  end
26
42
  end
@@ -0,0 +1,33 @@
1
+ module Aptible
2
+ module Api
3
+ class ServiceSizingPolicy < Resource
4
+ belongs_to :account
5
+ has_many :services
6
+
7
+ field :id
8
+ field :created_at, type: Time
9
+ field :updated_at, type: Time
10
+
11
+ field :scaling_enabled
12
+ field :default_policy
13
+ field :metric_lookback_seconds
14
+ field :percentile
15
+ field :post_scale_up_cooldown_seconds
16
+ field :post_scale_down_cooldown_seconds
17
+ field :post_release_cooldown_seconds
18
+ field :mem_cpu_ratio_r_threshold
19
+ field :mem_cpu_ratio_c_threshold
20
+ field :mem_scale_up_threshold
21
+ field :mem_scale_down_threshold
22
+ field :minimum_memory
23
+ field :disable_recommendations
24
+ field :maximum_memory
25
+ field :cpu_consideration_threshold
26
+ field :autoscaling
27
+ field :min_cpu_threshold
28
+ field :max_cpu_threshold
29
+ field :min_containers
30
+ field :max_containers
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Api
3
- VERSION = '1.6.2'.freeze
3
+ VERSION = '1.6.4'.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.6.2
4
+ version: 1.6.4
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: 2024-08-09 00:00:00.000000000 Z
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-auth
@@ -233,6 +233,7 @@ files:
233
233
  - lib/aptible/api/resource.rb
234
234
  - lib/aptible/api/service.rb
235
235
  - lib/aptible/api/service_definition.rb
236
+ - lib/aptible/api/service_sizing_policy.rb
236
237
  - lib/aptible/api/source.rb
237
238
  - lib/aptible/api/ssh_portal_connection.rb
238
239
  - lib/aptible/api/stack.rb
@@ -250,7 +251,7 @@ homepage: https://github.com/aptible/aptible-api-ruby
250
251
  licenses:
251
252
  - MIT
252
253
  metadata: {}
253
- post_install_message:
254
+ post_install_message:
254
255
  rdoc_options: []
255
256
  require_paths:
256
257
  - lib
@@ -265,8 +266,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
266
  - !ruby/object:Gem::Version
266
267
  version: '0'
267
268
  requirements: []
268
- rubygems_version: 3.0.3.1
269
- signing_key:
269
+ rubygems_version: 3.1.6
270
+ signing_key:
270
271
  specification_version: 4
271
272
  summary: Ruby client for api.aptible.com
272
273
  test_files: