Skip to content

Commit

Permalink
Document the DELETE_INDEX task in the ingestion server API
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb committed Nov 9, 2023
1 parent 66134fa commit 5cf2dd3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
9 changes: 6 additions & 3 deletions documentation/ingestion_server/guides/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ differences.

- If the staging API reports errors, immediately switch back the aliases to
the old indices.
- If the staging API works, delete the old indices to recover the free space.
- If the staging API works,
[delete the old indices](/ingestion_server/reference/task_api.md#delete_index)
to recover the free space.

### Production deployment

Expand Down Expand Up @@ -102,8 +104,9 @@ differences.

- If the production API reports errors, immediately switch back the aliases
to the old indices.
- If the production API works, delete the old indices to recover the free
space.
- If the production API works,
[delete the old indices](/ingestion_server/reference/task_api.md#delete_index)
to recover the free space.

## Rollback

Expand Down
32 changes: 31 additions & 1 deletion documentation/ingestion_server/reference/task_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ suffix.
$ curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"model": "image", "action": "CREATE_AND_POPULATE_FILTERED_INDEX", "destination_index_suffix": "kw"}' \
-d '{"model": "image", "action": "CREATE_AND_POPULATE_FILTERED_INDEX", "destination_index_suffix": "20231106"}' \
http://localhost:8001/task
```

Expand Down Expand Up @@ -93,3 +93,33 @@ $ curl \
-d '{"model": "image", "action": "POINT_ALIAS", "index_suffix": "20231106", "alias": "image-filtered"}' \
http://localhost:8001/task
```

## DELETE_INDEX

This endpoint deletes the given index for a given media type.

```{danger}
Index deletion is an irreversible destructive operation. Please ensure that you
do not delete an index that is currently in use as the default or filtered index
for a media type.
```

### Body

```typescript
{
model: "image" | "audio"
action: "DELETE_INDEX"
index_suffix: string
}
```

### Example

```console
$ curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"model": "image", "action": "DELETE_INDEX", "index_suffix": "20231106"}' \
http://localhost:8001/task
```

0 comments on commit 5cf2dd3

Please sign in to comment.