resolver_endpoint_request.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with self work for additional information
  5. # regarding copyright ownership. The ASF licenses self file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use self file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing,
  13. # software distributed under the License is distributed on an
  14. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. # KIND, either express or implied. See the License for the
  16. # specific language governing permissions and limitations
  17. # under the License.
  18. #
  19. ENDPOINT_TYPE_INNER = "innerAPI"
  20. ENDPOINT_TYPE_OPEN = "openAPI"
  21. class ResolveEndpointRequest(object):
  22. def __init__(self, region_id, product_code, location_service_code, endpoint_type):
  23. self.region_id = region_id
  24. self.product_code = product_code
  25. self.product_code_lower = self.product_code.lower()
  26. if not endpoint_type:
  27. self.endpoint_type = ENDPOINT_TYPE_OPEN
  28. else:
  29. self.endpoint_type = endpoint_type
  30. self.location_service_code = location_service_code
  31. self.request_network = "public"
  32. self.product_suffix = ""
  33. self.endpoint_map = None
  34. self.endpoint_regional = None
  35. def is_open_api_endpoint(self):
  36. return ENDPOINT_TYPE_OPEN == self.endpoint_type