:doc:`WorkSpaces <../../workspaces>` / Client / rebuild_workspaces

******************
rebuild_workspaces
******************



.. py:method:: WorkSpaces.Client.rebuild_workspaces(**kwargs)

  

  Rebuilds the specified WorkSpace.

   

  You cannot rebuild a WorkSpace unless its state is ``AVAILABLE``, ``ERROR``, ``UNHEALTHY``, ``STOPPED``, or ``REBOOTING``.

   

  Rebuilding a WorkSpace is a potentially destructive action that can result in the loss of data. For more information, see `Rebuild a WorkSpace <https://docs.aws.amazon.com/workspaces/latest/adminguide/reset-workspace.html>`__.

   

  This operation is asynchronous and returns before the WorkSpaces have been completely rebuilt.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces>`_  


  **Request Syntax**
  ::

    response = client.rebuild_workspaces(
        RebuildWorkspaceRequests=[
            {
                'WorkspaceId': 'string'
            },
        ]
    )
    
  :type RebuildWorkspaceRequests: list
  :param RebuildWorkspaceRequests: **[REQUIRED]** 

    The WorkSpace to rebuild. You can specify a single WorkSpace.

    

  
    - *(dict) --* 

      Describes the information used to rebuild a WorkSpace.

      

    
      - **WorkspaceId** *(string) --* **[REQUIRED]** 

        The identifier of the WorkSpace.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'FailedRequests': [
              {
                  'WorkspaceId': 'string',
                  'ErrorCode': 'string',
                  'ErrorMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **FailedRequests** *(list) --* 

        Information about the WorkSpace that could not be rebuilt.

        
        

        - *(dict) --* 

          Describes a WorkSpace that could not be rebooted. (  RebootWorkspaces), rebuilt (  RebuildWorkspaces), restored (  RestoreWorkspace), terminated (  TerminateWorkspaces), started (  StartWorkspaces), or stopped (  StopWorkspaces).

          
          

          - **WorkspaceId** *(string) --* 

            The identifier of the WorkSpace.

            
          

          - **ErrorCode** *(string) --* 

            The error code that is returned if the WorkSpace cannot be rebooted.

            
          

          - **ErrorMessage** *(string) --* 

            The text of the error message that is returned if the WorkSpace cannot be rebooted.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`WorkSpaces.Client.exceptions.OperationNotSupportedException`

  