You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2018/05/30 02:23:33 UTC
[incubator-trafficcontrol] branch master updated: add the ability
to filter servers by parent cachegroup
This is an automated email from the ASF dual-hosted git repository.
mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 38d2a1d add the ability to filter servers by parent cachegroup
38d2a1d is described below
commit 38d2a1d0e861e7b340eadcfc8ac9e0416bb83d58
Author: Dylan Volz <Dy...@comcast.com>
AuthorDate: Tue May 29 13:27:25 2018 -0600
add the ability to filter servers by parent cachegroup
---
traffic_ops/traffic_ops_golang/server/servers.go | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/traffic_ops/traffic_ops_golang/server/servers.go b/traffic_ops/traffic_ops_golang/server/servers.go
index 8fbcb71..468ce21 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)
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.