Sha256: e1b617b95cd504a8258abe0e98259afc1908b23e443d34185a3e526d3ddd6b84

Contents?: true

Size: 546 Bytes

Versions: 34

Compression:

Stored size: 546 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 #{pastel.cyan(subnet)} as a trusted subnet in #{pastel.cyan(current_grid)} grid " do
        client.put("grids/#{current_grid}", data)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.10 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.9 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.8 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.7 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.6 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.5 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.4 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.3 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.7.0 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.9 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.8 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.7 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.6 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.5 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.4 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.3 lib/kontena/cli/grids/trusted_subnets/add_command.rb
krates-1.6.2 lib/kontena/cli/grids/trusted_subnets/add_command.rb