diff --git a/venus-shared/api/market/v0/api.go b/venus-shared/api/market/v0/api.go index 675c88251b..28f5ee9931 100644 --- a/venus-shared/api/market/v0/api.go +++ b/venus-shared/api/market/v0/api.go @@ -152,6 +152,9 @@ type IMarket interface { // DagstoreGC runs garbage collection on the DAG store. DagstoreGC(ctx context.Context) ([]market.DagstoreShardResult, error) //perm:admin + // DagstoreDestroyShards destroy shards by keys + DagstoreDestroyShards(ctx context.Context, keys []string) error //perm:admin + MarkDealsAsPacking(ctx context.Context, miner address.Address, deals []abi.DealID) error //perm:write UpdateDealOnPacking(ctx context.Context, miner address.Address, dealID abi.DealID, sectorid abi.SectorNumber, offset abi.PaddedPieceSize) error //perm:write UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus) error //perm:write diff --git a/venus-shared/api/market/v0/method.md b/venus-shared/api/market/v0/method.md index 1fffad0a96..640a217f5f 100644 --- a/venus-shared/api/market/v0/method.md +++ b/venus-shared/api/market/v0/method.md @@ -15,6 +15,7 @@ curl http://:/rpc/v0 -X POST -H "Content-Type: application/json" -H " * [AddFsPieceStorage](#addfspiecestorage) * [AddS3PieceStorage](#adds3piecestorage) * [AssignUnPackedDeals](#assignunpackeddeals) + * [DagstoreDestroyShards](#dagstoredestroyshards) * [DagstoreGC](#dagstoregc) * [DagstoreInitializeAll](#dagstoreinitializeall) * [DagstoreInitializeShard](#dagstoreinitializeshard) @@ -272,6 +273,23 @@ Response: ] ``` +### DagstoreDestroyShards +DagstoreDestroyShards destroy shards by keys + + +Perms: admin + +Inputs: +```json +[ + [ + "string value" + ] +] +``` + +Response: `{}` + ### DagstoreGC DagstoreGC runs garbage collection on the DAG store. diff --git a/venus-shared/api/market/v0/mock/mock_imarket.go b/venus-shared/api/market/v0/mock/mock_imarket.go index f12e0fcfeb..e3caddc9fc 100644 --- a/venus-shared/api/market/v0/mock/mock_imarket.go +++ b/venus-shared/api/market/v0/mock/mock_imarket.go @@ -165,6 +165,20 @@ func (mr *MockIMarketMockRecorder) AssignUnPackedDeals(arg0, arg1, arg2, arg3 in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AssignUnPackedDeals", reflect.TypeOf((*MockIMarket)(nil).AssignUnPackedDeals), arg0, arg1, arg2, arg3) } +// DagstoreDestroyShards mocks base method. +func (m *MockIMarket) DagstoreDestroyShards(arg0 context.Context, arg1 []string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreDestroyShards", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DagstoreDestroyShards indicates an expected call of DagstoreDestroyShards. +func (mr *MockIMarketMockRecorder) DagstoreDestroyShards(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreDestroyShards", reflect.TypeOf((*MockIMarket)(nil).DagstoreDestroyShards), arg0, arg1) +} + // DagstoreGC mocks base method. func (m *MockIMarket) DagstoreGC(arg0 context.Context) ([]market.DagstoreShardResult, error) { m.ctrl.T.Helper() diff --git a/venus-shared/api/market/v0/proxy_gen.go b/venus-shared/api/market/v0/proxy_gen.go index 79f5ce79a0..121e8ffa9a 100644 --- a/venus-shared/api/market/v0/proxy_gen.go +++ b/venus-shared/api/market/v0/proxy_gen.go @@ -30,6 +30,7 @@ type IMarketStruct struct { AddFsPieceStorage func(ctx context.Context, name string, path string, readonly bool) error `perm:"admin"` AddS3PieceStorage func(ctx context.Context, name, endpoit, bucket, subdir, accessKey, secretKey, token string, readonly bool) error `perm:"admin"` AssignUnPackedDeals func(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) `perm:"write"` + DagstoreDestroyShards func(ctx context.Context, keys []string) error `perm:"admin"` DagstoreGC func(ctx context.Context) ([]market.DagstoreShardResult, error) `perm:"admin"` DagstoreInitializeAll func(ctx context.Context, params market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) `perm:"admin"` DagstoreInitializeShard func(ctx context.Context, key string) error `perm:"admin"` @@ -143,6 +144,9 @@ func (s *IMarketStruct) AddS3PieceStorage(p0 context.Context, p1, p2, p3, p4, p5 func (s *IMarketStruct) AssignUnPackedDeals(p0 context.Context, p1 abi.SectorID, p2 abi.SectorSize, p3 *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) { return s.Internal.AssignUnPackedDeals(p0, p1, p2, p3) } +func (s *IMarketStruct) DagstoreDestroyShards(p0 context.Context, p1 []string) error { + return s.Internal.DagstoreDestroyShards(p0, p1) +} func (s *IMarketStruct) DagstoreGC(p0 context.Context) ([]market.DagstoreShardResult, error) { return s.Internal.DagstoreGC(p0) } diff --git a/venus-shared/api/market/v1/api.go b/venus-shared/api/market/v1/api.go index f8f36c63c3..d3b0055b43 100644 --- a/venus-shared/api/market/v1/api.go +++ b/venus-shared/api/market/v1/api.go @@ -152,6 +152,9 @@ type IMarket interface { // DagstoreGC runs garbage collection on the DAG store. DagstoreGC(ctx context.Context) ([]market.DagstoreShardResult, error) //perm:admin + // DagstoreDestroyShards destroy shards by keys + DagstoreDestroyShards(ctx context.Context, keys []string) error //perm:admin + MarkDealsAsPacking(ctx context.Context, miner address.Address, deals []abi.DealID) error //perm:write UpdateDealOnPacking(ctx context.Context, miner address.Address, dealID abi.DealID, sectorid abi.SectorNumber, offset abi.PaddedPieceSize) error //perm:write UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus, dealStatus storagemarket.StorageDealStatus) error //perm:write diff --git a/venus-shared/api/market/v1/method.md b/venus-shared/api/market/v1/method.md index 1ec21485ba..e6b361e5cb 100644 --- a/venus-shared/api/market/v1/method.md +++ b/venus-shared/api/market/v1/method.md @@ -15,6 +15,7 @@ curl http://:/rpc/v1 -X POST -H "Content-Type: application/json" -H " * [AddFsPieceStorage](#addfspiecestorage) * [AddS3PieceStorage](#adds3piecestorage) * [AssignUnPackedDeals](#assignunpackeddeals) + * [DagstoreDestroyShards](#dagstoredestroyshards) * [DagstoreGC](#dagstoregc) * [DagstoreInitializeAll](#dagstoreinitializeall) * [DagstoreInitializeShard](#dagstoreinitializeshard) @@ -273,6 +274,23 @@ Response: ] ``` +### DagstoreDestroyShards +DagstoreDestroyShards destroy shards by keys + + +Perms: admin + +Inputs: +```json +[ + [ + "string value" + ] +] +``` + +Response: `{}` + ### DagstoreGC DagstoreGC runs garbage collection on the DAG store. diff --git a/venus-shared/api/market/v1/mock/mock_imarket.go b/venus-shared/api/market/v1/mock/mock_imarket.go index 2e24bce8a6..d023007725 100644 --- a/venus-shared/api/market/v1/mock/mock_imarket.go +++ b/venus-shared/api/market/v1/mock/mock_imarket.go @@ -165,6 +165,20 @@ func (mr *MockIMarketMockRecorder) AssignUnPackedDeals(arg0, arg1, arg2, arg3 in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AssignUnPackedDeals", reflect.TypeOf((*MockIMarket)(nil).AssignUnPackedDeals), arg0, arg1, arg2, arg3) } +// DagstoreDestroyShards mocks base method. +func (m *MockIMarket) DagstoreDestroyShards(arg0 context.Context, arg1 []string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreDestroyShards", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DagstoreDestroyShards indicates an expected call of DagstoreDestroyShards. +func (mr *MockIMarketMockRecorder) DagstoreDestroyShards(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreDestroyShards", reflect.TypeOf((*MockIMarket)(nil).DagstoreDestroyShards), arg0, arg1) +} + // DagstoreGC mocks base method. func (m *MockIMarket) DagstoreGC(arg0 context.Context) ([]market.DagstoreShardResult, error) { m.ctrl.T.Helper() diff --git a/venus-shared/api/market/v1/proxy_gen.go b/venus-shared/api/market/v1/proxy_gen.go index dd1506a65a..8cfb00a62c 100644 --- a/venus-shared/api/market/v1/proxy_gen.go +++ b/venus-shared/api/market/v1/proxy_gen.go @@ -30,6 +30,7 @@ type IMarketStruct struct { AddFsPieceStorage func(ctx context.Context, name string, path string, readonly bool) error `perm:"admin"` AddS3PieceStorage func(ctx context.Context, name, endpoit, bucket, subdir, accessKey, secretKey, token string, readonly bool) error `perm:"admin"` AssignUnPackedDeals func(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) `perm:"write"` + DagstoreDestroyShards func(ctx context.Context, keys []string) error `perm:"admin"` DagstoreGC func(ctx context.Context) ([]market.DagstoreShardResult, error) `perm:"admin"` DagstoreInitializeAll func(ctx context.Context, params market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) `perm:"admin"` DagstoreInitializeShard func(ctx context.Context, key string) error `perm:"admin"` @@ -144,6 +145,9 @@ func (s *IMarketStruct) AddS3PieceStorage(p0 context.Context, p1, p2, p3, p4, p5 func (s *IMarketStruct) AssignUnPackedDeals(p0 context.Context, p1 abi.SectorID, p2 abi.SectorSize, p3 *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) { return s.Internal.AssignUnPackedDeals(p0, p1, p2, p3) } +func (s *IMarketStruct) DagstoreDestroyShards(p0 context.Context, p1 []string) error { + return s.Internal.DagstoreDestroyShards(p0, p1) +} func (s *IMarketStruct) DagstoreGC(p0 context.Context) ([]market.DagstoreShardResult, error) { return s.Internal.DagstoreGC(p0) }