geonode.harvesting.tests.harvesters.test_harvester
Classes
Override base harvester as test harvester |
Module Contents
- class geonode.harvesting.tests.harvesters.test_harvester.TestHarvester(remote_url: str, harvester_id: int)[source]
Bases:
geonode.harvesting.harvesters.base.BaseHarvesterWorkerOverride base harvester as test harvester
- property allows_copying_resources: bool[source]
Whether copying remote resources is implemented by this worker
- classmethod from_django_record(record: geonode.harvesting.models.Harvester)[source]
Return a new instance of the worker from the django harvester
- get_num_available_resources() int[source]
Return the number of available resources on the remote service.
If there is a problem retrieving the number of available resource, this method shall raise HarvestingException.
- list_resources(offset: int | None = 0) List[geonode.harvesting.harvesters.base.BriefRemoteResource][source]
Return a list of resources from the remote service.
If there is a problem listing resource, this method shall raise HarvestingException.
- check_availability(timeout_seconds: int | None = 5) bool[source]
Check whether the remote service is online
- get_resource(harvestable_resource: geonode.harvesting.models.HarvestableResource, harvesting_session_id: int) geonode.harvesting.harvesters.base.HarvestedResourceInfo | None[source]
Harvest a single resource from the remote service.
The return value is an instance of HarvestedResourceInfo. It stores an instance of RecordDescription and additionally whatever type is required by child classes to be able to customize resource creation/update on the local GeoNode. Note that the default implementation of update_geonode_resource() only needs the RecordDescription. The possibility to return additional information exists solely for extensibility purposes and can be left as None in the simple cases.