Skip to content

Commit cc9a1f8

Browse files
committed
docs: Update action queue docs, include recent actions update support
1 parent 62735aa commit cc9a1f8

File tree

4 files changed

+88
-17
lines changed

4 files changed

+88
-17
lines changed

.github/workflows/indexer-agent-image.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
permissions:
16+
packages: write
1517

1618
steps:
1719
- name: Checkout
@@ -27,11 +29,11 @@ jobs:
2729
- name: Set up Docker Buildx
2830
uses: docker/setup-buildx-action@v1
2931
- name: Login to GitHub Container Registry
30-
uses: docker/login-action@v1
32+
uses: docker/login-action@v2
3133
with:
3234
registry: ghcr.io
3335
username: ${{github.repository_owner}}
34-
password: ${{secrets.cr_pat}}
36+
password: ${{secrets.GITHUB_TOKEN}}
3537
- name: Build and push Indexer Agent image
3638
id: docker_build
3739
uses: docker/build-push-action@v2

.github/workflows/indexer-cli-image.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
permissions:
16+
packages: write
1517

1618
steps:
1719
- name: Checkout
@@ -27,11 +29,11 @@ jobs:
2729
- name: Set up Docker Buildx
2830
uses: docker/setup-buildx-action@v1
2931
- name: Login to GitHub Container Registry
30-
uses: docker/login-action@v1
32+
uses: docker/login-action@v2
3133
with:
3234
registry: ghcr.io
3335
username: ${{github.repository_owner}}
34-
password: ${{secrets.cr_pat}}
36+
password: ${{secrets.GITHUB_TOKEN}}
3537
- name: Build and push Indexer CLI image
3638
id: docker_build
3739
uses: docker/build-push-action@v2

.github/workflows/indexer-service-image.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
permissions:
16+
packages: write
1517

1618
steps:
1719
- name: Checkout
@@ -27,11 +29,11 @@ jobs:
2729
- name: Set up Docker Buildx
2830
uses: docker/setup-buildx-action@v1
2931
- name: Login to GitHub Container Registry
30-
uses: docker/login-action@v1
32+
uses: docker/login-action@v2
3133
with:
3234
registry: ghcr.io
3335
username: ${{github.repository_owner}}
34-
password: ${{secrets.cr_pat}}
36+
password: ${{secrets.GITHUB_TOKEN}}
3537
- name: Build and push Indexer Service image
3638
id: docker_build
3739
uses: docker/build-push-action@v2

docs/action-queue.md

Lines changed: 76 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ The indexer-cli provides an `actions` module for manually working with the actio
1717
```bash
1818
Manage 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

2830
Local 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
6873
type 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+
125149
type 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

142190
enum 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

159224
Example usage

0 commit comments

Comments
 (0)