MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / get_regions

Function get_regions

web/pgadmin/misc/cloud/rds/__init__.py:151–173  ·  view source on GitHub ↗

GET Regions for AWS.

()

Source from the content-addressed store, hash-verified

149 methods=['GET'], endpoint='regions')
150@pga_login_required
151def get_regions():
152 """GET Regions for AWS."""
153 try:
154 clear_aws_session()
155 _session = Session()
156 res = _session.get_available_regions('rds')
157 regions = []
158
159 for value in res:
160 if value in AWS_REGIONS:
161 regions.append({
162 'label': AWS_REGIONS[value] + ' | ' + value,
163 'value': value
164 })
165
166 return make_json_response(data=regions)
167
168 except Exception as e:
169 return make_json_response(
170 status=410,
171 success=0,
172 errormsg=sanitize_external_text(str(e))
173 )
174
175
176class RDS():

Callers

nothing calls this directly

Calls 4

make_json_responseFunction · 0.90
sanitize_external_textFunction · 0.90
clear_aws_sessionFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected