Skip to content

Commit

Permalink
fix: add fs status for piece storage info
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin committed Aug 26, 2022
1 parent bd90f0e commit 21229f6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion venus-shared/api/market/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions venus-shared/api/market/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -747,7 +747,12 @@ Response:
{
"Path": "string value",
"Name": "string value",
"ReadOnly": true
"ReadOnly": true,
"Status": {
"Capacity": 9,
"Available": 9,
"Reserved": 9
}
}
],
"S3Storage": [
Expand All @@ -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
}
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions venus-shared/types/market/piecestorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type FsStorage struct {
Path string
Name string
ReadOnly bool
Status StorageStatus
}

type S3Storage struct {
Expand All @@ -17,4 +18,5 @@ type S3Storage struct {
EndPoint string
Bucket string
SubDir string
Status StorageStatus
}
6 changes: 6 additions & 0 deletions venus-shared/types/market/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ type StorageDealStatistic struct {
type RetrievalDealStatistic struct {
DealsStatus map[retrievalmarket.DealStatus]int64
}

type StorageStatus struct {
Capacity int64
Available int64
Reserved int64
}

0 comments on commit 21229f6

Please sign in to comment.