Skip to main content

Consul.NET

.NET client library for the Consul HTTP API

Downloads
NuGet
CI
License
Contributors
Contribute with GitPod
.NET Framework: >= 4.6.1
.NET Core: >= 2.0.0
dotnet add package Consul

Curious about what's next? try the ⚡ preview version

Easy to Use

Consul.NET was designed by humans, for humans. It's meant to be intuitive, simple and easy to use.

Open-Source

Consul.NET is open-source and free to use. It's developed by the community and for the community.

Production Ready

Consul.NET is used in production by many companies and is battle-tested.

Supported APIs

The table below shows which endpoints are currently supported.

✅ supported · 🚧 in progress · ❌ not supported

GroupEndpointRouteStatus
ACLsBootstrap ACLsPUT v1/acl/bootstrap
Check ACL ReplicationGET v1/acl/replication
Login to Auth MethodPOST v1/acl/login
Logout from Auth MethodPOST v1/acl/logout
Update ACL Token RulesPUT v1/acl/update
List ACL TokensGET v1/acl/list
Clone a TokenPUT v1/acl/clone/:id
Create New TokenPUT v1/acl/create
Destroy a TokenPUT v1/acl/destroy/:id
Read a TokenGET v1/acl/info/:id
OIDC Authorization URL RequestPOST v1/acl/oidc/auth-url
OIDC CallbackPOST v1/acl/oidc/callback
ACL-TokensCreate a TokenPUT v1/acl/token
Read a TokenGET v1/acl/token/:AccessorID
Read Self TokenGET v1/acl/token/self
Update a TokenPUT v1/acl/token/:AccessorID
Clone a TokenPUT v1/acl/token/:AccessorID/clone
Delete a TokenDELETE v1/acl/token/:AccessorID
List TokensGET v1/acl/tokens
ACL-PoliciesCreate a PolicyPUT v1/acl/policy
Read a PolicyGET v1/acl/policy/:id
Read a Policy by NameGET v1/acl/policy/name/:name
Update a PolicyPUT v1/acl/policy/:id
Delete a PolicyDELETE v1/acl/policy/:id
List PoliciesGET v1/acl/policies
ACL-Templated PoliciesRead a templated policy by nameGET v1/acl/templated-policy/name/:name
Preview a templated policyPOST v1/acl/templated-policy/preview/:name
List templated policiesGET v1/acl/templated-policies
ACL-RolesCreate a RolePUT v1/acl/role
Read a RoleGET v1/acl/role/:id
Read a Role by NameGET v1/acl/role/name/:name
Update a RolePUT v1/acl/role/:id
Delete a RoleDELETE v1/acl/role/:id
List RolesGET v1/acl/roles
ACL-Auth MethodsCreate an Auth MethodPUT v1/acl/auth-method
Read an Auth MethodGET v1/acl/auth-method/:name
Update an Auth MethodPUT v1/acl/auth-method/:name
Delete an Auth MethodDELETE v1/acl/auth-method/:name
List Auth MethodsGET v1/acl/auth-methods
ACL-Binding RulesCreate a Binding RulePUT v1/acl/binding-rule
Read a Binding RuleGET v1/acl/binding-rule/:id
Update a Binding RulePUT v1/acl/binding-rule/:id
Delete a Binding RuleDELETE v1/acl/binding-rule/:id
List Binding RulesGET v1/acl/binding-rules
Translate Legacy Rule to Latest SyntaxPOST v1/acl/rules/translate
Read Translated RuleGET v1/acl/rules/translate/:id
Admin PartitionCreate a PartitionPUT v1/partition
Read a PartitionGET v1/partition/:name
Update a PartitionPUT v1/partition/:name
Delete a PartitionDELETE v1/partition/:name
List all PartitionsGET v1/partitions
AgentRetrieve host informationGET v1/agent/host
Retrieve version informationGET v1/agent/version
List MembersGET v1/agent/members
Read ConfigurationGET v1/agent/self
Reload AgentPUT v1/agent/reload
Enable Maintenance ModePUT v1/agent/maintenance
View MetricsGET v1/agent/metrics
Stream LogsGET v1/agent/monitor
Join AgentPUT v1/agent/join/:address
Graceful Leave and ShutdownPUT v1/agent/leave
Force Leave and ShutdownPUT v1/agent/force-leave/:node
Update ACL TokensPUT v1/agent/token/:token_type
Update ACL TokensPUT v1/agent/token/agent_master🛑 (Deprecated in 1.11)
Update ACL TokensPUT v1/agent/token/acl_token🛑 (Deprecated in 1.4.3)
Update ACL TokensPUT v1/agent/token/acl_agent_token🛑 (Deprecated in 1.4.3)
Update ACL TokensPUT v1/agent/token/acl_agent_master_token🛑 (Deprecated in 1.4.3)
Update ACL TokensPUT v1/agent/token/acl_replication_token🛑 (Deprecated in 1.4.3)
Agent-ChecksList ChecksGET v1/agent/checks
Register CheckPUT v1/agent/check/register
Deregister CheckPUT v1/agent/check/deregister/:check_id
TTL Check PassPUT v1/agent/check/pass/:check_id
TTL Check WarnPUT v1/agent/check/warn/:check_id
TTL Check FailPUT v1/agent/check/fail/:check_id
TTL Check UpdatePUT v1/agent/check/update/:check_id
Agent-ServicesList ServicesGET v1/agent/services
Get Service ConfigurationGET v1/agent/service/:service_id
Get local service healthGET v1/agent/health/service/name/:service_name
Get local service health by IDGET v1/agent/health/service/id/:service_id
Register ServicePUT v1/agent/service/register
Deregister ServicePUT v1/agent/service/deregister/:service_id
Enable Maintenance ModePUT v1/agent/service/maintenance/:service_id
ConnectAuthorizePOST v1/agent/connect/authorize
Certificate Authority (CA) RootsGET v1/agent/connect/ca/roots
Service Leaf CertificateGET v1/agent/connect/ca/leaf/:service
CatalogRegister EntityPUT v1/catalog/register
Deregister EntityPUT v1/catalog/deregister
List DatacentersGET v1/catalog/datacenters
List NodesGET v1/catalog/nodes
List ServicesGET v1/catalog/services
List Nodes for ServiceGET v1/catalog/service/:service
List Nodes for Mesh-capable ServiceGET v1/catalog/connect/:service
Retrieve Map of Services for a NodeGET v1/catalog/node/:node
List Services for NodeGET v1/catalog/node-services/:node
List Services for GatewayGET v1/catalog/gateway-services/:gateway
Cluster PeeringGenerate a Peering TokenPOST v1/peering/token
Establish a Peering ConnectionPOST v1/peering/establish
Read a Peering ConnectionGET v1/peering/:name
Delete a Peering ConnectionDELETE v1/peering/:name
List all PeeringsGET v1/peerings
ConfigApply ConfigurationPUT v1/config
Get ConfigurationGET v1/config/:kind/:name
List ConfigurationsGET v1/config/:kind/:name
Delete ConfigurationDELETE v1/config/:kind/:name
ConnectList CA Root CertificatesGET v1/connect/ca/roots
Get CA ConfigurationGET v1/connect/ca/configuration
Update CA ConfigurationPUT v1/connect/ca/configuration
Upsert Intention by NamePUT v1/connect/intentions/exact
Create Intention with IDPOST v1/connect/intentions🛑 (Deprecated in 1.9.0)
Update Intention by IDPUT v1/connect/intentions/:uuid🛑 (Deprecated in 1.9.0)
Read Specific Intention by NameGET v1/connect/intentions/exact
Read Specific Intention by IDGET v1/connect/intentions/:uuid🛑 (Deprecated in 1.9.0)
List IntentionsGET v1/connect/intentions
Delete Intention by NameDELETE v1/connect/intentions/exact
Delete Intention by IDDELETE v1/connect/intentions/:uuid🛑 (Deprecated in 1.9.0)
Check Intention ResultGET v1/connect/intentions/check
List Matching IntentionsGET v1/connect/intentions/match
CoordinateRead WAN CoordinatesGET v1/coordinate/datacenters
Read LAN Coordinates for all nodesGET v1/coordinate/nodes
Read LAN Coordinates for a nodeGET v1/coordinate/node/:node
Update LAN Coordinates for a nodePUT v1/coordinate/update
Discovery ChainRead Compiled Discovery ChainGET v1/discovery-chain/:service
POST v1/discovery-chain/:servicePOST v1/discovery-chain/:service
EventsFire EventPUT v1/event/fire/:name
List EventsGET v1/event/list
Exported ServicesList Exported ServicesGET v1/exported-services
HealthList Checks for NodeGET v1/health/node/:node
List Checks for ServiceGET v1/health/checks/:service
List Nodes for ServiceGET v1/health/service/:service
List Nodes for Connect-capable ServiceGET v1/health/connect/:service
List Nodes for Ingress Gateways Associated to a ServiceGET v1/health/ingress/:service
List Checks in StateGET v1/health/state/:state
KV StoreRead KeyGET v1/kv/:key
Create/Update KeyPUT v1/kv/:key
Delete KeyDELETE v1/kv/:key
Operator-AreaCreate Network AreaPOST v1/operator/area
List Network AreasGET v1/operator/area
Update Network AreaPUT v1/operator/area/:uuid
List Specific Network AreaGET v1/operator/area/:uuid
Delete Network AreaDELETE v1/operator/area/:uuid
Join Network AreaPUT v1/operator/area/:uuid/join🚧
List Network Area MembersGET v1/operator/area/:uuid/members
Autopilot OperatorRead ConfigurationGET v1/operator/autopilot/configuration
Update ConfigurationPUT v1/operator/autopilot/configuration
Read HealthGET v1/operator/autopilot/health
Read the Autopilot StateGET v1/operator/autopilot/state
Keyring OperatorList Gossip Encryption KeysGET v1/operator/keyring
Add New Gossip Encryption KeyPOST v1/operator/keyring
Change Primary Gossip Encryption KeyPUT v1/operator/keyring
Delete Gossip Encryption KeyDELETE v1/operator/keyring
License - OperatorGetting the Consul LicenseGET v1/operator/license
Updating the Consul LicensePUT v1/operator/license🛑 (Deprecated in 1.10.0)
Resetting the Consul LicenseDELETE v1/operator/license🛑 (Deprecated in 1.10.0)
Raft OperatorRead ConfigurationGET v1/operator/raft/configuration
Delete Raft PeerDELETE v1/operator/raft/peer
Transfer Raft LeadershipPOST v1/operator/raft/transfer-leader
Network Segments - OperatorList Network SegmentsGET v1/operator/segment
Operator-UtilizationGenerate utilization bundleGET v1/operator/utilization
NamespaceCreate a NamespacePUT v1/namespace
Read a NamespaceGET v1/namespace/:name
Update a NamespacePUT v1/namespace/:name
Delete a NamespaceDELETE v1/namespace/:name
List all NamespacesGET v1/namespaces
Prepared QueryCreate Prepared QueryPOST v1/query
List Prepared QueriesGET v1/query
Update Prepared QueryPUT v1/query/:uuid
Read Prepared QueryGET v1/query/:uuid
Delete Prepared QueryDELETE v1/query/:uuid
Execute Prepared QueryGET v1/query/:uuid/execute
Explain Prepared QueryGET v1/query/:uuid/explain
SessionCreate SessionPUT v1/session/create
Delete SessionPUT v1/session/destroy/:uuid
Read SessionGET v1/session/info/:uuid
List Sessions for NodeGET v1/session/node/:node
List SessionsGET v1/session/list
Renew SessionPUT v1/session/renew/:uuid
SnapshotGenerate SnapshotGET v1/snapshot
Restore SnapshotPUT v1/snapshot
StatusGet Raft LeaderGET v1/status/leader
List Raft PeersGET v1/status/peers
TransactionsCreate TransactionPUT v1/txn