|
25 | 25 | if output['OutputKey'] == 'ApiEndpoint':
|
26 | 26 | st.session_state['api_endpoint_url'] = output['OutputValue']
|
27 | 27 | except:
|
28 |
| - print("Failed to get API Endpoint from CloudFormation Stack") |
29 |
| - |
30 |
| - if os.path.isfile("config.json") and 'api_endpoint_url' not in st.session_state: |
31 |
| - with open("config.json","r",encoding="utf-8") as f: |
32 |
| - app_config = json.load(f) |
33 |
| - st.session_state['api_endpoint_url'] = app_config["api_endpoint"].strip() |
34 |
| - else: |
35 | 28 | st.session_state['api_endpoint_url'] = "https://{APIGATEWAYID}.execute-api.{REGION}.amazonaws.com/Prod/"
|
36 | 29 |
|
37 | 30 | if 'unicorn_art' not in st.session_state:
|
@@ -225,14 +218,14 @@ def update_unicorn_reserve_list():
|
225 | 218 | key="api_endpoint_url",
|
226 | 219 | on_change=update_api_endpoint
|
227 | 220 | )
|
228 |
| - if st.button("Retrieve API Endpoint"): |
| 221 | + if st.button(f"Reset API Endpoint from Stack"): |
229 | 222 | cfn_client = boto3.client('cloudformation')
|
230 | 223 | response = cfn_client.describe_stacks(StackName=os.environ.get('BACKEND_STACK_NAME','urs-backend'))
|
231 | 224 | for output in response['Stacks'][0]['Outputs']:
|
232 | 225 | if output['OutputKey'] == 'ApiEndpoint':
|
233 |
| - st.session_state['api_endpoint_url'] = output['OutputValue'] |
| 226 | + st.write(f"Resetting API Endpoint to: {output['OutputValue']}") |
| 227 | + |
234 | 228 |
|
235 |
| - |
236 | 229 | # File picker for uploading to the unicorn inventory
|
237 | 230 | uploaded_file = st.file_uploader("Choose a CSV file for the Unicorn Inventory.", type=["csv"])
|
238 | 231 | if uploaded_file is not None:
|
|
0 commit comments