Skip to content

Instantly share code, notes, and snippets.

@isaacharrisholt
Created April 23, 2022 15:02
Show Gist options
  • Save isaacharrisholt/ff71a5d2e28c65e6b11312a780d0983d to your computer and use it in GitHub Desktop.
Save isaacharrisholt/ff71a5d2e28c65e6b11312a780d0983d to your computer and use it in GitHub Desktop.
from typing import List
import requests
API_ROOT = 'http://localhost:8000/api/v1' # This is the default for Airbyte
def get_workspaces() -> List[str]:
response = requests.post(f'{API_ROOT}/workspaces/list')
response.raise_for_status() # Either handle this yourself, or use a tool like Sentry for logging
return [
workspace['workspaceId']
for workspace in repsonse.json()['workspaces']
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment