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/06/13 22:41:17 UTC

[GitHub] rob05c closed pull request #2410: Fix go DS API query params for filtering/ordering

rob05c closed pull request #2410: Fix go DS API query params for filtering/ordering
URL: https://github.com/apache/trafficcontrol/pull/2410
 
 
   

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/deliveryservice/deliveryservicesv13.go b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
index a4685a0d6..50497807a 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
@@ -621,8 +621,18 @@ func readGetDeliveryServices(params map[string]string, db *sqlx.DB, user auth.Cu
 	// Query Parameters to Database Query column mappings
 	// see the fields mapped in the SQL query
 	queryParamsToSQLCols := map[string]dbhelpers.WhereColumnInfo{
-		"id":       dbhelpers.WhereColumnInfo{"ds.id", api.IsInt},
-		"hostName": dbhelpers.WhereColumnInfo{"s.host_name", nil},
+		"id":               dbhelpers.WhereColumnInfo{"ds.id", api.IsInt},
+		"cdn":              dbhelpers.WhereColumnInfo{"ds.cdn_id", api.IsInt},
+		"xml_id":           dbhelpers.WhereColumnInfo{"ds.xml_id", nil},
+		"profile":          dbhelpers.WhereColumnInfo{"ds.profile", api.IsInt},
+		"type":             dbhelpers.WhereColumnInfo{"ds.type", api.IsInt},
+		"logsEnabled":      dbhelpers.WhereColumnInfo{"ds.logs_enabled", api.IsBool},
+		"tenant":           dbhelpers.WhereColumnInfo{"ds.tenant_id", api.IsInt},
+		"signingAlgorithm": dbhelpers.WhereColumnInfo{"ds.signing_algorithm", nil},
+	}
+
+	if _, ok := params["orderby"]; !ok {
+		params["orderby"] = "xml_id"
 	}
 
 	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