You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2018/10/01 16:47:18 UTC

[trafficcontrol] branch master updated (93b3961 -> 4d974f0)

This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git.


    from 93b3961  ensure all conf copied to trafficops-go container
     new a0768fc  Add TO GO steering endpoint
     new ec226a0  Add TO Go client steering endpoint
     new a2a1333  Add TO Go steering api test
     new 982263b  Remove empty import
     new 6aba1ce  Change TO Go steering order, weight to signed int
     new 869cb43  Change TO Go GET /steering to PrivLevelSteering
     new 03c2877  Fix TO Go steering db error message
     new 4452b8f  Fix TO Go GET steering to only primary origins
     new e070285  Fix TO Go steering test for int/uint change
     new a0b101e  Change TO Go steering fields to int32 to match TR
     new 4d974f0  Updated TO Perl,client,tests to v14

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/go-tc/enum.go                                  |  42 ++++
 lib/go-tc/{roles.go => steering.go}                |  53 ++---
 lib/go-util/ptr.go                                 |   4 +
 traffic_ops/app/lib/TrafficOpsRoutes.pm            |   6 +
 traffic_ops/client/endpoints.go                    |   2 +-
 traffic_ops/client/{ping.go => steering.go}        |  15 +-
 traffic_ops/client/steeringtarget.go               |   8 +-
 traffic_ops/testing/api/{v13 => v14}/about_test.go |   2 +-
 .../testing/api/{v13 => v14}/cachegroups_test.go   |   2 +-
 .../cachegroupsdeliveryservices_test.go            |   2 +-
 .../testing/api/{v13 => v14}/cdn_domains_test.go   |   2 +-
 .../api/{v13 => v14}/cdnfederations_test.go        |   2 +-
 traffic_ops/testing/api/{v13 => v14}/cdns_test.go  |   2 +-
 .../testing/api/{v13 => v14}/coordinates_test.go   |   2 +-
 .../testing/api/{v13 => v14}/crconfig_test.go      |   2 +-
 .../deliveryservice_request_comments_test.go       |   2 +-
 .../{v13 => v14}/deliveryservice_requests_test.go  |   2 +-
 .../{v13 => v14}/deliveryservicematches_test.go    |   2 +-
 .../api/{v13 => v14}/deliveryservices_test.go      |   2 +-
 .../{v13 => v14}/deliveryserviceservers_test.go    |   2 +-
 .../deliveryservicesideligible_test.go             |   2 +-
 .../testing/api/{v13 => v14}/divisions_test.go     |   2 +-
 traffic_ops/testing/api/{v13 => v14}/fixtures.go   |   2 +-
 .../testing/api/{v13 => v14}/origins_test.go       |   2 +-
 .../testing/api/{v13 => v14}/parameters_test.go    |   2 +-
 .../api/{v13 => v14}/phys_locations_test.go        |   2 +-
 traffic_ops/testing/api/{v13 => v14}/ping_test.go  |   2 +-
 .../api/{v13 => v14}/profile_parameters_test.go    |   2 +-
 .../testing/api/{v13 => v14}/profiles_test.go      |   2 +-
 .../testing/api/{v13 => v14}/regions_test.go       |   2 +-
 traffic_ops/testing/api/{v13 => v14}/roles_test.go |   2 +-
 .../testing/api/{v13 => v14}/servers_test.go       |   2 +-
 traffic_ops/testing/api/{v13 => v14}/session.go    |   8 +-
 .../api/{v13 => v14}/staticdnsentries_test.go      |   2 +-
 .../testing/api/{v13 => v14}/statuses_test.go      |   2 +-
 traffic_ops/testing/api/v14/steering_test.go       |  94 +++++++++
 .../api/{v13 => v14}/steeringtargets_test.go       |   2 +-
 .../testing/api/{v13 => v14}/tc-fixtures.json      |   0
 .../testing/api/{v13 => v14}/tenants_test.go       |   2 +-
 traffic_ops/testing/api/{v13 => v14}/todb.go       |   2 +-
 .../testing/api/{v13 => v14}/traffic_control.go    |   2 +-
 .../testing/api/{v13 => v14}/traffic_ops_test.go   |   2 +-
 traffic_ops/testing/api/{v13 => v14}/types_test.go |   2 +-
 traffic_ops/testing/api/{v13 => v14}/user_test.go  |   2 +-
 .../api/{v13 => v14}/userdeliveryservices_test.go  |   2 +-
 traffic_ops/traffic_ops_golang/routes.go           |   3 +
 .../traffic_ops_golang/steering/steering.go        | 234 +++++++++++++++++++++
 47 files changed, 449 insertions(+), 90 deletions(-)
 copy lib/go-tc/{roles.go => steering.go} (51%)
 copy traffic_ops/client/{ping.go => steering.go} (72%)
 rename traffic_ops/testing/api/{v13 => v14}/about_test.go (98%)
 rename traffic_ops/testing/api/{v13 => v14}/cachegroups_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/cachegroupsdeliveryservices_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/cdn_domains_test.go (98%)
 rename traffic_ops/testing/api/{v13 => v14}/cdnfederations_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/cdns_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/coordinates_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/crconfig_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/deliveryservice_request_comments_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/deliveryservice_requests_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/deliveryservicematches_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/deliveryservices_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/deliveryserviceservers_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/deliveryservicesideligible_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/divisions_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/fixtures.go (98%)
 rename traffic_ops/testing/api/{v13 => v14}/origins_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/parameters_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/phys_locations_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/ping_test.go (98%)
 rename traffic_ops/testing/api/{v13 => v14}/profile_parameters_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/profiles_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/regions_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/roles_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/servers_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/session.go (91%)
 rename traffic_ops/testing/api/{v13 => v14}/staticdnsentries_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/statuses_test.go (99%)
 create mode 100644 traffic_ops/testing/api/v14/steering_test.go
 rename traffic_ops/testing/api/{v13 => v14}/steeringtargets_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/tc-fixtures.json (100%)
 rename traffic_ops/testing/api/{v13 => v14}/tenants_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/todb.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/traffic_control.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/traffic_ops_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/types_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/user_test.go (99%)
 rename traffic_ops/testing/api/{v13 => v14}/userdeliveryservices_test.go (99%)
 create mode 100644 traffic_ops/traffic_ops_golang/steering/steering.go


[trafficcontrol] 10/11: Change TO Go steering fields to int32 to match TR

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit a0b101edcb39e1abbcc0e3a5db7763e80948e379
Author: Robert Butts <ro...@apache.org>
AuthorDate: Mon Oct 1 08:38:18 2018 -0600

    Change TO Go steering fields to int32 to match TR
---
 lib/go-tc/steering.go                               | 4 ++--
 traffic_ops/traffic_ops_golang/steering/steering.go | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/go-tc/steering.go b/lib/go-tc/steering.go
