[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity

2019-08-16 Thread GitBox
mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity
URL: https://github.com/apache/trafficcontrol/pull/2306#discussion_r314904736
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
 ##
 @@ -0,0 +1,325 @@
+package cdn
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+   "database/sql"
+   "encoding/json"
+   "errors"
+   "net/http"
+   "net/url"
+   "strconv"
+   "strings"
+   "time"
+
+   "github.com/apache/trafficcontrol/lib/go-tc"
+   "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+)
+
+func GetCapacity(w http.ResponseWriter, r *http.Request) {
+   inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+   if userErr != nil || sysErr != nil {
+   api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+   return
+   }
+   defer inf.Close()
+
+   api.RespWriter(w, r, inf.Tx.Tx)(getCapacity(inf.Tx.Tx))
+}
+
+const MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
+const MonitorRequestTimeout = time.Second * 10
+const MonitorOnlineStatus = "ONLINE"
+
+// CRStates contains the Monitor CRStates members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRStates struct {
+   Caches map[tc.CacheName]Available `json:"caches"`
+}
+
+type Available struct {
+   IsAvailable bool `json:"isAvailable"`
+}
+
+// CRConfig contains the Monitor CRConfig members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRConfig struct {
+   ContentServers map[tc.CacheName]CRConfigServer `json:"contentServers"`
+}
+
+type CRConfigServer struct {
+   CacheGroup tc.CacheGroupName `json:"locationId"`
+   Status tc.CacheStatus`json:"status"`
+   Type   tc.CacheType  `json:"type"`
+   Profilestring`json:"profile"`
+}
+
+func getCapacity(tx *sql.Tx) (CapacityResp, error) {
+   monitors, err := getCDNMonitorFQDNs(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting monitors: " + 
err.Error())
+   }
+   return getMonitorsCapacity(tx, monitors)
+}
+
+type CapacityResp struct {
+   AvailablePercent   float64 `json:"availablePercent"`
+   UnavailablePercent float64 `json:"unavailablePercent"`
+   UtilizedPercentfloat64 `json:utilizedPercent"`
+   MaintenancePercent float64 `json:maintenancePercent"`
+}
+
+type CapData struct {
+   Available   float64
+   Unavailable float64
+   Utilizedfloat64
+   Maintenance float64
+   Capacityfloat64
+}
+
+func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName]string) 
(CapacityResp, error) {
+   monitorForwardProxy, monitorForwardProxyExists, err := 
getGlobalParam(tx, MonitorProxyParameter)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting global monitor proxy 
parameter: " + err.Error())
+   }
+   client := &http.Client{Timeout: MonitorRequestTimeout}
+   if monitorForwardProxyExists {
+   proxyURI, err := url.Parse(monitorForwardProxy)
+   if err != nil {
+   return CapacityResp{}, errors.New("monitor forward 
proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + 
"' not a URI: " + err.Error())
+   }
+   client = &http.Client{Timeout: MonitorRequestTimeout, 
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
+   }
+
+   thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting profile thresholds: 
" + err.Error())
+   }
+
+   cap := CapData{}
+   for cdn, monitorFQDN := range monitors {
+   crStates, err := getCRStates(monitorFQDN, client)
+   // TODO on err, try another online monitor
+   if err != nil {
+   return CapacityResp{}, errors.New("getting CRStates for 
CDN '" + string(cdn) + "' monitor '" + monitorFQDN + "': " + err.Error())
+   

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity

2019-08-16 Thread GitBox
mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity
URL: https://github.com/apache/trafficcontrol/pull/2306#discussion_r314900152
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
 ##
 @@ -0,0 +1,325 @@
+package cdn
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+   "database/sql"
+   "encoding/json"
+   "errors"
+   "net/http"
+   "net/url"
+   "strconv"
+   "strings"
+   "time"
+
+   "github.com/apache/trafficcontrol/lib/go-tc"
+   "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+)
+
+func GetCapacity(w http.ResponseWriter, r *http.Request) {
+   inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+   if userErr != nil || sysErr != nil {
+   api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+   return
+   }
+   defer inf.Close()
+
+   api.RespWriter(w, r, inf.Tx.Tx)(getCapacity(inf.Tx.Tx))
+}
+
+const MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
+const MonitorRequestTimeout = time.Second * 10
+const MonitorOnlineStatus = "ONLINE"
+
+// CRStates contains the Monitor CRStates members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRStates struct {
+   Caches map[tc.CacheName]Available `json:"caches"`
+}
+
+type Available struct {
+   IsAvailable bool `json:"isAvailable"`
+}
+
+// CRConfig contains the Monitor CRConfig members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRConfig struct {
+   ContentServers map[tc.CacheName]CRConfigServer `json:"contentServers"`
+}
+
+type CRConfigServer struct {
+   CacheGroup tc.CacheGroupName `json:"locationId"`
+   Status tc.CacheStatus`json:"status"`
+   Type   tc.CacheType  `json:"type"`
+   Profilestring`json:"profile"`
+}
+
+func getCapacity(tx *sql.Tx) (CapacityResp, error) {
+   monitors, err := getCDNMonitorFQDNs(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting monitors: " + 
err.Error())
+   }
+   return getMonitorsCapacity(tx, monitors)
+}
+
+type CapacityResp struct {
+   AvailablePercent   float64 `json:"availablePercent"`
+   UnavailablePercent float64 `json:"unavailablePercent"`
+   UtilizedPercentfloat64 `json:utilizedPercent"`
+   MaintenancePercent float64 `json:maintenancePercent"`
+}
+
+type CapData struct {
+   Available   float64
+   Unavailable float64
+   Utilizedfloat64
+   Maintenance float64
+   Capacityfloat64
+}
+
+func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName]string) 
(CapacityResp, error) {
+   monitorForwardProxy, monitorForwardProxyExists, err := 
getGlobalParam(tx, MonitorProxyParameter)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting global monitor proxy 
parameter: " + err.Error())
+   }
+   client := &http.Client{Timeout: MonitorRequestTimeout}
+   if monitorForwardProxyExists {
+   proxyURI, err := url.Parse(monitorForwardProxy)
+   if err != nil {
+   return CapacityResp{}, errors.New("monitor forward 
proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + 
"' not a URI: " + err.Error())
+   }
+   client = &http.Client{Timeout: MonitorRequestTimeout, 
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
+   }
+
+   thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting profile thresholds: 
" + err.Error())
+   }
+
+   cap := CapData{}
+   for cdn, monitorFQDN := range monitors {
+   crStates, err := getCRStates(monitorFQDN, client)
+   // TODO on err, try another online monitor
+   if err != nil {
+   return CapacityResp{}, errors.New("getting CRStates for 
CDN '" + string(cdn) + "' monitor '" + monitorFQDN + "': " + err.Error())
+   

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity

2019-08-16 Thread GitBox
mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity
URL: https://github.com/apache/trafficcontrol/pull/2306#discussion_r314902536
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
 ##
 @@ -0,0 +1,325 @@
+package cdn
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+   "database/sql"
+   "encoding/json"
+   "errors"
+   "net/http"
+   "net/url"
+   "strconv"
+   "strings"
+   "time"
+
+   "github.com/apache/trafficcontrol/lib/go-tc"
+   "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+)
+
+func GetCapacity(w http.ResponseWriter, r *http.Request) {
+   inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+   if userErr != nil || sysErr != nil {
+   api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+   return
+   }
+   defer inf.Close()
+
+   api.RespWriter(w, r, inf.Tx.Tx)(getCapacity(inf.Tx.Tx))
+}
+
+const MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
+const MonitorRequestTimeout = time.Second * 10
+const MonitorOnlineStatus = "ONLINE"
+
+// CRStates contains the Monitor CRStates members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRStates struct {
+   Caches map[tc.CacheName]Available `json:"caches"`
+}
+
+type Available struct {
+   IsAvailable bool `json:"isAvailable"`
+}
+
+// CRConfig contains the Monitor CRConfig members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRConfig struct {
+   ContentServers map[tc.CacheName]CRConfigServer `json:"contentServers"`
+}
+
+type CRConfigServer struct {
+   CacheGroup tc.CacheGroupName `json:"locationId"`
+   Status tc.CacheStatus`json:"status"`
+   Type   tc.CacheType  `json:"type"`
+   Profilestring`json:"profile"`
+}
+
+func getCapacity(tx *sql.Tx) (CapacityResp, error) {
+   monitors, err := getCDNMonitorFQDNs(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting monitors: " + 
err.Error())
+   }
+   return getMonitorsCapacity(tx, monitors)
+}
+
+type CapacityResp struct {
+   AvailablePercent   float64 `json:"availablePercent"`
+   UnavailablePercent float64 `json:"unavailablePercent"`
+   UtilizedPercentfloat64 `json:utilizedPercent"`
+   MaintenancePercent float64 `json:maintenancePercent"`
+}
+
+type CapData struct {
+   Available   float64
+   Unavailable float64
+   Utilizedfloat64
+   Maintenance float64
+   Capacityfloat64
+}
+
+func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName]string) 
(CapacityResp, error) {
+   monitorForwardProxy, monitorForwardProxyExists, err := 
getGlobalParam(tx, MonitorProxyParameter)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting global monitor proxy 
parameter: " + err.Error())
+   }
+   client := &http.Client{Timeout: MonitorRequestTimeout}
+   if monitorForwardProxyExists {
+   proxyURI, err := url.Parse(monitorForwardProxy)
+   if err != nil {
+   return CapacityResp{}, errors.New("monitor forward 
proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + 
"' not a URI: " + err.Error())
+   }
+   client = &http.Client{Timeout: MonitorRequestTimeout, 
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
+   }
+
+   thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting profile thresholds: 
" + err.Error())
+   }
+
+   cap := CapData{}
+   for cdn, monitorFQDN := range monitors {
+   crStates, err := getCRStates(monitorFQDN, client)
+   // TODO on err, try another online monitor
 
 Review comment:
   you are looping thru all the ONLINE monitors, right? if there's an error 
can't you just skip that monitor rather than `TODO on err, try another online 
monitor` which will happen o

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity

2019-08-16 Thread GitBox
mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity
URL: https://github.com/apache/trafficcontrol/pull/2306#discussion_r314902596
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
 ##
 @@ -0,0 +1,325 @@
+package cdn
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+   "database/sql"
+   "encoding/json"
+   "errors"
+   "net/http"
+   "net/url"
+   "strconv"
+   "strings"
+   "time"
+
+   "github.com/apache/trafficcontrol/lib/go-tc"
+   "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+)
+
+func GetCapacity(w http.ResponseWriter, r *http.Request) {
+   inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+   if userErr != nil || sysErr != nil {
+   api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+   return
+   }
+   defer inf.Close()
+
+   api.RespWriter(w, r, inf.Tx.Tx)(getCapacity(inf.Tx.Tx))
+}
+
+const MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
+const MonitorRequestTimeout = time.Second * 10
+const MonitorOnlineStatus = "ONLINE"
+
+// CRStates contains the Monitor CRStates members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRStates struct {
+   Caches map[tc.CacheName]Available `json:"caches"`
+}
+
+type Available struct {
+   IsAvailable bool `json:"isAvailable"`
+}
+
+// CRConfig contains the Monitor CRConfig members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRConfig struct {
+   ContentServers map[tc.CacheName]CRConfigServer `json:"contentServers"`
+}
+
+type CRConfigServer struct {
+   CacheGroup tc.CacheGroupName `json:"locationId"`
+   Status tc.CacheStatus`json:"status"`
+   Type   tc.CacheType  `json:"type"`
+   Profilestring`json:"profile"`
+}
+
+func getCapacity(tx *sql.Tx) (CapacityResp, error) {
+   monitors, err := getCDNMonitorFQDNs(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting monitors: " + 
err.Error())
+   }
+   return getMonitorsCapacity(tx, monitors)
+}
+
+type CapacityResp struct {
+   AvailablePercent   float64 `json:"availablePercent"`
+   UnavailablePercent float64 `json:"unavailablePercent"`
+   UtilizedPercentfloat64 `json:utilizedPercent"`
+   MaintenancePercent float64 `json:maintenancePercent"`
+}
+
+type CapData struct {
+   Available   float64
+   Unavailable float64
+   Utilizedfloat64
+   Maintenance float64
+   Capacityfloat64
+}
+
+func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName]string) 
(CapacityResp, error) {
+   monitorForwardProxy, monitorForwardProxyExists, err := 
getGlobalParam(tx, MonitorProxyParameter)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting global monitor proxy 
parameter: " + err.Error())
+   }
+   client := &http.Client{Timeout: MonitorRequestTimeout}
+   if monitorForwardProxyExists {
+   proxyURI, err := url.Parse(monitorForwardProxy)
+   if err != nil {
+   return CapacityResp{}, errors.New("monitor forward 
proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + 
"' not a URI: " + err.Error())
+   }
+   client = &http.Client{Timeout: MonitorRequestTimeout, 
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
+   }
+
+   thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting profile thresholds: 
" + err.Error())
+   }
+
+   cap := CapData{}
+   for cdn, monitorFQDN := range monitors {
+   crStates, err := getCRStates(monitorFQDN, client)
+   // TODO on err, try another online monitor
 
 Review comment:
   so i guess what i'm saying is can you get rid of these todo comments?


This is an automated message from the Apache 

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity

2019-08-16 Thread GitBox
mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity
URL: https://github.com/apache/trafficcontrol/pull/2306#discussion_r314895317
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
 ##
 @@ -0,0 +1,325 @@
+package cdn
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+   "database/sql"
+   "encoding/json"
+   "errors"
+   "net/http"
+   "net/url"
+   "strconv"
+   "strings"
+   "time"
+
+   "github.com/apache/trafficcontrol/lib/go-tc"
+   "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+)
+
+func GetCapacity(w http.ResponseWriter, r *http.Request) {
+   inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+   if userErr != nil || sysErr != nil {
+   api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+   return
+   }
+   defer inf.Close()
+
+   api.RespWriter(w, r, inf.Tx.Tx)(getCapacity(inf.Tx.Tx))
+}
+
+const MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
+const MonitorRequestTimeout = time.Second * 10
+const MonitorOnlineStatus = "ONLINE"
+
+// CRStates contains the Monitor CRStates members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRStates struct {
+   Caches map[tc.CacheName]Available `json:"caches"`
+}
+
+type Available struct {
+   IsAvailable bool `json:"isAvailable"`
+}
+
+// CRConfig contains the Monitor CRConfig members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRConfig struct {
+   ContentServers map[tc.CacheName]CRConfigServer `json:"contentServers"`
+}
+
+type CRConfigServer struct {
+   CacheGroup tc.CacheGroupName `json:"locationId"`
+   Status tc.CacheStatus`json:"status"`
+   Type   tc.CacheType  `json:"type"`
+   Profilestring`json:"profile"`
+}
+
+func getCapacity(tx *sql.Tx) (CapacityResp, error) {
+   monitors, err := getCDNMonitorFQDNs(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting monitors: " + 
err.Error())
+   }
+   return getMonitorsCapacity(tx, monitors)
+}
+
+type CapacityResp struct {
+   AvailablePercent   float64 `json:"availablePercent"`
+   UnavailablePercent float64 `json:"unavailablePercent"`
+   UtilizedPercentfloat64 `json:utilizedPercent"`
+   MaintenancePercent float64 `json:maintenancePercent"`
+}
+
+type CapData struct {
+   Available   float64
+   Unavailable float64
+   Utilizedfloat64
+   Maintenance float64
+   Capacityfloat64
+}
+
+func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName]string) 
(CapacityResp, error) {
+   monitorForwardProxy, monitorForwardProxyExists, err := 
getGlobalParam(tx, MonitorProxyParameter)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting global monitor proxy 
parameter: " + err.Error())
+   }
+   client := &http.Client{Timeout: MonitorRequestTimeout}
+   if monitorForwardProxyExists {
+   proxyURI, err := url.Parse(monitorForwardProxy)
+   if err != nil {
+   return CapacityResp{}, errors.New("monitor forward 
proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + 
"' not a URI: " + err.Error())
+   }
+   client = &http.Client{Timeout: MonitorRequestTimeout, 
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
+   }
+
+   thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting profile thresholds: 
" + err.Error())
+   }
+
+   cap := CapData{}
+   for cdn, monitorFQDN := range monitors {
+   crStates, err := getCRStates(monitorFQDN, client)
+   // TODO on err, try another online monitor
+   if err != nil {
+   return CapacityResp{}, errors.New("getting CRStates for 
CDN '" + string(cdn) + "' monitor '" + monitorFQDN + "': " + err.Error())
+   

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity

2019-08-16 Thread GitBox
mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity
URL: https://github.com/apache/trafficcontrol/pull/2306#discussion_r314894104
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
 ##
 @@ -0,0 +1,325 @@
+package cdn
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+   "database/sql"
+   "encoding/json"
+   "errors"
+   "net/http"
+   "net/url"
+   "strconv"
+   "strings"
+   "time"
+
+   "github.com/apache/trafficcontrol/lib/go-tc"
+   "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+)
+
+func GetCapacity(w http.ResponseWriter, r *http.Request) {
+   inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+   if userErr != nil || sysErr != nil {
+   api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+   return
+   }
+   defer inf.Close()
+
+   api.RespWriter(w, r, inf.Tx.Tx)(getCapacity(inf.Tx.Tx))
+}
+
+const MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
+const MonitorRequestTimeout = time.Second * 10
+const MonitorOnlineStatus = "ONLINE"
+
+// CRStates contains the Monitor CRStates members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRStates struct {
+   Caches map[tc.CacheName]Available `json:"caches"`
+}
+
+type Available struct {
+   IsAvailable bool `json:"isAvailable"`
+}
+
+// CRConfig contains the Monitor CRConfig members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRConfig struct {
+   ContentServers map[tc.CacheName]CRConfigServer `json:"contentServers"`
+}
+
+type CRConfigServer struct {
+   CacheGroup tc.CacheGroupName `json:"locationId"`
+   Status tc.CacheStatus`json:"status"`
+   Type   tc.CacheType  `json:"type"`
+   Profilestring`json:"profile"`
+}
+
+func getCapacity(tx *sql.Tx) (CapacityResp, error) {
+   monitors, err := getCDNMonitorFQDNs(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting monitors: " + 
err.Error())
+   }
+   return getMonitorsCapacity(tx, monitors)
+}
+
+type CapacityResp struct {
+   AvailablePercent   float64 `json:"availablePercent"`
+   UnavailablePercent float64 `json:"unavailablePercent"`
+   UtilizedPercentfloat64 `json:utilizedPercent"`
+   MaintenancePercent float64 `json:maintenancePercent"`
+}
+
+type CapData struct {
+   Available   float64
+   Unavailable float64
+   Utilizedfloat64
+   Maintenance float64
+   Capacityfloat64
+}
+
+func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName]string) 
(CapacityResp, error) {
+   monitorForwardProxy, monitorForwardProxyExists, err := 
getGlobalParam(tx, MonitorProxyParameter)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting global monitor proxy 
parameter: " + err.Error())
+   }
+   client := &http.Client{Timeout: MonitorRequestTimeout}
+   if monitorForwardProxyExists {
+   proxyURI, err := url.Parse(monitorForwardProxy)
+   if err != nil {
+   return CapacityResp{}, errors.New("monitor forward 
proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + 
"' not a URI: " + err.Error())
+   }
+   client = &http.Client{Timeout: MonitorRequestTimeout, 
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
+   }
+
+   thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting profile thresholds: 
" + err.Error())
+   }
+
+   cap := CapData{}
+   for cdn, monitorFQDN := range monitors {
+   crStates, err := getCRStates(monitorFQDN, client)
+   // TODO on err, try another online monitor
+   if err != nil {
+   return CapacityResp{}, errors.New("getting CRStates for 
CDN '" + string(cdn) + "' monitor '" + monitorFQDN + "': " + err.Error())
+   

[GitHub] [trafficcontrol] mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity

2019-08-16 Thread GitBox
mitchell852 commented on a change in pull request #2306: Add TO Go cdns/capacity
URL: https://github.com/apache/trafficcontrol/pull/2306#discussion_r314894718
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
 ##
 @@ -0,0 +1,325 @@
+package cdn
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import (
+   "database/sql"
+   "encoding/json"
+   "errors"
+   "net/http"
+   "net/url"
+   "strconv"
+   "strings"
+   "time"
+
+   "github.com/apache/trafficcontrol/lib/go-tc"
+   "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
+)
+
+func GetCapacity(w http.ResponseWriter, r *http.Request) {
+   inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+   if userErr != nil || sysErr != nil {
+   api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)
+   return
+   }
+   defer inf.Close()
+
+   api.RespWriter(w, r, inf.Tx.Tx)(getCapacity(inf.Tx.Tx))
+}
+
+const MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
+const MonitorRequestTimeout = time.Second * 10
+const MonitorOnlineStatus = "ONLINE"
+
+// CRStates contains the Monitor CRStates members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRStates struct {
+   Caches map[tc.CacheName]Available `json:"caches"`
+}
+
+type Available struct {
+   IsAvailable bool `json:"isAvailable"`
+}
+
+// CRConfig contains the Monitor CRConfig members needed for health. It is NOT 
the full object served by the Monitor, but only the data required by this 
endpoint.
+type CRConfig struct {
+   ContentServers map[tc.CacheName]CRConfigServer `json:"contentServers"`
+}
+
+type CRConfigServer struct {
+   CacheGroup tc.CacheGroupName `json:"locationId"`
+   Status tc.CacheStatus`json:"status"`
+   Type   tc.CacheType  `json:"type"`
+   Profilestring`json:"profile"`
+}
+
+func getCapacity(tx *sql.Tx) (CapacityResp, error) {
+   monitors, err := getCDNMonitorFQDNs(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting monitors: " + 
err.Error())
+   }
+   return getMonitorsCapacity(tx, monitors)
+}
+
+type CapacityResp struct {
+   AvailablePercent   float64 `json:"availablePercent"`
+   UnavailablePercent float64 `json:"unavailablePercent"`
+   UtilizedPercentfloat64 `json:utilizedPercent"`
+   MaintenancePercent float64 `json:maintenancePercent"`
+}
+
+type CapData struct {
+   Available   float64
+   Unavailable float64
+   Utilizedfloat64
+   Maintenance float64
+   Capacityfloat64
+}
+
+func getMonitorsCapacity(tx *sql.Tx, monitors map[tc.CDNName]string) 
(CapacityResp, error) {
+   monitorForwardProxy, monitorForwardProxyExists, err := 
getGlobalParam(tx, MonitorProxyParameter)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting global monitor proxy 
parameter: " + err.Error())
+   }
+   client := &http.Client{Timeout: MonitorRequestTimeout}
+   if monitorForwardProxyExists {
+   proxyURI, err := url.Parse(monitorForwardProxy)
+   if err != nil {
+   return CapacityResp{}, errors.New("monitor forward 
proxy '" + monitorForwardProxy + "' in parameter '" + MonitorProxyParameter + 
"' not a URI: " + err.Error())
+   }
+   client = &http.Client{Timeout: MonitorRequestTimeout, 
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURI)}}
+   }
+
+   thresholds, err := getEdgeProfileHealthThresholdBandwidth(tx)
+   if err != nil {
+   return CapacityResp{}, errors.New("getting profile thresholds: 
" + err.Error())
+   }
+
+   cap := CapData{}
+   for cdn, monitorFQDN := range monitors {
+   crStates, err := getCRStates(monitorFQDN, client)
+   // TODO on err, try another online monitor
+   if err != nil {
+   return CapacityResp{}, errors.New("getting CRStates for 
CDN '" + string(cdn) + "' monitor '" + monitorFQDN + "': " + err.Error())
+   

[GitHub] [trafficcontrol] asfgit commented on issue #3875: Add TO Go ATS CDN configs

2019-08-16 Thread GitBox
asfgit commented on issue #3875: Add TO Go ATS CDN configs
URL: https://github.com/apache/trafficcontrol/pull/3875#issuecomment-522152688
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/4165/
   Test PASSed.
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] asfgit commented on issue #2459: Add TO Go deliveryservices/id/capacity

2019-08-16 Thread GitBox
asfgit commented on issue #2459: Add TO Go deliveryservices/id/capacity
URL: https://github.com/apache/trafficcontrol/pull/2459#issuecomment-522146685
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/4164/
   Test PASSed.
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] asfgit commented on issue #2305: Add TO Go cdns/health

2019-08-16 Thread GitBox
asfgit commented on issue #2305: Add TO Go cdns/health
URL: https://github.com/apache/trafficcontrol/pull/2305#issuecomment-522131004
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/4163/
   Test PASSed.
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] asfgit commented on issue #3761: Improvements to Server-to-Delivery Service assignments

2019-08-16 Thread GitBox
asfgit commented on issue #3761: Improvements to Server-to-Delivery Service 
assignments
URL: https://github.com/apache/trafficcontrol/pull/3761#issuecomment-522109936
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/4162/
   Test PASSed.
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


Jenkins build is back to normal : trafficcontrol-master-build #1466

2019-08-16 Thread Apache Jenkins Server
See 




[GitHub] [trafficcontrol] asfgit commented on issue #3879: Doc fixes

2019-08-16 Thread GitBox
asfgit commented on issue #3879: Doc fixes
URL: https://github.com/apache/trafficcontrol/pull/3879#issuecomment-522079291
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/4161/
   Test PASSed.
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


Build failed in Jenkins: trafficcontrol-3.1.x-rat #5

2019-08-16 Thread Apache Jenkins Server
See 

--
Started by upstream project "trafficcontrol-3.1.x-build" build number 5
originally caused by:
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
 Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H48 (ubuntu bionic) in workspace 

[trafficcontrol-3.1.x-rat] $ /bin/bash -xe /tmp/jenkins2677737804554464372.sh
+ rm -rf 

  
'
Copied 2 artifacts from "trafficcontrol-3.1.x-build" build number 4
[trafficcontrol-3.1.x-rat] $ /bin/bash -xe /tmp/jenkins6947260801459334560.sh
+ set -exu
++ ls dist/apache-trafficcontrol-3.0.1-docs.tar.gz 
dist/apache-trafficcontrol-3.0.1.tar.gz
++ grep -v docs
+ tarball=dist/apache-trafficcontrol-3.0.1.tar.gz
+ tar xzf dist/apache-trafficcontrol-3.0.1.tar.gz
++ pwd
++ basename dist/apache-trafficcontrol-3.0.1.tar.gz .tar.gz
+ 
tcdir=
+ cd 

++ date +%Y
+ egrep 'Copyright .*-?2019 The Apache Software Foundation' NOTICE
Copyright 2016-2019 The Apache Software Foundation
+ set +x
Searching for class files:
PASSED: No class files found.
Searching for jar files:
PASSED: No jar files found.
Searching for tar files:
PASSED: No tar files found.
Searching for tgz files:
PASSED: No tgz files found.
Searching for zip files:
PASSED: No zip files found.
++ curl 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.14-SNAPSHOT/
 -sN
++ grep jar
++ grep -ve md5 -e sha1
++ awk -F '"' '{print $2}'
++ sort -r
++ head -n 1
++ cut -d / -f 12
+ ratver=apache-rat-0.14-20190624.185047-40.jar
++ mktemp -d
+ ratdir=/tmp/user/910/tmp.A0iLQBixvK
+ ratjar=/tmp/user/910/tmp.A0iLQBixvK/apache-rat-0.14.SNAPSHOT.jar
+ curl -L -o /tmp/user/910/tmp.A0iLQBixvK/apache-rat-0.14.SNAPSHOT.jar 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.14-SNAPSHOT/apache-rat-0.14-20190624.185047-40.jar
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
0 1971k0 156650 0  41662  0  0:00:48 --:--:--  0:00:48 41662100 
1971k  100 1971k0 0  2495k  0 --:--:-- --:--:-- --:--:-- 2492k
+ curl -L -o /tmp/user/910/tmp.A0iLQBixvK/apache-rat-0.14.SNAPSHOT.jar.sha1 
https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.14-SNAPSHOT/apache-rat-0.14-20190624.185047-40.jar.sha1
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 
010040  100400 0129  0 --:--:-- --:--:-- --:--:--   129
++ sha1sum /tmp/user/910/tmp.A0iLQBixvK/apache-rat-0.14.SNAPSHOT.jar
++ awk '{print $1}'
++ cat /tmp/user/910/tmp.A0iLQBixvK/apache-rat-0.14.SNAPSHOT.jar.sha1
+ [[ af14e5fa1d66ff915f592a4f212b42ceb0f758d2 == 
af14e5fa1d66ff915f592a4f212b42ceb0f758d2 ]]
++ pwd
++ pwd
+ java -jar /tmp/user/910/tmp.A0iLQBixvK/apache-rat-0.14.SNAPSHOT.jar -E 

 -d 

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version 
number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at 

[GitHub] [trafficcontrol] ocket8888 opened a new pull request #3879: Doc fixes

2019-08-16 Thread GitBox
ocket opened a new pull request #3879: Doc fixes
URL: https://github.com/apache/trafficcontrol/pull/3879
 
 
   ## What does this PR (Pull Request) do?
   
   - [x] This PR fixes #3878
   
   Fixes inaccuracies, compilation errors in documentation
   
   ## Which Traffic Control components are affected by this PR?
   - Documentation
   
   ## What is the best way to verify this PR?
   Build and read the docs
   
   ## The following criteria are ALL met by this PR
   
   - [x] Tests are unnecessary
   - [x] This PR includes documentation
   - [x] An update to CHANGELOG.md is not necessary
   - x ] This PR includes any and all required license headers
   - [x] This PR does not include a database migration
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] rawlinp commented on issue #3430: Traffic Portal: Doesn't allow wildcard DNS static entries

