src/ServiceManagement/ServiceManagementRestProxy.php
public function upgradeDeployment(
        $name,
        $mode,
        $packageUrl,
        $configuration,
        $label,
        $force,
        UpgradeDeploymentOptions $options
    ) {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($mode, 'mode');
        Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG);
        Validate::isString($packageUrl, 'packageUrl');
        Validate::notNullOrEmpty($packageUrl, 'packageUrl');
        Validate::isString($configuration, 'configuration');
        Validate::notNullOrEmpty($configuration, 'configuration');
        Validate::isString($label, 'label');
        Validate::notNullOrEmpty($label, 'label');
        Validate::isBoolean($force, 'force');
        Validate::notNullOrEmpty($force, 'force');
        Validate::notNullOrEmpty($options, 'options');

        $configuration = $this->_encodeConfiguration($configuration);

        $xmlElements = [
            Resources::XTAG_MODE => $mode,
            Resources::XTAG_PACKAGE_URL => $packageUrl,
            Resources::XTAG_CONFIGURATION => $configuration,
            Resources::XTAG_LABEL => $label,
            Resources::XTAG_ROLE_TO_UPGRADE => $options->getRoleToUpgrade(),
            Resources::XTAG_FORCE => Utilities::booleanToString($force),
        ];
        $body = $this->_createRequestXml(
            $xmlElements,
            Resources::XTAG_UPGRADE_DEPLOYMENT
        );
        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getDeploymentPath($name, $options).'/');
        $context->addStatusCode(Resources::STATUS_ACCEPTED);
        $context->addQueryParameter(
            Resources::QP_COMP,
            Resources::QPV_UPGRADE
        );
        $context->setBody($body);
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

        assert(Utilities::endsWith($context->getPath(), '/'));
        $response = $this->sendHttpContext($context);

        return AsynchronousOperationResult::create(HttpClient::getResponseHeaders($response));
    }
public function upgradeDeployment(
        $name,
        $mode,
        $packageUrl,
        $configuration,
        $label,
        $force,
        UpgradeDeploymentOptions $options
    ) {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($mode, 'mode');
        Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG);
        Validate::isString($packageUrl, 'packageUrl');
        Validate::notNullOrEmpty($packageUrl, 'packageUrl');
        Validate::isString($configuration, 'configuration');
        Validate::notNullOrEmpty($configuration, 'configuration');
        Validate::isString($label, 'label');
        Validate::notNullOrEmpty($label, 'label');
        Validate::isBoolean($force, 'force');
        Validate::notNullOrEmpty($force, 'force');
        Validate::notNullOrEmpty($options, 'options');

        $configuration = $this->_encodeConfiguration($configuration);

        $xmlElements = [
            Resources::XTAG_MODE => $mode,
            Resources::XTAG_PACKAGE_URL => $packageUrl,
            Resources::XTAG_CONFIGURATION => $configuration,
            Resources::XTAG_LABEL => $label,
            Resources::XTAG_ROLE_TO_UPGRADE => $options->getRoleToUpgrade(),
            Resources::XTAG_FORCE => Utilities::booleanToString($force),
        ];
        $body = $this->_createRequestXml(
            $xmlElements,
            Resources::XTAG_UPGRADE_DEPLOYMENT
        );
        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getDeploymentPath($name, $options).'/');
        $context->addStatusCode(Resources::STATUS_ACCEPTED);
        $context->addQueryParameter(
            Resources::QP_COMP,
            Resources::QPV_UPGRADE
        );
        $context->setBody($body);
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

        assert(Utilities::endsWith($context->getPath(), '/'));
        $response = $this->sendHttpContext($context);

        return AsynchronousOperationResult::create(HttpClient::getResponseHeaders($response));
    }
public function upgradeDeployment ( $ name , $ mode , $ packageUrl , $ configuration , $ label , $ force , UpgradeDeploymentOptions $ options ) { Validate :: isString ( $ name , 'name' ) ; Validate :: notNullOrEmpty ( $ name , 'name' ) ; Validate :: isString ( $ mode , 'mode' ) ; Validate :: isTrue ( Mode :: isValid ( $ mode ) , Resources :: INVALID_CHANGE_MODE_MSG ) ; Validate :: isString ( $ packageUrl , 'packageUrl' ) ; Validate :: notNullOrEmpty ( $ packageUrl , 'packageUrl' ) ; Validate :: isString ( $ configuration , 'configuration' ) ; Validate :: notNullOrEmpty ( $ configuration , 'configuration' ) ; Validate :: isString ( $ label , 'label' ) ; Validate :: notNullOrEmpty ( $ label , 'label' ) ; Validate :: isBoolean ( $ force , 'force' ) ; Validate :: notNullOrEmpty ( $ force , 'force' ) ; Validate :: notNullOrEmpty ( $ options , 'options' ) ; $ configuration = $ this -> _encodeConfiguration ( $ configuration ) ; $ xmlElements = [ Resources :: XTAG_MODE => $ mode , Resources :: XTAG_PACKAGE_URL => $ packageUrl , Resources :: XTAG_CONFIGURATION => $ configuration , Resources :: XTAG_LABEL => $ label , Resources :: XTAG_ROLE_TO_UPGRADE => $ options -> getRoleToUpgrade ( ) , Resources :: XTAG_FORCE => Utilities :: booleanToString ( $ force ) , ] ; $ body = $ this -> _createRequestXml ( $ xmlElements , Resources :: XTAG_UPGRADE_DEPLOYMENT ) ; $ context = new HttpCallContext ( ) ; $ context -> setMethod ( Resources :: HTTP_POST ) ; $ context -> setPath ( $ this -> _getDeploymentPath ( $ name , $ options ) . '/' ) ; $ context -> addStatusCode ( Resources :: STATUS_ACCEPTED ) ; $ context -> addQueryParameter ( Resources :: QP_COMP , Resources :: QPV_UPGRADE ) ; $ context -> setBody ( $ body ) ; $ context -> addHeader ( Resources :: CONTENT_TYPE , Resources :: XML_CONTENT_TYPE ) ; assert ( Utilities :: endsWith ( $ context -> getPath ( ) , '/' ) ) ; $ response = $ this -> sendHttpContext ( $ context ) ; return AsynchronousOperationResult :: create ( HttpClient :: getResponseHeaders ( $ response ) ) ; }
Initiates an upgrade to a deployment.

Note that you can upgrade a deployment either by specifying the deployment
environment (staging or production), or by specifying the deployment's unique
name.

@param string                   $name          The hosted service name
@param string                   $mode          The type of upgrade to initiate. If not specified the default
value is Auto. If set to Manual, walkUpgradeDomain API must be
called to apply the update. If set to Auto, the Windows Azure
platform will automatically apply the update to each Upgrade
Domain in sequence
@param string                   $packageUrl    The URL that refers to the location of the service package in the
Blob service. The service package can be located in a storage
account beneath the same subscription
@param string|resource          $configuration The configuration file contents
or file stream
@param string                   $label         The name for the hosted service that is base-64 encoded. The name
may be up to 100 characters in length
@param bool                     $force         Specifies whether the rollback should proceed even when it will
cause local data to be lost from some role instances. True if the
rollback should proceed; otherwise false if the rollback should
fail
@param UpgradeDeploymentOptions $options       The optional parameters

@return AsynchronousOperationResult

@see http://msdn.microsoft.com/en-us/library/windowsazure/ee460793.aspx
Initiates an upgrade to a deployment .