index dbe8f8f..61cf549 100644
--- a/lib/go-tc/steering.go
+++ b/lib/go-tc/steering.go
@@ -32,8 +32,8 @@ type SteeringFilter struct {
 }
 
 type SteeringSteeringTarget struct {
-	Order           int64               `json:"order"`
-	Weight          int64               `json:"weight"`
+	Order           int32               `json:"order"`
+	Weight          int32               `json:"weight"`
 	DeliveryService DeliveryServiceName `json:"deliveryService"`
 	GeoOrder        *int                `json:"geoOrder,omitempty"`
 	Longitude       *float64            `json:"longitude,omitempty"`
diff --git a/traffic_ops/traffic_ops_golang/steering/steering.go b/traffic_ops/traffic_ops_golang/steering/steering.go
index fd5dd44..2078a95 100644
--- a/traffic_ops/traffic_ops_golang/steering/steering.go
+++ b/traffic_ops/traffic_ops_golang/steering/steering.go
@@ -82,15 +82,15 @@ func findSteering(tx *sql.Tx) ([]tc.Steering, error) {
 		target := tc.SteeringSteeringTarget{DeliveryService: data.TargetName}
 		switch data.Type {
 		case tc.SteeringTypeOrder:
-			target.Order = int64(data.Value)
+			target.Order = int32(data.Value)
 		case tc.SteeringTypeWeight:
-			target.Weight = int64(data.Value)
+			target.Weight = int32(data.Value)
 		case tc.SteeringTypeGeoOrder:
 			target.GeoOrder = util.IntPtr(data.Value)
 			target.Latitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lat)
 			target.Longitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lon)
 		case tc.SteeringTypeGeoWeight:
-			target.Weight = int64(data.Value)
+			target.Weight = int32(data.Value)
 			target.GeoOrder = util.IntPtr(0)
 			target.Latitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lat)
 			target.Longitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lon)


[trafficcontrol] 01/11: Add TO GO steering endpoint

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit a0768fc8157938e2c958c615842721d47b97b065
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 14 15:13:28 2018 -0600

    Add TO GO steering endpoint
---
 lib/go-tc/enum.go                                  |  42 ++++
 lib/go-tc/steering.go                              |  43 ++++
 lib/go-util/ptr.go                                 |   4 +
 traffic_ops/traffic_ops_golang/routes.go           |   3 +
 .../traffic_ops_golang/steering/steering.go        | 233 +++++++++++++++++++++
 5 files changed, 325 insertions(+)

diff --git a/lib/go-tc/enum.go b/lib/go-tc/enum.go
index 4ab943f..b5fbe9b 100644
--- a/lib/go-tc/enum.go
+++ b/lib/go-tc/enum.go
@@ -323,6 +323,48 @@ func (t DeepCachingType) MarshalJSON() ([]byte, error) {
 	return json.Marshal(t.String())
 }
 
+type SteeringType string
+
+const (
+	SteeringTypeOrder     SteeringType = "STEERING_ORDER"
+	SteeringTypeWeight    SteeringType = "STEERING_WEIGHT"
+	SteeringTypeGeoOrder  SteeringType = "STEERING_GEO_ORDER"
+	SteeringTypeGeoWeight SteeringType = "STEERING_GEO_WEIGHT"
+	SteeringTypeInvalid   SteeringType = ""
+)
+
+func SteeringTypeFromString(s string) SteeringType {
+	s = strings.ToLower(strings.Replace(s, "_", "", -1))
+	switch s {
+	case "steeringorder":
+		return SteeringTypeOrder
+	case "steeringweight":
+		return SteeringTypeWeight
+	case "steeringgeoorder":
+		return SteeringTypeGeoOrder
+	case "steeringgeoweight":
+		return SteeringTypeGeoWeight
+	default:
+		return SteeringTypeInvalid
+	}
+}
+
+// String returns a string representation of this steering type.
+func (t SteeringType) String() string {
+	switch t {
+	case SteeringTypeOrder:
+		fallthrough
+	case SteeringTypeWeight:
+		fallthrough
+	case SteeringTypeGeoOrder:
+		fallthrough
+	case SteeringTypeGeoWeight:
+		return string(t)
+	default:
+		return "INVALID"
+	}
+}
+
 // DSType is the Delivery Service type.
 type DSType string
 
