Sha256: de931e412a2d3539d9a3b799ed84c937e2c28dda747c06ad389e5787d448594d

Contents?: true

Size: 552 Bytes

Versions: 44

Compression:

Stored size: 552 Bytes

Contents

module Kontena::Cli::Grids::TrustedSubnets
  class AddCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "SUBNET", "Trusted subnet"

    requires_current_master

    def execute
      grid = client.get("grids/#{current_grid}")
      data = {trusted_subnets: grid['trusted_subnets'] + [self.subnet]}
      spinner "Adding #{subnet.colorize(:cyan)} as a trusted subnet in #{current_grid.colorize(:cyan)} grid " do
        client.put("grids/#{current_grid}", data)
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
kontena-cli-1.4.3 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.1.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.3.5 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/grids/trusted_subnets/add_command.rb