vserver_image_copy ()
This function copy server image to another user.
HTTP Method: | GET | |
---|---|---|
Parameters: | sid | session id* |
simage_id | image id | |
$target_user_id | target user id | |
$id_vserver_plan | new image vserver plan. 0 or not set for keep if possible | |
Returns: | HTTP code | 200 (OK) |
Image has been succesfully copied. |
Return errors
Error code | HTTP response code | Description |
---|---|---|
1 | 400 (Bad request) | Function was not performed, because all required parameters were not entered. Reply portion reply is empty. |
2 | 403 (Forbidden) | Permission denied. You can't copy images to this user. |
3 | 403 (Forbidden) | Function call failed, invalid sid parameter. Create new sid using /api/login function. Reply portion reply is empty. |
5 | 400 (Bad request) | Permission denied. Image not exists or is not accesible. |
25 | 400 (Bad request) | Image server plan is invalid. Choose another. |
99 | 400 (Bad request) | Image copying failed. So sorry. |
CURL
curl "https://admin.hosting90.eu/api/vserver_image_copy?sid=%sid%&image_id=%image_id%&target_user_id=%target_user_id%"
PHP Library
$api->vserver_image_copy(array(
'image_id' => %image_id%,
'target_user_id' => %target_user_id%,
));
Example of data output
<?xml version="1.0" encoding="UTF-8"?>
<reply>
<status>
<code>0</code>
<text>Image has been succesfully copied</text>
</status>
</reply>