aptible-api 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8cc528901ec30b1988a8180773652503e06da040e80ba8fe8e504cc49d57bf8
4
- data.tar.gz: e1bf404cddd059e109d0f293ceb7abb74ca63e2933adf1375420dc8e05467483
3
+ metadata.gz: b0b7e13ed899f14bc07324d8ef60ce88db511ca821057b7051027a4843ad89ba
4
+ data.tar.gz: 3ad1f7b3abf3657ec98740d0f4ff28b898349a286a2d0e98497b01cd9eeafb6c
5
5
  SHA512:
6
- metadata.gz: f331dbfe536de347378c68b7a471ab6272f8557a56ffdad49963faed14841c5251aa57b9e376b42fbbd49a3f213b70569b5f31a18ded26cc3eca4f2729871017
7
- data.tar.gz: fb6e0fa361a89924535945d4583bb1aa01b07112df824f63931d9955dcf814f8594fbbad5e425e9e1b5e37a3dd84565d18c09f5aed401b2e1f91e303ded32f6e
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
@@ -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.3'.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.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-21 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
@@ -265,7 +266,7 @@ 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
+ rubygems_version: 3.1.6
269
270
  signing_key:
270
271
  specification_version: 4
271
272
  summary: Ruby client for api.aptible.com