You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/05/30 02:23:32 UTC

[GitHub] mitchell852 closed pull request #2340: add the ability to filter servers by parent cachegroup

mitchell852 closed pull request #2340: add the ability to filter servers by parent cachegroup
URL: https://github.com/apache/incubator-trafficcontrol/pull/2340
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/traffic_ops_golang/server/servers.go b/traffic_ops/traffic_ops_golang/server/servers.go
index 60a46826d..883263395 100644
--- a/traffic_ops/traffic_ops_golang/server/servers.go
+++ b/traffic_ops/traffic_ops_golang/server/servers.go
@@ -206,14 +206,15 @@ func getServers(params map[string]string, db *sqlx.DB, privLevel int) ([]tc.Serv
 	// Query Parameters to Database Query column mappings
 	// see the fields mapped in the SQL query
 	queryParamsToSQLCols := map[string]dbhelpers.WhereColumnInfo{
-		"cachegroup":   dbhelpers.WhereColumnInfo{"s.cachegroup", api.IsInt},
-		"cdn":          dbhelpers.WhereColumnInfo{"s.cdn_id", api.IsInt},
-		"id":           dbhelpers.WhereColumnInfo{"s.id", api.IsInt},
-		"hostName":     dbhelpers.WhereColumnInfo{"s.host_name", nil},
-		"physLocation": dbhelpers.WhereColumnInfo{"s.phys_location", api.IsInt},
-		"profileId":    dbhelpers.WhereColumnInfo{"s.profile", api.IsInt},
-		"status":       dbhelpers.WhereColumnInfo{"st.name", nil},
-		"type":         dbhelpers.WhereColumnInfo{"t.name", nil},
+		"cachegroup":       dbhelpers.WhereColumnInfo{"s.cachegroup", api.IsInt},
+		"parentCachegroup": dbhelpers.WhereColumnInfo{"cg.parent_cachegroup_id", api.IsInt},
+		"cdn":              dbhelpers.WhereColumnInfo{"s.cdn_id", api.IsInt},
+		"id":               dbhelpers.WhereColumnInfo{"s.id", api.IsInt},
+		"hostName":         dbhelpers.WhereColumnInfo{"s.host_name", nil},
+		"physLocation":     dbhelpers.WhereColumnInfo{"s.phys_location", api.IsInt},
+		"profileId":        dbhelpers.WhereColumnInfo{"s.profile", api.IsInt},
+		"status":           dbhelpers.WhereColumnInfo{"st.name", nil},
+		"type":             dbhelpers.WhereColumnInfo{"t.name", nil},
 	}
 
 	where, orderBy, queryValues, errs := dbhelpers.BuildWhereAndOrderBy(params, queryParamsToSQLCols)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services