Skip to content

Harvesting API

Bo Lu edited this page Oct 18, 2022 · 1 revision

Harvesting API

Summary

This program uses the GeoNetwork 'change' API to obtain a feed records that are new, modified, deleted or had their child/parent changed.

Location of the 'change' API: @https://maps.canada.ca/geonetwork/srv/api/0.1/records/status/change?@

Locations

Github repository

HNAP_JSON_Harvest

CloudFormation

hnap-json-harvester-HnapJsonHarvester2-XYZ

Usage and test cases

Note: runtype and fromDateTime cannot be used together

Default behaviour

Default behaviour (i.e., no additional parameters): This program will look backwards 11 minutes.

I.e., ?fromDateTime=XYZ, where XYZ is exactly 11 minutes prior and in ISO 8601 datetime format.

**Reload all JSON records **

?runtype=full

Insert a specific JSON record

?runtype=insert_uuid&uuid=$SOME_UUID

Delete a specific JSON record

?runtype=delete_uuid&uuid=$SOME_UUID

Load all records since a specific datetime

Note: dateTime is in ISO 8601

?fromDateTime=yyyy-MM-ddTHH:mm:ssZ
E.g., ?fromDateTime=2021-04-29T00:00:00Z

Load all records up to a specific datetime

Note: dateTime is in ISO 8601

?toDateTime=yyyy-MM-ddTHH:mm:ssZ
E.g., ?toDateTime=2021-04-29T00:00:00Z

Load all records between specific datetimes

Note: dateTime is in ISO 8601

?fromDateTime=yyyy-MM-ddTHH:mm:ssZ&toDateTime=yyyy-MM-ddTHH:mm:ssZ
E.g., ?fromDateTime=2021-04-29T00:00:00Z&toDateTime=2021-09-29T00:00:00Z

Fail-safe

If GeoNetwork (https://maps.canada.ca/geonetwork) is inaccessible then exit.

Clone this wiki locally