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

Delete Server API

POST /deleteServer

Description

This API endpoint allows users to delete an existing server by providing its unique identifier. Deleting a server will remove it and all associated attributes such as hostname, IP addresses, SSH credentials, and other configuration details.

Request Body

The request utilizes GraphQL to perform the deleteServer mutation.

Mutation:

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

Variables:

{
"id": 0
}
  • id (Int): The unique identifier of the server to be deleted.

Response:

  • Success (200 OK):

    {
    "data": {
    "deleteServer": {
    "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 deleted server.
    • hostName (String): The hostname of the deleted server.
    • publicIp (String): The public IP address of the deleted server.
    • type (String): The type of server.
    • privateIp (String): The private IP address of the deleted server.
    • city (String): The city where the deleted server was located.
    • country (String): The country where the deleted server was located.
    • continent (String): The continent where the deleted server was 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 was 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 deleted. Once deleted, the server and its settings cannot be recovered. Make sure to back up any necessary data before performing this action.