Skip to content

Commit

Permalink
Link schema api for streams
Browse files Browse the repository at this point in the history
  • Loading branch information
rajvarkala committed Dec 30, 2023
1 parent 5dbf2f2 commit 34afe1c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions core/stream_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ def get_bearer_header(bearer_token):


# Object Schema Definitions
@router.get("/workspaces/{workspace_id}/api/schema/link/{type}", response={200: Json, 500: Json})
def destination_schema_obj(request, workspace_id, type):
authObject = ValmiUserIDJitsuApiToken.objects.get(user=request.user)
response = requests.get(
f"{config('STREAM_API_URL')}/api/schema/link/{type}",
timeout=SHORT_TIMEOUT,
headers=get_bearer_header(authObject.api_token),
)
try:
response.raise_for_status()
except requests.exceptions.HTTPError:
try:
return (500, response.text)
except Exception as e:
raise e

return response.text


@router.get("/workspaces/{workspace_id}/api/schema/destination/{type}", response={200: Json, 500: Json})
def destination_schema_obj(request, workspace_id, type):
authObject = ValmiUserIDJitsuApiToken.objects.get(user=request.user)
Expand Down

0 comments on commit 34afe1c

Please sign in to comment.