Class: NeetoDeploy::CLI::Processes::SetResources
- Defined in:
- lib/neeto_deploy/cli/processes/set_resources.rb
Constant Summary
Constants included from Session
Instance Attribute Summary collapse
-
#app_slug ⇒ Object
readonly
Returns the value of attribute app_slug.
-
#cpu ⇒ Object
readonly
Returns the value of attribute cpu.
-
#memory ⇒ Object
readonly
Returns the value of attribute memory.
-
#process_type ⇒ Object
readonly
Returns the value of attribute process_type.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options:) ⇒ SetResources
constructor
A new instance of SetResources.
- #run ⇒ Object
Methods included from Constants
Methods included from Session
#auth_headers, #console_executable_name, #json_auth_headers, #os, require_app_option, #send_delete_request, #send_get_request, #send_patch_request, #send_post_request
Methods inherited from Base
Constructor Details
#initialize(options:) ⇒ SetResources
Returns a new instance of SetResources.
15 16 17 18 19 20 21 |
# File 'lib/neeto_deploy/cli/processes/set_resources.rb', line 15 def initialize(options:) super() @app_slug = [:app] @process_type = [:process_type] @cpu = [:cpu] @memory = [:memory] end |
Instance Attribute Details
#app_slug ⇒ Object (readonly)
Returns the value of attribute app_slug.
13 14 15 |
# File 'lib/neeto_deploy/cli/processes/set_resources.rb', line 13 def app_slug @app_slug end |
#cpu ⇒ Object (readonly)
Returns the value of attribute cpu.
13 14 15 |
# File 'lib/neeto_deploy/cli/processes/set_resources.rb', line 13 def cpu @cpu end |
#memory ⇒ Object (readonly)
Returns the value of attribute memory.
13 14 15 |
# File 'lib/neeto_deploy/cli/processes/set_resources.rb', line 13 def memory @memory end |
#process_type ⇒ Object (readonly)
Returns the value of attribute process_type.
13 14 15 |
# File 'lib/neeto_deploy/cli/processes/set_resources.rb', line 13 def process_type @process_type end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/neeto_deploy/cli/processes/set_resources.rb', line 23 def run ui.execute_with_loading("Updating resources for #{process_type}...") do @response = send_patch_request( "#{process_url(process_type)}/set_resources", { app_slug:, cpu:, memory: }.compact ) end ui.error(@response["error"] || @response.) and return unless @response.success? ui.success(JSON.parse(@response.body)["message"]) end |