API publishing¶
When wis2box starts, the API provisioning environment is initialized. At this stage, the following steps are required:
station metadata has been configured
discovery metadata has been created
data pipelines are configured and running
Let’s dive into publishing the data and metadata:
wis2box provides an API supporting the OGC API standards using pygeoapi.
Station metadata API publishing¶
The first step is to publish our station metadata to the API. The command below will generate local station collection GeoJSON for pygeoapi publication.
wis2box metadata station publish-collection
Note
run the command wis2box metadata station sync /path/to/station_list.csv
to both
cache stations form OSCAR/Surface and publish station as a collection to the wis2box API
See also
Discovery metadata API publishing¶
This step will publish dataset discovery metadata to the API.
wis2box metadata discovery publish /path/to/discovery-metadata.yml
Dataset collection API publishing¶
The below command will add the dataset collection to pygeoapi from the discovery metadata MCF created as described in the Discovery metadata section.
wis2box api add-collection $WIS2BOX_DATADIR/data/config/foo/bar/baz/discovery-metadata.yml --topic-hierarchy foo.bar.baz
To delete the colection from the API backend and configuration:
wis2box api delete-collection --topic-hierarchy foo.bar.baz
Note that the data itself is being published to the API backend automatically given the event driven workflow. If manual ingest is needed, the following command can be run in interactive mode:
wis2box api add-collection-items --topic-hierarchy foo.bar.baz
Note
Changes to the API configuration are reflected and updated automatically.
Summary¶
At this point, you have successfully published the required data and metadata collections to the API.