diff --git a/lib/go-tc/steering.go b/lib/go-tc/steering.go
new file mode 100644
index 0000000..f5419f5
--- /dev/null
+++ b/lib/go-tc/steering.go
@@ -0,0 +1,43 @@
+package tc
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import ()
+
+type Steering struct {
+	DeliveryService DeliveryServiceName      `json:"deliveryService"`
+	ClientSteering  bool                     `json:"clientSteering"`
+	Targets         []SteeringSteeringTarget `json:"targets"`
+	Filters         []SteeringFilter         `json:"filters"`
+}
+
+type SteeringFilter struct {
+	DeliveryService DeliveryServiceName `json:"deliveryService"`
+	Pattern         string              `json:"pattern"`
+}
+
+type SteeringSteeringTarget struct {
+	Order           uint64              `json:"order"`
+	Weight          uint64              `json:"weight"`
+	DeliveryService DeliveryServiceName `json:"deliveryService"`
+	GeoOrder        *int                `json:"geoOrder,omitempty"`
+	Longitude       *float64            `json:"longitude,omitempty"`
+	Latitude        *float64            `json:"latitude,omitempty"`
+}
diff --git a/lib/go-util/ptr.go b/lib/go-util/ptr.go
index 3bc227f..cd1fe6b 100644
--- a/lib/go-util/ptr.go
+++ b/lib/go-util/ptr.go
@@ -34,3 +34,7 @@ func Int64Ptr(i int64) *int64 {
 func BoolPtr(b bool) *bool {
 	return &b
 }
+
+func FloatPtr(f float64) *float64 {
+	return &f
+}
diff --git a/traffic_ops/traffic_ops_golang/routes.go b/traffic_ops/traffic_ops_golang/routes.go
index 72e7d05..ff9ec0b 100644
--- a/traffic_ops/traffic_ops_golang/routes.go
+++ b/traffic_ops/traffic_ops_golang/routes.go
@@ -63,6 +63,7 @@ import (
 	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/server"
 	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/staticdnsentry"
 	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/status"
+	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/steering"
 	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/steeringtargets"
 	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/systeminfo"
 	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/types"
@@ -390,6 +391,8 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) {
 		{1.1, http.MethodPost, `steering/{deliveryservice}/targets/?(\.json)?$`, api.CreateHandler(steeringtargets.TypeFactory), auth.PrivLevelOperations, Authenticated, nil},
 		{1.1, http.MethodPut, `steering/{deliveryservice}/targets/{target}/?(\.json)?$`, api.UpdateHandler(steeringtargets.TypeFactory), auth.PrivLevelOperations, Authenticated, nil},
 		{1.1, http.MethodDelete, `steering/{deliveryservice}/targets/{target}/?(\.json)?$`, api.DeleteHandler(steeringtargets.TypeFactory), auth.PrivLevelOperations, Authenticated, nil},
+
+		{1.4, http.MethodGet, `steering/?(\.json)?$`, steering.Get, auth.PrivLevelReadOnly, Authenticated, nil},
 	}
 
 	// rawRoutes are served at the root path. These should be almost exclusively old Perl pre-API routes, which have yet to be converted in all clients. New routes should be in the versioned API path.
diff --git a/traffic_ops/traffic_ops_golang/steering/steering.go b/traffic_ops/traffic_ops_golang/steering/steering.go
new file mode 100644
index 0000000..5480c25
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/steering/steering.go
@@ -0,0 +1,233 @@
+package steering
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+	"database/sql"
+	"errors"
+	"net/http"
+
+	"github.com/apache/trafficcontrol/lib/go-tc"
+	"github.com/apache/trafficcontrol/lib/go-util"
+	"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+
+	"github.com/lib/pq"
+)
+
+func Get(w http.ResponseWriter, r *http.Request) {
+	inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+	if userErr != nil || sysErr != nil {
+		api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+		return
+	}
+	defer inf.Close()
+
+	steering, err := findSteering(inf.Tx.Tx)
+	if err != nil {
+		api.HandleErr(w, r, inf.Tx.Tx, http.StatusInternalServerError, nil, errors.New("steering.Get finding: "+err.Error()))
+		return
+	}
+	api.WriteResp(w, r, steering)
+}
+
+func findSteering(tx *sql.Tx) ([]tc.Steering, error) {
+	steeringData, err := getSteeringData(tx)
+	if err != nil {
+		return nil, err
+	}
+	targetIDs := steeringDataTargetIDs(steeringData)
+	steeringFilters, err := getSteeringFilters(tx, targetIDs)
+	if err != nil {
+		return nil, err
+	}
+	primaryOriginCoords, err := getPrimaryOriginCoords(tx, targetIDs)
+	if err != nil {
+		return nil, err
+	}
+
+	steerings := map[tc.DeliveryServiceName]tc.Steering{}
+
+	for _, data := range steeringData {
+		if _, ok := steerings[data.DeliveryService]; !ok {
+			steerings[data.DeliveryService] = tc.Steering{
+				DeliveryService: data.DeliveryService,
+				ClientSteering:  data.DSType == tc.DSTypeClientSteering,
+				Filters:         []tc.SteeringFilter{},         // Initialize, so JSON produces `[]` not `null` if there are no filters.
+				Targets:         []tc.SteeringSteeringTarget{}, // Initialize, so JSON produces `[]` not `null` if there are no targets.
+			}
+		}
+		steering := steerings[data.DeliveryService]
+
+		if filters, ok := steeringFilters[data.TargetID]; ok {
+			steering.Filters = append(steering.Filters, filters...)
+		}
+
+		target := tc.SteeringSteeringTarget{DeliveryService: data.TargetName}
+		switch data.Type {
+		case tc.SteeringTypeOrder:
+			target.Order = uint64(data.Value)
+		case tc.SteeringTypeWeight:
+			target.Weight = uint64(data.Value)
+		case tc.SteeringTypeGeoOrder:
+			target.GeoOrder = util.IntPtr(data.Value)
+			target.Latitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lat)
+			target.Longitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lon)
+		case tc.SteeringTypeGeoWeight:
+			target.Weight = uint64(data.Value)
+			target.GeoOrder = util.IntPtr(0)
+			target.Latitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lat)
+			target.Longitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lon)
+		}
+		steering.Targets = append(steering.Targets, target)
+		steerings[data.DeliveryService] = steering
+	}
+
+	arr := []tc.Steering{}
+	for _, steering := range steerings {
+		arr = append(arr, steering)
+	}
+	return arr, nil
+}
+
+type SteeringData struct {
+	DeliveryService tc.DeliveryServiceName
+	SteeringID      int
+	TargetName      tc.DeliveryServiceName
+	TargetID        int
+	Value           int
+	Type            tc.SteeringType
+	DSType          tc.DSType
+}
+
+func steeringDataTargetIDs(data []SteeringData) []int {
+	ids := []int{}
+	for _, d := range data {
+		ids = append(ids, d.TargetID)
+	}
+	return ids
+}
+
+func getSteeringData(tx *sql.Tx) ([]SteeringData, error) {
+	qry := `
+SELECT
+  ds.xml_id as steering_xml_id,
+  ds.id as steering_id,
+  t.xml_id as target_xml_id,
+  t.id as target_id,
+  st.value,
+  tp.name as steering_type,
+  dt.name as ds_type
+FROM
+  steering_target st
+  JOIN deliveryservice ds on ds.id = st.deliveryservice
+  JOIN deliveryservice t on t.id = st.target
+  JOIN type tp on tp.id = st.type
+  JOIN type dt on dt.id = ds.type
+ORDER BY
+  steering_xml_id,
+  target_xml_id
+`
+	rows, err := tx.Query(qry)
+	if err != nil {
+		return nil, errors.New("querying steering: " + err.Error())
+	}
+	defer rows.Close()
+	data := []SteeringData{}
+	for rows.Next() {
+		sd := SteeringData{}
+		if err := rows.Scan(&sd.DeliveryService, &sd.SteeringID, &sd.TargetName, &sd.TargetID, &sd.Value, &sd.Type, &sd.DSType); err != nil {
+			return nil, errors.New("scanning profile name parameters: " + err.Error())
+		}
+		data = append(data, sd)
+	}
+	return data, nil
+}
+
+// getSteeringFilters takes a slice of ds ids, and returns a map of delivery service ids to patterns and delivery service names.
+func getSteeringFilters(tx *sql.Tx, dsIDs []int) (map[int][]tc.SteeringFilter, error) {
+	qry := `
+SELECT
+  ds.id,
+  ds.xml_id,
+  r.pattern
+FROM
+  deliveryservice ds
+  JOIN deliveryservice_regex dsr ON dsr.deliveryservice = ds.id
+  JOIN regex r ON dsr.regex = r.id
+  JOIN type t ON r.type = t.id
+WHERE
+  ds.id = ANY($1)
+  AND t.name = $2
+ORDER BY
+  r.pattern,
+  ds.type,
+  dsr.set_number
+`
+	rows, err := tx.Query(qry, pq.Array(dsIDs), tc.DSMatchTypeSteeringRegex)
+	if err != nil {
+		return nil, errors.New("querying steering regexes: " + err.Error())
+	}
+	defer rows.Close()
+	filters := map[int][]tc.SteeringFilter{}
+	for rows.Next() {
+		dsID := 0
+		f := tc.SteeringFilter{}
+		if err := rows.Scan(&dsID, &f.DeliveryService, &f.Pattern); err != nil {
+			return nil, errors.New("scanning steering filters: " + err.Error())
+		}
+		filters[dsID] = append(filters[dsID], f)
+	}
+	return filters, nil
+}
+
+type Coord struct {
+	Lat float64
+	Lon float64
+}
+
+// getPrimaryOriginCoords takes a slice of ds ids, and returns a map of delivery service ids to their primary origin coordinates.
+func getPrimaryOriginCoords(tx *sql.Tx, dsIDs []int) (map[int]Coord, error) {
+	qry := `
+SELECT
+  o.deliveryservice,
+  c.latitude,
+  c.longitude
+FROM
+  origin o
+  JOIN coordinate c ON c.id = o.coordinate
+WHERE
+  o.deliveryservice = ANY($1)
+`
+	rows, err := tx.Query(qry, pq.Array(dsIDs))
+	if err != nil {
+		return nil, errors.New("querying steering primary origin coords: " + err.Error())
+	}
+	defer rows.Close()
+	coords := map[int]Coord{}
+	for rows.Next() {
+		dsID := 0
+		c := Coord{}
+		if err := rows.Scan(&dsID, &c.Lat, &c.Lon); err != nil {
+			return nil, errors.New("scanning steering primary origin coords: " + err.Error())
+		}
+		coords[dsID] = c
+	}
+	return coords, nil
+}


[trafficcontrol] 03/11: Add TO Go steering api test

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit a2a13335346c33f234f5bdd07901984fd2919190
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 14 16:50:01 2018 -0600

    Add TO Go steering api test
---
 traffic_ops/testing/api/v13/steering_test.go | 94 ++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/traffic_ops/testing/api/v13/steering_test.go b/traffic_ops/testing/api/v13/steering_test.go
