Returns the resource-based policy that is attached to an endpoint. If the endpoint doesn't have a policy, you get a ValidationException.
Parameters:
-
endpoint_name
(Optional[EndpointName], default:
None
)
–
The name of the endpoint. The endpoint must be in your account and in the current Amazon Web Services Region.
Raises:
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
| def get_endpoint_policy(
self,
*,
config_overrides: Optional[SageMakerClientConfig] = None,
endpoint_name: Optional[
"capo_sagemaker.types.endpoint_name.EndpointName"
] = None,
) -> "capo_sagemaker.types.get_endpoint_policy_response.GetEndpointPolicyResponse":
"""<p>Returns the resource-based policy that is attached to an endpoint. If the endpoint doesn't have a policy, you get a <code>ValidationException</code>.</p>
Args:
endpoint_name: <p>The name of the endpoint. The endpoint must be in your account and in the current Amazon Web Services Region.</p>
Raises:
capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sagemaker.types.get_endpoint_policy_request.GetEndpointPolicyRequest]",
) -> OperationResponse[
"capo_sagemaker.types.get_endpoint_policy_response.GetEndpointPolicyResponse"
]:
import capo_sagemaker._operations.sage_maker.get_endpoint_policy
output, http_response = (
capo_sagemaker._operations.sage_maker.get_endpoint_policy.get_endpoint_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetEndpointPolicy")
)
input_: capo_sagemaker.types.get_endpoint_policy_request.GetEndpointPolicyRequest = {}
if endpoint_name is not None:
input_["endpoint_name"] = endpoint_name
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|