curl --location --request POST 'https://api.hetzner.cloud/v1/servers' \
--header 'Content-Type: application/json' \
--data-raw '{
"automount": false,
"datacenter": "nbg1-dc3",
"firewalls": [
{
"firewall": 38
}
],
"image": "ubuntu-20.04",
"labels": {},
"location": "nbg1",
"name": "my-server",
"networks": [
456
],
"placement_group": 1,
"public_net": {
"enable_ipv4": true,
"enable_ipv6": true,
"ipv4": 0,
"ipv6": 0
},
"server_type": "cx11",
"ssh_keys": [
"my-ssh-key"
],
"start_after_create": true,
"user_data": "#cloud-config\nruncmd:\n- [touch, /root/cloud-init-worked]\n",
"volumes": [
123
]
}'
{
"action": {
"command": "create_server",
"error": {
"code": "action_failed",
"message": "Action failed"
},
"finished": null,
"id": 1,
"progress": 0,
"resources": [
{
"id": 42,
"type": "server"
}
],
"started": "2016-01-30T23:50:00.000Z",
"status": "running"
},
"next_actions": [
{
"command": "start_server",
"error": {
"code": "action_failed",
"message": "Action failed"
},
"finished": null,
"id": 13,
"progress": 0,
"resources": [
{
"id": 42,
"type": "server"
}
],
"started": "2016-01-30T23:50:00.000Z",
"status": "running"
}
],
"root_password": "YItygq1v3GYjjMomLaKc",
"server": {
"backup_window": "22-02",
"created": "2016-01-30T23:50:00.000Z",
"datacenter": {
"description": "Falkenstein 1 DC 8",
"id": 1,
"location": {
"city": "Falkenstein",
"country": "DE",
"description": "Falkenstein DC Park 1",
"id": 1,
"latitude": 50.47612,
"longitude": 12.370071,
"name": "fsn1",
"network_zone": "eu-central"
},
"name": "fsn1-dc8",
"server_types": {
"available": [
1,
2,
3
],
"available_for_migration": [
1,
2,
3
],
"supported": [
1,
2,
3
]
}
},
"id": 42,
"image": {
"bound_to": null,
"created": "2016-01-30T23:50:00.000Z",
"created_from": {
"id": 1,
"name": "Server"
},
"deleted": null,
"deprecated": "2018-02-28T00:00:00.000Z",
"description": "Ubuntu 20.04 Standard 64 bit",
"disk_size": 10,
"id": 4711,
"image_size": 2.3,
"labels": {
"env": "dev"
},
"name": "ubuntu-20.04",
"os_flavor": "ubuntu",
"os_version": "20.04",
"protection": {
"delete": false
},
"rapid_deploy": false,
"status": "available",
"type": "snapshot"
},
"included_traffic": 654321,
"ingoing_traffic": 123456,
"iso": {
"deprecated": "2018-02-28T00:00:00.000Z",
"description": "FreeBSD 11.0 x64",
"id": 4711,
"name": "FreeBSD-11.0-RELEASE-amd64-dvd1",
"type": "public"
},
"labels": {
"env": "dev"
},
"load_balancers": [],
"locked": false,
"name": "my-server",
"outgoing_traffic": 123456,
"primary_disk_size": 50,
"private_net": [
{
"alias_ips": [],
"ip": "10.0.0.2",
"mac_address": "86:00:ff:2a:7d:e1",
"network": 4711
}
],
"protection": {
"delete": false,
"rebuild": false
},
"public_net": {
"firewalls": [
{
"id": 38,
"status": "applied"
}
],
"floating_ips": [
478
],
"ipv4": {
"blocked": false,
"dns_ptr": "server01.example.com",
"ip": "1.2.3.4"
},
"ipv6": {
"blocked": false,
"dns_ptr": [
{
"dns_ptr": "server.example.com",
"ip": "2001:db8::1"
}
],
"ip": "2001:db8::/64"
}
},
"rescue_enabled": false,
"server_type": {
"cores": 1,
"cpu_type": "shared",
"deprecated": true,
"description": "CX11",
"disk": 25,
"id": 1,
"memory": 1,
"name": "cx11",
"prices": [
{
"location": "fsn1",
"price_hourly": {
"gross": "1.1900000000000000",
"net": "1.0000000000"
},
"price_monthly": {
"gross": "1.1900000000000000",
"net": "1.0000000000"
}
}
],
"storage_type": "local"
},
"status": "initializing",
"volumes": []
}
}