query
Implement the following REST endpoints.
- Create a storage element.
- Fetch storage elements.
- Toggle active state of storage element.
check_dataset_fully_transformed
async
¶
check_dataset_fully_transformed(session, name, scope, storage_name, transformation, test_mode=False)
Check if dataset has been fully transformed.
dataset_belongs_to
¶
Query the L4 action picker database to get the dataset name.
dataset_scout
¶
Return the number of file replicas for each storage element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Postgres session. |
required | |
dataset_name
|
str
|
Name of dataset. |
required |
dataset_scope
|
str
|
Name of dataset scope. |
required |
Returns:
Name | Type | Description |
---|---|---|
count |
Dict
|
Number of file replicas for each storage element. |
find_dataset
async
¶
Find location of the dataset.
find_dataset_by_id
async
¶
Find dataset by id.
find_datasets_at_storage_element
async
¶
Find all datasets at a storage element.
find_file_by_id
async
¶
Find file by id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Union[AsyncSession, sessionmaker]
|
Postgres session. |
required |
id
|
int
|
File's id number. |
required |
Returns:
Name | Type | Description |
---|---|---|
file |
Dict
|
Dictionary containing file's info. |
find_num_replicas_by_deletion_status
async
¶
Find number of file replicas matching deletion status.
find_num_replicas_by_replication_status
async
¶
Find number of file replicas matching replication status.
find_replica_by_id
async
¶
Find file replica by id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Union[AsyncSession, sessionmaker]
|
Postgres session. |
required |
id
|
int
|
File replica's id number. |
required |
Returns:
Name | Type | Description |
---|---|---|
replica |
Dict
|
Dictionary containing replica's info. |
find_replica_info_by_deletion_status
async
¶
Find number of file replicas matching deletion status.
find_replica_info_by_replication_status
async
¶
find_replica_info_by_replication_status(session, status, duration, limit=100, test_mode=False)
Find number of file replicas matching replication status.
get_dataset
async
¶
Get a specific dataset.
get_dataset_by_file_replica_deletion_status
async
¶
Find datasets by file replica deletion status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Union[AsyncSession, sessionmaker]
|
Postgres session. |
required |
status
|
str
|
Deletion status. |
required |
storage_name
|
str
|
Storage name. |
required |
num_datasets
|
int
|
Number of datasets. |
10
|
Returns:
Name | Type | Description |
---|---|---|
datasets |
List[Dataset]
|
List of datasets. |
get_dataset_children
async
¶
Get dataset's children.
get_dataset_deletion_date
async
¶
List deletion date and state for dataset in all scopes dataset exists in.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Union[AsyncSession, sessionmaker]
|
Postgres session. |
required |
dataset
|
str
|
Name of dataset. |
required |
Returns:
Name | Type | Description |
---|---|---|
deletion_info |
Dict[str, Dict[str, Any]]
|
Dictionary of scope containing storage elements contain deletion date and state. |
get_dataset_scopes
async
¶
Get all scopes.
get_datasets
async
¶
Get all datasets for a scope.
get_file_replicas_by_deletion_status
async
¶
Find file replicas by deletion status.
get_file_replicas_by_replication_status
async
¶
get_file_replicas_by_replication_status(session, status, storage_name, replicate_to, num_replicas=1000)
Find file replicas by replication status.
Useful for finding replicas that are at replicate_to, but do not have an entry in the Datatrail database.
get_files
async
¶
Fetch files from a dataset.
get_larger_datasets
async
¶
Get the larger datasets for a given scope.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Union[AsyncSession, sessionmaker]
|
Postgres session. |
required |
scope
|
str
|
Name of scope. |
required |
test_mode
|
bool
|
Activate test mode. |
False
|
query_tsar_verification
¶
Fetch tsar verification from frb-master's verifications.