Skip to content

Module API.cron

Variables

RATE_LIMIT_PER_MIN
router

Functions

create_cron

def create_cron(
    request: starlette.requests.Request,
    cron_data: dict,
    user_data: API.auth.AuthUser = Depends(staff_required)
)
Create a new Cron entry.

Args: request (Request): The request object. cron_data (dict): Data for creating the cron entry. user_data (AuthUser): User authentication data.

Returns: dict: Result of the cron creation process.

delete_cron

def delete_cron(
    request: starlette.requests.Request,
    cron_id: int,
    user_data: API.auth.AuthUser = Depends(admin_required)
)
Delete an existing cron entry.

Args: request (Request): The request object. cron_id (int): ID of the cron entry to delete. user_data (AuthUser): User authentication data.

Returns: dict: Result of the cron deletion process.

Raises: HTTPException: If the cron entry is not found.

patch_cron

def patch_cron(
    request: starlette.requests.Request,
    cron_id: int,
    cron_data: Dict,
    user_data: API.auth.AuthUser = Depends(staff_required)
)
Partially update an existing cron entry.

Args: request (Request): The request object. cron_id (int): ID of the cron entry to update. cron_data (Dict): Data for partially updating the cron entry. user_data (AuthUser): User authentication data.

Returns: Dict: Result of the cron update process.

Raises: HTTPException: If the cron entry is not found.

read_cron

def read_cron(
    request: starlette.requests.Request,
    cron_id: int
)
Retrieve a specific cron entry by its ID.

Args: request (Request): The request object. cron_id (int): ID of the cron entry to retrieve.

Returns: dict: Details of the requested cron entry.

Raises: HTTPException: If the cron entry is not found.

read_cron_list

def read_cron_list(
    request: starlette.requests.Request,
    skip: int = 0,
    limit: int = 10
)
Retrieve a list of Cron entries based on provided filters.

Args: request (Request): The request object. skip (int): Number of entries to skip. limit (int): Maximum number of entries to retrieve.

Returns: List[dict]: List of Cron entries.

search_cron

def search_cron(
    request: starlette.requests.Request,
    dataset_title: str = Query(PydanticUndefined),
    skip: int = Query(0),
    limit: int = Query(10)
)
Search for Cron entries by dataset title.

Args: request (Request): The request object. dataset_title (str): The title of the dataset to search for. skip (int): Number of entries to skip. limit (int): Maximum number of entries to retrieve.

Returns: List[dict]: List of Cron entries matching the dataset title.

update_cron

def update_cron(
    request: starlette.requests.Request,
    cron_id: int,
    cron_data: dict,
    user_data: API.auth.AuthUser = Depends(staff_required)
)
Update an existing cron entry.

Args: request (Request): The request object. cron_id (int): ID of the cron entry to update. cron_data (dict): Data for updating the cron entry. user_data (AuthUser): User authentication data.

Returns: dict: Result of the cron update process.

Raises: HTTPException: If the cron entry is not found.