mirror of https://github.com/status-im/consul.git
Expose SkipNodeUpdate field and some health check info in the http api
This commit is contained in:
parent
b6de1f7446
commit
a7c42a6c2a
|
@ -28,7 +28,7 @@ func (c *Catalog) Register(args *structs.RegisterRequest, reply *struct{}) error
|
||||||
defer metrics.MeasureSince([]string{"catalog", "register"}, time.Now())
|
defer metrics.MeasureSince([]string{"catalog", "register"}, time.Now())
|
||||||
|
|
||||||
// Verify the args.
|
// Verify the args.
|
||||||
if args.Node == "" || args.Address == "" {
|
if args.Node == "" || (args.Address == "" && !args.SkipNodeUpdate) {
|
||||||
return fmt.Errorf("Must provide node and address")
|
return fmt.Errorf("Must provide node and address")
|
||||||
}
|
}
|
||||||
if args.ID != "" {
|
if args.ID != "" {
|
||||||
|
|
|
@ -482,6 +482,11 @@ type HealthCheck struct {
|
||||||
ServiceName string // optional service name
|
ServiceName string // optional service name
|
||||||
ServiceTags []string // optional service tags
|
ServiceTags []string // optional service tags
|
||||||
|
|
||||||
|
HTTP string `json:",omitempty"`
|
||||||
|
TCP string `json:",omitempty"`
|
||||||
|
Interval string `json:",omitempty"`
|
||||||
|
Timeout string `json:",omitempty"`
|
||||||
|
|
||||||
RaftIndex
|
RaftIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,10 @@ type AgentCheck struct {
|
||||||
Output string
|
Output string
|
||||||
ServiceID string
|
ServiceID string
|
||||||
ServiceName string
|
ServiceName string
|
||||||
|
HTTP string
|
||||||
|
TCP string
|
||||||
|
Interval string
|
||||||
|
Timeout string
|
||||||
}
|
}
|
||||||
|
|
||||||
// AgentService represents a service known to the agent
|
// AgentService represents a service known to the agent
|
||||||
|
|
|
@ -42,6 +42,7 @@ type CatalogRegistration struct {
|
||||||
Datacenter string
|
Datacenter string
|
||||||
Service *AgentService
|
Service *AgentService
|
||||||
Check *AgentCheck
|
Check *AgentCheck
|
||||||
|
SkipNodeUpdate bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type CatalogDeregistration struct {
|
type CatalogDeregistration struct {
|
||||||
|
|
|
@ -34,6 +34,11 @@ type HealthCheck struct {
|
||||||
ServiceID string
|
ServiceID string
|
||||||
ServiceName string
|
ServiceName string
|
||||||
ServiceTags []string
|
ServiceTags []string
|
||||||
|
|
||||||
|
HTTP string
|
||||||
|
TCP string
|
||||||
|
Interval string
|
||||||
|
Timeout string
|
||||||
}
|
}
|
||||||
|
|
||||||
// HealthChecks is a collection of HealthCheck structs.
|
// HealthChecks is a collection of HealthCheck structs.
|
||||||
|
|
Loading…
Reference in New Issue