region_provider.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. #
  12. #
  13. # Unless required by applicable law or agreed to in writing,
  14. # software distributed under the License is distributed on an
  15. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. # KIND, either express or implied. See the License for the
  17. # specific language governing permissions and limitations
  18. # under the License.
  19. # coding=utf-8
  20. """
  21. Region&Endpoint provider module.
  22. Created on 6/12/2015
  23. @author: alex
  24. modified by wenyang@2018-03-14:
  25. reconstruction the smelly codes and keep compatibility
  26. """
  27. from aliyunsdkcore.endpoint.default_endpoint_resolver import DefaultEndpointResolver
  28. # WARNING: Deprecated Functions!
  29. # same as modify_point
  30. def add_endpoint(product_name, region_id, end_point):
  31. modify_point(product_name, region_id, end_point)
  32. # WARNING: Deprecated Functions!
  33. def modify_point(product_name, region_id, end_point):
  34. put_endpoint_entry = DefaultEndpointResolver.predefined_endpoint_resolver.put_endpoint_entry
  35. put_endpoint_entry(region_id, product_name, end_point)