http: add partition query param parsing

This commit is contained in:
Kyle Havlovitz 2021-07-14 12:07:38 -07:00
parent 8c5723ec98
commit e97bc2bda7
4 changed files with 10 additions and 0 deletions

View File

@ -235,6 +235,9 @@ func (s *HTTPHandlers) CatalogNodes(resp http.ResponseWriter, req *http.Request)
// Setup the request
args := structs.DCSpecificRequest{}
s.parseSource(req, &args.Source)
if err := parseEntMetaPartition(req, &args.EnterpriseMeta); err != nil {
return nil, err
}
args.NodeMetaFilters = s.parseMetaFilter(req)
if done := s.parse(resp, req, &args.Datacenter, &args.QueryOptions); done {
metrics.IncrCounterWithLabels([]string{"client", "rpc", "error", "catalog_nodes"}, 1,

View File

@ -73,3 +73,8 @@ func (s *HTTPHandlers) enterpriseHandler(next http.Handler) http.Handler {
func (s *HTTPHandlers) uiTemplateDataTransform(data map[string]interface{}) error {
return nil
}
// parseEntMetaPartition is a noop for the enterprise implementation.
func parseEntMetaPartition(req *http.Request, meta *structs.EnterpriseMeta) error {
return nil
}

View File

@ -47,6 +47,7 @@ type CatalogService struct {
Checks HealthChecks
ModifyIndex uint64
Namespace string `json:",omitempty"`
Partition string `json:",omitempty"`
}
type CatalogNode struct {

View File

@ -44,6 +44,7 @@ type HealthCheck struct {
ServiceTags []string
Type string
Namespace string `json:",omitempty"`
Partition string `json:",omitempty"`
Definition HealthCheckDefinition