You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless I'm completely failing to find it, there is not--but there should be! We'll try to get something in the next release--I'll start off submitting the following function, which you can use in the meantime if it helps.
fromnomic.projectimportAtlasClassimportrequestsdeflist_projects(organization_id=None):
""" Lists all projects in an organization. If called without an organization id, it will list all projects in the current user's main organization. """c=AtlasClass()
iforganization_idisNone:
organization=c._get_current_users_main_organization()
iforganizationisNone:
raiseValueError(
"No organization id provided and no main organization found."
)
organization_id=organization['organization_id']
response=requests.get(
c.atlas_api_path+f"/v1/organization/{organization_id}",
headers=c.header
)
proj_info=response.json()['projects']
return [
{'name': p['project_name'],
'id': p['id'],
'created_timestamp': p['created_timestamp']}
forpinproj_info
]
Hey, is there a method to list all projects under my Nomic account?
Thanks!
The text was updated successfully, but these errors were encountered: