Skip to main content

Class Catalog

Namespace: Consul
Assembly: Consul.dll

Catalog can be used to query the Catalog endpoints

public class Catalog : ICatalogEndpoint

Inheritance

objectCatalog

Implements

ICatalogEndpoint

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

ct CancellationToken

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

q QueryOptions

ct CancellationToken

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

reg CatalogDeregistration

A catalog deregistration

ct CancellationToken

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

reg CatalogDeregistration

A catalog deregistration

q WriteOptions

Customized write options

ct CancellationToken

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

q QueryOptions

Query Parameters

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

q QueryOptions

Customized query options

ct CancellationToken

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

ct CancellationToken

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

q QueryOptions

Customized query options

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

q QueryOptions

Customized Query options

filter Filter

Specifies the expression used to filter the queries results prior to returning the data

ct CancellationToken

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

reg CatalogRegistration

A catalog registration

ct CancellationToken

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

reg CatalogRegistration

A catalog registration

q WriteOptions

Customized write options

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

q QueryOptions

Customized query options

ct CancellationToken

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

ct CancellationToken

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

q QueryOptions

Customized query options

ct CancellationToken

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

ct CancellationToken

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

q QueryOptions

Query Parameters

ct CancellationToken

Cancellation Token

Returns

Task <QueryResult <NodeService >>

Node Services

  • Methods
    • Datacenters(CancellationToken)
    • Datacenters(QueryOptions, CancellationToken)
    • Deregister(CatalogDeregistration, CancellationToken)
    • Deregister(CatalogDeregistration, WriteOptions, CancellationToken)
    • GatewayService(string, QueryOptions, CancellationToken)
    • GatewayService(string, CancellationToken)
    • Node(string, CancellationToken)
    • Node(string, QueryOptions, CancellationToken)
    • Nodes(CancellationToken)
    • Nodes(QueryOptions, CancellationToken)
    • NodesForMeshCapableService(string, CancellationToken)
    • NodesForMeshCapableService(string, Filter, CancellationToken)
    • NodesForMeshCapableService(string, QueryOptions, Filter, CancellationToken)
    • Register(CatalogRegistration, CancellationToken)
    • Register(CatalogRegistration, WriteOptions, CancellationToken)
    • Service(string, CancellationToken)
    • Service(string, string, CancellationToken)
    • Service(string, string, QueryOptions, CancellationToken)
    • Services(CancellationToken)
    • Services(QueryOptions, CancellationToken)
    • ServicesForNode(string, CancellationToken)
    • ServicesForNode(string, QueryOptions, CancellationToken)