new file mode 100644
index 0000000..784b1a5
--- /dev/null
+++ b/traffic_ops/testing/api/v13/steering_test.go
@@ -0,0 +1,94 @@
+package v13
+
+/*
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+import (
+	"testing"
+
+	"github.com/apache/trafficcontrol/lib/go-log"
+)
+
+func TestSteering(t *testing.T) {
+	CreateTestCDNs(t)
+	CreateTestTypes(t)
+	CreateTestProfiles(t)
+	CreateTestStatuses(t)
+	CreateTestDivisions(t)
+	CreateTestRegions(t)
+	CreateTestPhysLocations(t)
+	CreateTestCacheGroups(t)
+	CreateTestServers(t)
+	CreateTestDeliveryServices(t)
+	CreateTestSteeringTargets(t)
+
+	GetTestSteering(t)
+
+	DeleteTestSteeringTargets(t)
+	DeleteTestDeliveryServices(t)
+	DeleteTestServers(t)
+	DeleteTestCacheGroups(t)
+	DeleteTestPhysLocations(t)
+	DeleteTestRegions(t)
+	DeleteTestDivisions(t)
+	DeleteTestStatuses(t)
+	DeleteTestProfiles(t)
+	DeleteTestTypes(t)
+	DeleteTestCDNs(t)
+}
+
+func GetTestSteering(t *testing.T) {
+	log.Debugln("GetTestSteering")
+
+	if len(testData.SteeringTargets) < 1 {
+		t.Fatalf("get steering: no steering target test data\n")
+	}
+	st := testData.SteeringTargets[0]
+	if st.DeliveryService == nil {
+		t.Fatalf("get steering: test data missing ds\n")
+	}
+
+	steerings, _, err := TOSession.Steering()
+	if err != nil {
+		t.Fatalf("steering get: getting steering: %v\n", err)
+	}
+
+	if len(steerings) != len(testData.SteeringTargets) {
+		t.Fatalf("steering get: expected %v actual %v\n", len(testData.SteeringTargets), len(steerings))
+	}
+
+	if steerings[0].ClientSteering {
+		t.Fatalf("steering get: ClientSteering expected %v actual %v\n", false, true)
+	}
+	if len(steerings[0].Targets) != 1 {
+		t.Fatalf("steering get: Targets expected %v actual %v\n", 1, len(steerings[0].Targets))
+	}
+	if steerings[0].Targets[0].Order != 0 {
+		t.Fatalf("steering get: Targets Order expected %v actual %v\n", 0, steerings[0].Targets[0].Order)
+	}
+	if testData.SteeringTargets[0].Value != nil && steerings[0].Targets[0].Weight != *testData.SteeringTargets[0].Value {
+		t.Fatalf("steering get: Targets Order expected %v actual %v\n", testData.SteeringTargets[0].Value, steerings[0].Targets[0].Weight)
+	}
+	if steerings[0].Targets[0].GeoOrder != nil {
+		t.Fatalf("steering get: Targets Order expected %v actual %+v\n", nil, *steerings[0].Targets[0].GeoOrder)
+	}
+	if steerings[0].Targets[0].Longitude != nil {
+		t.Fatalf("steering get: Targets Order expected %v actual %+v\n", nil, *steerings[0].Targets[0].Longitude)
+	}
+	if steerings[0].Targets[0].Latitude != nil {
+		t.Fatalf("steering get: Targets Order expected %v actual %+v\n", nil, *steerings[0].Targets[0].Latitude)
+	}
+	log.Debugln("GetTestSteering() PASSED")
+}


[trafficcontrol] 06/11: Change TO Go GET /steering to PrivLevelSteering

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 869cb43679ad6ff90e3d2907a06cc1c2b75cd139
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 28 16:18:54 2018 -0600

    Change TO Go GET /steering to PrivLevelSteering
---
 traffic_ops/traffic_ops_golang/routes.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/traffic_ops/traffic_ops_golang/routes.go b/traffic_ops/traffic_ops_golang/routes.go
index ff9ec0b..57060af 100644
--- a/traffic_ops/traffic_ops_golang/routes.go
+++ b/traffic_ops/traffic_ops_golang/routes.go
@@ -392,7 +392,7 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) {
 		{1.1, http.MethodPut, `steering/{deliveryservice}/targets/{target}/?(\.json)?$`, api.UpdateHandler(steeringtargets.TypeFactory), auth.PrivLevelOperations, Authenticated, nil},
 		{1.1, http.MethodDelete, `steering/{deliveryservice}/targets/{target}/?(\.json)?$`, api.DeleteHandler(steeringtargets.TypeFactory), auth.PrivLevelOperations, Authenticated, nil},
 
-		{1.4, http.MethodGet, `steering/?(\.json)?$`, steering.Get, auth.PrivLevelReadOnly, Authenticated, nil},
+		{1.4, http.MethodGet, `steering/?(\.json)?$`, steering.Get, auth.PrivLevelSteering, Authenticated, nil},
 	}
 
 	// rawRoutes are served at the root path. These should be almost exclusively old Perl pre-API routes, which have yet to be converted in all clients. New routes should be in the versioned API path.


[trafficcontrol] 09/11: Fix TO Go steering test for int/uint change

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit e0702851589d5c5ec9474e31fbbfa359c1083469
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 28 17:27:18 2018 -0600

    Fix TO Go steering test for int/uint change
---
 traffic_ops/testing/api/v13/steering_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/traffic_ops/testing/api/v13/steering_test.go b/traffic_ops/testing/api/v13/steering_test.go
index 784b1a5..0d52d97 100644
--- a/traffic_ops/testing/api/v13/steering_test.go
+++ b/traffic_ops/testing/api/v13/steering_test.go
@@ -78,7 +78,7 @@ func GetTestSteering(t *testing.T) {
 	if steerings[0].Targets[0].Order != 0 {
 		t.Fatalf("steering get: Targets Order expected %v actual %v\n", 0, steerings[0].Targets[0].Order)
 	}
-	if testData.SteeringTargets[0].Value != nil && steerings[0].Targets[0].Weight != *testData.SteeringTargets[0].Value {
+	if testData.SteeringTargets[0].Value != nil && steerings[0].Targets[0].Weight != int64(*testData.SteeringTargets[0].Value) {
 		t.Fatalf("steering get: Targets Order expected %v actual %v\n", testData.SteeringTargets[0].Value, steerings[0].Targets[0].Weight)
 	}
 	if steerings[0].Targets[0].GeoOrder != nil {


[trafficcontrol] 02/11: Add TO Go client steering endpoint

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit ec226a044eeb3ae65dc0fc9025c13912f1345828
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 14 15:32:28 2018 -0600

    Add TO Go client steering endpoint
---
 traffic_ops/client/steering.go       | 38 ++++++++++++++++++++++++++++++++++++
 traffic_ops/client/steeringtarget.go |  8 ++++----
 2 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/traffic_ops/client/steering.go b/traffic_ops/client/steering.go
new file mode 100644
index 0000000..6d4f6d4
--- /dev/null
+++ b/traffic_ops/client/steering.go
@@ -0,0 +1,38 @@
+/*
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+package client
+
+import (
+	"encoding/json"
+	"net/http"
+
+	"github.com/apache/trafficcontrol/lib/go-tc"
+)
+
+func (to *Session) Steering() ([]tc.Steering, ReqInf, error) {
+	resp, remoteAddr, err := to.request(http.MethodGet, "/api/1.4/"+`/steering`, nil)
+	reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: remoteAddr}
+	if err != nil {
+		return nil, reqInf, err
+	}
+	defer resp.Body.Close()
+
+	data := struct {
+		Response []tc.Steering `json:"response"`
+	}{}
+	err = json.NewDecoder(resp.Body).Decode(&data)
+	return data.Response, reqInf, err
+}
diff --git a/traffic_ops/client/steeringtarget.go b/traffic_ops/client/steeringtarget.go
index bb5c7d5..a855cec 100644
--- a/traffic_ops/client/steeringtarget.go
+++ b/traffic_ops/client/steeringtarget.go
@@ -41,7 +41,7 @@ func (to *Session) CreateSteeringTarget(st tc.SteeringTargetNullable) (tc.Alerts
 	defer resp.Body.Close()
 	alerts := tc.Alerts{}
 	err = json.NewDecoder(resp.Body).Decode(&alerts)
-	return alerts, reqInf, nil
+	return alerts, reqInf, err
 }
 
 func (to *Session) UpdateSteeringTarget(st tc.SteeringTargetNullable) (tc.Alerts, ReqInf, error) {
@@ -65,7 +65,7 @@ func (to *Session) UpdateSteeringTarget(st tc.SteeringTargetNullable) (tc.Alerts
 	defer resp.Body.Close()
 	alerts := tc.Alerts{}
 	err = json.NewDecoder(resp.Body).Decode(&alerts)
-	return alerts, reqInf, nil
+	return alerts, reqInf, err
 }
 
 func (to *Session) GetSteeringTargets(dsID int) ([]tc.SteeringTargetNullable, ReqInf, error) {
@@ -80,7 +80,7 @@ func (to *Session) GetSteeringTargets(dsID int) ([]tc.SteeringTargetNullable, Re
 		Response []tc.SteeringTargetNullable `json:"response"`
 	}{}
 	err = json.NewDecoder(resp.Body).Decode(&data)
-	return data.Response, reqInf, nil
+	return data.Response, reqInf, err
 }
 
 func (to *Session) DeleteSteeringTarget(dsID int, targetID int) (tc.Alerts, ReqInf, error) {
@@ -92,5 +92,5 @@ func (to *Session) DeleteSteeringTarget(dsID int, targetID int) (tc.Alerts, ReqI
 	defer resp.Body.Close()
 	alerts := tc.Alerts{}
 	err = json.NewDecoder(resp.Body).Decode(&alerts)
-	return alerts, reqInf, nil
+	return alerts, reqInf, err
 }


[trafficcontrol] 08/11: Fix TO Go GET steering to only primary origins

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 4452b8f4bec5bff23322c96682a77d5f24e43eaf
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 28 17:17:44 2018 -0600

    Fix TO Go GET steering to only primary origins
---
 traffic_ops/traffic_ops_golang/steering/steering.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/traffic_ops/traffic_ops_golang/steering/steering.go b/traffic_ops/traffic_ops_golang/steering/steering.go
index b7301e5..fd5dd44 100644
--- a/traffic_ops/traffic_ops_golang/steering/steering.go
+++ b/traffic_ops/traffic_ops_golang/steering/steering.go
@@ -214,6 +214,7 @@ FROM
   JOIN coordinate c ON c.id = o.coordinate
 WHERE
   o.deliveryservice = ANY($1)
+  AND o.is_primary
 `
 	rows, err := tx.Query(qry, pq.Array(dsIDs))
 	if err != nil {


[trafficcontrol] 07/11: Fix TO Go steering db error message

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 03c28773596f09c227c6b1383266c764bd179cbc
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 28 16:20:21 2018 -0600

    Fix TO Go steering db error message
---
 traffic_ops/traffic_ops_golang/steering/steering.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/traffic_ops/traffic_ops_golang/steering/steering.go b/traffic_ops/traffic_ops_golang/steering/steering.go
index 96cd6dc..b7301e5 100644
--- a/traffic_ops/traffic_ops_golang/steering/steering.go
+++ b/traffic_ops/traffic_ops_golang/steering/steering.go
@@ -153,7 +153,7 @@ ORDER BY
 	for rows.Next() {
 		sd := SteeringData{}
 		if err := rows.Scan(&sd.DeliveryService, &sd.SteeringID, &sd.TargetName, &sd.TargetID, &sd.Value, &sd.Type, &sd.DSType); err != nil {
-			return nil, errors.New("scanning profile name parameters: " + err.Error())
+			return nil, errors.New("get steering data scanning: " + err.Error())
 		}
 		data = append(data, sd)
 	}


[trafficcontrol] 05/11: Change TO Go steering order, weight to signed int

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 6aba1ce83e84d16f26546330347cc01b6a870101
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 28 16:07:34 2018 -0600

    Change TO Go steering order, weight to signed int
---
 lib/go-tc/steering.go                               | 4 ++--
 traffic_ops/traffic_ops_golang/steering/steering.go | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/go-tc/steering.go b/lib/go-tc/steering.go
index 1cb08ad..dbe8f8f 100644
--- a/lib/go-tc/steering.go
+++ b/lib/go-tc/steering.go
@@ -32,8 +32,8 @@ type SteeringFilter struct {
 }
 
 type SteeringSteeringTarget struct {
-	Order           uint64              `json:"order"`
-	Weight          uint64              `json:"weight"`
+	Order           int64               `json:"order"`
+	Weight          int64               `json:"weight"`
 	DeliveryService DeliveryServiceName `json:"deliveryService"`
 	GeoOrder        *int                `json:"geoOrder,omitempty"`
 	Longitude       *float64            `json:"longitude,omitempty"`
diff --git a/traffic_ops/traffic_ops_golang/steering/steering.go b/traffic_ops/traffic_ops_golang/steering/steering.go
index 5480c25..96cd6dc 100644
--- a/traffic_ops/traffic_ops_golang/steering/steering.go
+++ b/traffic_ops/traffic_ops_golang/steering/steering.go
@@ -82,15 +82,15 @@ func findSteering(tx *sql.Tx) ([]tc.Steering, error) {
 		target := tc.SteeringSteeringTarget{DeliveryService: data.TargetName}
 		switch data.Type {
 		case tc.SteeringTypeOrder:
-			target.Order = uint64(data.Value)
+			target.Order = int64(data.Value)
 		case tc.SteeringTypeWeight:
-			target.Weight = uint64(data.Value)
+			target.Weight = int64(data.Value)
 		case tc.SteeringTypeGeoOrder:
 			target.GeoOrder = util.IntPtr(data.Value)
 			target.Latitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lat)
 			target.Longitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lon)
 		case tc.SteeringTypeGeoWeight:
-			target.Weight = uint64(data.Value)
+			target.Weight = int64(data.Value)
 			target.GeoOrder = util.IntPtr(0)
 			target.Latitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lat)
 			target.Longitude = util.FloatPtr(primaryOriginCoords[data.TargetID].Lon)


[trafficcontrol] 04/11: Remove empty import

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 982263b4350bc94b4ecc1b3f0dc5ca6e68a4eb2f
Author: Robert Butts <ro...@apache.org>
AuthorDate: Fri Sep 28 16:05:16 2018 -0600

    Remove empty import
---
 lib/go-tc/steering.go | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/go-tc/steering.go b/lib/go-tc/steering.go
index f5419f5..1cb08ad 100644
--- a/lib/go-tc/steering.go
+++ b/lib/go-tc/steering.go
@@ -19,8 +19,6 @@ package tc
  * under the License.
  */
 
