You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2019/03/19 16:27:06 UTC

[trafficcontrol] branch master updated: TO API: reverts api 1.5 version to 1.4 as 1.5 wasn't needed yet (#3420)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c0f9be4  TO API: reverts api 1.5 version to 1.4 as 1.5 wasn't needed yet (#3420)
c0f9be4 is described below

commit c0f9be4204e043f3f1b208fd21e8adb1283e53e7
Author: Jeremy Mitchell <mi...@users.noreply.github.com>
AuthorDate: Tue Mar 19 10:26:59 2019 -0600

    TO API: reverts api 1.5 version to 1.4 as 1.5 wasn't needed yet (#3420)
    
    * no need to move to api 1.5 yet. reverts consistenthash route to 1.4 and configures TP to use 1.4.
    * fixes status test that would not build
    * updates consistenthash documentation to 1.4 instead of 1.5
---
 docs/source/api/consistenthash.rst                     | 2 +-
 traffic_ops/app/lib/TrafficOpsRoutes.pm                | 6 ------
 traffic_ops/traffic_ops_golang/routing/routes.go       | 2 +-
 traffic_ops/traffic_ops_golang/status/statuses_test.go | 2 ++
 traffic_portal/app/src/scripts/config.js               | 2 +-
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/docs/source/api/consistenthash.rst b/docs/source/api/consistenthash.rst
index 9484cd1..1643569 100644
--- a/docs/source/api/consistenthash.rst
+++ b/docs/source/api/consistenthash.rst
@@ -37,7 +37,7 @@ Request Structure
 .. code-block:: http
 	:caption: Request Example
 
-	POST /api/1.5/consistenthash HTTP/1.1
+	POST /api/1.4/consistenthash HTTP/1.1
 	Host: trafficops.infra.ciab.test
 	User-Agent: curl/7.54.0
 	Accept: */*
diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm b/traffic_ops/app/lib/TrafficOpsRoutes.pm
index f3df230..de718e4 100644
--- a/traffic_ops/app/lib/TrafficOpsRoutes.pm
+++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm
@@ -64,12 +64,6 @@ sub define {
 	# Traffic Stats Extension 1.4
 	$self->traffic_stats_routes( $r, $version );
 
-	# 1.5 Routes
-	$version = "1.5";
-	$self->api_routes( $r, $version, $namespace );
-	# Traffic Stats Extension 1.5
-	$self->traffic_stats_routes( $r, $version );
-
 	$self->catch_all( $r, $namespace );
 }
 
diff --git a/traffic_ops/traffic_ops_golang/routing/routes.go b/traffic_ops/traffic_ops_golang/routing/routes.go
index 5c7d835..3b52b13 100644
--- a/traffic_ops/traffic_ops_golang/routing/routes.go
+++ b/traffic_ops/traffic_ops_golang/routing/routes.go
@@ -416,7 +416,7 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) {
 		{1.1, http.MethodDelete, `steering/{deliveryservice}/targets/{target}/?(\.json)?$`, api.DeleteHandler(&steeringtargets.TOSteeringTargetV11{}), auth.PrivLevelOperations, Authenticated, nil},
 
 		//Pattern based consistent hashing endpoint
-		{1.5, http.MethodPost, `consistenthash/?$`, consistenthash.Post, auth.PrivLevelReadOnly, Authenticated, nil},
+		{1.4, http.MethodPost, `consistenthash/?$`, consistenthash.Post, auth.PrivLevelReadOnly, Authenticated, nil},
 
 		{1.4, http.MethodGet, `steering/?(\.json)?$`, steering.Get, auth.PrivLevelSteering, Authenticated, nil},
 	}
diff --git a/traffic_ops/traffic_ops_golang/status/statuses_test.go b/traffic_ops/traffic_ops_golang/status/statuses_test.go
index 51aa7ca..25f5236 100644
--- a/traffic_ops/traffic_ops_golang/status/statuses_test.go
+++ b/traffic_ops/traffic_ops_golang/status/statuses_test.go
@@ -20,6 +20,7 @@ package status
  */
 
 import (
+	"database/sql"
 	"testing"
 	"time"
 
@@ -80,6 +81,7 @@ func TestReadStatuses(t *testing.T) {
 	obj := TOStatus{
 		api.APIInfoImpl{&reqInfo},
 		tc.StatusNullable{},
+		sql.NullString{},
 	}
 	statuses, userErr, sysErr, _ := obj.Read()
 	if userErr != nil || sysErr != nil {
diff --git a/traffic_portal/app/src/scripts/config.js b/traffic_portal/app/src/scripts/config.js
index ef4c0b8..c7fce2c 100644
--- a/traffic_portal/app/src/scripts/config.js
+++ b/traffic_portal/app/src/scripts/config.js
@@ -23,6 +23,6 @@
 
 angular.module('config', [])
 
-.constant('ENV', { api: { root:'/api/1.5/' } })
+.constant('ENV', { api: { root:'/api/1.4/' } })
 
 ;