api/agent: enable setting SuccessBeforePassing and FailuresBeforeCritical in API (#7949)

Fixes #7764

Until now these two fields could only be set through on-disk agent configuration.
This change adds the fields to the agent API struct definition so that they can
be set using the agent HTTP API.
This commit is contained in:
Seth Hoenig 2020-06-29 07:52:35 -05:00 committed by hashicorp-ci
parent c7a6c5c4f5
commit 870097646e
2 changed files with 30 additions and 20 deletions

View File

@ -208,6 +208,8 @@ type AgentServiceCheck struct {
GRPCUseTLS bool `json:",omitempty"`
AliasNode string `json:",omitempty"`
AliasService string `json:",omitempty"`
SuccessBeforePassing int `json:",omitempty"`
FailuresBeforeCritical int `json:",omitempty"`
// In Consul 0.7 and later, checks that are associated with a service
// may also contain this optional DeregisterCriticalServiceAfter field,

View File

@ -207,6 +207,14 @@ The table below shows this endpoint's support for
- `Status` `(string: "")` - Specifies the initial status of the health check.
- `SuccessBeforePassing` `(int: 0)` - Specifies the number of consecutive successful
results required before check status transitions to passing. Available for HTTP,
TCP, gRPC, Docker & Monitor checks.
- `FailuresBeforeCritical` `(int: 0)` - Specifies the number of consecutive unsuccessful
results required before check status transitions to critical. Available for HTTP,
TCP, gRPC, Docker & Monitor checks.
### Sample Payload
```json