UpCloud: World’s fastest cloud servers

// Create the serverserverDetails, err := svc.CreateServer(&request.CreateServerRequest{Zone: "fi-hel1",Title: "My new server",Hostname: "server.example.com",PasswordDelivery: request.PasswordDeliveryNone,StorageDevices: []request.CreateServerStorageDevice{{Action: request.CreateStorageDeviceActionClone,Storage: "01000000-0000-4000-8000-000030060200",Title: "disk1",Size: 30,Tier: upcloud.StorageTierMaxIOPS,},},IPAddresses: []request.CreateServerIPAddress{{Access: upcloud.IPAddressAccessPrivate,Family: upcloud.IPAddressFamilyIPv4,},{Access: upcloud.IPAddressAccessPublic,Family: upcloud.IPAddressFamilyIPv4,},{Access: upcloud.IPAddressAccessPublic,Family: upcloud.IPAddressFamilyIPv6,},},})import upcloud_apifrom upcloud_api import Server, Storage, ZONE, login_user_blockmanager = upcloud_api.CloudManager('api_user', 'password')manager.authenticate()login_user = login_user_block( username='theuser', ssh_keys=['ssh-rsa AAAAB3NzaC1yc2EAA[...]ptshi44x [emailprotected]'], create_password=False)cluster = { 'web1': Server( core_number=1, # CPU cores memory_amount=1024, # RAM in MB hostname='web1.example.com', zone=ZONE.London, # ZONE.Helsinki and ZONE.Chicago available also storage_devices=[ # OS: Ubuntu 14.04 from template # default tier: maxIOPS, the 100k IOPS storage backend Storage(os='Ubuntu 14.04', size=10), # secondary storage, hdd for reduced cost Storage(size=100, tier='hdd') ], login_user=login_user # user and ssh-keys ), 'web2': Server( core_number=1, memory_amount=1024, hostname='web2.example.com', zone=ZONE.London, storage_devices=[ Storage(os='Ubuntu 14.04', size=10), Storage(size=100, tier='hdd'), ], login_user=login_user ), 'db': Server( plan='2xCPU-4GB', # use a preconfigured plan, instead of custom hostname='db.example.com', zone=ZONE.London, storage_devices=[ Storage(os='Ubuntu 14.04', size=10), Storage(size=100), ], login_user=login_user ), 'lb': Server( core_number=2, memory_amount=1024, hostname='balancer.example.com', zone=ZONE.London, storage_devices=[ Storage(os='Ubuntu 14.04', size=10) ], login_user=login_user )}for server in cluster: manager.create_server(cluster[server]) # automatically populates the Server objects with data from APIvar upcloud = require('upcloud');var defaultClient = upcloud.ApiClient.instance;// Configure HTTP basic authorization: baseAuthvar baseAuth = defaultClient.authentications['baseAuth'];baseAuth.username = 'UPCLOUD_USERNAME';baseAuth.password = 'UPCLOUD_PASSWORD';var api = new upcloud.AccountApi();api.getAccount().then( function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); },);require_once(__DIR__ . '/vendor/autoload.php');$api_instance = new UpcloudApiClientUpcloudAccountApi();$config = $api_instance->getConfig();$config->setUsername('YOUR UPCLOUD USERNAME');$config->setPassword('YOUR UPCLOUD PASSWORD');try { $result = $api_instance->getAccount(); print_r($result);} catch (Exception $e) { echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;}HTTP/1.0 200 OK{ "servers": { "server": [ { "core_number": "1", "hostname": "example.upcloud.com", "license: 0, "memory_amount": "1024", "plan": "1xCPU-1GB", "state": "started", "tags": { "tag": [] }, "title": "Example UpCloud server", "uuid": "00e8051f-86af-468b-b932-4fe4ac6c7f08", "zone": "fi-hel1" } ] }}

Original post:
UpCloud: World's fastest cloud servers

Related Post

Comments are closed.