<commit_before>#!/usr/bin/env ruby


# Create a droplet with FQDN the contents of ambari-server.txt appended with @domain variable below. Adds also a A record DNS entry.


image  = 'ubuntu-14-04-x64'
region = 'fra1'
size   = '512m'

# Install with 'gem install droplet_kit'
require 'droplet_kit'
require './config.rb'
require './droplet_commons.rb'

# Connection client
client = DropletKit::Client.new(access_token: @docean_token_v2)

# Select name
puts "Reading name from abmari-server.txt"
file = File.open("ambari-server.txt", "r")
name = file.read.chomp
file.close()

puts "Selected region      : " + region
puts "Selected size        : " + size
puts "Selected key         : " + @sshkey.to_s
puts "Selected droplet name: [" + name + "]"

# TODO fetch SSH keys from digitalocean
droplet = DropletKit::Droplet.new(name: name + "." + @domain , region: region, size: '512mb', image: image, ssh_keys: [@sshkey.to_s])

created = client.droplets.create(droplet)

print created.inspect
<commit_msg>refactor size param<commit_after>#!/usr/bin/env ruby


# Create a droplet with FQDN the contents of ambari-server.txt appended with @domain variable below. Adds also a A record DNS entry.


image  = 'ubuntu-14-04-x64'
region = 'fra1'
size   = '1g'

# Install with 'gem install droplet_kit'
require 'droplet_kit'
require './config.rb'
require './droplet_commons.rb'

# Connection client
client = DropletKit::Client.new(access_token: @docean_<PASSWORD>)

# Select name
puts "Reading name from abmari-server.txt"
file = File.open("ambari-server.txt", "r")
name = file.read.chomp
file.close()

puts "Selected region      : " + region
puts "Selected size        : " + size
puts "Selected key         : " + @sshkey.to_s
puts "Selected droplet name: [" + name + "]"

# TODO fetch SSH keys from digitalocean
droplet = DropletKit::Droplet.new(name: name + "." + @domain , region: region, size: size, image: image, ssh_keys: [@sshkey.to_s])

created = client.droplets.create(droplet)

print created.inspect

{'fraction_non_alphanumeric': 0.12958312405826217, 'fraction_numerical': 0.011049723756906077, 'mean_word_length': 4.120822622107969, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6161389', 'n_tokens_mistral': 727, 'n_tokens_neox': 668, 'n_words': 196}