# Bare-Metal Server

## Get all servers

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/server`

This endpoint allows to get list of all your servers.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  servers: [
    {
      id: number;
      alias: string;
      hostname: string | null;
      platform: 'epyc' | 'threadripper' | 'ryzen';
      cpu: {
        name: string;
        cores: number;
        threads: number;
        baseClockMhz: number;
        boostClockMhz: number;
        type: 'SINGLE' | 'DUAL';
      } 
      motherboard: {
        name: string;
        dimmCount: number;
      }
      ram: {
        ddrVersion: 'DDR5';
        totalSizeGb: number;
        stickSizeGb: number;
        stickCount: number;
        speedMts: number;
        isECC: boolean;
      }
      ssd: [
        {
          pcieVersion: '4.0' | '5.0';
          sizeGb: number;
          name: string;
          slotType: 'M2' | 'U2'; 
          count: number;
        }
      ]
      connectivity: {
        speedGbit: number;
      }
      traffic: {
        amountTb: number;
      }
      ipAddresses: string[];
      psu: 'SINGLE' | 'DUAL';
      powerStatus: string | null;
      ipmi: boolean;
      os: {
        name: string;
        version: string | null;
      }
      bios?: {
        model: string;
        value: string;
        serial: string;
      }
      location: {
        country: string;
        city: string;
      }
      priceMonthlyUSD: number;
      priceHourlyUSD: number;
      prepaidTill: string | null;
      createdAt: string;
      readyAt: string;
    } 
  ]  
}
```

{% endtab %}
{% endtabs %}

## Get all available Instant servers

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/server/hosting/instant`

This endpoint allows to get list of all available to host Instant servers.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  instantServers: [
    {
      id: number;
      platform: 'epyc' | 'threadripper' | 'ryzen';
      cpu: {
        name: string;
        cores: number;
        threads: number;
        baseClockMhz: number;
        boostClockMhz: number;
        type: 'SINGLE' | 'DUAL';
      }
      motherboard: {
        name: string;
        dimmCount: number;
      }
      ram: {
        ddrVersion: 'DDR5';
        totalSizeGb: number;
        stickSizeGb: number;
        stickCount: number;
        speedMts: number;
        isECC: boolean;
      }
      ssd: [
        {
          pcieVersion: '4.0' | '5.0';
          sizeGb: number;
          name: string;
          slotType: 'M2' | 'U2'; 
          count: number;
        }
      ]
      connectivity: {
        speedGbit: number;
      }
      traffic: {
        amountTb: number;
      }
      psu: 'SINGLE' | 'DUAL';
      location: {
        country: string;
        city: string;
      }
      pricing: {
        onDemand?: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        oneMonth: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        threeMonths: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        sixMonths: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        oneYear: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Get all available Instant server upgrades

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/server/hosting/instant/upgrades`

