get_knowledge_base_resource_details¶
- ArtificialIntelligenceApi.get_knowledge_base_resource_details(id, resource_id, action, role_id, limit=None, offset=None, sortorder=None, sortby=None, projection_expression=None, filter_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get file status or metrics for a knowledge base source
Requires action. file_status returns a paginated list of files and per-KB indexing status (default sort FileName, offset 1, limit 100, max 1000). get_metrics returns aggregated Bedrock ingestion Metrics for the source (pagination query params are ignored). Requires at least read-only access. file_status matches SourceDetails.SourceId. get_metrics uses resource_id as the Bedrock data source ID.
- Parameters:
id (str) – Unique identifier of the knowledge base. (required)
resource_id (str) – Bedrock data source ID (SourceId). file_status matches SourceDetails.SourceId; get_metrics lists ingestion jobs for this ID. (required)
action (str) – file_status returns paginated file indexing status. get_metrics returns aggregated source metrics. Any other value is rejected. (required)
role_id (str) – Amorphic role ID of the requesting user. Must be a role the authenticated user belongs to. (required)
limit (int) – Page size for file_status. Default 100, maximum 1000. Ignored for get_metrics.
offset (str) – 1-based page offset for file_status. Default 1. Ignored for get_metrics.
sortorder (str) – Sort direction for file_status. Default desc. Any value other than desc is treated as ascending. Ignored for get_metrics.
sortby (str) – Field to sort by for file_status. Default FileName. The field must exist on every file item. Ignored for get_metrics.
projection_expression (str) – Comma-separated file attributes to include for file_status. When omitted, all file fields are returned. Ignored for get_metrics.
filter_expression (str) – Comma-separated field:value filters for file_status, applied before pagination (format key:value). FileName supports wildcard matching. Ignored for get_metrics.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /ai/knowledgebases/{id}/resources/{resource_id}
Parameter examples¶
Name |
In |
Example |
|---|---|---|
|
path |
|
|
path |
|
|
query |
|
|
header |
|
|
query |
|
|
query |
|
Success (HTTP 200)¶
file_status returns files plus next_available, count, and total_count. get_metrics returns Metrics.
action=file_status
{
"files": [
{
"FileName": "quarterly_report.pdf",
"FileStatus": "COMPLETE",
"DatasetName": "sales_docs",
"FilePath": "s3://example-dlz/sales_domain/sales_docs/upload_date=2026-08-01/quarterly_report.pdf"
}
],
"next_available": "no",
"count": 1,
"total_count": 1
}
action=get_metrics
{
"Metrics": {
"FilesScanned": 12,
"FilesDeleted": 0,
"FilesFailed": 0,
"MetadataFilesScanned": 0,
"MetadataFilesModified": 0,
"ModifiedFilesIndexed": 0,
"NewFilesIndexed": 12
}
}
Errors¶
Documented error codes: IPV-1006, IPV-1045, IPV-1002, AUTH-1001, AUTH-1011, GE-1085, DB-1002.
HTTP 400
Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1006 (missing/invalid action), IPV-1045 (limit over maximum), IPV-1002 (KB/source not found), AUTH-1001 (missing role_id), AUTH-1011 (caller not authorized).
Missing role_id header
{
"Message": "AUTH-1001 - Missing role information in event header"
}
Caller not authorized
{
"Message": "AUTH-1011 - User does not have sufficient permission to perform this action"
}
Invalid action query parameter
{
"Message": "IPV-1006 - Invalid action: bad_action. Allowed values: file_status, get_metrics"
}
HTTP 500
Backend failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1085 (unexpected backend failure), DB-1002 (persistence failure).
Unexpected backend failure
{
"Message": "GE-1085 - An unexpected error occurred"
}