پرش به مطلب اصلی

Create Server API

POST /createServer

Description

This API endpoint allows users to create a new server with specific attributes such as hostname, public and private IPs, server type, location, SSH credentials, and additional configuration details.

Request Body

The request utilizes GraphQL to perform the createServer mutation.

Mutation:

mutation createServer ($server: ServerEdit) {
createServer (server: $server) {
id
hostName
publicIp
type
privateIp
city
country
continent
secret
ports
sshUsername
sshKey
killCommand
rootCommand
description
hero
spot
zeus
bridgeIp
bridgeCountry
}
}

Variables:

{
"server": {
"hostName": "<Host_Name>",
"publicIp": "<Public_IP>",
"type": "<Server_Type>",
"privateIp": "<Private_IP>",
"city": "<City>",
"country": "<Country>",
"continent": "<Continent>",
"secret": "<Secret>",
"ports": 0,
"sshUsername": "<SSH_Username>",
"sshKey": "<SSH_Key>",
"killCommand": "<Kill_Command>",
"rootCommand": "<Root_Command>",
"description": "<Description>",
"hero": "<Hero>",
"spot": "<Spot>",
"zeus": "<Zeus>",
"bridgeIp": "<Bridge_IP>",
"bridgeCountry": "<Bridge_Country>"
}
}
  • server (ServerEdit Object): An object containing the server details.
    • hostName (String): The hostname of the server.
    • publicIp (String): The public IP address of the server.
    • type (String): The type of server.
    • privateIp (String): The private IP address of the server.
    • city (String): The city where the server is located.
    • country (String): The country where the server is located.
    • continent (String): The continent where the server is located.
    • secret (String): A secret key for the server.
    • ports (Int): The number of ports available on the server.
    • sshUsername (String): The SSH username for accessing the server.
    • sshKey (String): The SSH key for accessing the server.
    • killCommand (String): The command used to terminate processes on the server.
    • rootCommand (String): The root command for administrative access to the server.
    • description (String): A description of the server.
    • hero (String): A hero name or identifier associated with the server.
    • spot (String): A spot identifier associated with the server.
    • zeus (String): A zeus identifier associated with the server.
    • bridgeIp (String): The IP address of the server's bridge.
    • bridgeCountry (String): The country where the server's bridge is located.

Response:

  • Success (200 OK):

    {
    "data": {
    "createServer": {
    "id": "<Server_ID>",
    "hostName": "<Host_Name>",
    "publicIp": "<Public_IP>",
    "type": "<Server_Type>",
    "privateIp": "<Private_IP>",
    "city": "<City>",
    "country": "<Country>",
    "continent": "<Continent>",
    "secret": "<Secret>",
    "ports": <Ports>,
    "sshUsername": "<SSH_Username>",
    "sshKey": "<SSH_Key>",
    "killCommand": "<Kill_Command>",
    "rootCommand": "<Root_Command>",
    "description": "<Description>",
    "hero": "<Hero>",
    "spot": "<Spot>",
    "zeus": "<Zeus>",
    "bridgeIp": "<Bridge_IP>",
    "bridgeCountry": "<Bridge_Country>"
    }
    }
    }
    • id (Int): The unique identifier of the created server.
    • hostName (String): The hostname of the server.
    • publicIp (String): The public IP address of the server.
    • type (String): The type of server.
    • privateIp (String): The private IP address of the server.
    • city (String): The city where the server is located.
    • country (String): The country where the server is located.
    • continent (String): The continent where the server is located.
    • secret (String): A secret key for the server.
    • ports (Int): The number of ports available on the server.
    • sshUsername (String): The SSH username for accessing the server.
    • sshKey (String): The SSH key for accessing the server.
    • killCommand (String): The command used to terminate processes on the server.
    • rootCommand (String): The root command for administrative access to the server.
    • description (String): A description of the server.
    • hero (String): A hero name or identifier associated with the server.
    • spot (String): A spot identifier associated with the server.
    • zeus (String): A zeus identifier associated with the server.
    • bridgeIp (String): The IP address of the server's bridge.
    • bridgeCountry (String): The country where the server's bridge is located.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that all required fields are provided and correctly formatted according to the platform's specifications. The server configuration should align with the platform's requirements for network settings, security, and location.