Class: Kontena::Plugin::Upcloud::Nodes::CreateCommand

Inherits:
Command
  • Object
show all
Includes:
Cli::Common, Cli::GridOptions
Defined in:
lib/kontena/plugin/upcloud/nodes/create_command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/kontena/plugin/upcloud/nodes/create_command.rb', line 16

def execute
  require_relative '../../../machine/upcloud'
  grid = fetch_grid
  provisioner = Kontena::Machine::Upcloud::NodeProvisioner.new(client, username, password)
  provisioner.run!(
    master_uri: api_url,
    grid_token: grid['token'],
    grid: current_grid,
    ssh_key: ssh_key,
    name: name,
    plan: plan,
    zone: zone,
    version: version
  )
end

#fetch_gridHash

Parameters:

  • id (String)

Returns:

  • (Hash)


34
35
36
# File 'lib/kontena/plugin/upcloud/nodes/create_command.rb', line 34

def fetch_grid
  client.get("grids/#{current_grid}")
end