Is it possible to hit endpoints hosted in SageMaker besides /invocations?

こ雲淡風輕ζ 提交于 2020-01-25 09:38:05

问题


Using the aws sagemaker cli tools it's possible to invoke endpoint that are hosted in sagemaker using a command like:

aws sagemaker-runtime invoke-endpoint --body file://container/local_test/payload.json \
--endpoint-name $(DEPLOYMENT_NAME)-staging \
--content-type application/json \
--accept application/json \
output.json

By default, this command goes to the /invocations endpoint. Is it possible to go to a different endpoint? For example, if I implemented a health-report endpoint? It's definately possible to make one as in the BYOM example. I'm just not sure how I'd access it.

Thanks!


回答1:


Currently sagemaker-runtime has a single invoke-endpoint method.
Calling other REST resources is most likely doable if you'll call the endpoint URL yourself over HTTP (that is without using aws sagemaker-runtime), however, you'll probably need to take care of the required sigv4 authentication header.




回答2:


/invocations is not a SageMaker Endpoint, it's a HTTP request path where the prediction request is handled.

See documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/API_runtime_InvokeEndpoint.html

Request syntax:
POST /endpoints/EndpointName/invocations HTTP/1.1
Content-Type: ContentType
Accept: Accept

To your endpoint, the request is like:
POST /endpoints/$(DEPLOYMENT_NAME)-staging/invocations HTTP/1.1
Content-Type: ContentType
Accept: Accept



来源:https://stackoverflow.com/questions/51333159/is-it-possible-to-hit-endpoints-hosted-in-sagemaker-besides-invocations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!