Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7055](https://github.com/apache/trafficcontrol/issues/7055) *Traffic Portal* Made `Clear Table Filters` option visible to the user.
- [#7024](https://github.com/apache/trafficcontrol/pull/7024) *Traffic Monitor* Added logging for `ipv4Availability` and `ipv6Availability` in TM.
- [#7063](https://github.com/apache/trafficcontrol/pull/7063) *Traffic Ops* Added API version 5.0 (IN DEVELOPMENT)
- [#7023](https://github.com/apache/trafficcontrol/pull/7023) *Traffic Ops* Added the `ASN` field in TO Server struct, which provides the ability to query servers by `ASN`.
- [#2101](https://github.com/apache/trafficcontrol/issues/2101) *Traffic Portal* Added the ability to tell if a Delivery Service is the target of another steering DS.
- [#6033](https://github.com/apache/trafficcontrol/issues/6033) *Traffic Ops, Traffic Portal* Added ability to assign multiple server capabilities to a server.
- [#7032](https://github.com/apache/trafficcontrol/issues/7032) *Cache Config* Add t3c-apply flag to use local ATS version for config generation rather than Server package Parameter, to allow managing the ATS OS package via external tools. See 'man t3c-apply' and 'man t3c-generate' for details.
Expand Down
2 changes: 1 addition & 1 deletion cache-config/t3cutil/toreq/clientfuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (cl *TOClient) GetServerByHostName(serverHostName string, reqHdr http.Heade
if len(toServers.Response) < 1 {
return errors.New("getting server name '" + serverHostName + "' from Traffic Ops '" + torequtil.MaybeIPStr(reqInf.RemoteAddr) + "': no servers returned")
}
asv, err := serverToLatest(&toServers.Response[0].ServerV40)
asv, err := serverToLatest(&toServers.Response[0])
if err != nil {
return errors.New("converting server to latest version: " + err.Error())
}
Expand Down
4 changes: 2 additions & 2 deletions cache-config/t3cutil/toreq/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
func serversToLatest(svs tc.ServersV4Response) ([]atscfg.Server, error) {
serversV40 := make([]tc.ServerV40, 0)
for _, srv := range svs.Response {
serversV40 = append(serversV40, srv.ServerV40)
serversV40 = append(serversV40, srv)
}
return atscfg.ToServers(serversV40), nil
}
Expand Down Expand Up @@ -222,7 +222,7 @@ func (cl *TOClient) GetServersCompat(opts toclient.RequestOptions) (tc.ServersV4
if err != nil {
return tc.ServersV4Response{}, reqInf, errors.New("converting server from possible legacy format: " + err.Error())
}
resp.Response = append(resp.Response, tc.ServerV41{ServerV40: newSv})
resp.Response = append(resp.Response, newSv)
}
return resp, reqInf, nil
}
Expand Down
4 changes: 0 additions & 4 deletions docs/source/api/v4/deliveryservices_id_servers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.

.. versionadded:: 4.1
:cachegroup: A string that is the :ref:`name of the Cache Group <cache-group-name>` to which the server belongs
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belongs
:cdnId: An integral, unique identifier the CDN to which the server belongs
Expand Down Expand Up @@ -145,7 +142,6 @@ Response Structure
"type": "EDGE",
"typeId": 11,
"updPending": false,
"asns": [1,2],
"interfaces": [{
"ipAddresses": [
{
Expand Down
4 changes: 0 additions & 4 deletions docs/source/api/v4/deliveryservices_id_servers_eligible.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.

.. versionadded:: 4.1
:cachegroup: A string which is the :ref:`Name of the Cache Group <cache-group-name>` to which the server belongs
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belongs
:cdnId: An integral, unique identifier the CDN to which the server belongs
Expand Down Expand Up @@ -143,7 +140,6 @@ Response Structure
"type": "EDGE",
"typeId": 11,
"updPending": false,
"asns": [1,2],
"interfaces": [{
"ipAddresses": [
{
Expand Down
11 changes: 0 additions & 11 deletions docs/source/api/v4/servers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ Request Structure
| | | the first page is 1. If ``offset`` was defined, this query parameter has no effect. ``limit`` must be defined to |
| | | make use of ``page``. |
+----------------+----------+-------------------------------------------------------------------------------------------------------------------+
| asn | no | Return only the servers that have a cachegroup matching the provided ASN. |
| | | |
| | | .. versionadded:: 4.1 |
+----------------+----------+-------------------------------------------------------------------------------------------------------------------+


.. code-block:: http
Expand All @@ -86,9 +82,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.

.. versionadded:: 4.1
:cachegroup: A string that is the :ref:`name of the Cache Group <cache-group-name>` to which the server belongs
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belongs
:cdnId: The integral, unique identifier of the CDN to which the server belongs
Expand Down Expand Up @@ -233,10 +226,6 @@ Response Structure
"routerHostName": "",
"routerPortName": ""
}
],
"asns": [
1,
2
]
}],
"summary": {
Expand Down
8 changes: 0 additions & 8 deletions docs/source/api/v4/servers_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.

.. versionadded:: 4.1
:cachegroup: A string that is the :ref:`name of the Cache Group <cache-group-name>` to which the server belongs
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belongs
:cdnId: The integral, unique identifier of the CDN to which the server belongs
Expand Down Expand Up @@ -265,7 +262,6 @@ Response Structure
}
],
"response": {
"asns": [1,2],
"cachegroup": "CDN_in_a_Box_Mid",
"cachegroupId": 6,
"cdnId": 2,
Expand Down Expand Up @@ -359,9 +355,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.

.. versionadded:: 4.1
:cachegroup: A string that is the :ref:`name of the Cache Group <cache-group-name>` to which the server belonged
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belonged
:cdnId: The integral, unique identifier of the CDN to which the server belonged
Expand Down Expand Up @@ -460,7 +453,6 @@ Response Structure
}
],
"response": {
"asns": [1,2],
"cachegroup": "CDN_in_a_Box_Mid",
"cachegroupId": 6,
"cdnId": 2,
Expand Down
2 changes: 0 additions & 2 deletions docs/source/api/v5/deliveryservices_id_servers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.
:cachegroup: A string that is the :ref:`name of the Cache Group <cache-group-name>` to which the server belongs
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belongs
:cdnId: An integral, unique identifier the CDN to which the server belongs
Expand Down Expand Up @@ -143,7 +142,6 @@ Response Structure
"type": "EDGE",
"typeId": 11,
"updPending": false,
"asns": [1,2],
"interfaces": [{
"ipAddresses": [
{
Expand Down
2 changes: 0 additions & 2 deletions docs/source/api/v5/deliveryservices_id_servers_eligible.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.
:cachegroup: A string which is the :ref:`Name of the Cache Group <cache-group-name>` to which the server belongs
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belongs
:cdnId: An integral, unique identifier the CDN to which the server belongs
Expand Down Expand Up @@ -141,7 +140,6 @@ Response Structure
"type": "EDGE",
"typeId": 11,
"updPending": false,
"asns": [1,2],
"interfaces": [{
"ipAddresses": [
{
Expand Down
4 changes: 0 additions & 4 deletions docs/source/api/v5/servers_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.
:cachegroup: A string that is the :ref:`name of the Cache Group <cache-group-name>` to which the server belongs
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belongs
:cdnId: The integral, unique identifier of the CDN to which the server belongs
Expand Down Expand Up @@ -263,7 +262,6 @@ Response Structure
}
],
"response": {
"asns": [1,2],
"cachegroup": "CDN_in_a_Box_Mid",
"cachegroupId": 6,
"cdnId": 2,
Expand Down Expand Up @@ -357,7 +355,6 @@ Request Structure

Response Structure
------------------
:asns: The :abbr:`ASN (Autonomous System Number)` associated with the cachegroups of the current server.
:cachegroup: A string that is the :ref:`name of the Cache Group <cache-group-name>` to which the server belonged
:cachegroupId: An integer that is the :ref:`ID of the Cache Group <cache-group-id>` to which the server belonged
:cdnId: The integral, unique identifier of the CDN to which the server belonged
Expand Down Expand Up @@ -456,7 +453,6 @@ Response Structure
}
],
"response": {
"asns": [1,2],
"cachegroup": "CDN_in_a_Box_Mid",
"cachegroupId": 6,
"cdnId": 2,
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/cdn-in-a-box/enroller/enroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func enrollServer(toSession *session, r io.Reader) error {
return err
}

alerts, _, err := toSession.CreateServer(tc.ServerV4{ServerV40: s}, client.RequestOptions{})
alerts, _, err := toSession.CreateServer(s, client.RequestOptions{})
if err != nil {
err = fmt.Errorf("error creating Server: %v - alerts: %+v", err, alerts.Alerts)
log.Infoln(err)
Expand Down
15 changes: 1 addition & 14 deletions lib/go-tc/deliveryservice_servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,34 +189,21 @@ type DSServerResponseV30 struct {

// DSServerV4 contains information for a V4.x Delivery Service Server.
type DSServerV4 struct {
DSServerV40
ASNs []int64 `json:"asns"`
}

// DSServerV40 contains information for a V4.0 Delivery Service Server.
type DSServerV40 struct {
DSServerBaseV4
ServerInterfaces *[]ServerInterfaceInfoV40 `json:"interfaces" db:"interfaces"`
}

// DSServerResponseV40 is the type of a response from Traffic Ops to a request
// for servers assigned to a Delivery Service - in API version 4.0.
type DSServerResponseV40 struct {
Response []DSServerV40 `json:"response"`
Alerts
}

// DSServerResponseV41 is the type of a response from Traffic Ops to a request
// for servers assigned to a Delivery Service - in API version 4.1.
type DSServerResponseV41 struct {
Response []DSServerV4 `json:"response"`
Alerts
}

// DSServerResponseV4 is the type of a response from Traffic Ops to a request
// for servers assigned to a Delivery Service - in the latest minor version of
// API version 4.
type DSServerResponseV4 = DSServerResponseV41
type DSServerResponseV4 = DSServerResponseV40

// ToDSServerBaseV4 upgrades the DSServerBase to the structure used by the
// latest minor version of version 4 of Traffic Ops's API.
Expand Down
10 changes: 2 additions & 8 deletions lib/go-tc/servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (

// ServersV4Response is the format of a response to a GET request for API v4.x /servers.
type ServersV4Response struct {
Response []ServerV41 `json:"response"`
Response []ServerV40 `json:"response"`
Summary struct {
Count uint64 `json:"count"`
} `json:"summary"`
Expand Down Expand Up @@ -1019,12 +1019,6 @@ func UpdateServerPropertiesV40(profileNames []string, properties CommonServerPro
}
}

// ServerV41 is the representation of a Server in version 4.1 of the Traffic Ops API.
type ServerV41 struct {
ServerV40
ASNs []int64 `json:"asns"`
}

// ServerV40 is the representation of a Server in version 4.0 of the Traffic Ops API.
type ServerV40 struct {
Cachegroup *string `json:"cachegroup" db:"cachegroup"`
Expand Down Expand Up @@ -1072,7 +1066,7 @@ type ServerV40 struct {

// ServerV4 is the representation of a Server in the latest minor version of
// version 4 of the Traffic Ops API.
type ServerV4 = ServerV41
type ServerV4 = ServerV40

// ServerV30 is the representation of a Server in version 3 of the Traffic Ops API.
type ServerV30 struct {
Expand Down
2 changes: 1 addition & 1 deletion traffic_monitor/towrap/towrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func (s TrafficOpsSessionThreadsafe) fetchServerByHostname(hostName string) (tc.
for i, srv := range resp.Response {
num = i
if srv.CDNName != nil && srv.HostName != nil && *srv.HostName == hostName {
server = srv.ServerV40
server = srv
found = true
break
}
Expand Down
Loading