I am a little confused, since I am calling POWER_ON / POWER_OFF and it returns SERVERS_START / SERVERS_SHUTDOWN in the JSON response. (Depending on what I am trying to do)
My code looks like this:
_(Pretty much exactly like the example provided in the serverexamples.php file that comes with the SDK)
<?php
# Path to the autoloader file
require(__DIR__ . "/vendor/IONOS/vendor/autoload.php");
use src\oneandone\oneandone;
# New instance
$client = new OneAndOne("<API_KEY>");
$server = $client -> server();
$action = [
"action" => "POWER_ON",
"method" => "SOFTWARE"
];
$response = $server -> changeStatus($action, "<SERVER-ID>");
?>
I also tried setting the method to HARDWARE, but it didn't work either.
Retrieving the current status of the server works perfectly fine.
Hello there. I am trying to power on/power off my servers using the API. However, calling the
action
POWER_ON
/POWER_OFF
results in an error:{"type":"NOT_ALLOWED_ERROR","message":"","errors":"Not allowed operation: SERVERS_SHUTDOWN"}
I am a little confused, since I am calling
POWER_ON
/POWER_OFF
and it returnsSERVERS_START
/SERVERS_SHUTDOWN
in the JSON response. (Depending on what I am trying to do)My code looks like this: _(Pretty much exactly like the example provided in the serverexamples.php file that comes with the SDK)
I also tried setting the
method
toHARDWARE
, but it didn't work either. Retrieving the current status of the server works perfectly fine.I hope you can help me with this problem, thanks