Exemplo n.º 1
0
 /**
  * Creates an instant snapshot of a volume.
  *
  * @param CreateSnapshotData $requestData Create snapshot request data object
  * @return SnapshotResponseData
  */
 public function createSnapshot(CreateSnapshotData $requestData)
 {
     $result = null;
     $response = $this->getClient()->call('createSnapshot', $requestData->toArray());
     if ($response->hasError() === false) {
         $resultObject = $response->getResult();
         if (!empty($resultObject)) {
             $result = $this->_loadSnapshotResponseData($resultObject);
         }
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Creates an instant snapshot of a volume.
  *
  * @param CreateSnapshotData|array $request Create snapshot request data object
  * @return SnapshotResponseData
  */
 public function create($request)
 {
     if ($request !== null && !$request instanceof CreateSnapshotData) {
         $request = CreateSnapshotData::initArray($request);
     }
     return $this->getApiHandler()->createSnapshot($request);
 }