From 68ec45dd0fb6222968045b70f1808807523ec558 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Wed, 1 Jul 2020 15:15:01 -0400 Subject: [PATCH] document namespace=* in relevant APIs --- website/pages/api-docs/allocations.mdx | 8 ++++++++ website/pages/api-docs/index.mdx | 11 +++++++++++ website/pages/api-docs/jobs.mdx | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/website/pages/api-docs/allocations.mdx b/website/pages/api-docs/allocations.mdx index a128d60d9..b2567b51c 100644 --- a/website/pages/api-docs/allocations.mdx +++ b/website/pages/api-docs/allocations.mdx @@ -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 diff --git a/website/pages/api-docs/index.mdx b/website/pages/api-docs/index.mdx index e0f5a4b8d..090981696 100644 --- a/website/pages/api-docs/index.mdx +++ b/website/pages/api-docs/index.mdx @@ -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 diff --git a/website/pages/api-docs/jobs.mdx b/website/pages/api-docs/jobs.mdx index 8b5cccd82..7abe15e95 100644 --- a/website/pages/api-docs/jobs.mdx +++ b/website/pages/api-docs/jobs.mdx @@ -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