Cloud Storage Integrator 2016 Node.js Edition
Cloud Storage Integrator 2016 Node.js Edition
Questions / Feedback?

ListBlocks Method

List the blocks under the specified block blob.

Syntax

azureblob.listBlocks(blobName, blockListType, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method will list the blocks that have been uploaded as part of the blob specified by blobName. All returned blocks will be stored within Blocks. The BlockList event will also fire for each block in the list.

There are two types of block lists maintained for a blob, Committed and Uncommitted. The committed block list contains a list of blocks that have been successfully committed using PutBlockList. The uncommitted block list contains a list of blocks that have been uploaded, using CreateBlock, but have not been committed.

blockListType allows you to specify which list you want return. The possible values are:

0 (Committed)Only the committed block list is retrieved.
1 (Uncommitted)Only the uncommitted block list is retrieved.
2 (All)Both the committed and uncommitted block lists are retrieved.

BlobSnapshot can be specified to retrieve a block list of a specific snapshot.

Optionally, LeaseId can be set in which case the operation will only be performed if the following two conditions are met;

  • The blob's lease is currently active.
  • The lease ID specified in the request matches that of the blob.

 
 
Copyright (c) 2019 /n software inc. - All rights reserved.
Cloud Storage Integrator 2016 Node.js Edition - Version 16.0 [Build 7239]