Sha256: fd90fe9c330e4ab1f198140c2627a9cadd1bfe7e74344a7a7fe71cd1f2bcac1b

Contents?: true

Size: 562 Bytes

Versions: 8

Compression:

Stored size: 562 Bytes

Contents

module Kontena::Cli::Nodes::Labels
  class RemoveCommand < Kontena::Command
    include Kontena::Cli::Common

    parameter "NODE_ID", "Node id"
    parameter "LABEL ...", "Labels"

    requires_current_master
    requires_current_master_token
    requires_current_grid

    def execute
      node = client.get("grids/#{current_grid}/nodes/#{node_id}")
      data = { labels: Array(node['labels']).reject {|label| label_list.include?(label) } }
      client.put("nodes/#{node['id']}", data, {}, {'Kontena-Grid-Token' => node['grid']['token']})
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kontena-cli-1.0.0.pre3 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.0.0.pre2 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.0.0.pre1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-0.17.0.pre5 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-0.17.0.pre4 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-0.17.0.pre3 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-0.17.0.pre2 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-0.17.0.pre1 lib/kontena/cli/nodes/labels/remove_command.rb