List Namespaces#
You can list all namespaces available to your organization through the NeMo Entity Store microservice. This is useful when you need to select an appropriate namespace for your related entities or when you need to find the id
of a namespace to use in other API requests.
Prerequisites#
Before you can list namespaces, make sure that you have:
Obtained the base URL of the NeMo Entity Store microservice.
Permissions to access the NeMo Entity Store microservice endpoint.
To List Namespaces#
Choose one of the following options of listing namespaces.
Set up a NeMoMicroservices
client instance using the base URL of the NeMo Entity Store microservice and perform the task as follows.
from nemo_microservices import NeMoMicroservices
client = NeMoMicroservices(
base_url=os.environ["ENTITY_STORE_BASE_URL"]
)
response = client.namespaces.list()
print(response)
Make a GET request to the /v1/namespaces
endpoint.
export ENTITY_STORE_BASE_URL=<URL for NeMo Entity Store>
curl -X GET "${ENTITY_STORE_BASE_URL}/v1/namespaces" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' | jq
Example Response
{
"object": "list",
"data": [
{
"id": "default",
"created_at": "2025-01-07T16:01:04.163550",
"updated_at": "2025-01-07T16:01:04.163552",
"description": null,
"project": null,
"custom_fields": {},
"ownership": null
},
{
"id": "your-namespace",
"created_at": "2025-02-12T18:45:40.227770",
"updated_at": "2025-02-12T18:45:40.227774",
"description": "The docs team",
"project": null,
"custom_fields": {
"sandbox": "true",
"location": "on-prem"
},
"ownership": {
"created_by": "user@nvidia.com",
"access_policies": {}
}
}
],
"pagination": {
"page": 1,
"page_size": 10,
"current_page_size": 4,
"total_pages": 1,
"total_results": 4
},
"sort": "created_at",
"filter": null
}