Skip to content

Action

vds_resource_check(resource_id) ΒΆ

Checks if the given resource ID is a datastore resource. This is defined as whether it has data in Elasticsearch or not.

Parameters:

Name Type Description Default
resource_id str

the resource ID

required

Returns:

Type Description
bool

True if the resource has data in Elasticsearch, False if not

Source code in ckanext/versioned_datastore/logic/resource/action.py
 7
 8
 9
10
11
12
13
14
15
16
@action(schema.vds_resource_check(), helptext.vds_resource_check)
def vds_resource_check(resource_id: str) -> bool:
    """
    Checks if the given resource ID is a datastore resource. This is defined as whether
    it has data in Elasticsearch or not.

    :param resource_id: the resource ID
    :returns: True if the resource has data in Elasticsearch, False if not
    """
    return is_datastore_resource(resource_id)