Skip to content

Commit

Permalink
fix:change dag cmd api permission to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin committed Jul 6, 2022
1 parent 7b6ee1e commit 9363190
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
10 changes: 5 additions & 5 deletions venus-shared/api/market/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ type IMarket interface {

// DagstoreListShards returns information about all shards known to the
// DAG store. Only available on nodes running the markets subsystem.
DagstoreListShards(ctx context.Context) ([]market.DagstoreShardInfo, error) //perm:read
DagstoreListShards(ctx context.Context) ([]market.DagstoreShardInfo, error) //perm:admin

// DagstoreInitializeShard initializes an uninitialized shard.
//
Expand All @@ -107,14 +107,14 @@ type IMarket interface {
//
// This operation fails if the shard is not in ShardStateNew state.
// It blocks until initialization finishes.
DagstoreInitializeShard(ctx context.Context, key string) error //perm:write
DagstoreInitializeShard(ctx context.Context, key string) error //perm:admin

// DagstoreRecoverShard attempts to recover a failed shard.
//
// This operation fails if the shard is not in ShardStateErrored state.
// It blocks until recovery finishes. If recovery failed, it returns the
// error.
DagstoreRecoverShard(ctx context.Context, key string) error //perm:write
DagstoreRecoverShard(ctx context.Context, key string) error //perm:admin

// DagstoreInitializeAll initializes all uninitialized shards in bulk,
// according to the policy passed in the parameters.
Expand All @@ -123,10 +123,10 @@ type IMarket interface {
// IO pressure if the storage subsystem has a large amount of deals.
//
// It returns a stream of events to report progress.
DagstoreInitializeAll(ctx context.Context, params market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) //perm:write
DagstoreInitializeAll(ctx context.Context, params market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) //perm:admin

//DagstoreInitializeStorage initializes all pieces in specify storage
DagstoreInitializeStorage(context.Context, string, market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error)
DagstoreInitializeStorage(context.Context, string, market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) //perm:admin

// DagstoreGC runs garbage collection on the DAG store.
DagstoreGC(ctx context.Context) ([]market.DagstoreShardResult, error) //perm:admin
Expand Down
11 changes: 6 additions & 5 deletions venus-shared/api/market/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ IO pressure if the storage subsystem has a large amount of deals.
It returns a stream of events to report progress.


Perms: write
Perms: admin

Inputs:
```json
Expand Down Expand Up @@ -285,7 +285,7 @@ This operation fails if the shard is not in ShardStateNew state.
It blocks until initialization finishes.


Perms: write
Perms: admin

Inputs:
```json
Expand All @@ -297,9 +297,10 @@ Inputs:
Response: `{}`

### DagstoreInitializeStorage
DagstoreInitializeStorage initializes all pieces in specify storage


Perms:
Perms: admin

Inputs:
```json
Expand Down Expand Up @@ -329,7 +330,7 @@ DagstoreListShards returns information about all shards known to the
DAG store. Only available on nodes running the markets subsystem.


Perms: read
Perms: admin

Inputs: `[]`

Expand All @@ -352,7 +353,7 @@ It blocks until recovery finishes. If recovery failed, it returns the
error.


Perms: write
Perms: admin

Inputs:
```json
Expand Down
10 changes: 5 additions & 5 deletions venus-shared/api/market/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9363190

Please sign in to comment.