yandex-cloud / python-sdk

Yandex.Cloud Python SDK
MIT License
75 stars 24 forks source link

Simplify supported modules #39

Closed l0kix2 closed 2 years ago

l0kix2 commented 2 years ago

We got several issues regarding absence of some cloud service in manually maintained list of supported endpoints, although there are exist in public api. Here i tried approach where we try to guess endpoint id based on stub module name if not found in list. For now we have list of endpoints which are have match with module name

ai-stt
ai-translate
ai-vision
billing
cdn
compute
dataproc-manager
dataproc
dns
endpoint
iam
iot-devices
kms
lockbox
logging
operation
serverless-apigateway
serverless-functions
serverless-triggers
vpc
ydb

also some new services will be available after this PR

datasphere
datatransfer
serverless-containers

Default behaviour are left as is: if we cant find endpoint in list in sources or in real endpoints list — we raise error.

So it should be backward compatible and in future we will less often have to put endpoints in hardcoded list.

On other hand it is half-measure because there are still many cloud services with non-guessable endpoint naming, so i guess better approaches: 1) to generate full mapping grpc-service to endpoint_id (if we have it somewhere already) 2) use endpoint_ids in user api and find stubs for them (still need reverse mapping)