boto / botocore

The low-level, core functionality of boto3 and the AWS CLI.
Apache License 2.0
1.45k stars 1.06k forks source link

get_available_regions for the 'sagemaker-a2i-runtime' service returns no regions / service endpoints #2324

Closed jvanbuel closed 2 years ago

jvanbuel commented 3 years ago

Describe the bug

When using get_available_regions api for the 'sagemaker-a2i-runtime' service, no regions / service endpoints are returned. I believe the underlying reason is that the service is not yet included in botocore/botocore/data/endpoints.json. Instead of submitting a PR to edit this file, I am submitting this issue, as suggested by the Contributing guide.

Steps to reproduce

import botocore.session

sess = botocore.session.Session()
sess.get_available_regions(service_name='sagemaker-a2i-runtime', partition_name='aws', allow_non_regional=True)

returns an empty list []

Expected behavior

I expected to receive a list of available regions and endpoints. The following boto3 snippet does allow me to list endpoints for the service:

import boto3
sess = boto3.session.Session()

a2i_runtime = sess.client(service_name='sagemaker-a2i-runtime')
a2i_runtime._endpoint.host

returns 'https://a2i-runtime.sagemaker.eu-west-1.amazonaws.com'

Debug logs

2021-03-23 14:04:45,741 - botocore.hooks - DEBUG - Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2021-03-23 14:04:45,743 - botocore.hooks - DEBUG - Changing event name from before-call.apigateway to before-call.api-gateway
2021-03-23 14:04:45,745 - botocore.hooks - DEBUG - Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2021-03-23 14:04:45,747 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2021-03-23 14:04:45,748 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2021-03-23 14:04:45,749 - botocore.hooks - DEBUG - Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2021-03-23 14:04:45,752 - botocore.hooks - DEBUG - Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2021-03-23 14:04:45,756 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2021-03-23 14:04:45,757 - botocore.hooks - DEBUG - Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2021-03-23 14:04:45,758 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2021-03-23 14:04:45,759 - botocore.hooks - DEBUG - Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2021-03-23 14:04:45,769 - botocore.loaders - DEBUG - Loading JSON file: /Users/jvanbuel/.pyenv/versions/3.7.6/lib/python3.7/site-packages/botocore/data/endpoints.json
2021-03-23 14:04:45,769 - botocore.loaders - DEBUG - Loading JSON file: /Users/jvanbuel/.pyenv/versions/3.7.6/lib/python3.7/site-packages/botocore/data/endpoints.json
2021-03-23 14:04:45,817 - botocore.loaders - DEBUG - Loading JSON file: /Users/jvanbuel/.pyenv/versions/3.7.6/lib/python3.7/site-packages/botocore/data/sagemaker-a2i-runtime/2019-11-07/service-2.json
2021-03-23 14:04:45,817 - botocore.loaders - DEBUG - Loading JSON file: /Users/jvanbuel/.pyenv/versions/3.7.6/lib/python3.7/site-packages/botocore/data/sagemaker-a2i-runtime/2019-11-07/service-2.json
kdaily commented 3 years ago

Hi @jvanbuel,

Thanks for raising this. The endpoints file is autogenerated, so any pull requests there would be overwritten later anyways. Thanks! The endpoints can be automatically inferred without being in the endpoints file, hence why you still get one when you instantiate a client. However knowing ahead of time which regions are supported is useful. I'm going to check in with the SageMaker team to clarify.

Generally you can also read about service endpoints in the documentation, but I don't see any for A2I either:

kdaily commented 3 years ago

V337343631

github-actions[bot] commented 2 years ago

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.