-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
239733f
commit e3eb477
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# API Informations | ||
from upsonic_on_prem.api.endpoints.utils import get_current_directory_name | ||
from upsonic_on_prem.api.app import app | ||
from flask import jsonify, request | ||
|
||
import requests | ||
import traceback | ||
|
||
|
||
url = get_current_directory_name() | ||
name_of_endpoint = url.replace("/", "_") | ||
auth = "user" | ||
scope_write_auth = False | ||
scope_read_auth = False | ||
method = "GET" | ||
# | ||
|
||
|
||
|
||
from upsonic_on_prem.__init__ import __version__ | ||
|
||
def endpoint(): | ||
""" """ | ||
try: | ||
result = requests.post("http://localhost:3001/get_username_of_ak", data={"access_key":request.authorization.password}).json()["result"] | ||
except: | ||
traceback.print_exc() | ||
result = "Error" | ||
|
||
return jsonify( | ||
{ | ||
"status": True, | ||
"result": result, | ||
} | ||
) | ||
|
||
|
||
endpoint.__name__ = name_of_endpoint | ||
app.route(url, methods=[method])(endpoint) |