public async Task <GetBlockListResponse> GetBlockListAsync(string containerName, string blobName, string leaseId = null, GetBlockListListType blockListType = GetBlockListListType.Committed)
        {
            var request  = new GetBlockListRequest(_account, containerName, blobName, leaseId, blockListType);
            var response = await request.ExecuteAsync();

            return(response.Payload);
        }
Beispiel #2
0
        /// <summary>
        /// 查看当前网络下的所有区块列表,分页展示
        /// </summary>
        /// <param name="req"><see cref="GetBlockListRequest"/></param>
        /// <returns><see cref="GetBlockListResponse"/></returns>
        public GetBlockListResponse GetBlockListSync(GetBlockListRequest req)
        {
            JsonResponseModel <GetBlockListResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "GetBlockList");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <GetBlockListResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }