src/ServiceManagement/ServiceManagementRestProxy.php
public function createStorageService($name, $label, CreateServiceOptions $options)
    {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($label, 'label');
        Validate::notNullOrEmpty($label, 'label');
        Validate::notNullOrEmpty($options, 'options');
        $affinityGroup = $options->getAffinityGroup();
        $location = $options->getLocation();
        Validate::isTrue(
            !empty($location) || !empty($affinityGroup),
            Resources::INVALID_CREATE_SERVICE_OPTIONS_MSG
        );

        $storageService = new StorageService();
        $storageService->setName($name);
        $storageService->setLabel($label);
        $storageService->setLocation($options->getLocation());
        $storageService->setAffinityGroup($options->getAffinityGroup());
        $storageService->setDescription($options->getDescription());
        $storageService->addSerializationProperty(
            XmlSerializer::ROOT_NAME,
            Resources::XTAG_CREATE_STORAGE_SERVICE_INPUT
        );

        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getStorageServicePath());
        $context->addStatusCode(Resources::STATUS_ACCEPTED);
        $context->setBody($storageService->serialize($this->dataSerializer));
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

        $response = $this->sendHttpContext($context);

        return AsynchronousOperationResult::create(HttpClient::getResponseHeaders($response));
    }
public function createStorageService($name, $label, CreateServiceOptions $options)
    {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($label, 'label');
        Validate::notNullOrEmpty($label, 'label');
        Validate::notNullOrEmpty($options, 'options');
        $affinityGroup = $options->getAffinityGroup();
        $location = $options->getLocation();
        Validate::isTrue(
            !empty($location) || !empty($affinityGroup),
            Resources::INVALID_CREATE_SERVICE_OPTIONS_MSG
        );

        $storageService = new StorageService();
        $storageService->setName($name);
        $storageService->setLabel($label);
        $storageService->setLocation($options->getLocation());
        $storageService->setAffinityGroup($options->getAffinityGroup());
        $storageService->setDescription($options->getDescription());
        $storageService->addSerializationProperty(
            XmlSerializer::ROOT_NAME,
            Resources::XTAG_CREATE_STORAGE_SERVICE_INPUT
        );

        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getStorageServicePath());
        $context->addStatusCode(Resources::STATUS_ACCEPTED);
        $context->setBody($storageService->serialize($this->dataSerializer));
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

        $response = $this->sendHttpContext($context);

        return AsynchronousOperationResult::create(HttpClient::getResponseHeaders($response));
    }
public function createStorageService ( $ name , $ label , CreateServiceOptions $ options ) { Validate :: isString ( $ name , 'name' ) ; Validate :: notNullOrEmpty ( $ name , 'name' ) ; Validate :: isString ( $ label , 'label' ) ; Validate :: notNullOrEmpty ( $ label , 'label' ) ; Validate :: notNullOrEmpty ( $ options , 'options' ) ; $ affinityGroup = $ options -> getAffinityGroup ( ) ; $ location = $ options -> getLocation ( ) ; Validate :: isTrue ( ! empty ( $ location ) || ! empty ( $ affinityGroup ) , Resources :: INVALID_CREATE_SERVICE_OPTIONS_MSG ) ; $ storageService = new StorageService ( ) ; $ storageService -> setName ( $ name ) ; $ storageService -> setLabel ( $ label ) ; $ storageService -> setLocation ( $ options -> getLocation ( ) ) ; $ storageService -> setAffinityGroup ( $ options -> getAffinityGroup ( ) ) ; $ storageService -> setDescription ( $ options -> getDescription ( ) ) ; $ storageService -> addSerializationProperty ( XmlSerializer :: ROOT_NAME , Resources :: XTAG_CREATE_STORAGE_SERVICE_INPUT ) ; $ context = new HttpCallContext ( ) ; $ context -> setMethod ( Resources :: HTTP_POST ) ; $ context -> setPath ( $ this -> _getStorageServicePath ( ) ) ; $ context -> addStatusCode ( Resources :: STATUS_ACCEPTED ) ; $ context -> setBody ( $ storageService -> serialize ( $ this -> dataSerializer ) ) ; $ context -> addHeader ( Resources :: CONTENT_TYPE , Resources :: XML_CONTENT_TYPE ) ; $ response = $ this -> sendHttpContext ( $ context ) ; return AsynchronousOperationResult :: create ( HttpClient :: getResponseHeaders ( $ response ) ) ; }
Creates a new storage account in Windows Azure.

In the optional parameters either location or affinity group must be provided.
Because Create Storage Account is an asynchronous operation, it always returns
status code 202 (Accepted). To determine the status code for the operation
once it is complete, call getOperationStatus API. The status code is embedded
in the response for this operation; if successful, it will be
status code 200 (OK).

@param string               $name    The storage account name
@param string               $label   The name for the storage account specified as a base64-encoded string. The
name may be up to 100 characters in length. The name can be used identify
the storage account for your tracking purposes
@param CreateServiceOptions $options The optional parameters

@return AsynchronousOperationResult

@see http://msdn.microsoft.com/en-us/library/windowsazure/hh264518.aspx
Creates a new storage account in Windows Azure .