/** * @covers WindowsAzure\ServiceManagement\Models\CreateServiceOptions::setAffinityGroup * @covers WindowsAzure\ServiceManagement\Models\CreateServiceOptions::getAffinityGroup */ public function testSetAffinityGroup() { // Setup $options = new CreateServiceOptions(); $expected = 'MyGroup'; // Test $options->setAffinityGroup($expected); // Assert $this->assertEquals($expected, $options->getAffinityGroup()); }
/** * 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; }
public function createHostedService($name, $options = null) { $label = base64_encode($name); $options = new CreateServiceOptions(); $options->setLocation($this->defaultLocation); $this->restProxy->createHostedService($name, $label, $options); $this->createdHostedServices[] = $name; }
/** * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::createHostedService * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::getOperationStatus * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_getOperationPath * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_getHostedServicePath * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_getPath * @covers WindowsAzure\ServiceManagement\Models\GetOperationStatusResult::create * @covers WindowsAzure\ServiceManagement\Models\HostedService::toArray * @covers WindowsAzure\ServiceManagement\Internal\WindowsAzureService::toArray * @group HostedService */ public function testCreateHostedService() { // Setup $name = $this->getTestName(); $label = base64_encode($name); $options = new CreateServiceOptions(); $options->setLocation($this->defaultLocation); $options->setDescription('I am description'); // Test $this->restProxy->createHostedService($name, $label, $options); $this->createdHostedServices[] = $name; // Assert $this->assertTrue($this->hostedServiceExists($name)); }