Class Catalog
Namespace: Consul
Assembly: Consul.dll
Catalog can be used to query the Catalog endpoints
public class Catalog : ICatalogEndpoint
Inheritance
Implements
Inherited Members
object.Equals(object) , object.Equals(object, object) , object.GetHashCode() , object.GetType() , object.MemberwiseClone() , object.ReferenceEquals(object, object) , object.ToString()
Methods
Datacenters(CancellationToken)
Datacenters is used to query for all the known datacenters
public Task<QueryResult<string[]>> Datacenters(CancellationToken ct = default)
Parameters
Returns
Task <QueryResult <string []>>
A list of datacenter names
Datacenters(QueryOptions, CancellationToken)
Datacenters is used to query for all the known datacenters with custom query options
public Task<QueryResult<string[]>> Datacenters(QueryOptions q, CancellationToken ct = default)
Parameters
Returns
Task <QueryResult <string []>>
A list of datacenter names
Deregister(CatalogDeregistration, CancellationToken)
Deregister an existing catalog item
public Task<WriteResult> Deregister(CatalogDeregistration reg, CancellationToken ct = default)
Parameters
A catalog deregistration
The cancellation token
Returns
Task <WriteResult >
An empty write result
Deregister(CatalogDeregistration, WriteOptions, CancellationToken)
Deregister an existing catalog item
public Task<WriteResult> Deregister(CatalogDeregistration reg, WriteOptions q, CancellationToken ct = default)
Parameters
A catalog deregistration
Customized write options
The cancellation token
Returns
Task <WriteResult >
An empty write result
GatewayService(string, QueryOptions, CancellationToken)
GatewayServices is used to query for the services associated with an ingress gateway or terminating gateway
public Task<QueryResult<GatewayService[]>> GatewayService(string gateway, QueryOptions q, CancellationToken ct = default)
Parameters
gateway
string
Gateway name
Query Parameters
Cancellation Token
Returns
Task <QueryResult <GatewayService []>>
Gateway services
GatewayService(string, CancellationToken)
GatewayServices is used to query for the services associated with an ingress gateway or terminating gateway
public Task<QueryResult<GatewayService[]>> GatewayService(string gateway, CancellationToken ct = default)
Parameters
gateway
string
Gateway name
Cancellation Token
Returns
Task <QueryResult <GatewayService []>>
Gateway services
Node(string, CancellationToken)
Node is used to query for service information about a single node
public Task<QueryResult<CatalogNode>> Node(string node, CancellationToken ct = default)
Parameters
node
string
The node name
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogNode >>
The node information including a list of services
Node(string, QueryOptions, CancellationToken)
Node is used to query for service information about a single node
public Task<QueryResult<CatalogNode>> Node(string node, QueryOptions q, CancellationToken ct = default)
Parameters
node
string
The node name
Customized query options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogNode >>
The node information including a list of services
Nodes(CancellationToken)
Nodes is used to query all the known nodes
public Task<QueryResult<Node[]>> Nodes(CancellationToken ct = default)
Parameters
Returns
Task <QueryResult <Node []>>
A list of all nodes
Nodes(QueryOptions, CancellationToken)
Nodes is used to query all the known nodes
public Task<QueryResult<Node[]>> Nodes(QueryOptions q, CancellationToken ct = default)
Parameters
Customized query options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <Node []>>
A list of all nodes
NodesForMeshCapableService(string, CancellationToken)
Returns the nodes providing a mesh-capable service in a given datacenter.
public Task<QueryResult<CatalogService[]>> NodesForMeshCapableService(string service, CancellationToken ct = default)
Parameters
service
string
The service ID
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogService []>>
A list of service instances
NodesForMeshCapableService(string, Filter, CancellationToken)
Returns the nodes providing a mesh-capable service in a given datacenter.
public Task<QueryResult<CatalogService[]>> NodesForMeshCapableService(string service, Filter filter, CancellationToken ct = default)
Parameters
service
string
The service ID
filter
Filter
Specifies the expression used to filter the queries results prior to returning the data
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogService []>>
A list of service instances
NodesForMeshCapableService(string, QueryOptions, Filter, CancellationToken)
Returns the nodes providing a mesh-capable service in a given datacenter.
public Task<QueryResult<CatalogService[]>> NodesForMeshCapableService(string service, QueryOptions q, Filter filter, CancellationToken ct = default)
Parameters
service
string
The service ID
Customized Query options
filter
Filter
Specifies the expression used to filter the queries results prior to returning the data
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogService []>>
A list of service instances
Register(CatalogRegistration, CancellationToken)
Register a new catalog item
public Task<WriteResult> Register(CatalogRegistration reg, CancellationToken ct = default)
Parameters
A catalog registration
The cancellation token
Returns
Task <WriteResult >
An empty write result
Register(CatalogRegistration, WriteOptions, CancellationToken)
Register a new catalog item
public Task<WriteResult> Register(CatalogRegistration reg, WriteOptions q, CancellationToken ct = default)
Parameters
A catalog registration
Customized write options
The cancellation token
Returns
Task <WriteResult >
An empty write result
Service(string, CancellationToken)
Service is used to query catalog entries for a given service
public Task<QueryResult<CatalogService[]>> Service(string service, CancellationToken ct = default)
Parameters
service
string
The service ID
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogService []>>
A list of service instances
Service(string, string, CancellationToken)
Service is used to query catalog entries for a given service
public Task<QueryResult<CatalogService[]>> Service(string service, string tag, CancellationToken ct = default)
Parameters
service
string
The service ID
tag
string
A tag to filter on
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogService []>>
A list of service instances
Service(string, string, QueryOptions, CancellationToken)
Service is used to query catalog entries for a given service
public Task<QueryResult<CatalogService[]>> Service(string service, string tag, QueryOptions q, CancellationToken ct)
Parameters
service
string
The service ID
tag
string
A tag to filter on
Customized query options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <CatalogService []>>
A list of service instances
Services(CancellationToken)
Services is used to query for all known services
public Task<QueryResult<Dictionary<string, string[]>>> Services(CancellationToken ct = default)
Parameters
Returns
Task <QueryResult <Dictionary <string , string []>>>
A list of all services
Services(QueryOptions, CancellationToken)
Services is used to query for all known services
public Task<QueryResult<Dictionary<string, string[]>>> Services(QueryOptions q, CancellationToken ct = default)
Parameters
Customized query options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <Dictionary <string , string []>>>
A list of all services
ServicesForNode(string, CancellationToken)
ServicesForNode is used to query for the services provided by a node
public Task<QueryResult<NodeService>> ServicesForNode(string node, CancellationToken ct = default)
Parameters
node
string
Node Name
CancellationToken
Returns
Task <QueryResult <NodeService >>
Node Services
ServicesForNode(string, QueryOptions, CancellationToken)
ServicesForNode is used to query for the services provided by a node
public Task<QueryResult<NodeService>> ServicesForNode(string node, QueryOptions q, CancellationToken ct = default)
Parameters
node
string
Node Name
Query Parameters
Cancellation Token
Returns
Task <QueryResult <NodeService >>
Node Services