SageMakerGatewayRuntime / Client / exceptions / AccessDeniedException

AccessDeniedException

class SageMakerGatewayRuntime.Client.exceptions.AccessDeniedException

The caller is not authorized to invoke this gateway. Invoking requires the sagemaker:InvokeGlobalInferenceGateway permission, or sagemaker:InvokeGlobalInferenceGatewayWithResponseStream for the streaming operation, on the gateway ARN. A message starting inference gateway means the inference gateway serving the model refused the request with a 401 or 403, for example for its customer identity token. Its status code is in the message (the response status is 403), and up to 256 bytes of its error message are quoted.

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    The caller is not authorized to invoke this gateway. Invoking requires the sagemaker:InvokeGlobalInferenceGateway permission, or sagemaker:InvokeGlobalInferenceGatewayWithResponseStream for the streaming operation, on the gateway ARN. A message starting inference gateway means the inference gateway serving the model refused the request with a 401 or 403, for example for its customer identity token. Its status code is in the message (the response status is 403), and up to 256 bytes of its error message are quoted.

    • Message (string) –

      A description of the error. It starts with a prefix such as Global Inference Gateway: or inference gateway: that says where the error came from.

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.