Sha256: f6fb01a311f73c3548f0625b6b313ce78314749f7a4aba1f6280d1f8221c560b

Contents?: true

Size: 634 Bytes

Versions: 11

Compression:

Stored size: 634 Bytes

Contents

module Kontena::Cli::Vpn
  class RemoveCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    option "--force", :flag, "Force remove", default: false, attribute_name: :forced

    def execute
      require_api_url
      token = require_token
      confirm unless forced?
      name = 'vpn'
      vpn = client(token).get("services/#{current_grid}/#{name}") rescue nil
      exit_with_error("#{name} service does not exist") if vpn.nil?

      spinner "Removing #{name.colorize(:cyan)} service " do
        client(token).delete("services/#{current_grid}/vpn")
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kontena-cli-0.16.3 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.3.rc1 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.2 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.2.rc1 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.1 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.1.rc3 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.1.rc2 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.1.rc1 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.0 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.0.rc3 lib/kontena/cli/vpn/remove_command.rb
kontena-cli-0.16.0.rc2 lib/kontena/cli/vpn/remove_command.rb