-import ()
-
 type Steering struct {
 	DeliveryService DeliveryServiceName      `json:"deliveryService"`
 	ClientSteering  bool                     `json:"clientSteering"`


[trafficcontrol] 11/11: Updated TO Perl,client,tests to v14

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 4d974f0000397016570e60597522f884077e1f26
Author: Robert Butts <ro...@apache.org>
AuthorDate: Mon Oct 1 09:17:42 2018 -0600

    Updated TO Perl,client,tests to v14
---
 traffic_ops/app/lib/TrafficOpsRoutes.pm                           | 6 ++++++
 traffic_ops/client/endpoints.go                                   | 2 +-
 traffic_ops/client/steering.go                                    | 2 +-
 traffic_ops/testing/api/{v13 => v14}/about_test.go                | 2 +-
 traffic_ops/testing/api/{v13 => v14}/cachegroups_test.go          | 2 +-
 .../testing/api/{v13 => v14}/cachegroupsdeliveryservices_test.go  | 2 +-
 traffic_ops/testing/api/{v13 => v14}/cdn_domains_test.go          | 2 +-
 traffic_ops/testing/api/{v13 => v14}/cdnfederations_test.go       | 2 +-
 traffic_ops/testing/api/{v13 => v14}/cdns_test.go                 | 2 +-
 traffic_ops/testing/api/{v13 => v14}/coordinates_test.go          | 2 +-
 traffic_ops/testing/api/{v13 => v14}/crconfig_test.go             | 2 +-
 .../api/{v13 => v14}/deliveryservice_request_comments_test.go     | 2 +-
 .../testing/api/{v13 => v14}/deliveryservice_requests_test.go     | 2 +-
 .../testing/api/{v13 => v14}/deliveryservicematches_test.go       | 2 +-
 traffic_ops/testing/api/{v13 => v14}/deliveryservices_test.go     | 2 +-
 .../testing/api/{v13 => v14}/deliveryserviceservers_test.go       | 2 +-
 .../testing/api/{v13 => v14}/deliveryservicesideligible_test.go   | 2 +-
 traffic_ops/testing/api/{v13 => v14}/divisions_test.go            | 2 +-
 traffic_ops/testing/api/{v13 => v14}/fixtures.go                  | 2 +-
 traffic_ops/testing/api/{v13 => v14}/origins_test.go              | 2 +-
 traffic_ops/testing/api/{v13 => v14}/parameters_test.go           | 2 +-
 traffic_ops/testing/api/{v13 => v14}/phys_locations_test.go       | 2 +-
 traffic_ops/testing/api/{v13 => v14}/ping_test.go                 | 2 +-
 traffic_ops/testing/api/{v13 => v14}/profile_parameters_test.go   | 2 +-
 traffic_ops/testing/api/{v13 => v14}/profiles_test.go             | 2 +-
 traffic_ops/testing/api/{v13 => v14}/regions_test.go              | 2 +-
 traffic_ops/testing/api/{v13 => v14}/roles_test.go                | 2 +-
 traffic_ops/testing/api/{v13 => v14}/servers_test.go              | 2 +-
 traffic_ops/testing/api/{v13 => v14}/session.go                   | 8 ++++----
 traffic_ops/testing/api/{v13 => v14}/staticdnsentries_test.go     | 2 +-
 traffic_ops/testing/api/{v13 => v14}/statuses_test.go             | 2 +-
 traffic_ops/testing/api/{v13 => v14}/steering_test.go             | 4 ++--
 traffic_ops/testing/api/{v13 => v14}/steeringtargets_test.go      | 2 +-
 traffic_ops/testing/api/{v13 => v14}/tc-fixtures.json             | 0
 traffic_ops/testing/api/{v13 => v14}/tenants_test.go              | 2 +-
 traffic_ops/testing/api/{v13 => v14}/todb.go                      | 2 +-
 traffic_ops/testing/api/{v13 => v14}/traffic_control.go           | 2 +-
 traffic_ops/testing/api/{v13 => v14}/traffic_ops_test.go          | 2 +-
 traffic_ops/testing/api/{v13 => v14}/types_test.go                | 2 +-
 traffic_ops/testing/api/{v13 => v14}/user_test.go                 | 2 +-
 traffic_ops/testing/api/{v13 => v14}/userdeliveryservices_test.go | 2 +-
 41 files changed, 49 insertions(+), 43 deletions(-)

diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm b/traffic_ops/app/lib/TrafficOpsRoutes.pm
index af64636..de718e4 100644
--- a/traffic_ops/app/lib/TrafficOpsRoutes.pm
+++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm
@@ -58,6 +58,12 @@ sub define {
 	# Traffic Stats Extension 1.3
 	$self->traffic_stats_routes( $r, $version );
 
+	# 1.4 Routes
+	$version = "1.4";
+	$self->api_routes( $r, $version, $namespace );
+	# Traffic Stats Extension 1.4
+	$self->traffic_stats_routes( $r, $version );
+
 	$self->catch_all( $r, $namespace );
 }
 
diff --git a/traffic_ops/client/endpoints.go b/traffic_ops/client/endpoints.go
index 2891c32..bd71a01 100644
--- a/traffic_ops/client/endpoints.go
+++ b/traffic_ops/client/endpoints.go
@@ -15,4 +15,4 @@
 
 package client
 
-const apiBase = "/api/1.3"
+const apiBase = "/api/1.4"
diff --git a/traffic_ops/client/steering.go b/traffic_ops/client/steering.go
index 6d4f6d4..1d1b232 100644
--- a/traffic_ops/client/steering.go
+++ b/traffic_ops/client/steering.go
@@ -23,7 +23,7 @@ import (
 )
 
 func (to *Session) Steering() ([]tc.Steering, ReqInf, error) {
-	resp, remoteAddr, err := to.request(http.MethodGet, "/api/1.4/"+`/steering`, nil)
+	resp, remoteAddr, err := to.request(http.MethodGet, apiBase+`/steering`, nil)
 	reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: remoteAddr}
 	if err != nil {
 		return nil, reqInf, err
diff --git a/traffic_ops/testing/api/v13/about_test.go b/traffic_ops/testing/api/v14/about_test.go
similarity index 98%
rename from traffic_ops/testing/api/v13/about_test.go
rename to traffic_ops/testing/api/v14/about_test.go
index b36f9f9..bb7e823 100644
--- a/traffic_ops/testing/api/v13/about_test.go
+++ b/traffic_ops/testing/api/v14/about_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/cachegroups_test.go b/traffic_ops/testing/api/v14/cachegroups_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/cachegroups_test.go
rename to traffic_ops/testing/api/v14/cachegroups_test.go
index ea9e9e1..eb7a664 100644
--- a/traffic_ops/testing/api/v13/cachegroups_test.go
+++ b/traffic_ops/testing/api/v14/cachegroups_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/cachegroupsdeliveryservices_test.go b/traffic_ops/testing/api/v14/cachegroupsdeliveryservices_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/cachegroupsdeliveryservices_test.go
rename to traffic_ops/testing/api/v14/cachegroupsdeliveryservices_test.go
index 10abfee..a3bdf61 100644
--- a/traffic_ops/testing/api/v13/cachegroupsdeliveryservices_test.go
+++ b/traffic_ops/testing/api/v14/cachegroupsdeliveryservices_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/cdn_domains_test.go b/traffic_ops/testing/api/v14/cdn_domains_test.go
similarity index 98%
rename from traffic_ops/testing/api/v13/cdn_domains_test.go
rename to traffic_ops/testing/api/v14/cdn_domains_test.go
index ea2523d..adae5c9 100644
--- a/traffic_ops/testing/api/v13/cdn_domains_test.go
+++ b/traffic_ops/testing/api/v14/cdn_domains_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/cdnfederations_test.go b/traffic_ops/testing/api/v14/cdnfederations_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/cdnfederations_test.go
rename to traffic_ops/testing/api/v14/cdnfederations_test.go
index 766eb16..662e01c 100644
--- a/traffic_ops/testing/api/v13/cdnfederations_test.go
+++ b/traffic_ops/testing/api/v14/cdnfederations_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/cdns_test.go b/traffic_ops/testing/api/v14/cdns_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/cdns_test.go
rename to traffic_ops/testing/api/v14/cdns_test.go
index 47cd949..ffab6c7 100644
--- a/traffic_ops/testing/api/v13/cdns_test.go
+++ b/traffic_ops/testing/api/v14/cdns_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/coordinates_test.go b/traffic_ops/testing/api/v14/coordinates_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/coordinates_test.go
rename to traffic_ops/testing/api/v14/coordinates_test.go
index 174818c..974c86d 100644
--- a/traffic_ops/testing/api/v13/coordinates_test.go
+++ b/traffic_ops/testing/api/v14/coordinates_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/crconfig_test.go b/traffic_ops/testing/api/v14/crconfig_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/crconfig_test.go
rename to traffic_ops/testing/api/v14/crconfig_test.go
index e9f0210..708cfad 100644
--- a/traffic_ops/testing/api/v13/crconfig_test.go
+++ b/traffic_ops/testing/api/v14/crconfig_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/deliveryservice_request_comments_test.go b/traffic_ops/testing/api/v14/deliveryservice_request_comments_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/deliveryservice_request_comments_test.go
rename to traffic_ops/testing/api/v14/deliveryservice_request_comments_test.go
index 8e1fcfc..0ef2b23 100644
--- a/traffic_ops/testing/api/v13/deliveryservice_request_comments_test.go
+++ b/traffic_ops/testing/api/v14/deliveryservice_request_comments_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/deliveryservice_requests_test.go b/traffic_ops/testing/api/v14/deliveryservice_requests_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/deliveryservice_requests_test.go
rename to traffic_ops/testing/api/v14/deliveryservice_requests_test.go
index c1e813e..38dd67a 100644
--- a/traffic_ops/testing/api/v13/deliveryservice_requests_test.go
+++ b/traffic_ops/testing/api/v14/deliveryservice_requests_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/deliveryservicematches_test.go b/traffic_ops/testing/api/v14/deliveryservicematches_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/deliveryservicematches_test.go
rename to traffic_ops/testing/api/v14/deliveryservicematches_test.go
index f1ec759..e530da8 100644
--- a/traffic_ops/testing/api/v13/deliveryservicematches_test.go
+++ b/traffic_ops/testing/api/v14/deliveryservicematches_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/deliveryservices_test.go b/traffic_ops/testing/api/v14/deliveryservices_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/deliveryservices_test.go
rename to traffic_ops/testing/api/v14/deliveryservices_test.go
index 13c4e0d..fd2bf53 100644
--- a/traffic_ops/testing/api/v13/deliveryservices_test.go
+++ b/traffic_ops/testing/api/v14/deliveryservices_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/deliveryserviceservers_test.go b/traffic_ops/testing/api/v14/deliveryserviceservers_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/deliveryserviceservers_test.go
rename to traffic_ops/testing/api/v14/deliveryserviceservers_test.go
index 99e61ac..893bcad 100644
--- a/traffic_ops/testing/api/v13/deliveryserviceservers_test.go
+++ b/traffic_ops/testing/api/v14/deliveryserviceservers_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/deliveryservicesideligible_test.go b/traffic_ops/testing/api/v14/deliveryservicesideligible_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/deliveryservicesideligible_test.go
rename to traffic_ops/testing/api/v14/deliveryservicesideligible_test.go
index 1af7069..ad4a691 100644
--- a/traffic_ops/testing/api/v13/deliveryservicesideligible_test.go
+++ b/traffic_ops/testing/api/v14/deliveryservicesideligible_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/divisions_test.go b/traffic_ops/testing/api/v14/divisions_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/divisions_test.go
rename to traffic_ops/testing/api/v14/divisions_test.go
index 1340c78..2bfb8a3 100644
--- a/traffic_ops/testing/api/v13/divisions_test.go
+++ b/traffic_ops/testing/api/v14/divisions_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/fixtures.go b/traffic_ops/testing/api/v14/fixtures.go
similarity index 98%
rename from traffic_ops/testing/api/v13/fixtures.go
rename to traffic_ops/testing/api/v14/fixtures.go
index 071ed9e..f9923c2 100644
--- a/traffic_ops/testing/api/v13/fixtures.go
+++ b/traffic_ops/testing/api/v14/fixtures.go
@@ -14,7 +14,7 @@
    limitations under the License.
 */
 
-package v13
+package v14
 
 import (
 	"encoding/json"
diff --git a/traffic_ops/testing/api/v13/origins_test.go b/traffic_ops/testing/api/v14/origins_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/origins_test.go
rename to traffic_ops/testing/api/v14/origins_test.go
index b706db8..682e17e 100644
--- a/traffic_ops/testing/api/v13/origins_test.go
+++ b/traffic_ops/testing/api/v14/origins_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/parameters_test.go b/traffic_ops/testing/api/v14/parameters_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/parameters_test.go
rename to traffic_ops/testing/api/v14/parameters_test.go
index 0d54618..88f4385 100644
--- a/traffic_ops/testing/api/v13/parameters_test.go
+++ b/traffic_ops/testing/api/v14/parameters_test.go
@@ -13,7 +13,7 @@
    limitations under the License.
 */
 
-package v13
+package v14
 
 import (
 	"sync"
diff --git a/traffic_ops/testing/api/v13/phys_locations_test.go b/traffic_ops/testing/api/v14/phys_locations_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/phys_locations_test.go
rename to traffic_ops/testing/api/v14/phys_locations_test.go
index 810dd20..1b4b316 100644
--- a/traffic_ops/testing/api/v13/phys_locations_test.go
+++ b/traffic_ops/testing/api/v14/phys_locations_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/ping_test.go b/traffic_ops/testing/api/v14/ping_test.go
similarity index 98%
rename from traffic_ops/testing/api/v13/ping_test.go
rename to traffic_ops/testing/api/v14/ping_test.go
index 8da9433..e614840 100644
--- a/traffic_ops/testing/api/v13/ping_test.go
+++ b/traffic_ops/testing/api/v14/ping_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/profile_parameters_test.go b/traffic_ops/testing/api/v14/profile_parameters_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/profile_parameters_test.go
rename to traffic_ops/testing/api/v14/profile_parameters_test.go
index b13613b..2a96777 100644
--- a/traffic_ops/testing/api/v13/profile_parameters_test.go
+++ b/traffic_ops/testing/api/v14/profile_parameters_test.go
@@ -13,7 +13,7 @@
    limitations under the License.
 */
 
-package v13
+package v14
 
 import (
 	"fmt"
diff --git a/traffic_ops/testing/api/v13/profiles_test.go b/traffic_ops/testing/api/v14/profiles_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/profiles_test.go
rename to traffic_ops/testing/api/v14/profiles_test.go
index 8ae19c9..6afa97c 100644
--- a/traffic_ops/testing/api/v13/profiles_test.go
+++ b/traffic_ops/testing/api/v14/profiles_test.go
@@ -13,7 +13,7 @@
    limitations under the License.
 */
 
-package v13
+package v14
 
 import (
 	"testing"
diff --git a/traffic_ops/testing/api/v13/regions_test.go b/traffic_ops/testing/api/v14/regions_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/regions_test.go
rename to traffic_ops/testing/api/v14/regions_test.go
index 4285c78..936833a 100644
--- a/traffic_ops/testing/api/v13/regions_test.go
+++ b/traffic_ops/testing/api/v14/regions_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/roles_test.go b/traffic_ops/testing/api/v14/roles_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/roles_test.go
rename to traffic_ops/testing/api/v14/roles_test.go
index 1ba75d4..bc8bc11 100644
--- a/traffic_ops/testing/api/v13/roles_test.go
+++ b/traffic_ops/testing/api/v14/roles_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/servers_test.go b/traffic_ops/testing/api/v14/servers_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/servers_test.go
rename to traffic_ops/testing/api/v14/servers_test.go
index d3399ae..0d448f5 100644
--- a/traffic_ops/testing/api/v13/servers_test.go
+++ b/traffic_ops/testing/api/v14/servers_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/session.go b/traffic_ops/testing/api/v14/session.go
similarity index 91%
rename from traffic_ops/testing/api/v13/session.go
rename to traffic_ops/testing/api/v14/session.go
index 423d97f..d7e14b2 100644
--- a/traffic_ops/testing/api/v13/session.go
+++ b/traffic_ops/testing/api/v14/session.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
@@ -31,15 +31,15 @@ func SetupSession(toReqTimeout time.Duration, toURL string, toUser string, toPas
 	var err error
 
 	toReqTimeout = time.Second * time.Duration(Config.Default.Session.TimeoutInSecs)
-	NoAuthTOSession = client.NewNoAuthSession(toURL, true, "to-api-v13-client-tests", true, toReqTimeout)
-	TOSession, _, err = client.LoginWithAgent(toURL, toUser, toPass, true, "to-api-v13-client-tests", true, toReqTimeout)
+	NoAuthTOSession = client.NewNoAuthSession(toURL, true, "to-api-v14-client-tests", true, toReqTimeout)
+	TOSession, _, err = client.LoginWithAgent(toURL, toUser, toPass, true, "to-api-v14-client-tests", true, toReqTimeout)
 	return err
 }
 
 func TeardownSession(toReqTimeout time.Duration, toURL string, toUser string, toPass string) error {
 	var err error
 	toReqTimeout = time.Second * time.Duration(Config.Default.Session.TimeoutInSecs)
-	TOSession, _, err = client.LogoutWithAgent(toURL, toUser, toPass, true, "to-api-v13-client-tests", true, toReqTimeout)
+	TOSession, _, err = client.LogoutWithAgent(toURL, toUser, toPass, true, "to-api-v14-client-tests", true, toReqTimeout)
 
 	return err
 }
diff --git a/traffic_ops/testing/api/v13/staticdnsentries_test.go b/traffic_ops/testing/api/v14/staticdnsentries_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/staticdnsentries_test.go
rename to traffic_ops/testing/api/v14/staticdnsentries_test.go
index db8948c..3dca576 100644
--- a/traffic_ops/testing/api/v13/staticdnsentries_test.go
+++ b/traffic_ops/testing/api/v14/staticdnsentries_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/statuses_test.go b/traffic_ops/testing/api/v14/statuses_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/statuses_test.go
rename to traffic_ops/testing/api/v14/statuses_test.go
index e4b135b..320f1b2 100644
--- a/traffic_ops/testing/api/v13/statuses_test.go
+++ b/traffic_ops/testing/api/v14/statuses_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/steering_test.go b/traffic_ops/testing/api/v14/steering_test.go
similarity index 97%
rename from traffic_ops/testing/api/v13/steering_test.go
rename to traffic_ops/testing/api/v14/steering_test.go
index 0d52d97..c04e68c 100644
--- a/traffic_ops/testing/api/v13/steering_test.go
+++ b/traffic_ops/testing/api/v14/steering_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
@@ -78,7 +78,7 @@ func GetTestSteering(t *testing.T) {
 	if steerings[0].Targets[0].Order != 0 {
 		t.Fatalf("steering get: Targets Order expected %v actual %v\n", 0, steerings[0].Targets[0].Order)
 	}
-	if testData.SteeringTargets[0].Value != nil && steerings[0].Targets[0].Weight != int64(*testData.SteeringTargets[0].Value) {
+	if testData.SteeringTargets[0].Value != nil && steerings[0].Targets[0].Weight != int32(*testData.SteeringTargets[0].Value) {
 		t.Fatalf("steering get: Targets Order expected %v actual %v\n", testData.SteeringTargets[0].Value, steerings[0].Targets[0].Weight)
 	}
 	if steerings[0].Targets[0].GeoOrder != nil {
diff --git a/traffic_ops/testing/api/v13/steeringtargets_test.go b/traffic_ops/testing/api/v14/steeringtargets_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/steeringtargets_test.go
rename to traffic_ops/testing/api/v14/steeringtargets_test.go
index 5c28f62..b709ba8 100644
--- a/traffic_ops/testing/api/v13/steeringtargets_test.go
+++ b/traffic_ops/testing/api/v14/steeringtargets_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/tc-fixtures.json b/traffic_ops/testing/api/v14/tc-fixtures.json
similarity index 100%
rename from traffic_ops/testing/api/v13/tc-fixtures.json
rename to traffic_ops/testing/api/v14/tc-fixtures.json
diff --git a/traffic_ops/testing/api/v13/tenants_test.go b/traffic_ops/testing/api/v14/tenants_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/tenants_test.go
rename to traffic_ops/testing/api/v14/tenants_test.go
index e959528..431e7af 100644
--- a/traffic_ops/testing/api/v13/tenants_test.go
+++ b/traffic_ops/testing/api/v14/tenants_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/todb.go b/traffic_ops/testing/api/v14/todb.go
similarity index 99%
rename from traffic_ops/testing/api/v13/todb.go
rename to traffic_ops/testing/api/v14/todb.go
index 3761ada..a1d5968 100644
--- a/traffic_ops/testing/api/v13/todb.go
+++ b/traffic_ops/testing/api/v14/todb.go
@@ -13,7 +13,7 @@
    limitations under the License.
 */
 
-package v13
+package v14
 
 import (
 	"database/sql"
diff --git a/traffic_ops/testing/api/v13/traffic_control.go b/traffic_ops/testing/api/v14/traffic_control.go
similarity index 99%
rename from traffic_ops/testing/api/v13/traffic_control.go
rename to traffic_ops/testing/api/v14/traffic_control.go
index 7c8d492..200bfdc 100644
--- a/traffic_ops/testing/api/v13/traffic_control.go
+++ b/traffic_ops/testing/api/v14/traffic_control.go
@@ -13,7 +13,7 @@
    limitations under the License.
 */
 
-package v13
+package v14
 
 import (
 	"github.com/apache/trafficcontrol/lib/go-tc"
diff --git a/traffic_ops/testing/api/v13/traffic_ops_test.go b/traffic_ops/testing/api/v14/traffic_ops_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/traffic_ops_test.go
rename to traffic_ops/testing/api/v14/traffic_ops_test.go
index 44491ba..884f565 100644
--- a/traffic_ops/testing/api/v13/traffic_ops_test.go
+++ b/traffic_ops/testing/api/v14/traffic_ops_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/types_test.go b/traffic_ops/testing/api/v14/types_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/types_test.go
rename to traffic_ops/testing/api/v14/types_test.go
index 0a0b59e..ef389d2 100644
--- a/traffic_ops/testing/api/v13/types_test.go
+++ b/traffic_ops/testing/api/v14/types_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
 
diff --git a/traffic_ops/testing/api/v13/user_test.go b/traffic_ops/testing/api/v14/user_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/user_test.go
rename to traffic_ops/testing/api/v14/user_test.go
index 483e0dd..ba24c94 100644
--- a/traffic_ops/testing/api/v13/user_test.go
+++ b/traffic_ops/testing/api/v14/user_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*
    Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/traffic_ops/testing/api/v13/userdeliveryservices_test.go b/traffic_ops/testing/api/v14/userdeliveryservices_test.go
similarity index 99%
rename from traffic_ops/testing/api/v13/userdeliveryservices_test.go
rename to traffic_ops/testing/api/v14/userdeliveryservices_test.go
index 474f8aa..cec199c 100644
--- a/traffic_ops/testing/api/v13/userdeliveryservices_test.go
+++ b/traffic_ops/testing/api/v14/userdeliveryservices_test.go
@@ -1,4 +1,4 @@
-package v13
+package v14
 
 /*