Sha256: db12c7b82e39100ebb11d1fcca6fc3887619a9843524b2bfb322ce57f41e9c8d
Contents?: true
Size: 680 Bytes
Versions: 16
Compression:
Stored size: 680 Bytes
Contents
module Kontena::Cli::Nodes::Labels class RemoveCommand < Kontena::Command include Kontena::Cli::Common parameter "NODE_ID", "Node id" parameter "LABEL", "Label" def execute require_api_url require_current_grid token = require_token node = client(token).get("grids/#{current_grid}/nodes/#{node_id}") unless node['labels'].include?(label) exit_with_error("Node #{node['name']} does not have label #{label}") end node['labels'].delete(label) data = {} data[:labels] = node['labels'] client.put("nodes/#{node['id']}", data, {}, {'Kontena-Grid-Token' => node['grid']['token']}) end end end
Version data entries
16 entries across 16 versions & 1 rubygems