Sha256: 5f38208a93073ae58d9b997a81d58576809bb2c779ae495adc59f7cf56f470c5

Contents?: true

Size: 595 Bytes

Versions: 5

Compression:

Stored size: 595 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
      client.put("nodes/#{node['id']}", data, {}, {'Kontena-Grid-Token' => node['grid']['token']})
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kontena-cli-0.16.0.pre5 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0.pre4 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0.pre3 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0.pre2 lib/kontena/cli/nodes/update_command.rb
kontena-cli-0.16.0.pre1 lib/kontena/cli/nodes/update_command.rb