Sha256: bca938a78e52a446a1501b866064dba642cdb1484274d1c26c8a1970cf6aca10

Contents?: true

Size: 1.02 KB

Versions: 16

Compression:

Stored size: 1.02 KB

Contents

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

    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

16 entries across 16 versions & 1 rubygems

Version Path
kontena-cli-0.11.7 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.11.6 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.11.5 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.11.4 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.11.3 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.11.2 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.11.1 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.11.0 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.10.3 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.10.2 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.10.1 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.10.0 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.9.3 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.9.2 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.9.1 lib/kontena/cli/nodes/digital_ocean/create_command.rb
kontena-cli-0.9.0 lib/kontena/cli/nodes/digital_ocean/create_command.rb