Difference between revisions of "API: Databases"
From BrainyCP
m (Fgsfds переименовал страницу API: базы данных в API: Databases) |
|||
Line 1: | Line 1: | ||
| | ||
− | + | <div data-placeholder="Перевод" dir="ltr">Administrative functions require API root rights in order to use any login hosted on the server. If you do not have root rights, you can only use your login.</div> <div data-placeholder="Перевод" dir="ltr">Incoming data marked with an asterisk are required.</div> | |
− | |||
− | |||
− | |||
− | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
|- | |- | ||
− | | <p dir="ltr" style="text-align: center;">''' | + | | <p dir="ltr" style="text-align: center;">'''Module'''</p> |
− | | <p dir="ltr" style="text-align: center;">''' | + | | <p dir="ltr" style="text-align: center;">'''Function'''</p> |
− | | <p dir="ltr" style="text-align: center;">''' | + | | <p dir="ltr" style="text-align: center;">'''Incoming data'''</p> |
− | | <p dir="ltr" style="text-align: center;">''' | + | | <p dir="ltr" style="text-align: center;">'''Error variants'''</p> |
|- | |- | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
Line 17: | Line 13: | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
− | + | List of user databases. | |
show_db | show_db | ||
− | | style="vertical-align: top;" | | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">username (post or get) * - username;</div> <div data-placeholder="Перевод" dir="ltr">password (post or get) * - user password;</div> <div data-placeholder="Перевод" dir="ltr">dbusage (post or get) * - constant, module name;</div> <div data-placeholder="Перевод" dir="ltr">show_db (post or get) * - constant, operation name;</div> <div data-placeholder="Перевод" dir="ltr">user_edit (post or get) - the name of the user being edited;</div> <div data-placeholder="Перевод" dir="ltr">language (post or get) - can take the value: en / ru (ru by default).</div> |
− | username (post | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">error: 0, mess: 'Displaying user bases';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, mess: 'The array of bases is empty';</div> <div data-placeholder="Перевод" dir="ltr">error: 400, mess: 'You do not have sufficient rights. Remove user_edit '.</div> |
− | |||
− | password (post | ||
− | |||
− | dbusage(post | ||
− | |||
− | show_db (post | ||
− | |||
− | user_edit (post | ||
− | |||
− | language (post | ||
− | |||
− | | style="vertical-align: top;" | | ||
− | error:0, mess:' | ||
− | |||
− | error:100, mess:' | ||
− | |||
− | error:400, mess:' | ||
− | |||
|- | |- | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
Line 46: | Line 24: | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
− | + | List of users of user databases.. | |
show_users | show_users | ||
− | | style="vertical-align: top;" | | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">username (post or get) * - username;</div> <div data-placeholder="Перевод" dir="ltr">password (post or get) * - user password;</div> <div data-placeholder="Перевод" dir="ltr">dbusage (post or get) * - constant, module name;</div> <div data-placeholder="Перевод" dir="ltr">show_users (post or get) * - constant, operation name;</div> <div data-placeholder="Перевод" dir="ltr">user_edit (post or get) - the name of the user being edited;</div> <div data-placeholder="Перевод" dir="ltr">language (post or get) - can take the value: en / ru (ru by default).</div> |
− | username (post | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">error: 0, mess: 'Displaying all users';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, mess: 'The user array is empty';</div> <div data-placeholder="Перевод" dir="ltr">error: 400, mess: 'You do not have sufficient rights. Remove user_edit '.</div> |
− | |||
− | password (post | ||
− | |||
− | dbusage(post | ||
− | |||
− | show_users (post | ||
− | |||
− | user_edit (post | ||
− | |||
− | language (post | ||
− | |||
− | | style="vertical-align: top;" | | ||
− | error:0, mess:' | ||
− | |||
− | error:100, mess:' | ||
− | |||
− | error:400, mess:' | ||
− | |||
|- | |- | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
Line 75: | Line 35: | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
− | + | List of database user privileges. | |
show_privilegies | show_privilegies | ||
− | | style="vertical-align: top;" | | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">username (post or get) * - username;</div> <div data-placeholder="Перевод" dir="ltr">password (post or get) * - user password;</div> <div data-placeholder="Перевод" dir="ltr">dbusage (post or get) * - constant, module name;</div> <div data-placeholder="Перевод" dir="ltr">show_privilegies (post or get) * - constant, operation name;</div> <div data-placeholder="Перевод" dir="ltr">name_db (post or get) * - the name of the database;</div> <div data-placeholder="Перевод" dir="ltr">name_user (post or get) * - database user;</div> <div data-placeholder="Перевод" dir="ltr">language (post or get) - can take the value: en / ru (ru by default).</div> |
− | username (post | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">error: 0, mess: 'Privilege list';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, mess: 'The user has no privileges. The list of privileges is empty ';</div> <div data-placeholder="Перевод" dir="ltr">error: 101, mess: 'Username is empty';</div> <div data-placeholder="Перевод" dir="ltr">error: 102, mess: 'Database name must be filled'.</div> |
− | |||
− | password (post | ||
− | |||
− | dbusage(post | ||
− | |||
− | show_privilegies (post | ||
− | |||
− | name_db (post | ||
− | |||
− | name_user (post | ||
− | |||
− | language (post | ||
− | |||
− | | style="vertical-align: top;" | | ||
− | error:0, mess:' | ||
− | |||
− | error:100, mess:' | ||
− | |||
− | error:101, mess:' | ||
− | |||
− | error:102, mess:' | ||
− | |||
|- | |- | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
Line 108: | Line 46: | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
− | + | Add database. | |
add_db | add_db | ||
− | | style="vertical-align: top;" | | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">username (post or get) * - username;</div> <div data-placeholder="Перевод" dir="ltr">password (post or get) * - user password;</div> <div data-placeholder="Перевод" dir="ltr">dbusage (post or get) * - constant, module name;</div> <div data-placeholder="Перевод" dir="ltr">add_db (post or get) * - constant, operation name;</div> <div data-placeholder="Перевод" dir="ltr">name_db (post or get) * - the name of the database;</div> <div data-placeholder="Перевод" dir="ltr">user_edit (post or get) - the name of the user being edited;</div> |
− | username (post | + | language (post или get) —can take a value: en/ru (by default ru). |
− | |||
− | password (post | ||
− | |||
− | dbusage(post | ||
− | |||
− | add_db (post | ||
− | |||
− | name_db (post | ||
− | |||
− | user_edit (post | ||
− | |||
− | language (post или get) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">error: 0, message: 'Database created';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, message: 'Database name must be filled in';</div> <div data-placeholder="Перевод" dir="ltr">error: 108, message: 'Wrong mysql root password. Please connects with server administrator ';</div> <div data-placeholder="Перевод" dir="ltr">error: -1, message: 'Database exists';</div> <div data-placeholder="Перевод" dir="ltr">error: 400, message: 'You do not have sufficient rights. Remove user_edit ';</div> <div data-placeholder="Перевод" dir="ltr">error: 404, message: 'mysql is not working';</div> <div data-placeholder="Перевод" dir="ltr">error: 107, message: 'Error. You have reached the maximum number of bases';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, message: 'DB NAME must be filled';</div> <div data-placeholder="Перевод" dir="ltr">error: 102, message: 'DB already exists'.</div> | ||
|- | |- | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
Line 151: | Line 59: | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
− | + | Add user. | |
add_user | add_user | ||
− | | style="vertical-align: top;" | | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">username (post or get) * - username;</div> <div data-placeholder="Перевод" dir="ltr">password (post or get) * - user password;</div> <div data-placeholder="Перевод" dir="ltr">dbusage (post or get) * - constant, module name;</div> <div data-placeholder="Перевод" dir="ltr">add_user (post or get) * - constant, operation name;</div> <div data-placeholder="Перевод" dir="ltr">login_user (post or get) * - database user login;</div> <div data-placeholder="Перевод" dir="ltr">password_user (post or get) * - database user password;</div> <div data-placeholder="Перевод" dir="ltr">user_edit (post or get) - the name of the user being edited;</div> <div data-placeholder="Перевод" dir="ltr">language (post or get) - can take the value: en / ru (ru by default).</div> |
− | username (post | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">error: 0, mess: 'User added';</div> <div data-placeholder="Перевод" dir="ltr">error: 404, mess: 'mysql is not working';</div> <div data-placeholder="Перевод" dir="ltr">error: 108, mess: 'Wrong mysql root password. Please connects with server administrator ';</div> <div data-placeholder="Перевод" dir="ltr">error: 101, mess: 'Username is empty';</div> <div data-placeholder="Перевод" dir="ltr">error: 102, mess: 'The password for user bd is empty';</div> <div data-placeholder="Перевод" dir="ltr">error: 400, mess: 'You do not have sufficient rights. Remove user_edit ';</div> <div data-placeholder="Перевод" dir="ltr">error: -1, mess: 'User exists';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, mess: 'Login must be filled';</div> <div data-placeholder="Перевод" dir="ltr">error: 101, mess: 'Login must be no more than 7 letters'</div> <div data-placeholder="Перевод" dir="ltr">error: 102, mess: 'Login already exists';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, mess: 'Password must be filled'.</div> |
− | |||
− | password (post | ||
− | |||
− | dbusage(post | ||
− | |||
− | add_user (post | ||
− | |||
− | login_user (post | ||
− | |||
− | password_user (post | ||
− | |||
− | user_edit (post | ||
− | |||
− | language (post | ||
− | |||
− | | style="vertical-align: top;" | | ||
− | error:0, mess:' | ||
− | |||
− | error:404, mess:' | ||
− | |||
− | error:108, mess:'Wrong mysql root password. Please connects with server administrator'; | ||
− | |||
− | error:101, mess:' | ||
− | |||
− | error:102, mess:' | ||
− | |||
− | error:400, mess:' | ||
− | |||
− | error:-1, mess:' | ||
− | |||
− | error:100, mess:'Login must be filled'; | ||
− | |||
− | error:101, mess:'Login must be no more than 7 letters' | ||
− | |||
− | error:102, mess:'Login already exists'; | ||
− | |||
− | error:100, mess:'Password must be filled'. | ||
− | |||
|- | |- | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
Line 200: | Line 70: | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
− | + | Add user to database. | |
add_user_db | add_user_db | ||
− | | style="vertical-align: top;" | | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">username (post or get) * - username;</div> <div data-placeholder="Перевод" dir="ltr">password (post or get) * - user password;</div> <div data-placeholder="Перевод" dir="ltr">dbusage (post or get) * - constant, module name;</div> <div data-placeholder="Перевод" dir="ltr">add_user_db (post or get) * - constant, operation name;</div> <div data-placeholder="Перевод" dir="ltr">name_db (post or get) * - the name of the database;</div> <div data-placeholder="Перевод" dir="ltr">name_user (post or get) * - database user;</div> <div data-placeholder="Перевод" dir="ltr">user_edit (post or get) - the name of the user being edited;</div> <div data-placeholder="Перевод" dir="ltr">language (post or get) - can take the value: en / ru (ru by default);</div> <div data-placeholder="Перевод" dir="ltr">privilegies name_user (post or get) * = all_privilegies (all privileges);</div> <div data-placeholder="Перевод" dir="ltr">open_remote (post or get) * - remote access ip-addresses separated by commas.</div> |
− | username (post | + | | style="vertical-align: top;" | <div data-placeholder="Перевод" dir="ltr">error: 0, mess: 'Privileges applied';</div> <div data-placeholder="Перевод" dir="ltr">error: 100, mess: 'Privilege is written incorrectly';</div> <div data-placeholder="Перевод" dir="ltr">error: 101, mess: 'Username is empty';</div> <div data-placeholder="Перевод" dir="ltr">error: 102, mess: 'Database name must be filled in';</div> <div data-placeholder="Перевод" dir="ltr">error: 109, mess: 'DB validation failed';</div> <div data-placeholder="Перевод" dir="ltr">error: 110, mess: 'User verification error';</div> <div data-placeholder="Перевод" dir="ltr">error: 404, mess: 'mysql is not working';</div> <div data-placeholder="Перевод" dir="ltr">error: 108, mess: 'mysql is not working';</div> <div data-placeholder="Перевод" dir="ltr">error: 405, mess: 'Attempt to edit data that is not your own'.</div> |
− | |||
− | password (post | ||
− | |||
− | dbusage(post | ||
− | |||
− | add_user_db (post | ||
− | |||
− | name_db (post | ||
− | |||
− | name_user (post | ||
− | |||
− | user_edit (post | ||
− | |||
− | language (post | ||
− | |||
− | privilegies name_user (post | ||
− | |||
− | open_remote (post | ||
− | |||
− | | style="vertical-align: top;" | | ||
− | error:0, mess:' | ||
− | |||
− | error:100, mess:' | ||
− | |||
− | error:101, mess:' | ||
− | |||
− | error:102, mess:' | ||
− | |||
− | error:109, mess:' | ||
− | |||
− | error:110, mess:' | ||
− | |||
− | error:404, mess:' | ||
− | |||
− | error:108, mess:' | ||
− | |||
− | error:405, mess:' | ||
− | |||
|} | |} | ||
− | + | Other useful articles: | |
{| style="width: 1191px;" | {| style="width: 1191px;" |
Revision as of 01:04, 11 April 2021
Administrative functions require API root rights in order to use any login hosted on the server. If you do not have root rights, you can only use your login.
Incoming data marked with an asterisk are required.
Module |
Function |
Incoming data |
Error variants |
dbusage |
List of user databases. show_db |
username (post or get) * - username; password (post or get) * - user password; dbusage (post or get) * - constant, module name; show_db (post or get) * - constant, operation name; user_edit (post or get) - the name of the user being edited; language (post or get) - can take the value: en / ru (ru by default).
|
error: 0, mess: 'Displaying user bases'; error: 100, mess: 'The array of bases is empty'; error: 400, mess: 'You do not have sufficient rights. Remove user_edit '.
|
dbusage |
List of users of user databases.. show_users |
username (post or get) * - username; password (post or get) * - user password; dbusage (post or get) * - constant, module name; show_users (post or get) * - constant, operation name; user_edit (post or get) - the name of the user being edited; language (post or get) - can take the value: en / ru (ru by default).
|
error: 0, mess: 'Displaying all users'; error: 100, mess: 'The user array is empty'; error: 400, mess: 'You do not have sufficient rights. Remove user_edit '.
|
dbusage |
List of database user privileges. show_privilegies |
username (post or get) * - username; password (post or get) * - user password; dbusage (post or get) * - constant, module name; show_privilegies (post or get) * - constant, operation name; name_db (post or get) * - the name of the database; name_user (post or get) * - database user; language (post or get) - can take the value: en / ru (ru by default).
|
error: 0, mess: 'Privilege list'; error: 100, mess: 'The user has no privileges. The list of privileges is empty '; error: 101, mess: 'Username is empty'; error: 102, mess: 'Database name must be filled'.
|
dbusage |
Add database. add_db |
username (post or get) * - username; password (post or get) * - user password; dbusage (post or get) * - constant, module name; add_db (post or get) * - constant, operation name; name_db (post or get) * - the name of the database; user_edit (post or get) - the name of the user being edited;
language (post или get) —can take a value: en/ru (by default ru). |
error: 0, message: 'Database created'; error: 100, message: 'Database name must be filled in'; error: 108, message: 'Wrong mysql root password. Please connects with server administrator '; error: -1, message: 'Database exists'; error: 400, message: 'You do not have sufficient rights. Remove user_edit '; error: 404, message: 'mysql is not working'; error: 107, message: 'Error. You have reached the maximum number of bases'; error: 100, message: 'DB NAME must be filled'; error: 102, message: 'DB already exists'.
|
dbusage |
Add user. add_user |
username (post or get) * - username; password (post or get) * - user password; dbusage (post or get) * - constant, module name; add_user (post or get) * - constant, operation name; login_user (post or get) * - database user login; password_user (post or get) * - database user password; user_edit (post or get) - the name of the user being edited; language (post or get) - can take the value: en / ru (ru by default).
|
error: 0, mess: 'User added'; error: 404, mess: 'mysql is not working'; error: 108, mess: 'Wrong mysql root password. Please connects with server administrator '; error: 101, mess: 'Username is empty'; error: 102, mess: 'The password for user bd is empty'; error: 400, mess: 'You do not have sufficient rights. Remove user_edit '; error: -1, mess: 'User exists'; error: 100, mess: 'Login must be filled'; error: 101, mess: 'Login must be no more than 7 letters' error: 102, mess: 'Login already exists'; error: 100, mess: 'Password must be filled'.
|
dbusage |
Add user to database. add_user_db |
username (post or get) * - username; password (post or get) * - user password; dbusage (post or get) * - constant, module name; add_user_db (post or get) * - constant, operation name; name_db (post or get) * - the name of the database; name_user (post or get) * - database user; user_edit (post or get) - the name of the user being edited; language (post or get) - can take the value: en / ru (ru by default); privilegies name_user (post or get) * = all_privilegies (all privileges); open_remote (post or get) * - remote access ip-addresses separated by commas.
|
error: 0, mess: 'Privileges applied'; error: 100, mess: 'Privilege is written incorrectly'; error: 101, mess: 'Username is empty'; error: 102, mess: 'Database name must be filled in'; error: 109, mess: 'DB validation failed'; error: 110, mess: 'User verification error'; error: 404, mess: 'mysql is not working'; error: 108, mess: 'mysql is not working'; error: 405, mess: 'Attempt to edit data that is not your own'.
|
Other useful articles: