Sha256: 28a585d565b026fa0998434fd4d28219c40b0af2638926d706ac5a5cba7b16d8

Contents?: true

Size: 559 Bytes

Versions: 75

Compression:

Stored size: 559 Bytes

Contents

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

    parameter "NAME", "Grid name"
    parameter "SUBNET", "Trusted subnet"

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

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
kontena-cli-1.2.2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.2.rc2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.2.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.1.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0.rc3 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0.rc2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0.pre3 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0.pre2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.1.6 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0.pre1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.1.5 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.1.5.rc3 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.1.5.rc2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.1.5.rc1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.1.4 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.2.0.dev1 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-1.1.3 lib/kontena/cli/grids/trusted_subnets/add_command.rb