/** * Creates a storage service if it does not exist and waits until it is created. * * @param string $name The storage service name. * @param string $execType The execution type for this call. * @param type $location The storage service location. By default East US. * * @return CloudStorageService */ public function createStorageService($name, $execType = self::SYNCHRONOUS, $location = 'East US') { $cloudStorageService = null; if (!$this->storageServiceExists($name)) { $options = new CreateServiceOptions(); $options->setLocation($location); $result = $this->_proxy->createStorageService($name, base64_encode($name), $options); if ($execType == self::SYNCHRONOUS) { $this->_blockUntilAsyncFinish($result); } $newStorageService = true; } $keys = $this->_proxy->getStorageServiceKeys($name); $properties = $this->_proxy->getStorageServiceProperties($name); $cloudStorageService = new CloudStorageService($name, $keys->getPrimary(), $properties->getStorageService()->getBlobEndpointUri(), $properties->getStorageService()->getQueueEndpointUri(), $properties->getStorageService()->getTableEndpointUri()); return $cloudStorageService; }
/** * Creates a storage service if it does not exist and waits until it is created. * * @param string $name The storage service name. * @param string $execType The execution type for this call. * @param type $location The storage service location. By default West US. * * @return CloudStorageService */ public function createStorageService($name, $execType = self::SYNCHRONOUS, $location = Locations::SOUTH_CENTRAL_US) { $newStorageService = false; $cloudStorageService = null; if (!$this->storageServiceExists($name)) { $options = new CreateStorageServiceOptions(); $options->setLocation($location); $result = $this->_proxy->createStorageService($name, base64_encode($name), $options); if ($execType == self::SYNCHRONOUS) { $this->_blockUntilAsyncFinish($result->getRequestId()); } $newStorageService = true; } if (!$newStorageService && $execType != self::ASYNCHRONOUS) { $keys = $this->_proxy->getStorageServiceKeys($name); $properties = $this->_proxy->getStorageServiceProperties($name); $cloudStorageService = new CloudStorageService($name, $keys->getPrimary(), $properties->getEndpoints()); } return $cloudStorageService; }