Sha256: ac303e0c326caf98cb9c442309fa10e2c3341e353171f828fe56c05b99dcf8d6
Contents?: true
Size: 600 Bytes
Versions: 5
Compression:
Stored size: 600 Bytes
Contents
module Kontena::Cli::Grids::TrustedSubnets class RemoveCommand < 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}") trusted_subnets = grid['trusted_subnets'] || [] unless trusted_subnets.delete(self.subnet) abort("Grid does not have trusted subnet #{self.subnet}") end data = {trusted_subnets: trusted_subnets} client(token).put("grids/#{name}", data) end end end
Version data entries
5 entries across 5 versions & 1 rubygems