You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2020/03/19 20:10:45 UTC
[trafficcontrol] branch master updated: Added Alerts to several
response structs (#4486)
This is an automated email from the ASF dual-hosted git repository.
ocket8888 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 8148d6a Added Alerts to several response structs (#4486)
8148d6a is described below
commit 8148d6ac508f361929d992d1a3f2073034f84578
Author: Eric Holguin <Zu...@users.noreply.github.com>
AuthorDate: Thu Mar 19 14:10:33 2020 -0600
Added Alerts to several response structs (#4486)
* Added Alerts to several Response Structs
* Added comments for new response structs
* Removed previously added responses
* Added alerts to more response structs
* Removed extra lines, added alerts
Co-authored-by: eholgu401 <er...@comcast.com>
---
lib/go-tc/api_capabilities.go | 1 +
lib/go-tc/asns.go | 2 ++
lib/go-tc/cachegroups.go | 2 ++
lib/go-tc/capabilities.go | 1 +
lib/go-tc/cdns.go | 2 ++
lib/go-tc/coordinates.go | 2 ++
lib/go-tc/deliveryservice_regexes.go | 1 +
lib/go-tc/deliveryservice_request_comments.go | 1 +
lib/go-tc/deliveryservice_servers.go | 3 ++-
lib/go-tc/deliveryservice_ssl_keys.go | 1 +
lib/go-tc/deliveryservices.go | 2 ++
lib/go-tc/divisions.go | 1 +
lib/go-tc/domains.go | 1 +
lib/go-tc/federation.go | 1 +
lib/go-tc/origins.go | 1 +
lib/go-tc/parameters.go | 1 +
lib/go-tc/physlocations.go | 2 ++
lib/go-tc/profile_parameters.go | 2 ++
lib/go-tc/profiles.go | 2 ++
lib/go-tc/regions.go | 1 +
lib/go-tc/roles.go | 2 ++
lib/go-tc/server_capabilities.go | 1 +
lib/go-tc/serverchecks.go | 1 +
lib/go-tc/servers.go | 2 ++
lib/go-tc/staticdnsentry.go | 1 +
lib/go-tc/stats_summary.go | 1 +
lib/go-tc/statuses.go | 2 ++
lib/go-tc/tenants.go | 1 +
lib/go-tc/toextension.go | 1 +
lib/go-tc/types.go | 1 +
lib/go-tc/users.go | 3 +++
31 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/lib/go-tc/api_capabilities.go b/lib/go-tc/api_capabilities.go
index 666b8a5..8b538d1 100644
--- a/lib/go-tc/api_capabilities.go
+++ b/lib/go-tc/api_capabilities.go
@@ -31,4 +31,5 @@ type APICapability struct {
// APICapabilityResponse represents an HTTP response to an API Capability request.
type APICapabilityResponse struct {
Response []APICapability `json:"response"`
+ Alerts
}
diff --git a/lib/go-tc/asns.go b/lib/go-tc/asns.go
index 15a399d..c9072dc 100644
--- a/lib/go-tc/asns.go
+++ b/lib/go-tc/asns.go
@@ -25,6 +25,7 @@ package tc
type ASNsResponse struct {
// in: body
Response []ASN `json:"response"`
+ Alerts
}
// ASNResponse is a single ASN response for Update and Create to depict what
@@ -34,6 +35,7 @@ type ASNsResponse struct {
type ASNResponse struct {
// in: body
Response ASN `json:"response"`
+ Alerts
}
// ASN contains info relating to a single Autonomous System Number (see RFC
diff --git a/lib/go-tc/cachegroups.go b/lib/go-tc/cachegroups.go
index 5a4c824..7b9d306 100644
--- a/lib/go-tc/cachegroups.go
+++ b/lib/go-tc/cachegroups.go
@@ -26,6 +26,7 @@ import (
// CacheGroupsResponse is a list of CacheGroups as a response.
type CacheGroupsResponse struct {
Response []CacheGroup `json:"response"`
+ Alerts
}
// CacheGroupsNullableResponse is a response with a list of CacheGroupNullables.
@@ -33,6 +34,7 @@ type CacheGroupsResponse struct {
// TOCacheGroups.
type CacheGroupsNullableResponse struct {
Response []CacheGroupNullable `json:"response"`
+ Alerts
}
// CacheGroupDetailResponse is the JSON object returned for a single CacheGroup
diff --git a/lib/go-tc/capabilities.go b/lib/go-tc/capabilities.go
index c520e50..5360f43 100644
--- a/lib/go-tc/capabilities.go
+++ b/lib/go-tc/capabilities.go
@@ -35,4 +35,5 @@ type Capability struct {
// Traffic Ops.
type CapabilitiesResponse struct {
Response []Capability `json:"response"`
+ Alerts
}
diff --git a/lib/go-tc/cdns.go b/lib/go-tc/cdns.go
index e17bfeb..b103b16 100644
--- a/lib/go-tc/cdns.go
+++ b/lib/go-tc/cdns.go
@@ -29,6 +29,7 @@ import (
type CDNsResponse struct {
// in: body
Response []CDN `json:"response"`
+ Alerts
}
// CDNResponse is a single CDN response for Update and Create to depict what
@@ -38,6 +39,7 @@ type CDNsResponse struct {
type CDNResponse struct {
// in: body
Response CDN `json:"response"`
+ Alerts
}
// CDN ...
diff --git a/lib/go-tc/coordinates.go b/lib/go-tc/coordinates.go
index a552952..09b9137 100644
--- a/lib/go-tc/coordinates.go
+++ b/lib/go-tc/coordinates.go
@@ -25,6 +25,7 @@ package tc
type CoordinatesResponse struct {
// in: body
Response []Coordinate `json:"response"`
+ Alerts
}
// CoordinateResponse is a single Coordinate response for Update and Create to
@@ -34,6 +35,7 @@ type CoordinatesResponse struct {
type CoordinateResponse struct {
// in: body
Response Coordinate `json:"response"`
+ Alerts
}
// Coordinate ...
diff --git a/lib/go-tc/deliveryservice_regexes.go b/lib/go-tc/deliveryservice_regexes.go
index ccc037d..e6b4c5f 100644
--- a/lib/go-tc/deliveryservice_regexes.go
+++ b/lib/go-tc/deliveryservice_regexes.go
@@ -18,6 +18,7 @@ package tc
// DeliveryServiceRegexResponse ...
type DeliveryServiceRegexResponse struct {
Response []DeliveryServiceRegexes `json:"response"`
+ Alerts
}
// DeliveryServiceRegexes ...
diff --git a/lib/go-tc/deliveryservice_request_comments.go b/lib/go-tc/deliveryservice_request_comments.go
index ec10111..dce1f77 100644
--- a/lib/go-tc/deliveryservice_request_comments.go
+++ b/lib/go-tc/deliveryservice_request_comments.go
@@ -23,6 +23,7 @@ package tc
// DeliveryServiceRequestComments as a response.
type DeliveryServiceRequestCommentsResponse struct {
Response []DeliveryServiceRequestComment `json:"response"`
+ Alerts
}
// DeliveryServiceRequestComment is a struct containing the fields for a delivery
diff --git a/lib/go-tc/deliveryservice_servers.go b/lib/go-tc/deliveryservice_servers.go
index c51be51..b082b56 100644
--- a/lib/go-tc/deliveryservice_servers.go
+++ b/lib/go-tc/deliveryservice_servers.go
@@ -34,12 +34,13 @@ type DSSMapResponse struct {
}
type DSSReplaceResponse struct {
- Alerts []Alert `json:"alerts"`
+ Alerts
Response DSSMapResponse `json:"response"`
}
type DSServersResponse struct {
Response DeliveryServiceServers `json:"response"`
+ Alerts
}
type DeliveryServiceServers struct {
diff --git a/lib/go-tc/deliveryservice_ssl_keys.go b/lib/go-tc/deliveryservice_ssl_keys.go
index dbef87e..20317d1 100644
--- a/lib/go-tc/deliveryservice_ssl_keys.go
+++ b/lib/go-tc/deliveryservice_ssl_keys.go
@@ -39,6 +39,7 @@ const (
// DeliveryServiceSSLKeysResponse ...
type DeliveryServiceSSLKeysResponse struct {
Response DeliveryServiceSSLKeys `json:"response"`
+ Alerts
}
// DeliveryServiceSSLKeys ...
diff --git a/lib/go-tc/deliveryservices.go b/lib/go-tc/deliveryservices.go
index a49f2ae..10c07c4 100644
--- a/lib/go-tc/deliveryservices.go
+++ b/lib/go-tc/deliveryservices.go
@@ -41,11 +41,13 @@ type GetDeliveryServiceResponse struct {
// DeliveryServicesResponse ...
type DeliveryServicesResponse struct {
Response []DeliveryService `json:"response"`
+ Alerts
}
// DeliveryServicesNullableResponse ...
type DeliveryServicesNullableResponse struct {
Response []DeliveryServiceNullable `json:"response"`
+ Alerts
}
// CreateDeliveryServiceResponse ...
diff --git a/lib/go-tc/divisions.go b/lib/go-tc/divisions.go
index e3c35c1..2ab27ba 100644
--- a/lib/go-tc/divisions.go
+++ b/lib/go-tc/divisions.go
@@ -24,6 +24,7 @@ package tc
type DivisionsResponse struct {
// in: body
Response []Division `json:"response"`
+ Alerts
}
// DivisionResponse is a single Division response for Update and Create to
diff --git a/lib/go-tc/domains.go b/lib/go-tc/domains.go
index 50e147c..f2f96a8 100644
--- a/lib/go-tc/domains.go
+++ b/lib/go-tc/domains.go
@@ -22,6 +22,7 @@ package tc
// DomainsResponse is a list of Domains as a response.
type DomainsResponse struct {
Response []Domain `json:"response"`
+ Alerts
}
// Domain contains information about a single domain and its profile.
diff --git a/lib/go-tc/federation.go b/lib/go-tc/federation.go
index 543df15..d2e8fa7 100644
--- a/lib/go-tc/federation.go
+++ b/lib/go-tc/federation.go
@@ -34,6 +34,7 @@ import (
// Federations.
type CDNFederationResponse struct {
Response []CDNFederation `json:"response"`
+ Alerts
}
// CreateCDNFederationResponse represents a Traffic Ops API response to a request to
diff --git a/lib/go-tc/origins.go b/lib/go-tc/origins.go
index 9f1ec6a..8e592a6 100644
--- a/lib/go-tc/origins.go
+++ b/lib/go-tc/origins.go
@@ -22,6 +22,7 @@ package tc
// OriginsResponse is a list of Origins as a response.
type OriginsResponse struct {
Response []Origin `json:"response"`
+ Alerts
}
// OriginDetailResponse is the JSON object returned for a single origin
diff --git a/lib/go-tc/parameters.go b/lib/go-tc/parameters.go
index ee24843..a48b61c 100644
--- a/lib/go-tc/parameters.go
+++ b/lib/go-tc/parameters.go
@@ -36,6 +36,7 @@ import (
// ParametersResponse ...
type ParametersResponse struct {
Response []Parameter `json:"response"`
+ Alerts
}
// Parameter ...
diff --git a/lib/go-tc/physlocations.go b/lib/go-tc/physlocations.go
index ad599c9..a238067 100644
--- a/lib/go-tc/physlocations.go
+++ b/lib/go-tc/physlocations.go
@@ -22,11 +22,13 @@ package tc
// PhysLocationsResponse is a list of PhysLocations as a response.
type PhysLocationsResponse struct {
Response []PhysLocation `json:"response"`
+ Alerts
}
// PhysLocationResponse is a single PhysLocationNullable as a response.
type PhysLocationResponse struct {
Response PhysLocationNullable `json:"response"`
+ Alerts
}
// PhysLocation contains the physical location of a cache group.
diff --git a/lib/go-tc/profile_parameters.go b/lib/go-tc/profile_parameters.go
index 17386a0..ad6d8cb 100644
--- a/lib/go-tc/profile_parameters.go
+++ b/lib/go-tc/profile_parameters.go
@@ -22,6 +22,7 @@ package tc
// ProfileParametersResponse ...
type ProfileParametersResponse struct {
Response []ProfileParameter `json:"response"`
+ Alerts
}
// ProfileParameterResponse is a single ProfileParameter response for Create to
@@ -31,6 +32,7 @@ type ProfileParametersResponse struct {
type ProfileParameterResponse struct {
// in: body
Response ProfileParameter `json:"response"`
+ Alerts
}
// ProfileParameter ...
diff --git a/lib/go-tc/profiles.go b/lib/go-tc/profiles.go
index c2b8c16..3df8e83 100644
--- a/lib/go-tc/profiles.go
+++ b/lib/go-tc/profiles.go
@@ -35,6 +35,7 @@ import (
// ProfilesResponse is a list of profiles returned by GET requests.
type ProfilesResponse struct {
Response []Profile `json:"response"`
+ Alerts
}
// ProfileResponse is a single Profile Response for Update and Create to depict what changed
@@ -43,6 +44,7 @@ type ProfilesResponse struct {
type ProfileResponse struct {
// in: body
Response Profile `json:"response"`
+ Alerts
}
// Profile ...
diff --git a/lib/go-tc/regions.go b/lib/go-tc/regions.go
index dea20df..bb1142a 100644
--- a/lib/go-tc/regions.go
+++ b/lib/go-tc/regions.go
@@ -22,6 +22,7 @@ package tc
// RegionsResponse ...
type RegionsResponse struct {
Response []Region `json:"response"`
+ Alerts
}
// Region ...
diff --git a/lib/go-tc/roles.go b/lib/go-tc/roles.go
index 5f43dad..22a0285 100644
--- a/lib/go-tc/roles.go
+++ b/lib/go-tc/roles.go
@@ -25,6 +25,7 @@ package tc
type RolesResponse struct {
// in: body
Response []Role `json:"response"`
+ Alerts
}
// RoleResponse is a single Role response for Update and Create to depict what
@@ -34,6 +35,7 @@ type RolesResponse struct {
type RoleResponse struct {
// in: body
Response Role `json:"response"`
+ Alerts
}
// Role ...
diff --git a/lib/go-tc/server_capabilities.go b/lib/go-tc/server_capabilities.go
index 96df8c1..45ab68b 100644
--- a/lib/go-tc/server_capabilities.go
+++ b/lib/go-tc/server_capabilities.go
@@ -22,6 +22,7 @@ package tc
// ServerCapabilitiesResponse contains the result data from a GET /server_capabilities request.
type ServerCapabilitiesResponse struct {
Response []ServerCapability `json:"response"`
+ Alerts
}
// ServerCapability contains information about a given ServerCapability in Traffic Ops.
diff --git a/lib/go-tc/serverchecks.go b/lib/go-tc/serverchecks.go
index a6b19a0..d25de70 100644
--- a/lib/go-tc/serverchecks.go
+++ b/lib/go-tc/serverchecks.go
@@ -33,6 +33,7 @@ import (
type ServerchecksResponse struct {
// in: body
Response []Servercheck `json:"response"`
+ Alerts
}
// CommonCheckFields is a structure containing all of the fields common to both
diff --git a/lib/go-tc/servers.go b/lib/go-tc/servers.go
index 0691348..5c33e4c 100644
--- a/lib/go-tc/servers.go
+++ b/lib/go-tc/servers.go
@@ -28,11 +28,13 @@ import (
// ServersResponse is a list of Servers as a response.
type ServersResponse struct {
Response []Server `json:"response"`
+ Alerts
}
// ServersDetailResponse is the JSON object returned for a single server.
type ServersDetailResponse struct {
Response Server `json:"response"`
+ Alerts
}
type Server struct {
diff --git a/lib/go-tc/staticdnsentry.go b/lib/go-tc/staticdnsentry.go
index 2b6215e..c867a89 100644
--- a/lib/go-tc/staticdnsentry.go
+++ b/lib/go-tc/staticdnsentry.go
@@ -22,6 +22,7 @@ package tc
// StaticDNSEntriesResponse is a list of StaticDNSEntry as a response.
type StaticDNSEntriesResponse struct {
Response []StaticDNSEntry `json:"response"`
+ Alerts
}
// StaticDNSEntry holds information about a static DNS entry.
diff --git a/lib/go-tc/stats_summary.go b/lib/go-tc/stats_summary.go
index cb26769..dc633ba 100644
--- a/lib/go-tc/stats_summary.go
+++ b/lib/go-tc/stats_summary.go
@@ -35,6 +35,7 @@ const dateFormat = "2006-01-02"
// StatsSummaryResponse ...
type StatsSummaryResponse struct {
Response []StatsSummary `json:"response"`
+ Alerts
}
// StatsSummary ...
diff --git a/lib/go-tc/statuses.go b/lib/go-tc/statuses.go
index 125cd65..3646adf 100644
--- a/lib/go-tc/statuses.go
+++ b/lib/go-tc/statuses.go
@@ -25,6 +25,7 @@ package tc
type StatusesResponse struct {
// in: body
Response []Status `json:"response"`
+ Alerts
}
// StatusResponse is a single Status response for Update and Create to depict
@@ -34,6 +35,7 @@ type StatusesResponse struct {
type StatusResponse struct {
// in: body
Response Status `json:"response"`
+ Alerts
}
// Status is a single Status response for Update and Create to depict what
diff --git a/lib/go-tc/tenants.go b/lib/go-tc/tenants.go
index e825945..9a81f7c 100644
--- a/lib/go-tc/tenants.go
+++ b/lib/go-tc/tenants.go
@@ -22,6 +22,7 @@ package tc
// GetTenantsResponse is the response for a request for a group of tenants
type GetTenantsResponse struct {
Response []Tenant `json:"response"`
+ Alerts
}
// TenantResponse is the response to a create/update
diff --git a/lib/go-tc/toextension.go b/lib/go-tc/toextension.go
index 7ce1316..e16224f 100644
--- a/lib/go-tc/toextension.go
+++ b/lib/go-tc/toextension.go
@@ -49,6 +49,7 @@ type TOExtensionNullable struct {
// TOExtensionResponse represents the response from Traffic Ops when getting TOExtension.
type TOExtensionResponse struct {
Response []TOExtensionNullable `json:"response"`
+ Alerts
}
// TOExtensionPostResponse represents the response from Traffic Ops when creating TOExtension.
diff --git a/lib/go-tc/types.go b/lib/go-tc/types.go
index 206bc8f..f13e936 100644
--- a/lib/go-tc/types.go
+++ b/lib/go-tc/types.go
@@ -27,6 +27,7 @@ import (
// TypesResponse ...
type TypesResponse struct {
Response []Type `json:"response"`
+ Alerts
}
// Type contains information about a given Type in Traffic Ops.
diff --git a/lib/go-tc/users.go b/lib/go-tc/users.go
index 0a65097..5b32861 100644
--- a/lib/go-tc/users.go
+++ b/lib/go-tc/users.go
@@ -281,11 +281,13 @@ func (u *CurrentUserUpdateRequestUser) UnmarshalAndValidate(user *User) error {
// It is unused.
type UsersResponseV13 struct {
Response []UserV13 `json:"response"`
+ Alerts
}
// UsersResponse can hold a Traffic Ops API response to a request to get a list of users.
type UsersResponse struct {
Response []User `json:"response"`
+ Alerts
}
// CreateUserResponse can hold a Traffic Ops API response to a POST request to create a user.
@@ -310,6 +312,7 @@ type DeleteUserResponse struct {
// or update the current user.
type UserCurrentResponse struct {
Response UserCurrent `json:"response"`
+ Alerts
}
// UserDeliveryServiceDeleteResponse can hold a Traffic Ops API response to