:doc:`SimSpaceWeaver <../../simspaceweaver>` / Client / create_snapshot

***************
create_snapshot
***************



.. py:method:: SimSpaceWeaver.Client.create_snapshot(**kwargs)

  

  Creates a snapshot of the specified simulation. A snapshot is a file that contains simulation state data at a specific time. The state data saved in a snapshot includes entity data from the State Fabric, the simulation configuration specified in the schema, and the clock tick number. You can use the snapshot to initialize a new simulation. For more information about snapshots, see `Snapshots <https://docs.aws.amazon.com/simspaceweaver/latest/userguide/working-with_snapshots.html>`__ in the *SimSpace Weaver User Guide*.

   

  You specify a ``Destination`` when you create a snapshot. The ``Destination`` is the name of an Amazon S3 bucket and an optional ``ObjectKeyPrefix``. The ``ObjectKeyPrefix`` is usually the name of a folder in the bucket. SimSpace Weaver creates a ``snapshot`` folder inside the ``Destination`` and places the snapshot file there.

   

  The snapshot file is an Amazon S3 object. It has an object key with the form: ``object-key-prefix/snapshot/simulation-name-YYMMdd-HHmm-ss.zip``, where:

   

  
  * ``YY`` is the 2-digit year
   
  * ``MM`` is the 2-digit month
   
  * ``dd`` is the 2-digit day of the month
   
  * ``HH`` is the 2-digit hour (24-hour clock)
   
  * ``mm`` is the 2-digit minutes
   
  * ``ss`` is the 2-digit seconds
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/CreateSnapshot>`_  


  **Request Syntax**
  ::

    response = client.create_snapshot(
        Destination={
            'BucketName': 'string',
            'ObjectKeyPrefix': 'string'
        },
        Simulation='string'
    )
    
  :type Destination: dict
  :param Destination: **[REQUIRED]** 

    The Amazon S3 bucket and optional folder (object key prefix) where SimSpace Weaver creates the snapshot file.

     

    The Amazon S3 bucket must be in the same Amazon Web Services Region as the simulation.

    

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

      The name of an Amazon S3 bucket. For more information about buckets, see `Creating, configuring, and working with Amazon S3 buckets <https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html>`__ in the *Amazon Simple Storage Service User Guide*.

      

    
    - **ObjectKeyPrefix** *(string) --* 

      A string prefix for an Amazon S3 object key. It's usually a folder name. For more information about folders in Amazon S3, see `Organizing objects in the Amazon S3 console using folders <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-folders.html>`__ in the *Amazon Simple Storage Service User Guide*.

      

    
  
  :type Simulation: string
  :param Simulation: **[REQUIRED]** 

    The name of the simulation.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`SimSpaceWeaver.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`SimSpaceWeaver.Client.exceptions.InternalServerException`

  
  *   :py:class:`SimSpaceWeaver.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`SimSpaceWeaver.Client.exceptions.ValidationException`

  
  *   :py:class:`SimSpaceWeaver.Client.exceptions.ConflictException`

  