Create Namespace#

You can create a namespace through the NeMo Entity Store microservice to group related entities by dimensions like user, team, or product.

Prerequisites#

Before you can create a namespace, make sure that you have:

  • Obtained the base URL of your NeMo Entity Store Microservice.

  • Permissions to access the NeMo Entity Store microservice endpoint.


How to Create a Namespace#

API#

  1. 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
    
    import os
    from dotenv import load_dotenv
    import requests
    import json
    
    load_dotenv()
    
    entity_hostname = os.getenv('ENTITY_STORE_HOSTNAME')
    
    if not entity_hostname:
        raise ValueError("ENTITY_STORE_HOSTNAME not found in environment variables")
    
    url = f"$${ENTITY_STORE_BASE_URL}/v1/namespaces"
    
    headers = {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
    }
    
    data = {
        'id': 'team-docs'
    }
    
    response = requests.post(url, headers=headers, json=data)
    
    print(json.dumps(response.json(), indent=2))
    
  2. Verify that the namespace was created by reviewing the response.

    Example Response
    {
      "id": "team-docs",
      "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": {}
      }
    }