Skip to content

Deploy API ​

Order new servers and follow them until they are ready. All endpoints require Bearer-token authentication; an API key needs read/write access to Deploy to order. The panel-side flow is described in Deploying a server.

An order is real: it creates an order and, for monthly, quarterly and annual terms, an invoice.

GET /deploy/servers ​

The catalogue: what can be ordered, where, and whether the account can pay for it.

bash
curl https://api.gigahost.no/api/v0/deploy/servers \
  -H "Authorization: Bearer $TOKEN"

data holds:

  • tiers: product groups, each with group_id, group_name, in_stock and products.
  • regions and datacenters: the locations used by the products. A datacenter has dc_id, dc_name, region_id, region_name, region_name_short, region_location, region_country and region_icon.
  • currency: NOK.
  • eligibility: the payment checks behind hourly orders (verified, has_method, method_qualifies, has_paid_invoice, qualifies_arrears, credit_nok and the hourly usage this month).

Each product has, among other fields:

FieldDescription
product_id, price_idPass both to POST /deploy/servers.
typevm, dedicated or auction.
in_stock, built_to_order, waitlist_eligibleStock state. A product that is sold out and not built to order can only be reserved.
allow_hourly, allow_recurringWhich billing periods the product accepts.
rate_hourly, rate_monthly, setupPrices in NOK excluding VAT.
region_ids, dc_idsRegions and datacenters the product can be placed in.
dc_stockObject of dc_id → true/false: whether the product is in stock in that datacenter.
specsCPU, memory, disks and bandwidth.

The operating systems come from GET /reinstall/distro and the one-click apps from GET /reinstall/apps.

POST /deploy/servers ​

Order one or more servers.

FieldTypeRequiredDescription
pidnumberYesproduct_id from the catalogue.
price_idnumberYesprice_id of the same product.
dc_idnumberOne of dc_id or region_idDatacenter to deploy in. Sets the region.
region_idnumberOne of dc_id or region_idRegion to deploy in, any datacenter.
os_idnumberOne of os_id, iso_id or rescueOperating system or one-click app.
iso_idnumberISO on the account to boot from. Cloud servers only.
rescuenumber1 to start the server in rescue mode.
billing_periodstringNohourly (default), monthly, quarterly or annual.
quantitynumberNoNumber of servers, default 1.
hostnamesarrayNoOne hostname per server. Only letters, digits, ., _ and -, up to 253 characters.
ssh_keysarrayNoIDs of SSH keys on the account (see sshkeys in GET /account). Without a key a root password is generated.
firstbootstringNoPlain-text script run once on the installed system at first boot, at most 32768 bytes. With an app it runs after the app.
app_domainstringNoApps only. Domain for the app. Only with quantity 1.
app_emailstringNoApps only. Email address for certificate notices.
backupsnumberNo1 to add backups. Cloud servers only.
coupon_codestringNoDiscount code. Ignored on hourly orders.
waitliststringNoreserve or notify for a sold-out product. See Waitlist.
bash
curl -X POST https://api.gigahost.no/api/v0/deploy/servers \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "pid": 123,
    "price_id": 456,
    "dc_id": 1,
    "os_id": 12,
    "billing_period": "monthly",
    "hostnames": ["web-01.example.com"],
    "ssh_keys": [42]
  }'

Response (excerpt):

json
{
  "data": {
    "success": true,
    "message": "Servers queued for deployment.",
    "order_ids": [98765],
    "order_numbers": ["100234"],
    "quantity": 1,
    "billing_period": "monthly",
    "currency": "NOK"
  }
}

Keep order_ids to follow the servers with GET /deploy/status. A monthly, quarterly or annual order also returns the prices, pending_payment and under_review. An hourly order returns rate_hourly and monthly_cap.

The hostname you send becomes the panel name. The OS hostname is built from it: it is lowercased and cut at the first character other than a letter, digit, . or -. An empty result gives srv<id>.gigahost.no.

Datacenter errors ​

meta.messageWhen
Required field is invalid: dc_iddc_id is not a number.
Datacenter was not found.Unknown dc_id.
Product is not available in the selected datacenter.The product is not offered there; check dc_ids.
Product is out of stock in the selected datacenter.Another datacenter still has stock; check dc_stock.
Not enough stock in the selected datacenter to deploy N server(s).Dedicated servers: fewer free units than quantity.

A product that is built to order, or that you reserve on the waitlist, ignores dc_id and is placed by region.

App errors ​

meta.messageWhen
This app is not available right now.The app is switched off.
Apps can only be installed on KVM servers and dedicated servers.The product is an LXC container.
This app is only available on dedicated servers.The app needs a dedicated server.
Required field is invalid: app_domainNot a valid domain name.
Required field is invalid: app_emailNot a valid email address.
One domain cannot be used for several servers. Order them one at a time, or leave the domain empty.app_domain with quantity above 1.

The memory and disk minimums of an app (os_minram, os_min_disk) are checked when the server is installed; choose a product that meets them.

Other errors ​

  • Required field is invalid: hostnames
  • Firstboot script is too large.
  • Choose an operating system, an ISO, or rescue mode.
  • This product cannot be ordered hourly. / This product cannot be ordered on a recurring term.
  • Product is out of stock. / Not enough stock to deploy N server(s).
  • Please complete your account profile before ordering.
  • Hourly servers require a non-prepaid card or PayPal on file plus at least one paid invoice on your account … (see eligibility in the catalogue)

Waitlist ​

When a product is sold out everywhere and waitlist_eligible is true, send waitlist:

  • reserve holds an order that deploys automatically when capacity frees up. You are billed when the server is deployed.
  • notify only sends you an email when the product is available again.

GET /deploy/status ​

Follow the servers of one or more orders.

bash
curl "https://api.gigahost.no/api/v0/deploy/status?ids=98765,98766" \
  -H "Authorization: Bearer $TOKEN"

ids is a comma-separated list of order_ids. data.servers has one entry per server with order_id, order_number, hostname, srv_id, ip, ipv6, status, password, app and install_progress. data.all_ready turns true when every server has reached a final state.

statusMeaning
waitingThe order waits for payment.
waitlistReserved; deploys when capacity frees up.
deployingThe server is being set up.
installingThe operating system is installing. install_progress has the same shape as GET /servers/{id}/install.
readyDone.
rescue / isoStarted in rescue mode or from an ISO.

password is the root password while the install runs, when no SSH key was chosen, and in rescue mode. It is not returned to read-only API keys. app holds the app login (name, url, admin_user, admin_password) while an app installs; admin_password is empty for read-only API keys. Neither is kept afterwards.

Gigahost Docs

This site is currently in development.
Enter the password to continue.