Sha256: a6e8170a4d4fe71bc4fa430db34a09f28e43aaafc0ac1f8f91bd49f3249e7ffb

Contents?: true

Size: 1.05 KB

Versions: 18

Compression:

Stored size: 1.05 KB

Contents

module Kontena::Cli::Nodes::DigitalOcean
  class CreateCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "[NAME]", "Node name"
    option "--token", "TOKEN", "DigitalOcean API token", required: true
    option "--ssh-key", "SSH_KEY", "Path to ssh public key", required: true
    option "--size", "SIZE", "Droplet size", default: '1gb'
    option "--region", "REGION", "Region", default: 'ams2'
    option "--version", "VERSION", "Define installed Kontena version", default: 'latest'

    def execute
      require_api_url
      require_current_grid

      require 'kontena/machine/digital_ocean'
      grid = client(require_token).get("grids/#{current_grid}")
      provisioner = Kontena::Machine::DigitalOcean::NodeProvisioner.new(client(require_token), token)
      provisioner.run!(
        master_uri: api_url,
        grid_token: grid['token'],
        grid: current_grid,
        ssh_key: ssh_key,
        name: name,
        size: size,
        region: region,
        version: version
      )
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
kontena-cli-0.14.7 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.14.6 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.14.5 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.14.4 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.14.3 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.14.2 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.14.1 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.14.0 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.13.4 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.13.3 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.13.2 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.13.1 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.13.0.1 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.13.0 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.12.3 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.12.2 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.12.1 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.12.0 lib/kontena/cli/nodes/digital_ocean/create_command.rb