get_model_run_logs_of_dataset¶
- MachineLearningApi.get_model_run_logs_of_dataset(role_id, model_run_id, modelid, id, servicename, serviceloggroup, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Download SageMaker transform job logs for a model run
Returns a presigned S3 URL plus log preview for CloudWatch logs of a SageMaker batch transform job tied to a dataset file model run. Required query params: servicename=sagemaker and serviceloggroup=TransformJobs (else IPV-1053 when missing, LOG-1001 when values differ). Caller must have access to the dataset. Safe to retry (read-only URL/preview mint).
- Parameters:
role_id (str) – Amorphic role ID the request is authorized against. Must grant access to the dataset. (required)
model_run_id (str) – Model run ID used as the CloudWatch log stream prefix for the transform job. (required)
modelid (str) – ML model ID associated with the run. (required)
id (str) – Dataset ID the model was run against. (required)
servicename (str) – Must be sagemaker. Any other value returns LOG-1001; missing with other required params returns IPV-1053. (required)
serviceloggroup (str) – Must be TransformJobs. Log group resolved as /aws/{servicename}/{serviceloggroup}. (required)
_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 /datasets/{id}/files/models/{modelid}/run/{model_run_id}/logs
Parameter examples¶
Name |
In |
Example |
|---|---|---|
|
path |
|
|
path |
|
|
path |
|
|
query |
|
|
query |
|
Success (HTTP 200)¶
Logs uploaded to the logs bucket. Body is FileDownload with url (presigned), logPreview, and logTruncated.
Request / response example
{
"url": "https://s3.amazonaws.com/example-logs-bucket/ml-model-runs/c9d8e7f6-a5b4-3210-9876-543210fedcba.log?X-Amz-Algorithm=...",
"logPreview": "Starting the inference container\nTransform job completed successfully\n",
"logTruncated": false
}
Errors¶
Documented error codes: IPV-1053, LOG-1001.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1053 (missing servicename/serviceloggroup/model_run_id), LOG-1001 (wrong service/group), AUTH-* (no dataset access).
Missing required log query/path params
{
"Message": "IPV-1053 - Missing mandatory parameter(s) servicename, serviceloggroup in queryStringParameters and/or model_run_id in pathParameters"
}
Unsupported service or log group
{
"Message": "LOG-1001 - Invalid service name or service log group - glue, TransformJobs"
}
HTTP 500
Backend/generic failure. Body is {“Message”: “<CODE> - <text>”}.