Class: NeetoDeploy::CLI::Redis::ResetStats
- Defined in:
- lib/neeto_deploy/cli/redis/reset_stats.rb
Constant Summary
Constants included from Constants
Constants::AVAILABLE_REDIS_CONFIGS_TO_EDIT, Constants::NEETO_DEPLOY_CLI_API_ADDONS_REDIS_URL
Instance Attribute Summary collapse
-
#addon_name ⇒ Object
readonly
Returns the value of attribute addon_name.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options) ⇒ ResetStats
constructor
A new instance of ResetStats.
- #run ⇒ Object
Methods included from Session
#common_body, require_app_option, #send_delete_request, #send_get_request, #send_patch_request, #send_post_request
Methods included from Constants
#available_configs_to_edit, #console_session_base_url, #redis_addon_url
Methods inherited from Base
Constructor Details
#initialize(options) ⇒ ResetStats
Returns a new instance of ResetStats.
16 17 18 19 |
# File 'lib/neeto_deploy/cli/redis/reset_stats.rb', line 16 def initialize() super() @addon_name = [:addon] end |
Instance Attribute Details
#addon_name ⇒ Object (readonly)
Returns the value of attribute addon_name.
14 15 16 |
# File 'lib/neeto_deploy/cli/redis/reset_stats.rb', line 14 def addon_name @addon_name end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/neeto_deploy/cli/redis/reset_stats.rb', line 21 def run if ui.yes?("Are you sure you want to reset the statistics (y/n)") response = send_patch_request( redis_addon_url, { addon_name:, command: "CONFIG RESETSTAT" } ) ui.error(response["error"]) and return unless response.success? ui.success("Stats reset successful.") else puts "Reset cancelled." end end |