VestaCP API
VestaCP API
(https://github.com/serghey-rodin/vesta) (https://www.facebook.com/vestacp)
(https://twitter.com/vestacp)
// Server credentials
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_returncode = 'yes';
$vst_command = 'v-add-user';
// New Account
$username = 'demo';
$password = 'd3m0p4ssw0rd';
$email = '[email protected]';
$package = 'default';
$fist_name = 'Rust';
$last_name = 'Cohle';
// Check result
if($answer == 0) {
echo "User account has been successfuly created\n";
} else {
echo "Query returned error code: " .$answer. "\n";
}
?>
<?php
// Server credentials
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_returncode = 'yes';
$vst_command = 'v-add-domain';
// New Domain
$username = 'demo';
$domain = 'demo.vestacp.com';
// Check result
if($answer == 0) {
echo "Domain has been successfuly created\n";
} else {
echo "Query returned error code: " .$answer. "\n";
}
?>
<?php
// Server credentials
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_returncode = 'yes';
$vst_command = 'v-add-database';
// New Database
$username = 'demo';
$db_name = 'wordpress';
$db_user = 'wordpress';
$db_pass = 'wpbl0gp4s';
// Check result
if($answer == 0) {
echo "Database has been successfuly created\n";
} else {
echo "Query returned error code: " .$answer. "\n";
}
?>
<?php
// Server credentials
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_command = 'v-list-user';
// Account
$username = 'demo';
$format = 'json';
// Print result
print_r($data);
?>
<?php
// Server credentials
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_command = 'v-list-web-domain';
// Account
$username = 'demo';
$domain = 'demo.vestacp.com';
$format = 'json';
// Print result
print_r($data);
?>
<?php
// Server credentials
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_returncode = 'yes';
$vst_command = 'v-delete-user';
// Account
$username = 'demo';
// Check result
if($answer == 0) {
echo "User account has been successfuly deleted\n";
} else {
echo "Query returned error code: " .$answer. "\n";
}
?>
<?php
// Server credentials
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_command = 'v-check-user-password';
$vst_returncode = 'yes';
// Account
$username = 'demo';
$password = 'demopassword';
// Check result
if($answer == 0) {
echo "OK: User can login\n";
} else {
echo "Error: Username or password is incorrect\n";
}
?>
Copyright © 2024 Vesta Control Panel. All right reserved. facebook CONTACT US:
[email protected]
(https://www.facebook.com
(mailto:[email protected])
/vestacp/)
twitter
(https://twitter.com/vestacp/)