@@ -17,12 +17,14 @@ The indexer-cli provides an `actions` module for manually working with the actio
1717``` bash
1818Manage indexer actions
1919
20- indexer actions queue Queue an action item
21- indexer actions get List one or more actions
22- indexer actions execute Execute approved items in the action queue
23- indexer actions cancel Cancel an item in the queue
24- indexer actions approve Approve an action item
25- indexer actions Manage indexer actions
20+ indexer actions update Update one or more actions
21+ indexer actions queue Queue an action item
22+ indexer actions get List one or more actions
23+ indexer actions execute Execute approved items in the action queue
24+ indexer actions delete Delete one or many actions in the queue
25+ indexer actions cancel Cancel an item in the queue
26+ indexer actions approve Approve an action item
27+ indexer actions Manage indexer actions
2628```
2729
2830Local usage from source
@@ -45,6 +47,9 @@ Local usage from source
4547# Queue unallocate action (closeAllocation())
4648./bin/graph-indexer indexer actions queue unallocate QmeqJ6hsdyk9dVbo1tvRgAxWrVS3rkERiEMsxzPShKLco6 0x4a58d33e27d3acbaecc92c15101fbc82f47c2ae
4749
50+ # Update all queued reallocate actions, setting force=true and poi=0x0...
51+ ./bin/graph-indexer indexer actions update --status queued --type reallocate force true poi 0
52+
4853# Cancel action in the queue
4954./bin/graph-indexer indexer actions cancel
5055
@@ -67,13 +72,20 @@ Action Schema (shortened for focus; the endpoint also includes other methods spe
6772``` graphql
6873type Query {
6974 action (actionID : String ! ): Action
70- actions (filter : ActionFilter ): [Action ]!
75+ actions (
76+ filter : ActionFilter
77+ orderBy : ActionParams
78+ orderDirection : OrderDirection
79+ first : Int
80+ ): [Action ]!
7181 }
7282
7383 type Mutation {
7484 updateAction (action : ActionInput ! ): Action !
85+ updateActions (filter : ActionFilter ! , action : ActionUpdateInput ! ): [Action ]!
7586 queueActions (actions : [ActionInput ! ]! ): [Action ]!
7687 cancelActions (actionIDs : [String ! ]! ): [Action ]!
88+ deleteActions (actionIDs : [String ! ]! ): Int !
7789 approveActions (actionIDs : [String ! ]! ): [Action ]!
7890 executeApprovedActions : [ActionResult ! ]!
7991 }
@@ -122,6 +134,18 @@ input ActionInput {
122134 priority : Int
123135}
124136
137+ input ActionUpdateInput {
138+ id : Int
139+ deploymentID : String
140+ allocationID : String
141+ amount : Int
142+ poi : String
143+ force : Boolean
144+ type : ActionType
145+ status : ActionStatus
146+ reason : String
147+ }
148+
125149type Action {
126150 id : Int !
127151 status : ActionStatus !
@@ -137,7 +161,31 @@ type Action {
137161 transaction : String
138162 createdAt : BigInt !
139163 updatedAt : BigInt
140- }
164+ }
165+
166+ type ActionResult {
167+ id : Int !
168+ type : ActionType !
169+ deploymentID : String
170+ allocationID : String
171+ amount : String
172+ poi : String
173+ force : Boolean
174+ source : String !
175+ reason : String !
176+ status : String !
177+ transaction : String
178+ failureReason : String
179+ priority : Int
180+ }
181+
182+ input ActionFilter {
183+ id : Int
184+ type : ActionType
185+ status : String
186+ source : String
187+ reason : String
188+ }
141189
142190enum ActionStatus {
143191 queued
@@ -146,14 +194,31 @@ enum ActionStatus {
146194 success
147195 failed
148196 canceled
149- }
197+ }
150198
151- enum ActionType {
199+ enum ActionType {
152200 allocate
153201 unallocate
154202 reallocate
155203 collect
156- }
204+ }
205+
206+ enum ActionParams {
207+ id
208+ status
209+ type
210+ deploymentID
211+ allocationID
212+ transaction
213+ amount
214+ poi
215+ force
216+ source
217+ reason
218+ priority
219+ createdAt
220+ updatedAt
221+ }
157222```
158223
159224Example usage
0 commit comments