:doc:`EBS <../../ebs>` / Client / list_snapshot_blocks

********************
list_snapshot_blocks
********************



.. py:method:: EBS.Client.list_snapshot_blocks(**kwargs)

  

  Returns information about the blocks in an Amazon Elastic Block Store snapshot.

   

  .. note::

    

    You should always retry requests that receive server ( ``5xx``) error responses, and ``ThrottlingException`` and ``RequestThrottledException`` client error responses. For more information see `Error retries <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/error-retries.html>`__ in the *Amazon Elastic Compute Cloud User Guide*.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListSnapshotBlocks>`_  


  **Request Syntax**
  ::

    response = client.list_snapshot_blocks(
        SnapshotId='string',
        NextToken='string',
        MaxResults=123,
        StartingBlockIndex=123
    )
    
  :type SnapshotId: string
  :param SnapshotId: **[REQUIRED]** 

    The ID of the snapshot from which to get block indexes and block tokens.

    

  
  :type NextToken: string
  :param NextToken: 

    The token to request the next page of results.

     

    If you specify **NextToken**, then **StartingBlockIndex** is ignored.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of blocks to be returned by the request.

     

    Even if additional blocks can be retrieved from the snapshot, the request can return less blocks than **MaxResults** or an empty array of blocks.

     

    To retrieve the next set of blocks from the snapshot, make another request with the returned **NextToken** value. The value of **NextToken** is ``null`` when there are no more blocks to return.

    

  
  :type StartingBlockIndex: integer
  :param StartingBlockIndex: 

    The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.

     

    If you specify **NextToken**, then **StartingBlockIndex** is ignored.

    

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

    
    ::

      {
          'Blocks': [
              {
                  'BlockIndex': 123,
                  'BlockToken': 'string'
              },
          ],
          'ExpiryTime': datetime(2015, 1, 1),
          'VolumeSize': 123,
          'BlockSize': 123,
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Blocks** *(list) --* 

        An array of objects containing information about the blocks.

        
        

        - *(dict) --* 

          A block of data in an Amazon Elastic Block Store snapshot.

          
          

          - **BlockIndex** *(integer) --* 

            The block index.

            
          

          - **BlockToken** *(string) --* 

            The block token for the block index.

            
      
    
      

      - **ExpiryTime** *(datetime) --* 

        The time when the ``BlockToken`` expires.

        
      

      - **VolumeSize** *(integer) --* 

        The size of the volume in GB.

        
      

      - **BlockSize** *(integer) --* 

        The size of the blocks in the snapshot, in bytes.

        
      

      - **NextToken** *(string) --* 

        The token to use to retrieve the next page of results. This value is null when there are no more results to return.

        
  
  **Exceptions**
  
  *   :py:class:`EBS.Client.exceptions.AccessDeniedException`

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

  
  *   :py:class:`EBS.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`EBS.Client.exceptions.RequestThrottledException`

  
  *   :py:class:`EBS.Client.exceptions.ServiceQuotaExceededException`

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

  