# vhsm namespace

The `namespace` command groups subcommands for managing namespaces in vHSM.

### **Examples**

| Action                                              | Command                                                                          |
| --------------------------------------------------- | -------------------------------------------------------------------------------- |
| List all namespaces                                 | `vhsm namespace list`                                                            |
| List all namespaces with details                    | `vhsm namespace list -detailed`                                                  |
| Create a namespace (`ns1/`) with no custom metadata | `vhsm namespace create ns1/`                                                     |
| Create a namespace with custom metadata             | `vhsm namespace create -custom-metadata=foo=abc -custom-metadata=bar=123 ns1/`   |
| Patch a namespace (`ns1/`) to add/remove metadata   | `vhsm namespace patch -custom-metadata=bar=123 -remove-custom-metadata=foo ns1/` |
| Delete a namespace (`ns1/`)                         | `vhsm namespace delete ns1/`                                                     |
| Lookup information of a namespace (`ns1/`)          | `vhsm namespace lookup ns1/`                                                     |
| Lock the API for the current namespace              | `vhsm namespace lock`                                                            |
| Lock the API for a descendant namespace (`ns1/`)    | `vhsm namespace lock ns1/`                                                       |
| Unlock the API for the current namespace            | `vhsm namespace unlock -unlock-key <unlock key>`                                 |
| Unlock the API for a descendant namespace (`ns1/`)  | `vhsm namespace unlock -unlock-key <unlock key> ns1/`                            |

***

### **Usage**

```
vhsm namespace <subcommand> [options] [args]
```

The command operates within the **namespace context** of the currently logged-in token.

#### **Subcommands**

| Subcommand | Description                    |
| ---------- | ------------------------------ |
| `create`   | Create a new namespace         |
| `delete`   | Delete an existing namespace   |
| `list`     | List child namespaces          |
| `lookup`   | Retrieve namespace details     |
| `lock`     | Lock the API for a namespace   |
| `unlock`   | Unlock the API for a namespace |

***

### **Command Options**

| Option                          | Description                                    | Default |
| ------------------------------- | ---------------------------------------------- | ------- |
| `-detailed`                     | Show additional namespace details when listing | `false` |
| `-custom-metadata=<K=V>`        | Set custom metadata when creating/patching     | `None`  |
| `-remove-custom-metadata=<key>` | Remove a metadata key when patching            | `None`  |
| `-unlock-key=<key>`             | Required to unlock a locked namespace          | `None`  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.enclaive.cloud/virtual-hsm/cli/configuration-and-management/vhsm-namespace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
