Sha256: 5d8932be1d33fc4ce59d312e8a7f778f078d76aa3a4d1d9e3b2162f98a8ee59d

Contents?: true

Size: 886 Bytes

Versions: 5

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true

require "thor"
require_relative "../session"
require_relative "./constants"

module NeetoDeploy
  class CLI
    module Redis
      class ResetStats < CLI::Base
        include Constants
        include Session

        attr_reader :addon_name

        def initialize(options)
          super()
          @addon_name = options[:addon_name]
        end

        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
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
neetodeploy-1.1.10 lib/neeto_deploy/cli/redis/reset_stats.rb
neetodeploy-1.1.9 lib/neeto_deploy/cli/redis/reset_stats.rb
neetodeploy-1.1.8 lib/neeto_deploy/cli/redis/reset_stats.rb
neetodeploy-1.1.7 lib/neeto_deploy/cli/redis/reset_stats.rb
neetodeploy-1.1.6 lib/neeto_deploy/cli/redis/reset_stats.rb