Skip to content

Commit

Permalink
docs: Add namespace parameters to /agent/service*
Browse files Browse the repository at this point in the history
Document supported namespace parameters for /agent/service* API
endpoints.

Resolves #9710
  • Loading branch information
blake committed Jul 21, 2021
1 parent c271308 commit da747c2
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions website/content/api-docs/agent/service.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ The table below shows this endpoint's support for
- `filter` `(string: "")` - Specifies the expression used to filter the
queries results prior to returning the data.

- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace in which
to list services. This value can be specified as the `ns` URL query
parameter or the `X-Consul-Namespace` header. If not provided by either,
the namespace will be inherited from the request's ACL token or will default
to the `default` namespace. Added in Consul 1.7.0.

### Sample Request

```shell-session
Expand All @@ -63,13 +69,14 @@ $ curl \
"port": 8000
},
"wan": {
"address": "198.18.0.53",
"address": "198.51.100.53",
"port": 80
}
},
"Meta": {
"redis_version": "4.0"
},
"Namespace": "default",
"Port": 8000,
"Address": "",
"EnableTagOverride": false,
Expand Down Expand Up @@ -158,6 +165,12 @@ The table below shows this endpoint's support for
- `service_id` `(string: <required>)` - Specifies the ID of the service to
fetch. This is specified as part of the URL.

- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace to lookup
the service's configuration. This value can be specified as the `ns` URL query
parameter or the `X-Consul-Namespace` header. If not provided by either,
the namespace will be inherited from the request's ACL token or will default
to the `default` namespace. Added in Consul 1.7.0.

### Sample Request

```shell-session
Expand All @@ -174,6 +187,7 @@ $ curl \
"Service": "web-sidecar-proxy",
"Tags": null,
"Meta": null,
"Namespace": "default",
"Port": 18080,
"Address": "",
"TaggedAddresses": {
Expand All @@ -182,7 +196,7 @@ $ curl \
"port": 8000
},
"wan": {
"address": "198.18.0.53",
"address": "198.51.100.53",
"port": 80
}
},
Expand Down Expand Up @@ -246,6 +260,17 @@ The table below shows this endpoint's support for
| ---------------- | ----------------- | ------------- | -------------- |
| `NO` | `none` | `none` | `service:read` |

### Parameters

- `service_name` `(string: <required>)` - Specifies the name of the service to
retrieve. This is specified as part of the URL.

- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace to lookup
the service's health data. This value can be specified as the `ns` URL query
parameter or the `X-Consul-Namespace` header. If not provided by either,
the namespace will be inherited from the request's ACL token or will default
to the `default` namespace. Added in Consul 1.7.0.

Those endpoints return the aggregated values of all health checks for the
service instance(s) and will return the corresponding HTTP codes:

Expand Down Expand Up @@ -523,6 +548,12 @@ service definition keys for compatibility with the config file format.
- `Meta` `(map<string|string>: nil)` - Specifies arbitrary KV metadata
linked to the service instance.

- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace in
which to register the service. This value can be specified as the `ns` URL query
parameter or the `X-Consul-Namespace` header. If not provided by either,
the namespace will be inherited from the request's ACL token or will default
to the `default` namespace. Added in Consul 1.7.0.

- `Port` `(int: 0)` - Specifies the port of the service.

- `Kind` `(string: "")` - The kind of service. Defaults to "" which is a
Expand Down Expand Up @@ -660,7 +691,13 @@ The table below shows this endpoint's support for
### Parameters

- `service_id` `(string: <required>)` - Specifies the ID of the service to
deregister. This is specified as part of the URL.
deregister. This is specifi### Parameters

- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace in which
to deregister the service. This value can be specified as the `ns` URL query
parameter or the `X-Consul-Namespace` header. If not provided by either,
the namespace will be inherited from the request's ACL token or will default
to the `default` namespace. Added in Consul 1.7.0.

### Sample Request

Expand Down Expand Up @@ -700,6 +737,12 @@ The table below shows this endpoint's support for
maintenance mode. This is specified as part of the URL as a query string
parameter.

- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace
of the service to place into maintenance mode. This value can be specified as
the `ns` URL query parameter or the `X-Consul-Namespace` header. If not provided
by either, the namespace will be inherited from the request's ACL token or will
default to the `default` namespace. Added in Consul 1.7.0.

- `reason` `(string: "")` - Specifies a text string explaining the reason for
placing the node into maintenance mode. This is simply to aid human operators.
If no reason is provided, a default value will be used instead. This is
Expand Down

0 comments on commit da747c2

Please sign in to comment.