You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ro...@apache.org on 2018/06/18 22:16:45 UTC
[trafficcontrol] 01/04: added anonymous_blocking_enabled field to
deliveryservice queries
This is an automated email from the ASF dual-hosted git repository.
rob pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 06e464db01f4b2593acdd64264924b2644497e85
Author: Jesse Rivas <je...@comcast.com>
AuthorDate: Wed Jun 13 08:26:19 2018 -0600
added anonymous_blocking_enabled field to deliveryservice queries
---
lib/go-tc/deliveryservices.go | 244 ++++++++++-----------
.../experimental/server/api/deliveryservices.go | 3 +
.../deliveryservice/deliveryservicesv13.go | 14 +-
3 files changed, 134 insertions(+), 127 deletions(-)
diff --git a/lib/go-tc/deliveryservices.go b/lib/go-tc/deliveryservices.go
index e7e8614..114d97e 100644
--- a/lib/go-tc/deliveryservices.go
+++ b/lib/go-tc/deliveryservices.go
@@ -60,59 +60,60 @@ type DeleteDeliveryServiceResponse struct {
// DeliveryService ...
// TODO move contents to DeliveryServiceV12, fix references, and remove
type DeliveryService struct {
- Active bool `json:"active"`
- CacheURL string `json:"cacheurl"`
- CCRDNSTTL int `json:"ccrDnsTtl"`
- CDNID int `json:"cdnId"`
- CDNName string `json:"cdnName"`
- CheckPath string `json:"checkPath"`
- DeepCachingType DeepCachingType `json:"deepCachingType"`
- DisplayName string `json:"displayName"`
- DNSBypassCname string `json:"dnsBypassCname"`
- DNSBypassIP string `json:"dnsBypassIp"`
- DNSBypassIP6 string `json:"dnsBypassIp6"`
- DNSBypassTTL int `json:"dnsBypassTtl"`
- DSCP int `json:"dscp"`
- EdgeHeaderRewrite string `json:"edgeHeaderRewrite"`
- ExampleURLs []string `json:"exampleURLs"`
- GeoLimit int `json:"geoLimit"`
- FQPacingRate int `json:"fqPacingRate"`
- GeoProvider int `json:"geoProvider"`
- GlobalMaxMBPS int `json:"globalMaxMbps"`
- GlobalMaxTPS int `json:"globalMaxTps"`
- HTTPBypassFQDN string `json:"httpBypassFqdn"`
- ID int `json:"id"`
- InfoURL string `json:"infoUrl"`
- InitialDispersion float32 `json:"initialDispersion"`
- IPV6RoutingEnabled bool `json:"ipv6RoutingEnabled"`
- LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
- LogsEnabled bool `json:"logsEnabled"`
- LongDesc string `json:"longDesc"`
- LongDesc1 string `json:"longDesc1"`
- LongDesc2 string `json:"longDesc2"`
- MatchList []DeliveryServiceMatch `json:"matchList,omitempty"`
- MaxDNSAnswers int `json:"maxDnsAnswers"`
- MidHeaderRewrite string `json:"midHeaderRewrite"`
- MissLat float64 `json:"missLat"`
- MissLong float64 `json:"missLong"`
- MultiSiteOrigin bool `json:"multiSiteOrigin"`
- OrgServerFQDN string `json:"orgServerFqdn"`
- ProfileDesc string `json:"profileDescription"`
- ProfileID int `json:"profileId,omitempty"`
- ProfileName string `json:"profileName"`
- Protocol int `json:"protocol"`
- QStringIgnore int `json:"qstringIgnore"`
- RangeRequestHandling int `json:"rangeRequestHandling"`
- RegexRemap string `json:"regexRemap"`
- RegionalGeoBlocking bool `json:"regionalGeoBlocking"`
- RemapText string `json:"remapText"`
- RoutingName string `json:"routingName"`
- SigningAlgorithm string `json:"signingAlgorithm" db:"signing_algorithm"`
- TypeID int `json:"typeId"`
- Type DSType `json:"type"`
- TRResponseHeaders string `json:"trResponseHeaders"`
- TenantID int `json:"tenantId,omitempty"`
- XMLID string `json:"xmlId"`
+ Active bool `json:"active"`
+ AnonymousBlockingEnabled bool `json:"anonymousBlockingEnabled"`
+ CacheURL string `json:"cacheurl"`
+ CCRDNSTTL int `json:"ccrDnsTtl"`
+ CDNID int `json:"cdnId"`
+ CDNName string `json:"cdnName"`
+ CheckPath string `json:"checkPath"`
+ DeepCachingType DeepCachingType `json:"deepCachingType"`
+ DisplayName string `json:"displayName"`
+ DNSBypassCname string `json:"dnsBypassCname"`
+ DNSBypassIP string `json:"dnsBypassIp"`
+ DNSBypassIP6 string `json:"dnsBypassIp6"`
+ DNSBypassTTL int `json:"dnsBypassTtl"`
+ DSCP int `json:"dscp"`
+ EdgeHeaderRewrite string `json:"edgeHeaderRewrite"`
+ ExampleURLs []string `json:"exampleURLs"`
+ GeoLimit int `json:"geoLimit"`
+ FQPacingRate int `json:"fqPacingRate"`
+ GeoProvider int `json:"geoProvider"`
+ GlobalMaxMBPS int `json:"globalMaxMbps"`
+ GlobalMaxTPS int `json:"globalMaxTps"`
+ HTTPBypassFQDN string `json:"httpBypassFqdn"`
+ ID int `json:"id"`
+ InfoURL string `json:"infoUrl"`
+ InitialDispersion float32 `json:"initialDispersion"`
+ IPV6RoutingEnabled bool `json:"ipv6RoutingEnabled"`
+ LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
+ LogsEnabled bool `json:"logsEnabled"`
+ LongDesc string `json:"longDesc"`
+ LongDesc1 string `json:"longDesc1"`
+ LongDesc2 string `json:"longDesc2"`
+ MatchList []DeliveryServiceMatch `json:"matchList,omitempty"`
+ MaxDNSAnswers int `json:"maxDnsAnswers"`
+ MidHeaderRewrite string `json:"midHeaderRewrite"`
+ MissLat float64 `json:"missLat"`
+ MissLong float64 `json:"missLong"`
+ MultiSiteOrigin bool `json:"multiSiteOrigin"`
+ OrgServerFQDN string `json:"orgServerFqdn"`
+ ProfileDesc string `json:"profileDescription"`
+ ProfileID int `json:"profileId,omitempty"`
+ ProfileName string `json:"profileName"`
+ Protocol int `json:"protocol"`
+ QStringIgnore int `json:"qstringIgnore"`
+ RangeRequestHandling int `json:"rangeRequestHandling"`
+ RegexRemap string `json:"regexRemap"`
+ RegionalGeoBlocking bool `json:"regionalGeoBlocking"`
+ RemapText string `json:"remapText"`
+ RoutingName string `json:"routingName"`
+ SigningAlgorithm string `json:"signingAlgorithm" db:"signing_algorithm"`
+ TypeID int `json:"typeId"`
+ Type DSType `json:"type"`
+ TRResponseHeaders string `json:"trResponseHeaders"`
+ TenantID int `json:"tenantId,omitempty"`
+ XMLID string `json:"xmlId"`
}
type DeliveryServiceV12 struct {
@@ -121,13 +122,12 @@ type DeliveryServiceV12 struct {
type DeliveryServiceV13 struct {
DeliveryServiceV12
- AnonymousBlockingEnabled bool `json:"anonymousBlockingEnabled"`
- DeepCachingType DeepCachingType `json:"deepCachingType"`
- FQPacingRate int `json:"fqPacingRate,omitempty"`
- SigningAlgorithm string `json:"signingAlgorithm" db:"signing_algorithm"`
- TenantName string `json:"tenantName,omitempty"`
- TRRequestHeaders string `json:"trRequestHeaders,omitempty"`
- TRResponseHeaders string `json:"trResponseHeaders,omitempty"`
+ DeepCachingType DeepCachingType `json:"deepCachingType"`
+ FQPacingRate int `json:"fqPacingRate,omitempty"`
+ SigningAlgorithm string `json:"signingAlgorithm" db:"signing_algorithm"`
+ TenantName string `json:"tenantName,omitempty"`
+ TRRequestHeaders string `json:"trRequestHeaders,omitempty"`
+ TRResponseHeaders string `json:"trResponseHeaders,omitempty"`
}
// DeliveryServiceNullable - a version of the deliveryservice that allows for all fields to be null
@@ -135,61 +135,62 @@ type DeliveryServiceV13 struct {
type DeliveryServiceNullable struct {
// NOTE: the db: struct tags are used for testing to map to their equivalent database column (if there is one)
//
- Active *bool `json:"active" db:"active"`
- CacheURL *string `json:"cacheurl" db:"cacheurl"`
- CCRDNSTTL *int `json:"ccrDnsTtl" db:"ccr_dns_ttl"`
- CDNID *int `json:"cdnId" db:"cdn_id"`
- CDNName *string `json:"cdnName"`
- CheckPath *string `json:"checkPath" db:"check_path"`
- DisplayName *string `json:"displayName" db:"display_name"`
- DNSBypassCNAME *string `json:"dnsBypassCname" db:"dns_bypass_cname"`
- DNSBypassIP *string `json:"dnsBypassIp" db:"dns_bypass_ip"`
- DNSBypassIP6 *string `json:"dnsBypassIp6" db:"dns_bypass_ip6"`
- DNSBypassTTL *int `json:"dnsBypassTtl" db:"dns_bypass_ttl"`
- DSCP *int `json:"dscp" db:"dscp"`
- EdgeHeaderRewrite *string `json:"edgeHeaderRewrite" db:"edge_header_rewrite"`
- FQPacingRate *int `json:"fqPacingRate" db:"fq_pacing_rate"`
- GeoLimit *int `json:"geoLimit" db:"geo_limit"`
- GeoLimitCountries *string `json:"geoLimitCountries" db:"geo_limit_countries"`
- GeoLimitRedirectURL *string `json:"geoLimitRedirectURL" db:"geolimit_redirect_url"`
- GeoProvider *int `json:"geoProvider" db:"geo_provider"`
- GlobalMaxMBPS *int `json:"globalMaxMbps" db:"global_max_mbps"`
- GlobalMaxTPS *int `json:"globalMaxTps" db:"global_max_tps"`
- HTTPBypassFQDN *string `json:"httpBypassFqdn" db:"http_bypass_fqdn"`
- ID *int `json:"id" db:"id"`
- InfoURL *string `json:"infoUrl" db:"info_url"`
- InitialDispersion *int `json:"initialDispersion" db:"initial_dispersion"`
- IPV6RoutingEnabled *bool `json:"ipv6RoutingEnabled" db:"ipv6_routing_enabled"`
- LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
- LogsEnabled *bool `json:"logsEnabled" db:"logs_enabled"`
- LongDesc *string `json:"longDesc" db:"long_desc"`
- LongDesc1 *string `json:"longDesc1" db:"long_desc_1"`
- LongDesc2 *string `json:"longDesc2" db:"long_desc_2"`
- MatchList *[]DeliveryServiceMatch `json:"matchList"`
- MaxDNSAnswers *int `json:"maxDnsAnswers" db:"max_dns_answers"`
- MidHeaderRewrite *string `json:"midHeaderRewrite" db:"mid_header_rewrite"`
- MissLat *float64 `json:"missLat" db:"miss_lat"`
- MissLong *float64 `json:"missLong" db:"miss_long"`
- MultiSiteOrigin *bool `json:"multiSiteOrigin" db:"multi_site_origin"`
- OriginShield *string `json:"originShield" db:"origin_shield"`
- OrgServerFQDN *string `json:"orgServerFqdn" db:"org_server_fqdn"`
- ProfileDesc *string `json:"profileDescription"`
- ProfileID *int `json:"profileId" db:"profile"`
- ProfileName *string `json:"profileName"`
- Protocol *int `json:"protocol" db:"protocol"`
- QStringIgnore *int `json:"qstringIgnore" db:"qstring_ignore"`
- RangeRequestHandling *int `json:"rangeRequestHandling" db:"range_request_handling"`
- RegexRemap *string `json:"regexRemap" db:"regex_remap"`
- RegionalGeoBlocking *bool `json:"regionalGeoBlocking" db:"regional_geo_blocking"`
- RemapText *string `json:"remapText" db:"remap_text"`
- RoutingName *string `json:"routingName" db:"routing_name"`
- Signed bool `json:"signed"`
- SSLKeyVersion *int `json:"sslKeyVersion" db:"ssl_key_version"`
- TenantID *int `json:"tenantId" db:"tenant_id"`
- Type *DSType `json:"type"`
- TypeID *int `json:"typeId" db:"type"`
- XMLID *string `json:"xmlId" db:"xml_id"`
- ExampleURLs []string `json:"exampleURLs"`
+ Active *bool `json:"active" db:"active"`
+ AnonymousBlockingEnabled *bool `json:"anonymousBlockingEnabled" db:"anonymous_blocking_enabled"`
+ CacheURL *string `json:"cacheurl" db:"cacheurl"`
+ CCRDNSTTL *int `json:"ccrDnsTtl" db:"ccr_dns_ttl"`
+ CDNID *int `json:"cdnId" db:"cdn_id"`
+ CDNName *string `json:"cdnName"`
+ CheckPath *string `json:"checkPath" db:"check_path"`
+ DisplayName *string `json:"displayName" db:"display_name"`
+ DNSBypassCNAME *string `json:"dnsBypassCname" db:"dns_bypass_cname"`
+ DNSBypassIP *string `json:"dnsBypassIp" db:"dns_bypass_ip"`
+ DNSBypassIP6 *string `json:"dnsBypassIp6" db:"dns_bypass_ip6"`
+ DNSBypassTTL *int `json:"dnsBypassTtl" db:"dns_bypass_ttl"`
+ DSCP *int `json:"dscp" db:"dscp"`
+ EdgeHeaderRewrite *string `json:"edgeHeaderRewrite" db:"edge_header_rewrite"`
+ FQPacingRate *int `json:"fqPacingRate" db:"fq_pacing_rate"`
+ GeoLimit *int `json:"geoLimit" db:"geo_limit"`
+ GeoLimitCountries *string `json:"geoLimitCountries" db:"geo_limit_countries"`
+ GeoLimitRedirectURL *string `json:"geoLimitRedirectURL" db:"geolimit_redirect_url"`
+ GeoProvider *int `json:"geoProvider" db:"geo_provider"`
+ GlobalMaxMBPS *int `json:"globalMaxMbps" db:"global_max_mbps"`
+ GlobalMaxTPS *int `json:"globalMaxTps" db:"global_max_tps"`
+ HTTPBypassFQDN *string `json:"httpBypassFqdn" db:"http_bypass_fqdn"`
+ ID *int `json:"id" db:"id"`
+ InfoURL *string `json:"infoUrl" db:"info_url"`
+ InitialDispersion *int `json:"initialDispersion" db:"initial_dispersion"`
+ IPV6RoutingEnabled *bool `json:"ipv6RoutingEnabled" db:"ipv6_routing_enabled"`
+ LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
+ LogsEnabled *bool `json:"logsEnabled" db:"logs_enabled"`
+ LongDesc *string `json:"longDesc" db:"long_desc"`
+ LongDesc1 *string `json:"longDesc1" db:"long_desc_1"`
+ LongDesc2 *string `json:"longDesc2" db:"long_desc_2"`
+ MatchList *[]DeliveryServiceMatch `json:"matchList"`
+ MaxDNSAnswers *int `json:"maxDnsAnswers" db:"max_dns_answers"`
+ MidHeaderRewrite *string `json:"midHeaderRewrite" db:"mid_header_rewrite"`
+ MissLat *float64 `json:"missLat" db:"miss_lat"`
+ MissLong *float64 `json:"missLong" db:"miss_long"`
+ MultiSiteOrigin *bool `json:"multiSiteOrigin" db:"multi_site_origin"`
+ OriginShield *string `json:"originShield" db:"origin_shield"`
+ OrgServerFQDN *string `json:"orgServerFqdn" db:"org_server_fqdn"`
+ ProfileDesc *string `json:"profileDescription"`
+ ProfileID *int `json:"profileId" db:"profile"`
+ ProfileName *string `json:"profileName"`
+ Protocol *int `json:"protocol" db:"protocol"`
+ QStringIgnore *int `json:"qstringIgnore" db:"qstring_ignore"`
+ RangeRequestHandling *int `json:"rangeRequestHandling" db:"range_request_handling"`
+ RegexRemap *string `json:"regexRemap" db:"regex_remap"`
+ RegionalGeoBlocking *bool `json:"regionalGeoBlocking" db:"regional_geo_blocking"`
+ RemapText *string `json:"remapText" db:"remap_text"`
+ RoutingName *string `json:"routingName" db:"routing_name"`
+ Signed bool `json:"signed"`
+ SSLKeyVersion *int `json:"sslKeyVersion" db:"ssl_key_version"`
+ TenantID *int `json:"tenantId" db:"tenant_id"`
+ Type *DSType `json:"type"`
+ TypeID *int `json:"typeId" db:"type"`
+ XMLID *string `json:"xmlId" db:"xml_id"`
+ ExampleURLs []string `json:"exampleURLs"`
}
type DeliveryServiceNullableV12 struct {
@@ -198,13 +199,12 @@ type DeliveryServiceNullableV12 struct {
type DeliveryServiceNullableV13 struct {
DeliveryServiceNullableV12
- AnonymousBlockingEnabled *bool `json:"anonymousBlockingEnabled" db:"anonymous_blocking_enabled"`
- DeepCachingType *DeepCachingType `json:"deepCachingType" db:"deep_caching_type"`
- FQPacingRate *int `json:"fqPacingRate,omitempty"`
- SigningAlgorithm *string `json:"signingAlgorithm" db:"signing_algorithm"`
- Tenant *string `json:"tenant,omitempty"`
- TRResponseHeaders *string `json:"trResponseHeaders,omitempty"`
- TRRequestHeaders *string `json:"trRequestHeaders,omitempty"`
+ DeepCachingType *DeepCachingType `json:"deepCachingType" db:"deep_caching_type"`
+ FQPacingRate *int `json:"fqPacingRate,omitempty"`
+ SigningAlgorithm *string `json:"signingAlgorithm" db:"signing_algorithm"`
+ Tenant *string `json:"tenant,omitempty"`
+ TRResponseHeaders *string `json:"trResponseHeaders,omitempty"`
+ TRRequestHeaders *string `json:"trRequestHeaders,omitempty"`
}
// Value implements the driver.Valuer interface
diff --git a/traffic_ops/experimental/server/api/deliveryservices.go b/traffic_ops/experimental/server/api/deliveryservices.go
index 05e21e6..297c7ec 100644
--- a/traffic_ops/experimental/server/api/deliveryservices.go
+++ b/traffic_ops/experimental/server/api/deliveryservices.go
@@ -179,6 +179,7 @@ func postDeliveryservice(payload []byte, db *sqlx.DB) (interface{}, error) {
sqlString += ",dns_bypass_cname"
sqlString += ",tr_request_headers"
sqlString += ",created_at"
+ sqlString += ",anonymous_blocking_enabled"
sqlString += ") VALUES ("
sqlString += ":name"
sqlString += ",:display_name"
@@ -221,6 +222,7 @@ func postDeliveryservice(payload []byte, db *sqlx.DB) (interface{}, error) {
sqlString += ",:dns_bypass_cname"
sqlString += ",:tr_request_headers"
sqlString += ",:created_at"
+ sqlString += ",:anonymous_blocking_enabled"
sqlString += ")"
result, err := db.NamedExec(sqlString, v)
if err != nil {
@@ -288,6 +290,7 @@ func putDeliveryservice(name string, payload []byte, db *sqlx.DB) (interface{},
sqlString += ",dns_bypass_cname = :dns_bypass_cname"
sqlString += ",tr_request_headers = :tr_request_headers"
sqlString += ",created_at = :created_at"
+ sqlString += ",anonymous_blocking_enabled = :anonymous_blocking_enabled"
sqlString += " WHERE name=:name"
result, err := db.NamedExec(sqlString, arg)
if err != nil {
diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
index a11b6c1..80d675f 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
@@ -192,7 +192,7 @@ func create(db *sql.DB, cfg config.Config, user *auth.CurrentUser, ds tc.Deliver
commitTx := false
defer dbhelpers.FinishTx(tx, &commitTx)
- resultRows, err := tx.Query(insertQuery(), &ds.Active, &ds.CacheURL, &ds.CCRDNSTTL, &ds.CDNID, &ds.CheckPath, &deepCachingType, &ds.DisplayName, &ds.DNSBypassCNAME, &ds.DNSBypassIP, &ds.DNSBypassIP6, &ds.DNSBypassTTL, &ds.DSCP, &ds.EdgeHeaderRewrite, &ds.GeoLimitRedirectURL, &ds.GeoLimit, &ds.GeoLimitCountries, &ds.GeoProvider, &ds.GlobalMaxMBPS, &ds.GlobalMaxTPS, &ds.FQPacingRate, &ds.HTTPBypassFQDN, &ds.InfoURL, &ds.InitialDispersion, &ds.IPV6RoutingEnabled, &ds.LogsEnabled, &ds.LongD [...]
+ resultRows, err := tx.Query(insertQuery(), &ds.Active, &ds.AnonymousBlockingEnabled, &ds.CacheURL, &ds.CCRDNSTTL, &ds.CDNID, &ds.CheckPath, &deepCachingType, &ds.DisplayName, &ds.DNSBypassCNAME, &ds.DNSBypassIP, &ds.DNSBypassIP6, &ds.DNSBypassTTL, &ds.DSCP, &ds.EdgeHeaderRewrite, &ds.GeoLimitRedirectURL, &ds.GeoLimit, &ds.GeoLimitCountries, &ds.GeoProvider, &ds.GlobalMaxMBPS, &ds.GlobalMaxTPS, &ds.FQPacingRate, &ds.HTTPBypassFQDN, &ds.InfoURL, &ds.InitialDispersion, &ds.IPV6RoutingEnabl [...]
if err != nil {
if pqerr, ok := err.(*pq.Error); ok {
@@ -533,7 +533,7 @@ func update(db *sql.DB, cfg config.Config, user auth.CurrentUser, ds *tc.Deliver
deepCachingType = ds.DeepCachingType.String() // necessary, because DeepCachingType's default needs to insert the string, not "", and Query doesn't call .String().
}
- resultRows, err := tx.Query(updateDSQuery(), &ds.Active, &ds.CacheURL, &ds.CCRDNSTTL, &ds.CDNID, &ds.CheckPath, &deepCachingType, &ds.DisplayName, &ds.DNSBypassCNAME, &ds.DNSBypassIP, &ds.DNSBypassIP6, &ds.DNSBypassTTL, &ds.DSCP, &ds.EdgeHeaderRewrite, &ds.GeoLimitRedirectURL, &ds.GeoLimit, &ds.GeoLimitCountries, &ds.GeoProvider, &ds.GlobalMaxMBPS, &ds.GlobalMaxTPS, &ds.FQPacingRate, &ds.HTTPBypassFQDN, &ds.InfoURL, &ds.InitialDispersion, &ds.IPV6RoutingEnabled, &ds.LogsEnabled, &ds.Lon [...]
+ resultRows, err := tx.Query(updateDSQuery(), &ds.Active, &ds.CacheURL, &ds.CCRDNSTTL, &ds.CDNID, &ds.CheckPath, &deepCachingType, &ds.DisplayName, &ds.DNSBypassCNAME, &ds.DNSBypassIP, &ds.DNSBypassIP6, &ds.DNSBypassTTL, &ds.DSCP, &ds.EdgeHeaderRewrite, &ds.GeoLimitRedirectURL, &ds.GeoLimit, &ds.GeoLimitCountries, &ds.GeoProvider, &ds.GlobalMaxMBPS, &ds.GlobalMaxTPS, &ds.FQPacingRate, &ds.HTTPBypassFQDN, &ds.InfoURL, &ds.InitialDispersion, &ds.IPV6RoutingEnabled, &ds.LogsEnabled, &ds.Lon [...]
if err != nil {
if err, ok := err.(*pq.Error); ok {
@@ -793,7 +793,7 @@ func readGetDeliveryServices(params map[string]string, db *sqlx.DB, user auth.Cu
for rows.Next() {
ds := tc.DeliveryServiceNullableV13{}
cdnDomain := ""
- err := rows.Scan(&ds.Active, &ds.CacheURL, &ds.CCRDNSTTL, &ds.CDNID, &ds.CDNName, &ds.CheckPath, &ds.DeepCachingType, &ds.DisplayName, &ds.DNSBypassCNAME, &ds.DNSBypassIP, &ds.DNSBypassIP6, &ds.DNSBypassTTL, &ds.DSCP, &ds.EdgeHeaderRewrite, &ds.GeoLimitRedirectURL, &ds.GeoLimit, &ds.GeoLimitCountries, &ds.GeoProvider, &ds.GlobalMaxMBPS, &ds.GlobalMaxTPS, &ds.FQPacingRate, &ds.HTTPBypassFQDN, &ds.ID, &ds.InfoURL, &ds.InitialDispersion, &ds.IPV6RoutingEnabled, &ds.LastUpdated, &ds.LogsEn [...]
+ err := rows.Scan(&ds.Active, &ds.AnonymousBlockingEnabled, &ds.CacheURL, &ds.CCRDNSTTL, &ds.CDNID, &ds.CDNName, &ds.CheckPath, &ds.DeepCachingType, &ds.DisplayName, &ds.DNSBypassCNAME, &ds.DNSBypassIP, &ds.DNSBypassIP6, &ds.DNSBypassTTL, &ds.DSCP, &ds.EdgeHeaderRewrite, &ds.GeoLimitRedirectURL, &ds.GeoLimit, &ds.GeoLimitCountries, &ds.GeoProvider, &ds.GlobalMaxMBPS, &ds.GlobalMaxTPS, &ds.FQPacingRate, &ds.HTTPBypassFQDN, &ds.ID, &ds.InfoURL, &ds.InitialDispersion, &ds.IPV6RoutingEnable [...]
if err != nil {
return nil, []error{fmt.Errorf("getting delivery services: %v", err)}, tc.SystemError
}
@@ -1105,6 +1105,7 @@ func selectQuery() string {
return `
SELECT
ds.active,
+ds.anonymous_blocking_enabled,
ds.cacheurl,
ds.ccr_dns_ttl,
ds.cdn_id,
@@ -1225,8 +1226,9 @@ tenant_id=$45,
tr_request_headers=$46,
tr_response_headers=$47,
type=$48,
-xml_id=$49
-WHERE id=$50
+xml_id=$49,
+anonymous_blocking_enabled=$50
+WHERE id=$51
RETURNING last_updated
`
}
@@ -1235,6 +1237,7 @@ func insertQuery() string {
return `
INSERT INTO deliveryservice (
active,
+anonymous_blocking_enabled,
cacheurl,
ccr_dns_ttl,
cdn_id,
@@ -1285,6 +1288,7 @@ type,
xml_id
)
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49)
+VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50)
RETURNING id, last_updated
`
}