session.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:tf_aws_ecs_instance_draining_on_scale_in 作者: terraform-community-modules 项目源码 文件源码
def get_available_regions(self, service_name, partition_name='aws',
                              allow_non_regional=False):
        """Lists the region and endpoint names of a particular partition.

        :type service_name: string
        :param service_name: Name of a service to list endpoint for (e.g., s3).
            This parameter accepts a service name (e.g., "elb") or endpoint
            prefix (e.g., "elasticloadbalancing").

        :type partition_name: string
        :param partition_name: Name of the partition to limit endpoints to.
            (e.g., aws for the public AWS endpoints, aws-cn for AWS China
            endpoints, aws-us-gov for AWS GovCloud (US) Endpoints, etc.

        :type allow_non_regional: bool
        :param allow_non_regional: Set to True to include endpoints that are
             not regional endpoints (e.g., s3-external-1,
             fips-us-gov-west-1, etc).
        :return: Returns a list of endpoint names (e.g., ["us-east-1"]).
        """
        resolver = self.get_component('endpoint_resolver')
        results = []
        try:
            service_data = self.get_service_data(service_name)
            endpoint_prefix = service_data['metadata'].get(
                'endpointPrefix', service_name)
            results = resolver.get_available_endpoints(
                endpoint_prefix, partition_name, allow_non_regional)
        except UnknownServiceError:
            pass
        return results
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号