Chapter 86: Controller: /siteworx/mysql/db Up Part III: SiteWorx API Spec Chapter 88: Controller: /siteworx/mysql/user 

87 Controller: /siteworx/mysql/perms

Required Permissions "MYSQL"
Required Options MySQL Databases, MySQL Users
Action: add
Added in version 4.7.0-339
Description Add mysql permissions.
Input Parameters
Name Type Notes Required?
name string Example Values
mydb
Yes
user string Example Values
testuser
Yes
perms struct (string) Example Values
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE, EVENT, TRIGGER
Example Default Value
["SELECT","INSERT","UPDATE","DELETE","CREATE","DROP","REFERENCES","INDEX","ALTER","CREATE TEMPORARY TABLES","LOCK TABLES","CREATE VIEW","SHOW VIEW","CREATE ROUTINE","ALTER ROUTINE","EXECUTE","EVENT","TRIGGER"]
No*
host string Example Default Value
%
No*
* indicates that it’s actually required, but probably already has a valid default value
Action: edit
Added in version 4.7.0-339
Description Edit mysql permissions.
Input Parameters
Name Type Notes Required?
perms struct (string) Example Values
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE, EVENT, TRIGGER
Example Default Value
["CREATE","DROP","REFERENCES","ALTER","DELETE","INDEX","INSERT","SELECT","UPDATE","CREATE VIEW","SHOW VIEW","ALTER ROUTINE","CREATE ROUTINE","EXECUTE","CREATE TEMPORARY TABLES","LOCK TABLES","EVENT","TRIGGER"]
No*
* indicates that it’s actually required, but probably already has a valid default value
Action: fail
Added in version n/a
Description Magic function - test for failure mechanism.
Action: listAvailablePerms
Added in version 4.7.0-339
Description List available MySQL permissions.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 => ’SELECT’,
1 => ’INSERT’,
2 => ’UPDATE’,
),
)
Action: queryDatabaseUserPerms
Added in version 4.8.0-393
Description Given a database, find all the db users and their permissions on that db.
Input Parameters
Name Type Notes Required?
name string Example Values
mydb
Yes
Action: queryEdit
Added in version 5.1.0-838
Description Displays the information available to the action "edit".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’name_copy’ => ’mydb’,
’user_copy’ => ’testuser’,
’perms’ =>
array (
0 => ’CREATE’,
1 => ’DROP’,
2 => ’REFERENCES’,
3 => ’ALTER’,
4 => ’DELETE’,
5 => ’INDEX’,
6 => ’INSERT’,
7 => ’SELECT’,
8 => ’UPDATE’,
9 => ’CREATE VIEW’,
10 => ’SHOW VIEW’,
11 => ’ALTER ROUTINE’,
12 => ’CREATE ROUTINE’,
13 => ’EXECUTE’,
14 => ’CREATE TEMPORARY TABLES’,
15 => ’LOCK TABLES’,
16 => ’EVENT’,
17 => ’TRIGGER’,
),
’host_copy’ => ’%’,
’name’ => ’mydb’,
’user’ => ’testuser’,
’host’ => ’%’,
),
)
Action: reroute
Added in version n/a
Description Action to re-route from the current controller to a different one.
Input Parameters
Name Type Notes Required?
controller string Example Values
Index, Overview, Email, EmailBox, EmailAlias, EmailGroup, EmailAutorespond, DomainsSlave, DomainsPointer, DomainsSub, DomainsPhp, Dns, Ssl, SslKey, SslChain, SslCrt, SslCsr, Ftp, FtpSessions, MysqlDb, MysqlUser, MysqlPerms, Cron, Htaccess, Simplescripts, Users, Logs, Twofactorauth, EmailRemotesetup, EmailFilters, EmailSpamprefs, EmailSpf, EmailDomainkeys, Backup, BackupSchedule, Prefs, Notice, Logout
Yes
Action: win
Added in version n/a
Description Magic function - test for testing success mechanism.
 Chapter 86: Controller: /siteworx/mysql/db Up Part III: SiteWorx API Spec Chapter 88: Controller: /siteworx/mysql/user 

(C) 2018 by InterWorx LLC