We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
parking domain api not work return code 1
parking domain api not work return code 1
hi I try this code for park domain
<?php
// Server credentials
$vst_hostname = 'mydomain.com';
$vst_username = 'admin';
$vst_password = 'mypassword';
$vst_returncode = 'yes';
$vst_command = 'v-add-web-domain-alias';
// New Domain
$username = 'admin';
$domain = 'mydomain';
$aliases = 'park domain';
// Prepare POST query
$postvars = array(
'user' => $vst_username,
'password' => $vst_password,
'returncode' => $vst_returncode,
'cmd' => $vst_command,
'arg1' => $username,
'arg2' => $domain
);
$postdata = http_build_query($postvars);
// Send POST query via cURL
$postdata = http_build_query($postvars);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
$answer = curl_exec($curl);
// Check result
if($answer == 0) {
echo "Domain has been successfuly created\n";
} else {
echo "Query returned error code: " .$answer. "\n";
}
?>
but this give me return code 1. what field I missing there?
<?php
// Server credentials
$vst_hostname = 'mydomain.com';
$vst_username = 'admin';
$vst_password = 'mypassword';
$vst_returncode = 'yes';
$vst_command = 'v-add-web-domain-alias';
// New Domain
$username = 'admin';
$domain = 'mydomain';
$aliases = 'park domain';
// Prepare POST query
$postvars = array(
'user' => $vst_username,
'password' => $vst_password,
'returncode' => $vst_returncode,
'cmd' => $vst_command,
'arg1' => $username,
'arg2' => $domain
);
$postdata = http_build_query($postvars);
// Send POST query via cURL
$postdata = http_build_query($postvars);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
$answer = curl_exec($curl);
// Check result
if($answer == 0) {
echo "Domain has been successfuly created\n";
} else {
echo "Query returned error code: " .$answer. "\n";
}
?>
but this give me return code 1. what field I missing there?
Re: parking domain api not work return code 1
$postvars = array(
'user' => $vst_username,
'password' => $vst_password,
'returncode' => $vst_returncode,
'cmd' => $vst_command,
'arg1' => $username,
'arg2' => $domain,
'arg3' => $aliases //here
);
'user' => $vst_username,
'password' => $vst_password,
'returncode' => $vst_returncode,
'cmd' => $vst_command,
'arg1' => $username,
'arg2' => $domain,
'arg3' => $aliases //here
);