Skip to content

Instantly share code, notes, and snippets.

@zwurgl
Created April 16, 2020 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zwurgl/b63eac7db437726e1ece06a325f68f7d to your computer and use it in GitHub Desktop.
Save zwurgl/b63eac7db437726e1ece06a325f68f7d to your computer and use it in GitHub Desktop.
def get_projects(server,token):
url = server + "/projects"
headers2 = {'Authorization': 'Bearer ' + token}
#print("calling sherpa server '%s' ..." % url)
response = requests.get(url,headers=headers2)
json_response = json.loads(response.text)
projects = ", ".join([project['name'] for project in json_response])
print("Available projects on %s: %s" % (server, projects))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment