Sha256: 3030bde88622bd6c63456004bbd773c1e5f4544aede5fb6abf230c4531d5fe77

Contents?: true

Size: 442 Bytes

Versions: 5

Compression:

Stored size: 442 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]}
      client(token).put("grids/#{name}", data)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kontena-cli-0.16.0.pre5 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-0.16.0.pre4 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-0.16.0.pre3 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-0.16.0.pre2 lib/kontena/cli/grids/trusted_subnets/add_command.rb
kontena-cli-0.16.0.pre1 lib/kontena/cli/grids/trusted_subnets/add_command.rb