简体   繁体   English

Azure 数据湖一代。 2 (adls2), api 获取存储在数据湖中的数据的总体大小

[英]Azure data lake gen. 2 (adls2), api to get overall size of data stored in data lake

I am looking for a way to get data about overall size of all data stored in data lake (azure data lake gen2 2 - adls2).我正在寻找一种方法来获取有关存储在数据湖(天蓝色数据湖 gen2 2 - adls2)中的所有数据的总体大小的数据。 Does anyone know how to obtain such information about data lake size (how much data is stored)?有谁知道如何获取有关数据湖大小(存储多少数据)的此类信息? Tried to find appropriate API but didn't find anything so far.试图找到合适的 API 但到目前为止没有找到任何东西。 Will be thankful for any tips.将感谢任何提示。

If you want to get the size of all data stored in data lake gen2(not include the File, Table, Queue storage), you could use this Metrics - List REST API with metricnames=BlobCapacity , specify the timespan with the latest one hour, eg now is 2019-10-14T05:48:03Z , just use timespan=2019-10-14T04:47:03Z/2019-10-14T05:47:03Z , it works fine on my side.如果您想获取存储在数据湖 gen2 中的所有数据的大小(不包括File, Table, Queue存储),您可以使用此Metrics - List REST API 与metricnames=BlobCapacity ,指定最近一小时的timespan ,例如,现在是2019-10-14T05:48:03Z ,只需使用timespan=2019-10-14T04:47:03Z/2019-10-14T05:47:03Z ,它在我这边工作正常。

Sample :样品

GET https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Storage/storageAccounts/<storageaccount-name>/blobServices/default/providers/microsoft.insights/metrics?timespan=2019-10-14T04:47:03Z/2019-10-14T05:47:03Z&metricnames=BlobCapacity&api-version=2018-01-01

Response :回应

 { 
   "cost":0,
   "timespan":"2019-10-14T04:47:03Z/2019-10-14T05:47:03Z",
   "interval":"PT1H",
   "value":[ 
      { 
         "id":"/subscriptions/xxxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Storage/storageAccounts/joygen2/blobServices/default/providers/Microsoft.Insights/metrics/BlobCapacity",
         "type":"Microsoft.Insights/metrics",
         "name":{ 
            "value":"BlobCapacity",
            "localizedValue":"Blob Capacity"
         },
         "displayDescription":"The amount of storage used by the storage account’s Blob service in bytes.",
         "unit":"Bytes",
         "timeseries":[ 
            { 
               "metadatavalues":[ 

               ],
               "data":[ 
                  { 
                     "timeStamp":"2019-10-14T04:47:00Z",
                     "average":44710.0
                  }
               ]
            }
         ]
      }
   ],
   "namespace":"Microsoft.Storage/storageAccounts/blobServices",
   "resourceregion":"eastus"
}

Update :更新

If you want to get the size all data including the File, Table, Queue storage, just use the UsedCapacity metric name.如果要获取所有数据的大小,包括File, Table, Queue存储,只需使用UsedCapacity指标名称。

Sample :样品

GET https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Storage/storageAccounts/<storageaccount-name>/providers/microsoft.insights/metrics?timespan=2019-10-14T04:47:03Z/2019-10-14T05:47:03Z&metricnames=UsedCapacity&api-version=2018-01-01

Response :回应

{ 
   "cost":0,
   "timespan":"2019-10-14T04:47:03Z/2019-10-14T05:47:03Z",
   "interval":"PT1H",
   "value":[ 
      { 
         "id":"/subscriptions/xxxxx/resourceGroups/xxxxx/providers/Microsoft.Storage/storageAccounts/xxxxx/providers/Microsoft.Insights/metrics/UsedCapacity",
         "type":"Microsoft.Insights/metrics",
         "name":{ 
            "value":"UsedCapacity",
            "localizedValue":"Used capacity"
         },
         "displayDescription":"Account used capacity",
         "unit":"Bytes",
         "timeseries":[ 
            { 
               "metadatavalues":[ 

               ],
               "data":[ 
                  { 
                     "timeStamp":"2019-10-14T04:47:00Z",
                     "average":2559131.0
                  }
               ]
            }
         ]
      }
   ],
   "namespace":"Microsoft.Storage/storageAccounts",
   "resourceregion":"eastus"
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM