src/ServiceManagement/ServiceManagementRestProxy.php
public function swapDeployment($name, $source, $destination)
    {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($destination, 'destination');
        Validate::notNullOrEmpty($destination, 'destination');
        Validate::isString($source, 'source');
        Validate::notNullOrEmpty($source, 'source');

        $xmlElements = [
            Resources::XTAG_PRODUCTION => $destination,
            Resources::XTAG_SOURCE_DEPLOYMENT => $source,
        ];
        $body = $this->_createRequestXml($xmlElements, Resources::XTAG_SWAP);
        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getHostedServicePath($name));
        $context->addStatusCode(Resources::STATUS_ACCEPTED);
        $context->setBody($body);
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

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

        return AsynchronousOperationResult::create(HttpClient::getResponseHeaders($response));
    }
public function swapDeployment($name, $source, $destination)
    {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($destination, 'destination');
        Validate::notNullOrEmpty($destination, 'destination');
        Validate::isString($source, 'source');
        Validate::notNullOrEmpty($source, 'source');

        $xmlElements = [
            Resources::XTAG_PRODUCTION => $destination,
            Resources::XTAG_SOURCE_DEPLOYMENT => $source,
        ];
        $body = $this->_createRequestXml($xmlElements, Resources::XTAG_SWAP);
        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getHostedServicePath($name));
        $context->addStatusCode(Resources::STATUS_ACCEPTED);
        $context->setBody($body);
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

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

        return AsynchronousOperationResult::create(HttpClient::getResponseHeaders($response));
    }
public function swapDeployment ( $ name , $ source , $ destination ) { Validate :: isString ( $ name , 'name' ) ; Validate :: notNullOrEmpty ( $ name , 'name' ) ; Validate :: isString ( $ destination , 'destination' ) ; Validate :: notNullOrEmpty ( $ destination , 'destination' ) ; Validate :: isString ( $ source , 'source' ) ; Validate :: notNullOrEmpty ( $ source , 'source' ) ; $ xmlElements = [ Resources :: XTAG_PRODUCTION => $ destination , Resources :: XTAG_SOURCE_DEPLOYMENT => $ source , ] ; $ body = $ this -> _createRequestXml ( $ xmlElements , Resources :: XTAG_SWAP ) ; $ context = new HttpCallContext ( ) ; $ context -> setMethod ( Resources :: HTTP_POST ) ; $ context -> setPath ( $ this -> _getHostedServicePath ( $ name ) ) ; $ context -> addStatusCode ( Resources :: STATUS_ACCEPTED ) ; $ context -> setBody ( $ body ) ; $ context -> addHeader ( Resources :: CONTENT_TYPE , Resources :: XML_CONTENT_TYPE ) ; $ response = $ this -> sendHttpContext ( $ context ) ; return AsynchronousOperationResult :: create ( HttpClient :: getResponseHeaders ( $ response ) ) ; }
Initiates a virtual IP swap between the staging and production deployment
environments for a service. If the service is currently running in the staging
environment, it will be swapped to the production environment. If it is
running in the production environment, it will be swapped to staging.

You can swap VIPs only if the number of endpoints specified by the service
definition is identical for both deployments. For example, if you add an HTTPS
endpoint to a web role that previously exposed only an HTTP endpoint, you
cannot upgrade your service using a VIP swap; you must delete your production
deployment and redeploy instead. You can obtain information about endpoints
that are used by using the Get Deployment operation.

@param string $name        The hosted service name
@param string $source      The name of the source deployment
@param string $destination The name of the destination deployment

@return AsynchronousOperationResult

@see http://msdn.microsoft.com/en-us/library/windowsazure/ee460814.aspx
Initiates a virtual IP swap between the staging and production deployment environments for a service . If the service is currently running in the staging environment it will be swapped to the production environment . If it is running in the production environment it will be swapped to staging .