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 2021/04/29 16:03:00 UTC
[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5747: Client consistency
rawlinp commented on a change in pull request #5747:
URL: https://github.com/apache/trafficcontrol/pull/5747#discussion_r623179674
##########
File path: lib/go-tc/crconfig.go
##########
@@ -209,3 +209,26 @@ type CRConfigStats struct {
TMUser *string `json:"tm_user,omitempty"`
TMVersion *string `json:"tm_version,omitempty"`
}
+
+// SnapshotResponseV40 is the type of the response of Traffic Ops to requests
+// for CDN Snapshots in API version 4.0.
+type SnapshotResponseV40 struct {
+ Response CRConfig `json:"response"`
+ Alerts
+}
+
+// SnapshotResponseV4 is the type of the response of Traffic Ops to requests
+// for CDN Snapshots in whatever the current latest minor version of API v4 is.
+type SnapshotResponseV4 = SnapshotResponseV40
Review comment:
I don't really foresee making breaking changes to the snapshot response data, so is this versioning really necessary?
##########
File path: lib/go-tc/deliveryservice_servers.go
##########
@@ -27,6 +27,21 @@ type DeliveryServiceServerResponse struct {
Limit int `json:"limit"`
}
+// DeliveryServiceServerResponseV40 is the type of a response from Traffic Ops
+// to a GET request to the /deliveryserviceserver endpoint in API version 4.0.
+type DeliveryServiceServerResponseV40 struct {
+ Orderby string `json:"orderby"`
+ Response []DeliveryServiceServer `json:"response"`
+ Size int `json:"size"`
+ Limit int `json:"limit"`
+ Alerts
+}
+
+// DeliveryServiceServerResponseV4 is the type of a response from Traffic Ops
+// to a GET request to the /deliveryserviceserver endpoint in the latest minor
+// version in API version 4.
+type DeliveryServiceServerResponseV4 = DeliveryServiceServerResponseV40
Review comment:
Similar to prior comments, I'm not sure we anticipate breaking changes to the deliveryserviceserver endpoint, so I'm not sure this extra versioning complexity is necessary.
##########
File path: lib/go-tc/cdns.go
##########
@@ -102,11 +102,24 @@ type CDNNullable struct {
Name *string `json:"name" db:"name"`
}
-// CDNSSLKeysResponse ...
+// CDNSSLKeysResponse is the structure of the Traffic Ops API's response to
+// requests made to its /cdns/name/{{name}}/sslkeys endpoint.
type CDNSSLKeysResponse struct {
Response []CDNSSLKeys `json:"response"`
}
+// CDNSSLKeysResponseV40 is the structure of the Traffic Ops API's response to
+// requests made to its /cdns/name/{{name}}/sslkeys endpoint in API version 4.0.
+type CDNSSLKeysResponseV40 struct {
+ Response []CDNSSLKeys `json:"response"`
+ Alerts
Review comment:
Since the API is already returning `alerts`, I think we can just add the `Alerts` to `CDNSSLKeysResponse` and not require a separate struct, right?
##########
File path: lib/go-tc/deliveryservice_ssl_keys.go
##########
@@ -90,6 +90,19 @@ type DeliveryServiceSSLKeysReq struct {
Certificate *DeliveryServiceSSLKeysCertificate `json:"certificate,omitempty"`
}
+// DeliveryServiceSSLKeysGenerationResponseV40 is the type of a response from
+// Traffic Ops to a request for generation of SSL Keys for a Delivery Service -
+// in API version 4.0.
+type DeliveryServiceSSLKeysGenerationResponseV40 struct {
+ Response string `json:"response"`
+ Alerts
+}
+
+// DeliveryServiceSSLKeysGenerationResponseV4 is the type of a response from
+// Traffic Ops to a request for generation of SSL Keys for a Delivery Service -
+// in the current latest minor version of API version 4.
+type DeliveryServiceSSLKeysGenerationResponseV4 = DeliveryServiceSSLKeysGenerationResponseV40
Review comment:
I'm starting to sound like a broken record here, but I don't think we need the extra versioning complexity in objects that we don't anticipate making breaking changes to (i.e. version number in the name, and major version alias).
--
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