Sha256: 752581530786d21ee2ccaf0ace72d34ae0ef5ad4ffa4156d5ee96662d33f4869

Contents?: true

Size: 526 Bytes

Versions: 21

Compression:

Stored size: 526 Bytes

Contents

module Kontena::Cli::Nodes::Labels
  class AddCommand < 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}")
      data = {}
      data[:labels] = node['labels'].to_a | [label]
      client.put("nodes/#{node['id']}", data, {}, {'Kontena-Grid-Token' => node['grid']['token']})
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
kontena-cli-0.16.3 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.3.rc1 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.2 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.2.rc1 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.1 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.1.rc3 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.1.rc2 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.1.rc1 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.rc3 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.rc2 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.rc1 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre9 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre8 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre7 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre6 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre5 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre4 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre3 lib/kontena/cli/nodes/labels/add_command.rb
kontena-cli-0.16.0.pre2 lib/kontena/cli/nodes/labels/add_command.rb