document namespace=* in relevant APIs

This commit is contained in:
Mahmood Ali 2020-07-01 15:15:01 -04:00
parent 970ccedd1f
commit 68ec45dd0f
3 changed files with 26 additions and 0 deletions

View File

@ -32,6 +32,9 @@ The table below shows this endpoint's support for
even number of hexadecimal characters (0-9a-f). This is specified as a query
string parameter.
- `namespace` `(string: "default")` - Specifies the namespace to search. Specifying
`*` would return all allocations across all the authorized namespaces.
### Sample Request
```shell-session
@ -44,6 +47,11 @@ $ curl \
https://localhost:4646/v1/allocations?prefix=a8198d79
```
```shell-session
$ curl \
https://localhost:4646/v1/allocations?namespace=*&prefix=a8198d79
```
### Sample Response
```json

View File

@ -90,6 +90,17 @@ $ curl \
https://localhost:4646/v1/jobs
```
## Namespaces
Nomad Enterprise has support for namespaces, which allow jobs and their associated objects to be segmented from each other and other users of the cluster. When using non-default namespace, the API request must pass the target namespace as an API query parameter.
Here is an example using curl:
```shell-session
$ curl \
https://localhost:4646/v1/jobs?namespace=qa
```
## Blocking Queries
Many endpoints in Nomad support a feature known as "blocking queries". A

View File

@ -30,6 +30,9 @@ The table below shows this endpoint's support for
- `prefix` `(string: "")` - Specifies a string to filter jobs on based on
an index prefix. This is specified as a query string parameter.
- `namespace` `(string: "default")` - Specifies the target namespace. Specifying
`*` would return all jobs across all the authorized namespaces.
### Sample Request
```shell-session
@ -40,6 +43,10 @@ $ curl https://localhost:4646/v1/jobs
$ curl https://localhost:4646/v1/jobs?prefix=team
```
```shell-session
$ curl https://localhost:4646/v1/jobs?namespace=*&prefix=team
```
### Sample Response
```json