You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-4Lines changed: 34 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@
55
55
-[Aggregation](#aggregation)
56
56
-[Hidden collections filter for authorization](#hidden-collections-filter-for-authorization)
57
57
-[Ingesting Data](#ingesting-data)
58
+
-[Ingest actions](#ingest-actions)
58
59
-[Ingesting large items](#ingesting-large-items)
59
60
-[Subscribing to SNS Topics](#subscribing-to-sns-topics)
60
61
-[Ingest Errors](#ingest-errors)
@@ -608,8 +609,9 @@ There are some settings that should be reviewed and updated as needeed in the se
608
609
| CORS_CREDENTIALS | Configure whether or not to send the `Access-Control-Allow-Credentials` CORS header. Header will be sent if set to `true`. | none |
609
610
| CORS_METHODS | Configure whether or not to send the `Access-Control-Allow-Methods` CORS header. Expects a comma-delimited string, e.g., `GET,PUT,POST`. | `GET,HEAD,PUT,PATCH,POST,DELETE` |
610
611
| CORS_HEADERS | Configure whether or not to send the `Access-Control-Allow-Headers` CORS header. Expects a comma-delimited string, e.g., `Content-Type,Authorization`. If not specified, defaults to reflecting the headers specified in the request’s `Access-Control-Request-Headers` header. | none |
611
-
| ENABLE_COLLECTIONS_AUTHX | Enables support for hidden `_collections` query parameter / field when set to `true`. | none |
612
-
| ENABLE_THUMBNAILS | Enables support for presigned thumnails. | none |
612
+
| ENABLE_COLLECTIONS_AUTHX | Enables support for hidden `_collections` query parameter / field when set to `true`. | none (not enabled) |
613
+
| ENABLE_THUMBNAILS | Enables support for presigned thumnails. | none (not enabled) |
614
+
| ENABLE_INGEST_ACTION_TRUNCATE | Enables support for ingest action "truncate". | none (not enabled) |
613
615
614
616
Additionally, the credential for OpenSearch must be configured, as decribed in the
615
617
section [Populating and accessing credentials](#populating-and-accessing-credentials).
@@ -1152,7 +1154,8 @@ STAC Collections and Items are ingested by the `ingest` Lambda function, however
1152
1154
**STAC Collections must be ingested before Items that belong to that Collection.** Items should have the `collection` field populated with the ID of an existing Collection. If an Item is ingested before ingestion of the Collection it contains,
1153
1155
ingestion will either fail (in the case of a single Item ingest) or if auto-creation of indexes is enabled (default) and multiple Items are ingested in bulk, the auto-created index will have incorrect mappings.
1154
1156
1155
-
If a collection or item is ingested, and an item with that id already exists in STAC, the new item will completely replace the old item.
1157
+
If a collection or item is ingested, and an item with that id already exists in STAC, the new item will completely replace the old item, except the `created` property will be retained and the `updated` property updated
1158
+
to match the time of the new update.
1156
1159
1157
1160
After a collection or item is ingested, the status of the ingest (success or failure) along with details of the collection or item are sent to a post-ingest SNS topic. To take action on items after they are ingested subscribe an endpoint to this topic.
1158
1161
@@ -1164,6 +1167,27 @@ Messages published to the post-ingest SNS topic include the following atributes
1164
1167
| ingestStatus | String | `successful` or `failed` |
1165
1168
| collection | String | |
1166
1169
1170
+
### Ingest actions
1171
+
1172
+
In addition to ingesting Item and Collection JSON, the ingestion pipeline can also execute
1173
+
actions. This is useful when the Transaction Extension is turned off, but data modification
1174
+
still needs to occur.
1175
+
1176
+
There is currently only one action implemented, `truncate`. This action will delete all
1177
+
of the Items in the specified Collection, but keep the Collection.
1178
+
1179
+
This action is enabled by setting `ENABLE_INGEST_ACTION_TRUNCATE` to `true`.
1180
+
1181
+
The form of this message is:
1182
+
1183
+
```json
1184
+
{
1185
+
"type": "action",
1186
+
"command": "truncate",
1187
+
"collection": "my_collection_1"
1188
+
}
1189
+
```
1190
+
1167
1191
### Ingesting large items
1168
1192
1169
1193
There is a 256 KB limit on the size of SQS messages. Larger items can by publishing a message to the `stac-server-<stage>-ingest` SNS topic in with the format:
@@ -1367,7 +1391,7 @@ npm test
1367
1391
npm run test:unit
1368
1392
1369
1393
# run unit tests with coverage
1370
-
npm run test:coverage
1394
+
npm run test:unit:coverage
1371
1395
1372
1396
# run tests from a single test file whose titles match 'foobar*'
1373
1397
npx ava tests/test-es.js --match='foobar*'
@@ -1401,6 +1425,12 @@ Once OpenSearch has been started, run the system tests:
1401
1425
npm run test:system
1402
1426
```
1403
1427
1428
+
With coverage:
1429
+
1430
+
```shell
1431
+
npm run test:system:coverage
1432
+
```
1433
+
1404
1434
A subset of system tests may be run by providing a glob matching the test files to run:
0 commit comments