Server

The server endpoints allow you to manage your servers, including starting, stopping, restarting, and retrieving server statistics.


POST/server/:serviceId/start

Start Server

This endpoint allows you to start a server.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server to start, fetched from the List Services endpoint.

Request

POST
/server/:serviceId/start
curl -X POST https://api.puregpu.com/server/10/start \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "message": "Start success"
}

POST/server/:serviceId/stop

Stop Server

This endpoint allows you to stop a server.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server to stop, fetched from the List Services endpoint.

Request

POST
/server/:serviceId/stop
curl -X POST https://api.puregpu.com/server/10/stop \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "message": "Stop success"
}

POST/server/:serviceId/restart

Restart Server

This endpoint allows you to restart a server.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server to restart, fetched from the List Services endpoint.

Request

POST
/server/:serviceId/restart
curl -X POST https://api.puregpu.com/server/10/restart \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "message": "Reboot success"
}

POST/server/:serviceId/shutdown

Shutdown Server

This endpoint allows you to shut down a server.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server to shut down, fetched from the List Services endpoint.

Request

POST
/server/:serviceId/shutdown
curl -X POST https://api.puregpu.com/server/10/shutdown \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "message": "Shutdown success"
}

GET/server/:serviceId/stats

Get Server Statistics

This endpoint allows you to retrieve statistics for a server.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server to retrieve statistics for, fetched from the List Services endpoint.

  • Name
    timeframe
    Type
    string
    Description

    The timeframe for the statistics, possible values are: hour, day, week, month, year.

Request

GET
/server/:serviceId/stats
curl https://api.puregpu.com/server/10/stats?timeframe=hour \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "stats": [
    {
        "date": "2024-06-09T17:01:00.000Z",
        "cpu": 0.06532379034742411,
        "diskread": null,
        "diskwrite": 11223.04,
        "mem": 342967910.4,
        "netin": 6089.91333333333,
        "netout": 102.4
    },
    ...
  ]
}

GET/server/ostemplates

Get OS Templates

This endpoint allows you to retrieve a list of available operating system templates.

Request

GET
/server/ostemplates
curl https://api.puregpu.com/server/ostemplates \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "osTemplates": [
      {
          "osid": "1021",
          "name": "ubuntu-22.04-x86_64",
          "distro": "ubuntu",
          "version": "22.04",
          "drivers": "standard"
      },
      {
          "osid": "1057",
          "name": "debian-12-x86_64",
          "distro": "debian",
          "version": "12",
          "drivers": "standard"
      },
      {
          "osid": "100001",
          "name": "debian-12-pgpu",
          "distro": "debian",
          "version": "12",
          "drivers": "puregpu"
      },
      {
          "osid": "100002",
          "name": "windows-server-2022-standard-dw",
          "distro": "windows",
          "version": "2022",
          "drivers": "dataracks"
      }
  ]
}

POST/server/:serviceId/rebuild

Rebuild Server

This endpoint allows you to rebuild a server with a specified operating system.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server to rebuild, fetched from the List Services endpoint.

  • Name
    osid
    Type
    string
    Description

    The ID of the operating system to install, fetched from the Get OS Templates endpoint.

  • Name
    sshkey
    Type
    string
    Description

    An SSH public key to be added to the server during the rebuild process.

Request

POST
/server/:serviceId/rebuild
curl -X POST https://api.puregpu.com/server/10/rebuild \
  -H "X-API-Key: {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "osid": "1021",
    "sshkey": "ssh-rsa AAAAB3NzaC1..."
  }'

Response

{
  "result": "success",
  "message": "Rebuild processed",
  "password": "new_generated_password"
}

GET/server/:serviceId/status

Get Server Status

This endpoint allows you to get the status of a server.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server to get the status for, fetched from the List Services endpoint.

Request

GET
/server/:serviceId/status
curl https://api.puregpu.com/server/10/status \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "server": {
      "status": "running",
      "uptime": 3600,
      "locked": false
  }
}

POST/server/:serviceId/setBootOrder

Set Boot Order

This endpoint allows you to set the boot order of your server.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server, fetched from the List Services endpoint.

  • Name
    order
    Type
    string
    Description

    The boot order to set. Possible values are:

    • cda: Boot from the hard disk first, then CD-ROM devices.
    • dca: Boot from CD-ROM devices first, then the hard disk.

Request

POST
/server/:serviceId/setBootOrder
curl -X POST https://api.puregpu.com/server/10/setBootOrder \
  -H "X-API-Key: {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "order": "dca"
  }'

Response

{
  "result": "success",
  "message": "Boot Order Modification Success"
}

POST/server/:serviceId/insertIso

Insert ISO

This endpoint allows you to insert one or two ISO images into your server's virtual CD-ROM drives.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server, fetched from the List Services endpoint.

  • Name
    iso
    Type
    string
    Description

    The name of the ISO file to insert into the primary CD-ROM drive. The ISO must be uploaded via the ISO Endpoints.

  • Name
    sec_iso
    Type
    string
    Description

    The name of the ISO file to insert into the secondary CD-ROM drive. The ISO must be uploaded via the ISO Endpoints.

Request

POST
/server/:serviceId/insertIso
curl -X POST https://api.puregpu.com/server/10/insertIso \
  -H "X-API-Key: {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "iso": "ubuntu.iso",
    "sec_iso": "drivers.iso"
  }'

Response

{
  "result": "success",
  "message": "ISO Modification Success"
}

GET/server/:serviceId/bootOrderAndIsos

Get Boot Order and Mounted ISOs

This endpoint allows you to retrieve the current boot order and the ISOs currently inserted into your server's CD-ROM drives.

Required attributes

  • Name
    serviceId
    Type
    integer
    Description

    The service ID of the server, fetched from the List Services endpoint.

Request

GET
/server/:serviceId/bootOrderAndIsos
curl https://api.puregpu.com/server/10/bootOrderAndIsos \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "bootOrder": "dca",
  "primaryISO": "ubuntu.iso",
  "secondaryISO": "drivers.iso"
}