Sha256: 243c245b73e75e7dd2a772e26ef886a9745c2af06683b1f0f99259baa3dc148f

Contents?: true

Size: 667 Bytes

Versions: 24

Compression:

Stored size: 667 Bytes

Contents

module Kontena::Cli::Nodes
  class UpdateCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "NODE_ID", "Node id"
    option ["-l", "--label"], "LABEL", "Node label", multivalued: true

    def execute
      require_api_url
      require_current_grid
      token = require_token

      node = client(token).get("grids/#{current_grid}/nodes/#{node_id}")
      data = {}
      data[:labels] = label_list if label_list
      spinner "Updating #{node_id.colorize(:cyan)} node " do
        client.put("nodes/#{node['id']}", data, {}, {'Kontena-Grid-Token' => node['grid']['token']})
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
kontena-cli-1.0.0.pre3 lib/kontena/cli/nodes/update_command.rb
kontena-cli-1.0.0.pre2 lib/kontena/cli/nodes/update_command.rb
kontena-cli-1.0.0.pre1 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.17.0.pre5 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.17.0.pre4 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.17.0.pre3 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.17.0.pre2 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.17.0.pre1 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.3 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.3.rc1 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.2 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.2.rc1 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.1 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.1.rc3 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.1.rc2 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.1.rc1 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0.rc3 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0.rc2 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0.rc1 lib/kontena/cli/nodes/update_command.rb