Update Namespace#

You can update a namespace through the NeMo Entity Store microservice to change details such as its description or custom fields.

Prerequisites#

Before you can update 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.

  • Obtained the id of the namespace you want to update.

To Update a Namespace#

Choose one of the following options of updating a namespace.

Note

Changes to custom_fields overwrite the existing custom_fields; include all custom_fields in the request, including the ones you want to update or add.

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.update(
  namespace_id="your-namespace", # Namespace that you create using NeMo Entity Store
  custom_fields={"sandbox": "true", "location": "on-prem"},
)
print(response)

Make a PATCH request to the /v1/namespaces/{id} endpoint.

export ENTITY_STORE_BASE_URL=<URL for NeMo Entity Store>

NAMESPACE_ID="team-docs"

curl -X PATCH "${ENTITY_STORE_BASE_URL}/v1/namespaces/${NAMESPACE_ID}" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
        "custom_fields": {
            "sandbox": "true",
            "location": "on-prem"
        }
    }' | 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",
    "location": "on-prem"
  },
  "ownership": {
    "created_by": "user@nvidia.com",
    "access_policies": {}
  }
}