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 2020/11/17 01:49:43 UTC
[GitHub] [trafficcontrol] ocket8888 opened a new issue #5289: Servers PUT handler returns API v2 servers when requested at v1
ocket8888 opened a new issue #5289:
URL: https://github.com/apache/trafficcontrol/issues/5289
## I'm submitting a ...
- bug report
## Traffic Control components affected ...
- Traffic Ops
## Current behavior:
When modifying a server by requesting API version 1, the server will respond (on success) with an APIv2 server structure.
## Expected behavior:
The API should respond to APIv1 requests with APIv1 structures only.
## Minimal reproduction of the problem with instructions:
Modify a server using APIv1, notice the response includes fields only added in APIv2.
## Anything else:
<details><summary>HTTP Stack</summary>
```http
PUT /api/1.4/servers/6 HTTP/1.1
User-Agent: python-requests/2.24.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 937
{
"cachegroup": "CDN_in_a_Box_Edge",
"ipNetmask": "2.2.2.2",
"ipGateway": "3.3.3.3",
"cachegroupId": 1,
"cdnId": 1,
"cdnName": "CDN-in-a-Box",
"domainName": "infra.ciab.test",
"guid": null,
"hostName": "test",
"httpsPort": 443,
"iloIpAddress": "",
"iloIpGateway": "",
"iloIpNetmask": "",
"iloPassword": "",
"iloUsername": "",
"mgmtIpAddress": "",
"mgmtIpGateway": "",
"mgmtIpNetmask": "",
"offlineReason": "",
"physLocation": "Apachecon North America 2018",
"physLocationId": 2,
"profile": "ATS_EDGE_TIER_CACHE",
"profileDesc": "Edge Cache - Apache Traffic Server",
"profileId": 8,
"rack": "a new rack",
"revalPending": false,
"routerHostName": "",
"routerPortName": "",
"status": "REPORTED",
"statusId": 3,
"tcpPort": 80,
"type": "EDGE",
"typeId": 11,
"updPending": false,
"xmppId": "edge",
"xmppPasswd": "",
"ipAddress": "1.1.1.1",
"interfaceMtu": 1281,
"ip6Address": "::1",
"interfaceName": "eth0"
}
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Tue, 17 Nov 2020 02:44:52 GMT; Max-Age=3600; HttpOnly
Vary: Accept-Encoding
X-Server-Name: traffic_ops_golang/
Date: Tue, 17 Nov 2020 01:44:52 GMT
Content-Length: 495
{
"alerts": [
{
"text": "Server updated",
"level": "success"
}
],
"response": {
"interfaceMtu": 1281,
"interfaceName": "eth0",
"ip6Address": "::1",
"ip6Gateway": null,
"ipAddress": "1.1.1.1",
"ipGateway": "3.3.3.3",
"ipNetmask": "2.2.2.2",
"cachegroup": "test",
"cachegroupId": 1,
"cdnId": 1,
"cdnName": "ALL",
"domainName": "infra.ciab.test",
"guid": null,
"hostName": "test",
"httpsPort": 443,
"id": 6,
"iloIpAddress": "",
"iloIpGateway": "",
"iloIpNetmask": "",
"iloPassword": "",
"iloUsername": "",
"lastUpdated": "2020-11-17 01:44:52+00",
"mgmtIpAddress": "",
"mgmtIpGateway": "",
"mgmtIpNetmask": "",
"offlineReason": "",
"physLocation": "test",
"physLocationId": 2,
"profile": "RIAK_ALL",
"profileDesc": "Riak profile for all CDNs",
"profileId": 8,
"rack": "a new rack",
"revalPending": false,
"routerHostName": "",
"routerPortName": "",
"status": "REPORTED",
"statusId": 3,
"tcpPort": 80,
"type": "EDGE",
"typeId": 11,
"updPending": false,
"xmppId": "edge",
"xmppPasswd": "",
"ipIsService": true,
"ip6IsService": true
}
}
```
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [trafficcontrol] ocket8888 closed issue #5289: Servers PUT handler returns API v2 servers when requested at v1
Posted by GitBox <gi...@apache.org>.
ocket8888 closed issue #5289:
URL: https://github.com/apache/trafficcontrol/issues/5289
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [trafficcontrol] ocket8888 commented on issue #5289: Servers PUT handler returns API v2 servers when requested at v1
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #5289:
URL: https://github.com/apache/trafficcontrol/issues/5289#issuecomment-728633821
This bug manifests because the PUT handler is checking the API _minor_ version instead of its _major_ version. As a result, it does not occur when requesting at API version 1.1
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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