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

Edit Server API

POST /editServer

Description

This API endpoint allows users to edit and update the details of an existing server by providing its unique identifier and the new server attributes. Users can modify various aspects of the server such as hostname, IP addresses, server type, location, SSH credentials, and other configuration details.

Request Body

The request utilizes GraphQL to perform the editServer mutation.

Mutation:

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

Variables:

{
"id": 0,
"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>"
}
}
  • id (Int): The unique identifier of the server to be edited.
  • server (ServerEdit Object): An object containing the updated 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": {
    "editServer": {
    "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 edited 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 the id corresponds to an existing server that needs to be edited. All required fields should be 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.