bkbit.utils.nimp_api_endpoints module
- bkbit.utils.nimp_api_endpoints.get_ancestors(nhash_id, jwt_token, nhash_only=True, depth=None)[source]
Retrieve information of all ancestors of a record with the given NHash ID.
- Parameters:
nhash_id (str) – The NHash ID of the record.
jwt_token (str) – The JWT token for authentication.
nhash_only (bool) – Flag indicating whether to retrieve only NHash IDs or complete record information. Default is True.
depth (int) – The depth of ancestors to retrieve. Default is 1.
- Returns:
The JSON response containing information of all ancestors.
- Return type:
dict
- Raises:
requests.exceptions.HTTPError – If there is an error getting data for the NHash ID.
- bkbit.utils.nimp_api_endpoints.get_data(nhash_id, jwt_token)[source]
Retrieve information of any record with a NHash ID in the system.
- Parameters:
nhash_id (str) – The NHash ID of the record to retrieve.
jwt_token (str) – The JWT token for authentication.
- Returns:
The JSON response containing the information of the record.
- Return type:
dict
- Raises:
requests.exceptions.HTTPError – If there is an error retrieving the data.
- bkbit.utils.nimp_api_endpoints.get_descendants(nhash_id, jwt_token, nhash_only=True, depth=None)[source]
Retrieve information of all descendents of a record with the given NHash ID.
- Parameters:
nhash_id (str) – The NHash ID of the record.
jwt_token (str) – The JWT token for authentication.
nhash_only (bool) – Flag indicating whether to retrieve only NHash IDs or complete record information. Default is True.
depth (int) – The depth of descendents to retrieve. Default is 1.
- Returns:
The JSON response containing information of all descendents.
- Return type:
dict
- Raises:
requests.exceptions.HTTPError – If there is an error getting data for the NHash ID.