This endpoint allows to get list of all available upgrades for Instant server.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  upgrades: {
    solanaPackage: {
      name: "Solana Package"
      additionalTrafficTb: number;
      pricing: {
        onDemand?: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        oneMonth: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        threeMonths: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        sixMonths: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        oneYear: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
      }
    }
    additionalIp: {
      maxAdditionalIps: number;
      pricing: {
        onDemand?: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        oneMonth: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        threeMonths: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        sixMonths: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
        oneYear: {
          priceMonthlyUSD: number;
          priceHourlyUSD: number;
          discountPercent: number;
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Get all available Instant server installation profiles

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/server/hosting/instant/:id/profiles`

This endpoint allows to get list of all available installation profiles (OS) for Instant server.

#### Path Parameters

| Name                                 | Type   | Description                                                           |
| ------------------------------------ | ------ | --------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | string | ID can be extracted from the “Get all available Instant servers” call |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  profiles: [
    {
      id: number;
      name: string;
      version: string;
      allowSshKeys: boolean;
      allowSetHostname: boolean;
      allowSetRootPassword: boolean;
      diskLayouts: [
        {
          id: number;
          name: string;
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Host an Instant server

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/server/hosting/instant`

This endpoint allows to host an Instant server.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

**Body**

| Name                           | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                   |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `instantServerId`              | string        | ID of an Instant server you want to host. You can get this value from the "Get all available Instant servers" API                                                                                                                                                                                                                                                                             |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `prepaidType`                  | <p>"onDemand" | </p><p>"oneMonth"                                                                                                                                                                                                                                                                                                                                                                             | </p><p>"threeMonths" | </p><p>"sixMonths" | </p><p>"oneYear"</p> | <p>Defines the prepaid billing period for the server.<br><br>This value represents the <strong>initial payment option</strong>:<br><code>onDemand</code> — no upfront payment, usage is billed hourly.<br><code>oneMonth</code>, <code>threeMonths</code>, <code>sixMonths</code>, <code>oneYear</code> — prepaid plans with a fixed monthly price and discounts depending on the selected period</p> |
| `instantServerPriceMonthlyUSD` | number        | The monthly price in USD that **must exactly match** the `priceMonthlyUSD` value from the selected `prepaidType` in the "Get all available Instant servers" API                                                                                                                                                                                                                               |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `solanaPackage`                | boolean       | <p>Whether to enable the <strong>Solana Package Traffic Upgrade</strong> for this server.<br></p><ul><li><code>true</code> — Solana traffic package will be added.</li><li><code>false</code> — no Solana traffic upgrade</li></ul>                                                                                                                                                           |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `additionalIpCount`            | number        | <p>Number of additional IPv4 addresses to attach to the server.<br></p><ul><li>The server includes <strong>1 IPv4 address by default</strong>.</li><li>You can request up to <strong>11 additional IPv4 addresses</strong>.</li><li>Maximum total IPv4 addresses per server: <strong>12</strong></li></ul>                                                                                    |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `osInstallation`               | object        | Configuration object describing the operating system and installation parameters that will be automatically installed on the server                                                                                                                                                                                                                                                           |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `osInstallation.profileId`     | number        | <p>ID of the operating system installation profile.</p><p>You can obtain this value from the "Get all available Instant server installation profiles" API</p>                                                                                                                                                                                                                                 |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `osInstallation.hostname`      | string        | <p>Hostname to be set on the server during OS installation.</p><p><br>This field is <strong>required only if</strong> the selected installation profile has <code>allowSetHostname = true</code><br><br>If the profile does not allow setting a hostname, this field must be omitted</p>                                                                                                      |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `osInstallation.rootPassword`  | string        | <p>Root user password for the operating system.<br></p><p>This field is <strong>required only if</strong> the selected installation profile has <code>allowSetRootPassword = true</code><br><br><br>If the profile does not allow setting a root password, this field must be omitted</p>                                                                                                     |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `osInstallation.diskLayoutId`  | number        | <p>ID of the disk layout to use during OS installation.<br><br>Available disk layout IDs can be obtained from the <code>diskLayouts</code> list of the selected installation profile</p>                                                                                                                                                                                                      |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |
| `osInstallation.sshKeyIds`     | number\[]     | <p>List of SSH key IDs that will be added to the server during OS installation.<br><br></p><ul><li>SSH key IDs can be obtained from the "Get all SSH Keys" API.</li><li>This field must be provided <strong>only if</strong> the selected installation profile has <code>allowSshKeys = true</code>.</li><li>If SSH keys are not allowed by the profile, this field must be omitted</li></ul> |                      |                    |                      |                                                                                                                                                                                                                                                                                                                                                                                                       |

{% tabs %}
{% tab title="201: OK " %}

```javascript
{
  serverOrder: {
    id: number;
    alias: string;
    hostname: string | null;
    platform: 'epyc' | 'threadripper' | 'ryzen';
    cpu: {
      name: string;
      cores: number;
      threads: number;
      baseClockMhz: number;
      boostClockMhz: number;
      type: 'SINGLE' | 'DUAL';
    } 
    motherboard: {
      name: string;
      dimmCount: number;
    }
    ram: {
      ddrVersion: 'DDR5';
      totalSizeGb: number;
      stickSizeGb: number;
      stickCount: number;
      speedMts: number;
      isECC: boolean;
    }
    ssd: [
      {
        pcieVersion: '4.0' | '5.0';
        sizeGb: number;
        name: string;
        slotType: 'M2' | 'U2'; 
        count: number;
      }
    ]
    connectivity: {
      speedGbit: number;
    }
    traffic: {
      amountTb: number;
    }
    ipAddresses: string[];
    psu: 'SINGLE' | 'DUAL';
    powerStatus: string | null;
    ipmi: boolean;
    os: {
      name: string;
      version: string | null;
    }
    bios?: {
      model: string;
      value: string;
      serial: string;
    }
    location: {
      country: string;
      city: string;
    }
    priceMonthlyUSD: number;
    priceHourlyUSD: number;
    prepaidTill: string | null;
    createdAt: string;
    readyAt: string; 
  }
}
```

{% endtab %}

{% tab title="403: Forbidden" %}

```
{
  error: "NOT_REGISTERED";
  description?: string;
}
```

{% endtab %}
{% endtabs %}
