From 21229f6a24a3bb7e1ce5c0808edc2ea7b4a30eb7 Mon Sep 17 00:00:00 2001 From: hunjixin <1084400399@qq.com> Date: Fri, 26 Aug 2022 13:31:48 +0800 Subject: [PATCH] fix: add fs status for piece storage info --- venus-shared/api/market/api.go | 2 +- venus-shared/api/market/method.md | 16 +++++++++++++--- venus-shared/types/market/piecestorage.go | 2 ++ venus-shared/types/market/storage.go | 6 ++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/venus-shared/api/market/api.go b/venus-shared/api/market/api.go index 99f9d8ea50..f0e5019c4e 100644 --- a/venus-shared/api/market/api.go +++ b/venus-shared/api/market/api.go @@ -162,7 +162,7 @@ type IMarket interface { GetStorageDealStatistic(ctx context.Context, miner address.Address) (*market.StorageDealStatistic, error) //perm:read // GetRetrievalDealStatistic get retrieval deal statistic infomation - // if set miner address to address.Undef, return all storage deal info + // todo address undefined is invalid, it is currently not possible to directly associate an order with a miner GetRetrievalDealStatistic(ctx context.Context, miner address.Address) (*market.RetrievalDealStatistic, error) //perm:read api.Version diff --git a/venus-shared/api/market/method.md b/venus-shared/api/market/method.md index 22e50defcf..aa5aea07e1 100644 --- a/venus-shared/api/market/method.md +++ b/venus-shared/api/market/method.md @@ -615,7 +615,7 @@ Response: ### GetRetrievalDealStatistic GetRetrievalDealStatistic get retrieval deal statistic infomation -if set miner address to address.Undef, return all storage deal info +todo address undefined is invalid, it is currently not possible to directly associate an order with a miner Perms: read @@ -747,7 +747,12 @@ Response: { "Path": "string value", "Name": "string value", - "ReadOnly": true + "ReadOnly": true, + "Status": { + "Capacity": 9, + "Available": 9, + "Reserved": 9 + } } ], "S3Storage": [ @@ -756,7 +761,12 @@ Response: "ReadOnly": true, "EndPoint": "string value", "Bucket": "string value", - "SubDir": "string value" + "SubDir": "string value", + "Status": { + "Capacity": 9, + "Available": 9, + "Reserved": 9 + } } ] } diff --git a/venus-shared/types/market/piecestorage.go b/venus-shared/types/market/piecestorage.go index c6a5d67dc2..09139fb6f7 100644 --- a/venus-shared/types/market/piecestorage.go +++ b/venus-shared/types/market/piecestorage.go @@ -9,6 +9,7 @@ type FsStorage struct { Path string Name string ReadOnly bool + Status StorageStatus } type S3Storage struct { @@ -17,4 +18,5 @@ type S3Storage struct { EndPoint string Bucket string SubDir string + Status StorageStatus } diff --git a/venus-shared/types/market/storage.go b/venus-shared/types/market/storage.go index cbf8a3e1ce..95909c20df 100644 --- a/venus-shared/types/market/storage.go +++ b/venus-shared/types/market/storage.go @@ -131,3 +131,9 @@ type StorageDealStatistic struct { type RetrievalDealStatistic struct { DealsStatus map[retrievalmarket.DealStatus]int64 } + +type StorageStatus struct { + Capacity int64 + Available int64 + Reserved int64 +}