diff --git a/lib/aptible/api/account.rb b/lib/aptible/api/account.rb index b8b310d..956bb6f 100644 --- a/lib/aptible/api/account.rb +++ b/lib/aptible/api/account.rb @@ -17,6 +17,7 @@ class Account < Resource has_many :metric_drains has_many :vhosts has_many :backup_retention_policies + has_many :service_sizing_policies embeds_many :log_drains field :id diff --git a/lib/aptible/api/resource.rb b/lib/aptible/api/resource.rb index 08890d5..d372d35 100644 --- a/lib/aptible/api/resource.rb +++ b/lib/aptible/api/resource.rb @@ -35,6 +35,7 @@ def root_url require 'aptible/api/permission' require 'aptible/api/release' require 'aptible/api/service' +require 'aptible/api/service_sizing_policy' require 'aptible/api/source' require 'aptible/api/vhost' require 'aptible/api/ssh_portal_connection' diff --git a/lib/aptible/api/service.rb b/lib/aptible/api/service.rb index 42fd0ad..e418527 100644 --- a/lib/aptible/api/service.rb +++ b/lib/aptible/api/service.rb @@ -9,6 +9,7 @@ class Service < Resource has_many :operations has_many :releases has_many :disk_attachments + has_one :service_sizing_policy field :id field :handle diff --git a/lib/aptible/api/service_sizing_policy.rb b/lib/aptible/api/service_sizing_policy.rb new file mode 100644 index 0000000..5b00c60 --- /dev/null +++ b/lib/aptible/api/service_sizing_policy.rb @@ -0,0 +1,33 @@ +module Aptible + module Api + class ServiceSizingPolicy < Resource + belongs_to :account + has_many :services + + field :id + field :created_at, type: Time + field :updated_at, type: Time + + field :scaling_enabled + field :default_policy + field :metric_lookback_seconds + field :percentile + field :post_scale_up_cooldown_seconds + field :post_scale_down_cooldown_seconds + field :post_release_cooldown_seconds + field :mem_cpu_ratio_r_threshold + field :mem_cpu_ratio_c_threshold + field :mem_scale_up_threshold + field :mem_scale_down_threshold + field :minimum_memory + field :disable_recommendations + field :maximum_memory + field :cpu_consideration_threshold + field :autoscaling + field :min_cpu_threshold + field :max_cpu_threshold + field :min_containers + field :max_containers + end + end +end