:doc:`ElasticBeanstalk <../../elasticbeanstalk>` / Client / swap_environment_cnames

***********************
swap_environment_cnames
***********************



.. py:method:: ElasticBeanstalk.Client.swap_environment_cnames(**kwargs)

  

  Swaps the CNAMEs of two environments.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs>`_  


  **Request Syntax**
  ::

    response = client.swap_environment_cnames(
        SourceEnvironmentId='string',
        SourceEnvironmentName='string',
        DestinationEnvironmentId='string',
        DestinationEnvironmentName='string'
    )
    
  :type SourceEnvironmentId: string
  :param SourceEnvironmentId: 

    The ID of the source environment.

     

    Condition: You must specify at least the ``SourceEnvironmentID`` or the ``SourceEnvironmentName``. You may also specify both. If you specify the ``SourceEnvironmentId``, you must specify the ``DestinationEnvironmentId``.

    

  
  :type SourceEnvironmentName: string
  :param SourceEnvironmentName: 

    The name of the source environment.

     

    Condition: You must specify at least the ``SourceEnvironmentID`` or the ``SourceEnvironmentName``. You may also specify both. If you specify the ``SourceEnvironmentName``, you must specify the ``DestinationEnvironmentName``.

    

  
  :type DestinationEnvironmentId: string
  :param DestinationEnvironmentId: 

    The ID of the destination environment.

     

    Condition: You must specify at least the ``DestinationEnvironmentID`` or the ``DestinationEnvironmentName``. You may also specify both. You must specify the ``SourceEnvironmentId`` with the ``DestinationEnvironmentId``.

    

  
  :type DestinationEnvironmentName: string
  :param DestinationEnvironmentName: 

    The name of the destination environment.

     

    Condition: You must specify at least the ``DestinationEnvironmentID`` or the ``DestinationEnvironmentName``. You may also specify both. You must specify the ``SourceEnvironmentName`` with the ``DestinationEnvironmentName``.

    

  
  
  :returns: None

  **Examples**

  The following operation swaps the assigned subdomains of two environments:
  ::

    response = client.swap_environment_cnames(
        DestinationEnvironmentName='my-env-green',
        SourceEnvironmentName='my-env-blue',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  