Skip to content

Commit

Permalink
feat: complete instanciator
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto-abarzua committed Nov 19, 2023
1 parent 44c7735 commit b81d247
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions frontend/src/redux/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ function* callHealthCheck() {
if (instanciatorUrl && instanciatorUrl !== 'undefined') {
try {
yield call(instanciatorApi.get, '/health_check/');
} catch (error) {}
} catch (error) {
console.error('Error calling instanciator healthcheck', error);
}
}
} catch (error) {
console.error('Error calling healthcheck', error);
Expand Down Expand Up @@ -44,5 +46,4 @@ function* watchFetchApiData() {

export default function* rootSaga() {
yield all([watchFetchApiData(), watchCallHealthCheck()]);

}
1 change: 0 additions & 1 deletion frontend/src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ api.interceptors.request.use(
);

export default api;

6 changes: 3 additions & 3 deletions instanciator/backend/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ def verify_token(token: str):


@app.get("/instances/")
async def get_instances() -> List[Dict[str, Any]]:
async def get_instances(_: str = token_dependency) -> List[Dict[str, Any]]:
instances = instance_generator.get_instances()
return instances


@app.post("/instances/{uuid_str}/destroy")
async def destroy_instance(uuid_str: str) -> Dict[str, Any]:
async def destroy_instance(uuid_str: str, _: str = token_dependency) -> Dict[str, Any]:
instance_generator.stop_by_uuid(uuid_str)
return {"status": "ok"}


@app.post("/stop_all/")
async def destroy_all() -> Dict[str, Any]:
async def destroy_all(_: str = token_dependency) -> Dict[str, Any]:
instance_generator.stop_all()
return {"status": "ok"}

Expand Down

0 comments on commit b81d247

Please sign in to comment.