/cloud/db/grant/delete


POST https://api.sitehost.nz/1.5/cloud/db/grant/delete.json

Removes all grants from an existing database user.

Form Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client that the database user belongs to.Example: 1
server_namestringYesThe server that the database user belongs to.Example: ch-servername
mysql_hoststringYesThe MySQL Integrated Container where the database resides. Valid options (if they are running) are mysql56, mysql57, and mysql8.Example: mysql8
databasestringYesThe name of the database that the grants are associated with.Example: dbname
usernamestringYesThe username of the database user to remove the grants from.Example: dbuser

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", "https://api.sitehost.nz/1.5/cloud/db/grant/delete.json", false);

var data = new FormData();
data.append("apikey", "your_key_here");
data.append("client_id", "1");
data.append("server_name", "ch-servername");
data.append("mysql_host", "mysql8");
data.append("database", "dbname");
data.append("username", "dbuser");

xmlHttp.send(data);

var response = xmlHttp.responseText;

Response

200:

application/json
{
  "return": {
    "job": {
      "type": "scheduler",
      "id": 7319505
    }
  },
  "msg": "Successful",
  "status": true
}