2019-08-16 Thread GitBox
rawlinp commented on issue #3430: Traffic Portal: Doesn't allow wildcard DNS 
static entries
URL: https://github.com/apache/trafficcontrol/issues/3430#issuecomment-522062301
 
 
   Interesting. The library we're currently using to validate DNS names does 
not support wildcard names (unless it has been updated since we vendored it). 
We could check for and remove the `*.` prefix if found then pass the rest to 
the validator. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


Build failed in Jenkins: trafficcontrol-3.1.x-build #5

2019-08-16 Thread Apache Jenkins Server
See 


Changes:

[mrdgelinas] Fix TM nil panic in CRConfig validation (#3877)

[github] Update VERSION

--
[...truncated 3.69 MB...]
traffic_portal_build_1   | | | +-- extsprintf@1.3.0 
traffic_portal_build_1   | | | +-- json-schema@0.2.3 
traffic_portal_build_1   | | | `-- verror@1.10.0 
traffic_portal_build_1   | | `-- sshpk@1.16.1 
traffic_portal_build_1   | |   +-- asn1@0.2.4 
traffic_portal_build_1   | |   +-- bcrypt-pbkdf@1.0.2 
traffic_portal_build_1   | |   +-- dashdash@1.14.1 
traffic_portal_build_1   | |   +-- ecc-jsbn@0.1.2 
traffic_portal_build_1   | |   +-- getpass@0.1.7 
traffic_portal_build_1   | |   +-- jsbn@0.1.1 
traffic_portal_build_1   | |   +-- safer-buffer@2.1.2 
traffic_portal_build_1   | |   `-- tweetnacl@0.14.5 
traffic_portal_build_1   | +-- is-typedarray@1.0.0 
traffic_portal_build_1   | +-- json-stringify-safe@5.0.1 
traffic_portal_build_1   | +-- oauth-sign@0.9.0 
traffic_portal_build_1   | +-- performance-now@2.1.0 
traffic_portal_build_1   | +-- qs@6.5.2 
traffic_portal_build_1   | +-- safe-buffer@5.1.2 
traffic_portal_build_1   | +-- tough-cookie@2.4.3 
traffic_portal_build_1   | | +-- psl@1.3.0 
traffic_portal_build_1   | | `-- punycode@1.4.1 
traffic_portal_build_1   | +-- tunnel-agent@0.6.0 
traffic_portal_build_1   | `-- uuid@3.3.2 
traffic_portal_build_1   | 
traffic_portal_build_1   | npm WARN optional SKIPPING OPTIONAL 
DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
traffic_portal_build_1   | npm WARN notsup SKIPPING OPTIONAL 
DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted 
{"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
traffic_portal_build_1   | npm WARN traffic_portal@ No description
traffic_portal_build_1   | npm WARN traffic_portal@ No repository 
field.
traffic_portal_build_1   | npm WARN traffic_portal@ No license field.
traffic_portal_build_1   | 
traffic_portal_build_1   | Done, without errors.
traffic_portal_build_1   | 
traffic_portal_build_1   | 
traffic_portal_build_1   | Execution Time (2019-08-16 15:48:13 UTC)
traffic_portal_build_1   | loading tasks  1.4s  ▇▇ 
4%
traffic_portal_build_1   | compass:prod   9.8s  
▇▇▇▇▇▇▇▇▇ 25%
traffic_portal_build_1   | browserify2:app-prod   2.3s  ▇▇ 
6%
traffic_portal_build_1   | browserify2:shared-libs-prod   3.4s  
▇▇▇ 9%
traffic_portal_build_1   | install-dependencies  21.3s  
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 55%
traffic_portal_build_1   | Total 38.5s
traffic_portal_build_1   | 
traffic_portal_build_1   | + exit 0
traffic_portal_build_1   | Executing(%install): /bin/sh -e 
/var/tmp/rpm-tmp.1UcxoU
traffic_portal_build_1   | + umask 022
traffic_portal_build_1   | + cd /tmp/trafficcontrol/rpmbuild/BUILD
traffic_portal_build_1   | + '[' 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64
 '!=' / ']'
traffic_portal_build_1   | + rm -rf 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64
traffic_portal_build_1   | ++ dirname 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64
traffic_portal_build_1   | + mkdir -p 
/tmp/trafficcontrol/rpmbuild/BUILDROOT
traffic_portal_build_1   | + mkdir 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64
traffic_portal_build_1   | + cd traffic_portal-3.1.0
traffic_portal_build_1   | + /usr/bin/mkdir -p 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64/etc/init.d
traffic_portal_build_1   | + /usr/bin/mkdir -p 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64/etc/logrotate.d
traffic_portal_build_1   | + /usr/bin/mkdir -p 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64/etc/traffic_portal
traffic_portal_build_1   | + /usr/bin/mkdir -p 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64/opt/traffic_portal/public
traffic_portal_build_1   | + /usr/bin/mkdir -p 
/tmp/trafficcontrol/rpmbuild/BUILDROOT/traffic_portal-3.1.0-9618.e09b9ada.el7.x86_64/opt/traffic_portal/server
traffic_portal_build_1   | + /usr/bin/mkdir -p 
/tmp/trafficc

[GitHub] [trafficcontrol] ocket8888 opened a new issue #3878: Docs build broken

2019-08-16 Thread GitBox
ocket opened a new issue #3878: Docs build broken
URL: https://github.com/apache/trafficcontrol/issues/3878
 
 
   ## I'm submitting a ...
   - bug report
   
   ## Traffic Control components affected ...
   - [ ] Documentation
   
   ## Current behavior:
   PR #3740 introduced numerous bugs, some of which are factual inaccuracies 
while others are actually partially preventing compilation.
   
   ## Expected / new behavior:
   The docs should be accurate and compile properly
   
   ## Minimal reproduction of the problem with instructions:
   Try to build and read the docs


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] ocket8888 merged pull request #3740: Update docs for orderby, sortOrder, limit, offset & page TO query params

2019-08-16 Thread GitBox
ocket merged pull request #3740: Update docs for orderby, sortOrder, limit, 
offset & page TO query params
URL: https://github.com/apache/trafficcontrol/pull/3740
 
 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] asfgit commented on issue #3877: Fix TM nil panic in CRConfig validation

2019-08-16 Thread GitBox
asfgit commented on issue #3877: Fix TM nil panic in CRConfig validation
URL: https://github.com/apache/trafficcontrol/pull/3877#issuecomment-522053377
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/trafficcontrol-PR/4160/
   Test PASSed.
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] dg4prez merged pull request #3877: Fix TM nil panic in CRConfig validation

2019-08-16 Thread GitBox
dg4prez merged pull request #3877: Fix TM nil panic in CRConfig validation
URL: https://github.com/apache/trafficcontrol/pull/3877
 
 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] hbeatty opened a new pull request #3877: Fix TM nil panic in CRConfig validation

2019-08-16 Thread GitBox
hbeatty opened a new pull request #3877: Fix TM nil panic in CRConfig validation
URL: https://github.com/apache/trafficcontrol/pull/3877
 
 
   (cherry picked from commit 4d86b1d10ecb32c5d52e1feddcb512d74aab208c)
   
   This fixes a bug where TM crashes when PostgreSQL is unavailable
   Updated Changelog
   
   This was done on behalf of @smalenfant 
   
   ## What does this PR (Pull Request) do?
   
   - This PR fixes a bug where TM crashes when PostgreSQL is unavailable
   
   ## Which Traffic Control components are affected by this PR?
   
   - Traffic Monitor
   
   ## What is the best way to verify this PR?
   
   Install and configure this version of TM, stop PostgreSQL and verify this 
version of TM didn't crash
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   
   3.0
   
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] hbeatty closed pull request #3876: Fix TM nil panic in CRConfig validation

2019-08-16 Thread GitBox
hbeatty closed pull request #3876: Fix TM nil panic in CRConfig validation
URL: https://github.com/apache/trafficcontrol/pull/3876
 
 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] hbeatty opened a new pull request #3876: Fix TM nil panic in CRConfig validation

2019-08-16 Thread GitBox
hbeatty opened a new pull request #3876: Fix TM nil panic in CRConfig validation
URL: https://github.com/apache/trafficcontrol/pull/3876
 
 
   (cherry picked from commit 4d86b1d10ecb32c5d52e1feddcb512d74aab208c)
   
   
   ## What does this PR (Pull Request) do?
   
   
   - The PR fixes a bug where TM crashes when PostgreSQL is not available.
   
   
   ## Which Traffic Control components are affected by this PR?
   
   
   - Traffic Monitor
   
   ## What is the best way to verify this PR?
   
   
   Install and configure this version of TM, stop PostgreSQL and see if this 
version of TM crashes. The 3.0 version of TM does.
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   
   * 3.0
   
   
   ## The following criteria are ALL met by this PR
   
   
   - [ ] This PR includes tests OR I have explained why tests are unnecessary
   - [ ] This PR includes documentation OR I have explained why documentation 
is unnecessary
   - [ ] This PR includes an update to CHANGELOG.md OR such an update is not 
necessary
   - [ ] This PR includes any and all required license headers
   - [ ] This PR ensures that database migration sequence is correct OR this PR 
does not include a database migration
   - [ ] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the 
Apache Software Foundation's security 
guidelines](https://www.apache.org/security/) for 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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] smalenfant commented on issue #3430: Traffic Portal: Doesn't allow wildcard DNS static entries

2019-08-16 Thread GitBox
smalenfant commented on issue #3430: Traffic Portal: Doesn't allow wildcard DNS 
static entries
URL: https://github.com/apache/trafficcontrol/issues/3430#issuecomment-521996430
 
 
   @rawlinp We use wildcard DNS to route any entries from a delivery services 
to a single A record. This is standard practice in the industry.  This goes 
hand in hand with wildcard certificate. Looks like Traffic Router doesn't allow 
a wildcard CNAME (which would be useful in some use cases). We use CNAME 
records to remap prefixes (ex. ccr, tr) on HTTP delivery services. 
   
   We mostly support only Traffic Server (astats) with Traffic Monitor to offer 
GSLB services on our CDN. I'm also using Traffic Router to load balance 
HAProxy/NGINX for some services in a static fashion at this time.


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:
us...@infra.apache.org


With regards,
Apache Git Services