Beispiel #1
0
 /**
  * List the virtual machines owned by the account.
  *
  * @param ListVirtualMachinesData|array $filter    List virtual machines request data
  * @param PaginationType                $pagination     Pagination data
  * @return VirtualMachineInstancesList|null
  */
 public function describe($filter = null, PaginationType $pagination = null)
 {
     if ($filter !== null && !$filter instanceof ListVirtualMachinesData) {
         $filter = ListVirtualMachinesData::initArray($filter);
     }
     return $this->getApiHandler()->listVirtualMachines($filter, $pagination);
 }
Beispiel #2
0
 /**
  * List the virtual machines owned by the account.
  *
  * @param ListVirtualMachinesData $requestData    List virtual machines request data
  * @param PaginationType          $pagination     Pagination data
  * @return VirtualMachineInstancesList|null
  */
 public function listVirtualMachines(ListVirtualMachinesData $requestData = null, PaginationType $pagination = null)
 {
     $result = null;
     $args = array();
     if ($requestData !== null) {
         $args = $requestData->toArray();
     }
     if ($pagination !== null) {
         $args = array_merge($args, $pagination->toArray());
     }
     $response = $this->getClient()->call('listVirtualMachines', $args);
     if ($response->hasError() === false) {
         $resultObject = $response->getResult();
         if (property_exists($resultObject, 'count') && $resultObject->count > 0) {
             $result = $this->_loadVirtualMachineInstancesList($resultObject->virtualmachine);
         }
     }
     return $result;
 }