elfsong commited on
Commit
bbe95b6
1 Parent(s): 9c2d484
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -23,8 +23,10 @@ def get_status(credentials):
23
  return status
24
 
25
  def activate_server():
26
- return True
27
-
 
 
28
 
29
  st.title("Lucky Reactor")
30
 
@@ -39,4 +41,6 @@ if not status:
39
  submitted = st.form_submit_button("Ignite")
40
 
41
  if submitted and token == os.getenv("EASY_TOKEN"):
42
- st.write("Lucky Reactor has been ignited. Please wait a few minutes (3~5) to preceed...")
 
 
 
23
  return status
24
 
25
  def activate_server():
26
+ service = googleapiclient.discovery.build('compute', 'v1', credentials=credentials)
27
+ request = service.instances().start(project='nus-cisco-corp-lab-wp1', zone='asia-southeast1-b', instance='venus')
28
+ response = request.execute()
29
+ return response
30
 
31
  st.title("Lucky Reactor")
32
 
 
41
  submitted = st.form_submit_button("Ignite")
42
 
43
  if submitted and token == os.getenv("EASY_TOKEN"):
44
+ st.write("Lucky Reactor has been ignited. Please wait a few minutes (3~5) to preceed...")
45
+ response = activate_server()
46
+ st.write(response)