Sha256: 577bf62e9023f45d911481ea71a29a2e67bcd33d70acd49d9ed862bd84c588c6
Contents?: true
Size: 598 Bytes
Versions: 28
Compression:
Stored size: 598 Bytes
Contents
module Kontena::Cli::Grids::TrustedSubnets class RemoveCommand < Clamp::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
28 entries across 28 versions & 1 rubygems