/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
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client that the database user belongs to.Example: 1 |
server_name | string | Yes | The server that the database user belongs to.Example: ch-servername |
mysql_host | string | Yes | The MySQL Integrated Container where the database resides. Valid options (if they are running) are mysql56, mysql57, and mysql8.Example: mysql8 |
database | string | Yes | The name of the database that the grants are associated with.Example: dbname |
username | string | Yes | The username of the database user to remove the grants from.Example: dbuser |
Code Samples
JavaScript PHP Rails Pythonvar 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
}
"return": {
"job": {
"type": "scheduler",
"id": 7319505
}
},
"msg": "Successful",
"status": true
}