Conversation
Add the missing /v1/agent endpoints, whitelist documented options, and fix join() and forceLeave() which used GET while Consul only accepts PUT.
Add connect(), nodeServices() and gatewayServices(), and whitelist the documented options.
Add connect() and ingress(), and whitelist the documented options.
Allow blocking queries (index, wait) on get() and check-and-set (cas) on delete().
Allow blocking queries and consistency modes on info(), node() and all().
Consul expects multi-valued parameters to be repeated (?tag=a&tag=b), but Symfony HttpClient encodes arrays PHP-style (?tag[0]=a&tag[1]=b).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds all the Consul Community Edition (v2.0.x) HTTP API endpoints to the SDK. It can be reviewed commit by commit.
New services
ACL,Config,Connect(CA + intentions),Coordinate,DiscoveryChain,Event,Operator(raft, keyring, autopilot, usage),Peering(+ exported / imported services),PreparedQuery,SnapshotandStatus.Existing services
Agent,CatalogandHealthnow cover all their endpointsfilter, ...) inAgent,Catalog,Health,KVandSessionAgent::join()andAgent::forceLeave(): they sentGET, Consul only acceptsPUT(405)No BC break: nothing is removed nor renamed, only new optional arguments.
Client
CONSUL_HTTP_TOKENenvironment variable (like the Consul CLI); an explicitX-Consul-Tokenheader wins['tag' => ['v1', 'primary']]is sent as?tag=v1&tag=primary(Symfony HttpClient would send?tag[0]=v1&tag[1]=primary, which Consul does not understand)dcoption is allowed on all endpoints, except the ones local to the agent, the datacenter listings, and the catalog (de)registration (where it goes in the payload). A test checks every method forwards it.Out of scope
ns,partition, operator area / license / segment / audit / utilization, OIDC...)POST /v1/connect/intentions)/v1/agent/monitor,/v1/agent/metrics/stream)/v1/internal/*Tests & tooling
default_policy = allow,rootmanagement token)MockHttpClient