harvest

Get a single source given an ID or a slug

Changed on

Deliberately readable without a session, like the rest of the harvest reads -- which sources feed an open data portal is public information, it is the contract the frontend and upstream udata are built on, and test_get_source_permissions_as_anonymous draws that anonymous 200 explicitly.

What makes it safe is that no secret reaches the payload, not that nobody is looking: url is redacted here and in harvests.csv for anyone without edit, config is served only to those same readers because it carries the CKAN apikey, HarvestError and HarvestLog are redacted as they are built and again as they are serialized, and the source URL copied onto harvested dataservices is redacted at the copy. @api.secure would not have replaced any of that -- it only demands an account, and anyone can create one, so a registered reader would have seen exactly what an anonymous one did.

The confirmation oracle that used to be accepted here is gone: the text index no longer covers url, so ?q=<password> matches nothing, and a source URL can no longer be stored with credentials at all (LEDG-2502).

odspt and maaf used to build public dataset resource URLs and remote ids out of the source URL, which is the same defect in a place where redacting breaks a working download link. That was settled by redacting anyway: a link that only works because it carries somebody else's password is the defect, not a feature.

See LEDG-2477, LEDG-2500, LEDG-2502 and LEDG-2514.

get/harvest/source/{source}/

Request

  • Base URL
    https://dados.gov.pt/api/1
  • URL
    https://dados.gov.pt/api/1/harvest/source/{source}/
  • Auth
    none declared

Headers

X-Fieldsstring mask

An optional fields mask

Response

Success

activeboolean required

Is this source active

autoarchiveboolean required

If enabled, datasets not present on the remote source will be automatically archived

backend'ckan' | 'ckanpt' | 'csw-dcat' | 'csw-iso-19139' | 'cswudata' | 'dcat' | 'dgt' | 'dkan' | 'ine' | 'inehvd' | 'odspt' | 'ogc' required

The source backend

configobject

The configuration as key-value pairs, served only to readers who may edit the source

created_atstring date-time required

The source creation date

datasets_countinteger

Number of datasets harvested by this source

deletedstring date-time

The source deletion date

descriptionstring markdown

The source description

idstring

The source unique identifier

namestring required

The source display name

schedulestring

The source schedule (interval or cron expression)

urlstring required

The source base URL

Example response

{
  "backend": "ckan",
  "last_job": {
    "items": [
      {
        "dataservice": {
          "title": "My awesome API"
        },
        "status": "pending"
      }
    ],
    "status": "pending"
  },
  "validation": {
    "state": "pending"
  }
}

Changes