0
votes

I use NodeJS 'azure-storage' module (version: 0.3.3)

I would like to get global stats about azure storage blob service.

Of course, I wont query all blobs to calculate by hand the total amount of storage used.

So I think that using blobService.getServiceStats could help me. But this method return an error.

this.blobService.getServiceStats(function(error, result) {
  if (error) {
     console.info(error);
  } else {
    console.info(result);
  }
});

This result in the following error :

{ [Error: Value for one of the query parameters specifie
RequestId:51b156a6-0001-002d-765f-b4ebd5000000
Time:2014-10-17T12:40:59.1246311Z]
  code: 'InvalidQueryParameterValue',
  queryparametername: 'comp',
  queryparametervalue: 'stats',
  reason: '',
  statusCode: 400,
  requestId: '51b156a6-0001-002d-765f-b4ebd5000000' }

This query parameter 'comp = stats' seems to be set by the SDK itself : blobservice.js line 156

What's wrong ? do you think I should open an issue here ?

Do you know a (working) way to get global blob stats ?

regards

1

1 Answers

3
votes

I think you're misunderstanding the purpose of this operation. This operation tells you the information about Geo Replication Status on your blob storage account and not how much space you're occupying for blob storage. From on the REST API documentation for Get Service Stats: http://msdn.microsoft.com/en-us/library/azure/dn495326.aspx

The Get Blob Service Stats operation retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.

If you're interested in calculating the storage size of blob storage, what you would want to do is enable storage analytics on your storage account. After storage analytics is enabled, you can then query $MetricsCapacityBlob table to find the blob storage size. You can read more about this table here: http://msdn.microsoft.com/en-us/library/azure/hh343264.aspx.

Now coming to the reason why you're getting this error is because this operation can only be called on the secondary geo-location url [youraccountname]-secondary.blob.core.windows.net of your storage account. My guess is that you're just going with the standard settings which basically tries to execute this operation on the primary storage url [youraccountname].blob.core.windows.net.