GetServiceHealth
consul..getServiceHealth can be used to get the list of the instances that
are currently healthy, according to their associated health-checks.
The result includes the list of service instances, the node associated to each
instance and its health-checks.
This resource is likely to change as frequently as the health-checks are being updated, you should expect different results in a frequent basis.
Using GetServiceHealth
function getServiceHealth(args: GetServiceHealthArgs, opts?: InvokeOptions): Promise<GetServiceHealthResult>function get_service_health(datacenter=None, name=None, near=None, node_meta=None, passing=None, tag=None, wait_for=None, opts=None)func GetServiceHealth(ctx *Context, args *GetServiceHealthArgs, opts ...InvokeOption) (*GetServiceHealthResult, error)public static class GetServiceHealth {
public static Task<GetServiceHealthResult> InvokeAsync(GetServiceHealthArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Name string
The service name to select.
- Datacenter string
The Consul datacenter to query.
- Near string
Specifies a node name to sort the node list in ascending order based on the estimated round trip time from that node.
- Node
Meta Dictionary<string, string> Filter the results to nodes with the specified key/value pairs.
- Passing bool
Whether to return only nodes with all checks in the passing state. Defaults to
true.- Tag string
A single tag that can be used to filter the list to return based on a single matching tag.
- Wait
For string
- Name string
The service name to select.
- Datacenter string
The Consul datacenter to query.
- Near string
Specifies a node name to sort the node list in ascending order based on the estimated round trip time from that node.
- Node
Meta map[string]string Filter the results to nodes with the specified key/value pairs.
- Passing bool
Whether to return only nodes with all checks in the passing state. Defaults to
true.- Tag string
A single tag that can be used to filter the list to return based on a single matching tag.
- Wait
For string
- name string
The service name to select.
- datacenter string
The Consul datacenter to query.
- near string
Specifies a node name to sort the node list in ascending order based on the estimated round trip time from that node.
- node
Meta {[key: string]: string} Filter the results to nodes with the specified key/value pairs.
- passing boolean
Whether to return only nodes with all checks in the passing state. Defaults to
true.- tag string
A single tag that can be used to filter the list to return based on a single matching tag.
- wait
For string
- name str
The service name to select.
- datacenter str
The Consul datacenter to query.
- near str
Specifies a node name to sort the node list in ascending order based on the estimated round trip time from that node.
- node_
meta Dict[str, str] Filter the results to nodes with the specified key/value pairs.
- passing bool
Whether to return only nodes with all checks in the passing state. Defaults to
true.- tag str
A single tag that can be used to filter the list to return based on a single matching tag.
- wait_
for str
GetServiceHealth Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The name of this health-check.
- Results
List<Get
Service Health Result> A list of entries and details about each endpoint advertising a service. Each element in the list has three attributes:
node,serviceandchecks. The list of the attributes of each one is detailed below.- Datacenter string
The datacenter in which the node is running. *
tagged_addresses- List of explicit LAN and WAN IP addresses for the agent.- Near string
The node to which the result must be sorted to.
- Node
Meta Dictionary<string, string> The list of metadata to filter the nodes.
- Passing bool
Whether to return only nodes with all checks in the passing state.
- Tag string
The name of the tag used to filter the list.
- Wait
For string
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The name of this health-check.
- Results
[]Get
Service Health Result Type A list of entries and details about each endpoint advertising a service. Each element in the list has three attributes:
node,serviceandchecks. The list of the attributes of each one is detailed below.- Datacenter string
The datacenter in which the node is running. *
tagged_addresses- List of explicit LAN and WAN IP addresses for the agent.- Near string
The node to which the result must be sorted to.
- Node
Meta map[string]string The list of metadata to filter the nodes.
- Passing bool
Whether to return only nodes with all checks in the passing state.
- Tag string
The name of the tag used to filter the list.
- Wait
For string
- id string
The provider-assigned unique ID for this managed resource.
- name string
The name of this health-check.
- results
Get
Service Health Result[] A list of entries and details about each endpoint advertising a service. Each element in the list has three attributes:
node,serviceandchecks. The list of the attributes of each one is detailed below.- datacenter string
The datacenter in which the node is running. *
tagged_addresses- List of explicit LAN and WAN IP addresses for the agent.- near string
The node to which the result must be sorted to.
- node
Meta {[key: string]: string} The list of metadata to filter the nodes.
- passing boolean
Whether to return only nodes with all checks in the passing state.
- tag string
The name of the tag used to filter the list.
- wait
For string
- id str
The provider-assigned unique ID for this managed resource.
- name str
The name of this health-check.
- results
List[Get
Service Health Result] A list of entries and details about each endpoint advertising a service. Each element in the list has three attributes:
node,serviceandchecks. The list of the attributes of each one is detailed below.- datacenter str
The datacenter in which the node is running. *
tagged_addresses- List of explicit LAN and WAN IP addresses for the agent.- near str
The node to which the result must be sorted to.
- node_
meta Dict[str, str] The list of metadata to filter the nodes.
- passing bool
Whether to return only nodes with all checks in the passing state.
- tag str
The name of the tag used to filter the list.
- wait_
for str
Supporting Types
GetServiceHealthResult
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Checks
List<Get
Service Health Result Check Args> - Node
Get
Service Health Result Node Args The name of the node associated with this health-check.
- Service
Get
Service Health Result Service Args
- Checks
[]Get
Service Health Result Check - Node
Get
Service Health Result Node The name of the node associated with this health-check.
- Service
Get
Service Health Result Service
- checks
Get
Service Health Result Check[] - node
Get
Service Health Result Node The name of the node associated with this health-check.
- service
Get
Service Health Result Service
- checks
List[Get
Service Health Result Check] - node
Dict[Get
Service Health Result Node] The name of the node associated with this health-check.
- service
Dict[Get
Service Health Result Service]
GetServiceHealthResultCheck
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Id string
The ID of this health-check.
- Name string
The service name to select.
- Node string
The name of the node associated with this health-check.
- Notes string
A human readable description of the current state of the health-check.
- Output string
The output of the health-check.
- Service
Id string The ID of the service associated to this health-check.
- Service
Name string The name of the service associated with this health-check.
- List<string>
The list of tags associated with this health-check.
- Status string
The status of this health-check.
- Id string
The ID of this health-check.
- Name string
The service name to select.
- Node string
The name of the node associated with this health-check.
- Notes string
A human readable description of the current state of the health-check.
- Output string
The output of the health-check.
- Service
Id string The ID of the service associated to this health-check.
- Service
Name string The name of the service associated with this health-check.
- []string
The list of tags associated with this health-check.
- Status string
The status of this health-check.
- id string
The ID of this health-check.
- name string
The service name to select.
- node string
The name of the node associated with this health-check.
- notes string
A human readable description of the current state of the health-check.
- output string
The output of the health-check.
- service
Id string The ID of the service associated to this health-check.
- service
Name string The name of the service associated with this health-check.
- string[]
The list of tags associated with this health-check.
- status string
The status of this health-check.
- id str
The ID of this health-check.
- name str
The service name to select.
- node str
The name of the node associated with this health-check.
- notes str
A human readable description of the current state of the health-check.
- output str
The output of the health-check.
- service
Name str The name of the service associated with this health-check.
- List[str]
The list of tags associated with this health-check.
- service_
id str The ID of the service associated to this health-check.
- status str
The status of this health-check.
GetServiceHealthResultNode
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Address string
The address of this instance.
- Datacenter string
The Consul datacenter to query.
- Id string
The ID of this health-check.
- Meta Dictionary<string, string>
Service metadata tag information, if any.
- Name string
The service name to select.
- Tagged
Addresses Dictionary<string, string>
- Address string
The address of this instance.
- Datacenter string
The Consul datacenter to query.
- Id string
The ID of this health-check.
- Meta map[string]string
Service metadata tag information, if any.
- Name string
The service name to select.
- Tagged
Addresses map[string]string
- address string
The address of this instance.
- datacenter string
The Consul datacenter to query.
- id string
The ID of this health-check.
- meta {[key: string]: string}
Service metadata tag information, if any.
- name string
The service name to select.
- tagged
Addresses {[key: string]: string}
- address str
The address of this instance.
- datacenter str
The Consul datacenter to query.
- id str
The ID of this health-check.
- meta Dict[str, str]
Service metadata tag information, if any.
- name str
The service name to select.
- tagged
Addresses Dict[str, str]
GetServiceHealthResultService
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
Package Details
- Repository
- https://github.com/pulumi/pulumi-consul
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
consulTerraform Provider.