aliyun / aliyun/aliyun-openapi-python-sdk

Can't override default region for DescribeDBInstancesRequest

Open
#486 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
578
PR merge metrics
No merged PRs in 30d

Description

  • Python Version: 3.11
  • aliyunsdkcore Version: 2.13.36
  • API: aliyunsdkrds.request.v20140815.DescribeDBInstancesRequest

When calling DescribeDBInstancesRequest through the CLI, I can override the default region by using the flag --RegionId. The same behaviour is not observed when using the python sdk.

I have already fixed this problem on my end by implement a get_RegionId and a set_RegionId to the DescribeDBInstancesRequest class, similar to the existing set_ZoneId and get_ZoneId, like so:

def get_RegionId(self): # String
    return self.get_query_params().get('RegionId')

def set_RegionId(self, RegionId):  # String
    self.add_query_param('RegionId', RegionId)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Find the aliyunsdkrds.request.v20140815.DescribeDBInstancesRequest class and compare its request-parameter accessors with the existing ZoneId accessors. Reproduce the Python SDK call using RegionId, then verify that the region override is included in the request and does not change existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.