Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ali_region_facts to retrieve Alibaba Cloud regions info #55765

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
3 participants
@atodorov
Copy link
Contributor

commented Apr 25, 2019

SUMMARY

Add ali_region_facts to retrieve Alibaba Cloud regions info

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

ali_region_facts

ADDITIONAL INFORMATION
$ ansible localhost -m ali_region_facts
localhost | SUCCESS => {
    "changed": false, 
    "regions": [
        {
            "LocalName": "华北 1", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "cn-qingdao"
        }, 
        {
            "LocalName": "华北 2", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "cn-beijing"
        }, 
        {
            "LocalName": "华北 3", 
            "RegionEndpoint": "ecs.cn-zhangjiakou.aliyuncs.com", 
            "RegionId": "cn-zhangjiakou"
        }, 
        {
            "LocalName": "华北 5", 
            "RegionEndpoint": "ecs.cn-huhehaote.aliyuncs.com", 
            "RegionId": "cn-huhehaote"
        }, 
        {
            "LocalName": "华东 1", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "cn-hangzhou"
        }, 
        {
            "LocalName": "华东 2", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "cn-shanghai"
        }, 
        {
            "LocalName": "华南 1", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "cn-shenzhen"
        }, 
        {
            "LocalName": "香港", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "cn-hongkong"
        }, 
        {
            "LocalName": "亚太东北 1 (东京)", 
            "RegionEndpoint": "ecs.ap-northeast-1.aliyuncs.com", 
            "RegionId": "ap-northeast-1"
        }, 
        {
            "LocalName": "亚太东南 1 (新加坡)", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "ap-southeast-1"
        }, 
        {
            "LocalName": "亚太东南 2 (悉尼)", 
            "RegionEndpoint": "ecs.ap-southeast-2.aliyuncs.com", 
            "RegionId": "ap-southeast-2"
        }, 
        {
            "LocalName": "亚太东南 3 (吉隆坡)", 
            "RegionEndpoint": "ecs.ap-southeast-3.aliyuncs.com", 
            "RegionId": "ap-southeast-3"
        }, 
        {
            "LocalName": "亚太东南 5 (雅加达)", 
            "RegionEndpoint": "ecs.ap-southeast-5.aliyuncs.com", 
            "RegionId": "ap-southeast-5"
        }, 
        {
            "LocalName": "亚太南部 1 (孟买)", 
            "RegionEndpoint": "ecs.ap-south-1.aliyuncs.com", 
            "RegionId": "ap-south-1"
        }, 
        {
            "LocalName": "美国东部 1 (弗吉尼亚)", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "us-east-1"
        }, 
        {
            "LocalName": "美国西部 1 (硅谷)", 
            "RegionEndpoint": "ecs.aliyuncs.com", 
            "RegionId": "us-west-1"
        }, 
        {
            "LocalName": "英国 (伦敦)", 
            "RegionEndpoint": "ecs.eu-west-1.aliyuncs.com", 
            "RegionId": "eu-west-1"
        }, 
        {
            "LocalName": "中东东部 1 (迪拜)", 
            "RegionEndpoint": "ecs.me-east-1.aliyuncs.com", 
            "RegionId": "me-east-1"
        }, 
        {
            "LocalName": "欧洲中部 1 (法兰克福)", 
            "RegionEndpoint": "ecs.eu-central-1.aliyuncs.com", 
            "RegionId": "eu-central-1"
        }
    ]
}

try:
from footmark.exception import ECSResponseError
from aliyunsdkcore.client import AcsClient
from aliyunsdkecs.request.v20140526.DescribeRegionsRequest import DescribeRegionsRequest

This comment has been minimized.

Copy link
@atodorov

atodorov Apr 25, 2019

Author Contributor

NOTE: the underlying library from Alibaba has this funky versioning scheme. I will open a PR with them to be able to import the DescribeRegionsRequest class directly from aliyunsdkecs.request as it looks more cleaner for me.

atodorov added a commit to atodorov/aliyun-openapi-python-sdk that referenced this pull request Apr 25, 2019

Import DecsribeRegionsRequest into aliyunsdkecs.request
so it can be imported by other modules without knowing the
versioning scheme. This will provide a more stable interface for
clients. Related to
ansible/ansible#55765
@atodorov

This comment has been minimized.

Copy link
Contributor Author

commented Apr 25, 2019

Please tell me where to look for tests b/c this new module doesn't have any.

@mattclay mattclay added the ci_verified label May 2, 2019

@ansibot ansibot added stale_ci and removed new_contributor labels May 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.