Create Namespace#
Create a namespace using the NeMo Entity Store microservice API to group related entities by dimensions such as user, team, or product.
Note
The namespace you create using this API is not associated with a Kubernetes namespace.
Prerequisites#
Before you can create a namespace, 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 Create a Namespace#
Choose one of the following options of creating a namespace.
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.create(
id="your-namespace" # Namespace that you create here is not associated with a Kubernetes namespace.
)
print(response)
Make a POST request to the /v1/namespaces
endpoint.
curl -X POST "$${ENTITY_STORE_BASE_URL}/v1/namespaces" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"id": "team-docs"
}' | jq
Example Response
{
"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"
},
"ownership": {
"created_by": "user@nvidia.com",
"access_policies": {}
}
}