GetServices
The consul..getServices data source returns a list of Consul services that
have been registered with the Consul cluster in a given datacenter. By
specifying a different datacenter in the query_options it is possible to
retrieve a list of services from a different WAN-attached Consul datacenter.
This data source is different from the consul..Service (singular) data
source, which provides a detailed response about a specific Consul service.
Using GetServices
function getServices(args: GetServicesArgs, opts?: InvokeOptions): Promise<GetServicesResult>function get_services(query_options=None, opts=None)func GetServices(ctx *Context, args *GetServicesArgs, opts ...InvokeOption) (*GetServicesResult, error)public static class GetServices {
public static Task<GetServicesResult> InvokeAsync(GetServicesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Query
Options List<GetServices Query Option Args> See below.
- Query
Options []GetServices Query Option See below.
- query
Options GetServices Query Option[] See below.
- query_
options List[GetServices Query Option] See below.
GetServices Result
The following output properties are available:
- Datacenter string
The datacenter the keys are being read from to.
- Id string
The provider-assigned unique ID for this managed resource.
- Names List<string>
- Services Dictionary<string, string>
- Query
Options List<GetServices Query Option>
- Datacenter string
The datacenter the keys are being read from to.
- Id string
The provider-assigned unique ID for this managed resource.
- Names []string
- Services map[string]string
- Query
Options []GetServices Query Option
- datacenter string
The datacenter the keys are being read from to.
- id string
The provider-assigned unique ID for this managed resource.
- names string[]
- services {[key: string]: string}
- query
Options GetServices Query Option[]
- datacenter str
The datacenter the keys are being read from to.
- id str
The provider-assigned unique ID for this managed resource.
- names List[str]
- services Dict[str, str]
- query_
options List[GetServices Query Option]
Supporting Types
GetServicesQueryOption
- Allow
Stale bool When
true, the default, allow responses from Consul servers that are followers.- Datacenter string
The Consul datacenter to query. Defaults to the same value found in
query_optionsparameter specified below, or if that is empty, thedatacentervalue found in the Consul agent that this provider is configured to talk to.- Namespace string
The namespace to lookup the services.
- Near string
- Node
Meta Dictionary<string, string> - Require
Consistent bool When
trueforce the client to perform a read on at least quorum servers and verify the result is the same. Defaults tofalse.- Token string
Specify the Consul ACL token to use when performing the request. This defaults to the same API token configured by the
consulprovider but may be overriden if necessary.- Wait
Index int Index number used to enable blocking quereis.
- Wait
Time string Max time the client should wait for a blocking query to return.
- Allow
Stale bool When
true, the default, allow responses from Consul servers that are followers.- Datacenter string
The Consul datacenter to query. Defaults to the same value found in
query_optionsparameter specified below, or if that is empty, thedatacentervalue found in the Consul agent that this provider is configured to talk to.- Namespace string
The namespace to lookup the services.
- Near string
- Node
Meta map[string]string - Require
Consistent bool When
trueforce the client to perform a read on at least quorum servers and verify the result is the same. Defaults tofalse.- Token string
Specify the Consul ACL token to use when performing the request. This defaults to the same API token configured by the
consulprovider but may be overriden if necessary.- Wait
Index int Index number used to enable blocking quereis.
- Wait
Time string Max time the client should wait for a blocking query to return.
- allow
Stale boolean When
true, the default, allow responses from Consul servers that are followers.- datacenter string
The Consul datacenter to query. Defaults to the same value found in
query_optionsparameter specified below, or if that is empty, thedatacentervalue found in the Consul agent that this provider is configured to talk to.- namespace string
The namespace to lookup the services.
- near string
- node
Meta {[key: string]: string} - require
Consistent boolean When
trueforce the client to perform a read on at least quorum servers and verify the result is the same. Defaults tofalse.- token string
Specify the Consul ACL token to use when performing the request. This defaults to the same API token configured by the
consulprovider but may be overriden if necessary.- wait
Index number Index number used to enable blocking quereis.
- wait
Time string Max time the client should wait for a blocking query to return.
- allow
Stale bool When
true, the default, allow responses from Consul servers that are followers.- datacenter str
The Consul datacenter to query. Defaults to the same value found in
query_optionsparameter specified below, or if that is empty, thedatacentervalue found in the Consul agent that this provider is configured to talk to.- namespace str
The namespace to lookup the services.
- near str
- node_
meta Dict[str, str] - require
Consistent bool When
trueforce the client to perform a read on at least quorum servers and verify the result is the same. Defaults tofalse.- token str
Specify the Consul ACL token to use when performing the request. This defaults to the same API token configured by the
consulprovider but may be overriden if necessary.- wait
Index float Index number used to enable blocking quereis.
- wait
Time str Max time the client should wait for a blocking query to return.
Package Details
- Repository
- https://github.com/pulumi/pulumi-consul
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
consulTerraform Provider.