Sha256: a71587d7ec44b0ce0d974567032d859ca4109d474209f255b8f48ea15f6ec388

Contents?: true

Size: 1.45 KB

Versions: 10

Compression:

Stored size: 1.45 KB

Contents

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

    option "--subscription-id", "SUBSCRIPTION ID", "Azure subscription id", required: true
    option "--subscription-cert", "CERTIFICATE", "Path to Azure management certificate", attribute_name: :certificate, required: true
    option "--size", "SIZE", "SIZE", default: 'Small'
    option "--network", "NETWORK", "Virtual Network name"
    option "--subnet", "SUBNET", "Subnet name"
    option "--ssh-key", "SSH KEY", "SSH private key file", required: true
    option "--password", "PASSWORD", "Password"
    option "--location", "LOCATION", "Location", default: 'West Europe'
    option "--version", "VERSION", "Define installed Kontena version", default: 'latest'

    parameter "[NAME]", "Node name"

    def execute
      require_api_url
      require_current_grid

      require 'kontena/machine/azure'
      grid = client(require_token).get("grids/#{current_grid}")
      provisioner = Kontena::Machine::Azure::NodeProvisioner.new(client(require_token), subscription_id, certificate)
      provisioner.run!(
        master_uri: api_url,
        grid_token: grid['token'],
        grid: current_grid,
        password: password,
        ssh_key: ssh_key,
        name: name,
        size: size,
        virtual_network: network,
        subnet: subnet,
        location: location,
        version: version
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kontena-cli-0.13.4 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.13.3 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.13.2 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.13.1 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.13.0.1 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.13.0 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.12.3 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.12.2 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.12.1 lib/kontena/cli/nodes/azure/create_command.rb
kontena-cli-0.12.0 lib/kontena/cli/nodes/azure/create_command.rb