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/10/23 17:08:25 UTC
[GitHub] rob05c commented on issue #2952: Change Traffic Ops to 501 Not
Implemented on unknown version reqs, and client to return a helpful message
rob05c commented on issue #2952: Change Traffic Ops to 501 Not Implemented on unknown version reqs, and client to return a helpful message
URL: https://github.com/apache/trafficcontrol/pull/2952#issuecomment-432335298
For anyone trying to test this, the easiest way I found was to manually increase the client's version, by changing `traffic_ops/client/endpoints.go` `apiBase` to `/api/1.5`, and then write a quick Go script to use the client against any existing TO:
```
package main
import (
"fmt"
"time"
toclient "github.com/apache/trafficcontrol/traffic_ops/client"
)
const UserAgent = "testclient-not-implemented-resp"
func main() {
toURI := "https://localhost"
toUser := "yourUser"
toPass := "yourPass"
insecure := true
useCache := false
reqTimeout := time.Second * 10
toClient, _, err := toclient.LoginWithAgent(toURI, toUser, toPass, insecure, UserAgent, useCache, reqTimeout)
if err != nil {
fmt.Println("Error creating client: " + err.Error())
return
}
cdns, _, err := toClient.GetCDNs()
if err != nil {
fmt.Println("Error getting CDNs: " + err.Error())
return
}
fmt.Println("Got CDNS: %+v", cdns)
}
```
----------------------------------------------------------------
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