vault/website/source/api/system/namespaces.html.md
Clint cf319a6193 Remove response code info from non-overview API docs (contd) (#7940)
Continues https://github.com/hashicorp/vault/pull/6459 and cleans up
some spots that should have been deleted, but due to markdown
formatting, weren't rendering anyway.

> Remove response code info from non-overview API docs as it can be
> misinterpreted and is always the same anyways.
2019-12-02 10:07:46 -08:00

104 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
layout: "api"
page_title: "/sys/namespaces - HTTP API"
sidebar_title: "<code>/sys/namespaces</code>"
sidebar_current: "api-http-system-namespaces"
description: |-
The `/sys/namespaces` endpoint is used manage namespaces in Vault.
---
# `/sys/namespaces`
The `/sys/namespaces` endpoint is used manage namespaces in Vault.
## List Namespaces
This endpoints lists all the namespaces.
| Method | Path |
| :--------------------------- | :--------------------- |
| `LIST` | `/sys/namespaces` |
### Sample Request
```
$ curl \
--header "X-Vault-Token: ..." \
-X LIST \
http://127.0.0.1:8200/v1/sys/namespaces
```
### Sample Response
```json
[
"ns1/",
"ns2/"
]
```
## Create Namespace
This endpoint creates a namespace at the givent path.
| Method | Path |
| :--------------------------- | :--------------------- |
| `POST` | `/sys/namespaces/:path` |
### Parameters
- `path` `(string: <required>)`  Specifies the path where the namespace
will be namespace. This is specified as part of the URL.
### Sample Request
```
$ curl \
--header "X-Vault-Token: ..." \
--request POST \
http://127.0.0.1:8200/v1/sys/namespaces/ns1
```
## Delete Namespace
This endpoint deletes a namespace at the specified path.
| Method | Path |
| :--------------------------- | :--------------------- |
| `DELETE` | `/sys/namespaces/:path` |
### Sample Request
```
$ curl \
--header "X-Vault-Token: ..." \
--request DELETE \
http://127.0.0.1:8200/v1/sys/namespaces/ns1
```
## Read Namespace Information
This endpoint get the metadata for the given namespace path.
| Method | Path |
| :--------------------------- | :--------------------- |
| `GET` | `/sys/namespaces/:path` |
### Sample Request
```
$ curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/sys/namespaces/ns1
```
### Sample Response
```json
{
"id": "gsudj",
"path": "ns1/"
}
```