geonode.harvesting.models

Attributes

logger

Classes

Harvester

AsynchronousHarvestingSession

HarvestableResource

Functions

validate_worker_configuration(worker_type, worker_config)

Module Contents

geonode.harvesting.models.logger[source]
class geonode.harvesting.models.Harvester[source]

Bases: django.db.models.Model

STATUS_READY = 'ready'[source]
STATUS_UPDATING_HARVESTABLE_RESOURCES = 'updating-harvestable-resources'[source]
STATUS_ABORTING_UPDATE_HARVESTABLE_RESOURCES = 'aborting-update-harvestable-resources'[source]
STATUS_PERFORMING_HARVESTING = 'harvesting-resources'[source]
STATUS_ABORTING_PERFORMING_HARVESTING = 'aborting-harvesting-resources'[source]
STATUS_CHECKING_AVAILABILITY = 'checking-availability'[source]
STATUS_CHOICES[source]
name[source]
status[source]
remote_url[source]
scheduling_enabled[source]
harvesting_session_update_frequency[source]
refresh_harvestable_resources_update_frequency[source]
remote_available[source]
check_availability_frequency[source]
last_checked_availability[source]
last_checked_harvestable_resources[source]
last_check_harvestable_resources_message[source]
default_owner[source]
harvest_new_resources_by_default[source]
delete_orphan_resources_automatically[source]
last_updated[source]
harvester_type[source]
harvester_type_specific_configuration[source]
num_harvestable_resources[source]
class Meta[source]
constraints[source]
__str__()[source]
property latest_refresh_session[source]
property latest_harvesting_session[source]
get_next_check_availability_dispatch_time() datetime.datetime[source]
get_next_refresh_session_dispatch_time() datetime.datetime | None[source]
get_next_harvesting_session_dispatch_time() datetime.datetime | None[source]
_get_next_dispatch_time(session_type: str) datetime.datetime | None[source]
is_availability_check_due()[source]
is_harvestable_resources_refresh_due()[source]
is_harvesting_due()[source]
clean()[source]

Perform model validation by inspecting fields that depend on each other.

We validate the harvester type specific configuration by determining if it meets the configured jsonschema (if any).

update_availability(timeout_seconds: int | None = 5)[source]

Use the harvesting worker to check if the remote service is available

initiate_update_harvestable_resources()[source]
initiate_perform_harvesting(harvestable_resource_ids: List[int] | None = None)[source]
initiate_abort_update_harvestable_resources()[source]
initiate_abort_perform_harvesting()[source]
get_harvester_worker() BaseHarvesterWorker[source]
worker_can_perform_action(target_status: str | None = STATUS_READY) Tuple[bool, str][source]
class geonode.harvesting.models.AsynchronousHarvestingSession[source]

Bases: django.db.models.Model

STATUS_PENDING = 'pending'[source]
STATUS_ON_GOING = 'on-going'[source]
STATUS_FINISHED_ALL_OK = 'finished-all-ok'[source]
STATUS_FINISHED_ALL_FAILED = 'finished-all-failed'[source]
STATUS_FINISHED_SOME_FAILED = 'finished-some-failed'[source]
STATUS_ABORTING = 'aborting'[source]
STATUS_ABORTED = 'aborted'[source]
STATUS_CHOICES[source]
TYPE_HARVESTING = 'harvesting'[source]
TYPE_DISCOVER_HARVESTABLE_RESOURCES = 'discover-harvestable-resources'[source]
TYPE_CHOICES[source]
session_type[source]
started[source]
updated[source]
ended[source]
harvester[source]
status[source]
details[source]
total_records_to_process[source]
records_done[source]
get_progress_percentage() int[source]
initiate(harvestable_resource_ids: List[int] | None = None)[source]

Initiate the asynchronous process that performs the work related to this session.

abort()[source]

Abort a pending or on-going session.

class geonode.harvesting.models.HarvestableResource[source]

Bases: django.db.models.Model

STATUS_READY = 'ready'[source]
STATUS_UPDATING_HARVESTABLE_RESOURCE = 'updating-harvestable-resource'[source]
STATUS_PERFORMING_HARVESTING = 'harvesting-resource'[source]
STATUS_CHOICES[source]
unique_identifier[source]
status[source]
title[source]
abstract[source]
harvester[source]
geonode_resource[source]
should_be_harvested[source]
last_updated[source]
last_refreshed[source]
last_harvested[source]
last_harvesting_message[source]
last_harvesting_succeeded[source]
remote_resource_type[source]
class Meta[source]
constraints[source]
delete(using=None, keep_parents=False)[source]
geonode.harvesting.models.validate_worker_configuration(worker_type: BaseHarvesterWorker, worker_config: Dict)[source]