Scalr\Service\Aws\Ec2\V20140615\Ec2Api::rebootInstances PHP Method

rebootInstances() public method

Requests a reboot of one or more instances. This operation is asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed if the instances are valid and belong to you. Requests to reboot terminated instances are ignored. Note! If a Linux/UNIX instance does not cleanly shut down within four minutes, Amazon EC2 will perform a hard reboot.
public rebootInstances ( ListDataType $instanceIdList ) : boolean
$instanceIdList Scalr\Service\Aws\DataType\ListDataType The list of the Instance IDs
return boolean Returns true on success or throws an exception otherwise
    public function rebootInstances(ListDataType $instanceIdList)
    {
        $result = false;
        $options = array();
        if ($instanceIdList !== null) {
            $options = array_merge($options, $this->getInstanceIdListQuery($instanceIdList));
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            //Success
            $sxml = simplexml_load_string($response->getRawContent());
            if ((string) $sxml->return != 'true') {
                throw new Ec2Exception(sprintf('Amazon Ec2 could not reboot instances. It returned "%s"', $sxml->return));
            }
            $result = true;
        }
        return $result;
    }
Ec2Api