[GitHub] RSK14 opened a new issue #1904: OPS Issue

2018-02-22 Thread GitBox
RSK14 opened a new issue #1904: OPS Issue
URL: https://github.com/apache/incubator-trafficcontrol/issues/1904
 
 
   Dear Team,
   
   Unable to install Traffic ops 2.1 version (CentOS Linux release 7.4.1708 
(Core) )
   
   RPM: traffic_ops-2.1.0-6807.1dcd512f.el7.x86_64.rpm -- i installed  this rpm.
   
   i getting below error.Could you please tell me how to fix this issue. 
   
   Thu Feb 22 07:00:47 2018: WARN Log file '/var/log/traffic_ops/cpan.log' does 
not exist - not rotating log
   Thu Feb 22 07:00:47 2018: INFO No input file given - using defaults
   Thu Feb 22 07:00:48 2018: ERROR Failed to install Traffic Ops Web 
dependencies, check the console output and rerun postinstall once you've 
resolved the error
   Thu Feb 22 07:03:22 2018: INFO Starting postinstall
   Thu Feb 22 07:03:22 2018: INFO Debug is on
   Thu Feb 22 07:03:22 2018: WARN Log file '/var/log/traffic_ops/cpan.log' does 
not exist - not rotating log
   Thu Feb 22 07:03:22 2018: INFO No input file given - using defaults
   Thu Feb 22 07:03:22 2018: ERROR Failed to install Traffic Ops Web 
dependencies, check the console output and rerun postinstall once you've 
resolved the error
   
   
   Successfully installed goose to /opt/traffic_ops/go/bin/goose
   unzipping log
   Starting postinstall
   Debug is on
   Log file '/var/log/traffic_ops/cpan.log' does not exist - not rotating log
   No input file given - using defaults
   Got HTTP 200 response for 
'https://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js'
   Failed to install Traffic Ops Web dependencies, check the console output and 
rerun postinstall once you've resolved the error
   Died at /opt/traffic_ops/install/lib/InstallUtils.pm line 62.
   
   Thanks 
   
   Satheesh R
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] elsloo commented on a change in pull request #1866: Added maxmind.default.override parameter to CRConfig to handle maxmind default locations

2018-02-22 Thread GitBox
elsloo commented on a change in pull request #1866: Added 
maxmind.default.override parameter to CRConfig to handle maxmind default 
locations
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1866#discussion_r169983105
 
 

 ##
 File path: docs/source/admin/traffic_ops/configuration.rst
 ##
 @@ -158,6 +158,9 @@ Many of the settings for the different servers in a 
Traffic Control CDN are cont
 
+--+---+---+
 | geolocation6.polling.url | CRConfig.json | The location to get the IPv6 
GeoLiteCity database from.  
 |
 
+--+---+---+
+| maxmind.default.override | CRConfig.json | The destination geo coordinates 
to use for client location when maxmind returns a default location that matches 
the country code. |
 
 Review comment:
   Yes, this parameter can be specified multiple times with different values. 
The documentation should be updated to reflect that.
   
   @rivasj can you update the documentation to reflect this?


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1890: Updated /asns, /cdns and /divisions to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1890: Updated /asns, /cdns and /divisions to use the 
CRUD interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1890#issuecomment-367708396
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1082/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1890: Updated /asns, /cdns and /divisions to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1890: Updated /asns, /cdns and /divisions to use the 
CRUD interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1890#issuecomment-367709913
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1083/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1890: Updated /asns, /cdns and /divisions to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1890: Updated /asns, /cdns and /divisions to use the 
CRUD interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1890#issuecomment-367715046
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1084/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] rivasj commented on a change in pull request #1866: Added maxmind.default.override parameter to CRConfig to handle maxmind default locations

2018-02-22 Thread GitBox
rivasj commented on a change in pull request #1866: Added 
maxmind.default.override parameter to CRConfig to handle maxmind default 
locations
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1866#discussion_r169998655
 
 

 ##
 File path: docs/source/admin/traffic_ops/configuration.rst
 ##
 @@ -158,6 +158,9 @@ Many of the settings for the different servers in a 
Traffic Control CDN are cont
 
+--+---+---+
 | geolocation6.polling.url | CRConfig.json | The location to get the IPv6 
GeoLiteCity database from.  
 |
 
+--+---+---+
+| maxmind.default.override | CRConfig.json | The destination geo coordinates 
to use for client location when maxmind returns a default location that matches 
the country code. |
 
 Review comment:
   I've updated documentation to show support for multiple parameter values.


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] rivasj commented on a change in pull request #1866: Added maxmind.default.override parameter to CRConfig to handle maxmind default locations

2018-02-22 Thread GitBox
rivasj commented on a change in pull request #1866: Added 
maxmind.default.override parameter to CRConfig to handle maxmind default 
locations
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1866#discussion_r169998956
 
 

 ##
 File path: 
traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 ##
 @@ -86,6 +87,8 @@
private final ConsistentHasher consistentHasher = new 
ConsistentHasher();
private SteeringRegistry steeringRegistry;
 
+   private final Map defaultGeolocations = new 
HashMap();
 
 Review comment:
   I've renamed defaultGeolocations to defaultGeolocationsOverride


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] ashish-timilsina opened a new issue #1905: SSL Customer Cert Upload

2018-02-22 Thread GitBox
ashish-timilsina opened a new issue #1905: SSL Customer Cert Upload
URL: https://github.com/apache/incubator-trafficcontrol/issues/1905
 
 
   Allow CDN tenants to upload a custom cert to the CDN for application to 
their services.
   
   Customers that split traffic across multiple CDNs have to use their own FQDN 
and SSL cert. We need a process for them to securely upload their certs to us 
for storage and application against their services.
   
   We also need to capture the FQDN of the cert and make sure it is applied as 
a host regex for their service so that the CDN recognizes it. It's possible 
that it is already in place when they upload the cert, but this should be 
checked.


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] ashish-timilsina opened a new issue #1906: SSL Automate Standard Cert Generation and Application

2018-02-22 Thread GitBox
ashish-timilsina opened a new issue #1906: SSL Automate Standard Cert 
Generation and Application
URL: https://github.com/apache/incubator-trafficcontrol/issues/1906
 
 
   It currently takes 2-3 business days to generate and apply an SSL cert. This 
is a manual process for several departments which means it often gets slowed 
down due to hand offs. We would like to automate the SSL cert generation and 
application process.
   
   @mitchell852 
   @ryandurfey 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] elsloo closed pull request #1866: Added maxmind.default.override parameter to CRConfig to handle maxmind default locations

2018-02-22 Thread GitBox
elsloo closed pull request #1866: Added maxmind.default.override parameter to 
CRConfig to handle maxmind default locations
URL: https://github.com/apache/incubator-trafficcontrol/pull/1866
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/source/admin/traffic_ops/configuration.rst 
b/docs/source/admin/traffic_ops/configuration.rst
index 89bb726a37..c63a5ecaf9 100644
--- a/docs/source/admin/traffic_ops/configuration.rst
+++ b/docs/source/admin/traffic_ops/configuration.rst
@@ -158,6 +158,10 @@ Many of the settings for the different servers in a 
Traffic Control CDN are cont
 
+--+---+---+
 | geolocation6.polling.url | CRConfig.json | The location to get the IPv6 
GeoLiteCity database from.  
 |
 
+--+---+---+
+| maxmind.default.override | CRConfig.json | The destination geo coordinates 
to use for client location when maxmind returns a default location that matches 
the country code. |
+|  |   | This parameter can be specified 
multiple times with different values to support default overrides for multiple 
countries. |
+|  |   | Format: 
;,   Ex: US;37.751,-97.822  
  |
++--+---+---+
 
 These parameters should be set to reflect the local environment.
 
diff --git a/traffic_ops/app/lib/UI/Topology.pm 
b/traffic_ops/app/lib/UI/Topology.pm
index 93c176b7ca..72777f7e84 100644
--- a/traffic_ops/app/lib/UI/Topology.pm
+++ b/traffic_ops/app/lib/UI/Topology.pm
@@ -153,6 +153,19 @@ sub gen_crconfig_json {
 }
 $data_obj->{'config'}->{'requestHeaders'} = $headers;
 }
+elsif ( $param eq 'maxmind.default.override' ) {
+( my $country_code, my $coordinates ) = split( /\;/, 
$row->parameter->value );
+( my $lat, my $long ) = split( /\,/, $coordinates );
+my $geolocation = {
+'countryCode' => "$country_code",
+'lat' => $lat + 0,
+'long' => $long + 0
+};
+if ( !$data_obj->{'config'}->{'maxmindDefaultOverride'} ) {
+@{ $data_obj->{'config'}->{'maxmindDefaultOverride'} } = ();
+}
+push ( @{ $data_obj->{'config'}->{'maxmindDefaultOverride'} }, 
$geolocation );
+}
 elsif ( !exists $requested_param_names{$param} ) {
 $data_obj->{'config'}->{$param} = $row->parameter->value;
 }
@@ -668,11 +681,21 @@ sub crconfig_strings {
 foreach my $key ( sort keys %{ $config_json->{'config'}->{$cfg} } 
) {
 $string .= "|$key:" . $config_json->{'config'}->{$cfg}->{$key};
 }
+push( @config_strings, $string );
+}
+elsif ( $cfg eq 'maxmindDefaultOverride' ) {
+foreach my $element ( @{ $config_json->{'config'}->{$cfg} } ) {
+$string = "|param:$cfg";
+foreach my $key ( sort keys %{ $element } ) {
+$string .= "|$key:" . $element->{$key};
+}
+push( @config_strings, $string );
+}
 }
 else {
 $string = "|param:$cfg|value:" . $config_json->{'config'}->{$cfg} 
. "|";
+push( @config_strings, $string );
 }
-push( @config_strings, $string );
 }
 foreach my $rascal ( sort keys %{ $config_json->{'monitors'} } ) {
 my $return = &stringify_rascal( $config_json->{'monitors'}->{$rascal} 
);
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/MaxmindGeolocationService.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/MaxmindGeolocationService.java
index b9150d2db6..1acc63eb91 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/MaxmindGeolocationService.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/MaxmindGeolocationService.java
@@ -150,6 +150,10 @@ public Geolocation createGeolocation(final CityResponse 
response) {
   

[GitHub] dneuman64 opened a new issue #1907: Deterministic Cachegroup failover

2018-02-22 Thread GitBox
dneuman64 opened a new issue #1907: Deterministic Cachegroup failover
URL: https://github.com/apache/incubator-trafficcontrol/issues/1907
 
 
   Currently, if all caches in a cache group are unavailable Traffic Router 
will route clients to the next closest cache group. This works great for some 
networks but could cause problems in others. Traffic Control should provide the 
ability to configure which cache group to fail over to if a given cache group 
is unavailable. Ideally, this will be able to be configured in Traffic Ops.


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh commented on issue #1890: Updated /asns, /cdns and /divisions to use the CRUD interface

2018-02-22 Thread GitBox
dangogh commented on issue #1890: Updated /asns, /cdns and /divisions to use 
the CRUD interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1890#issuecomment-367746900
 
 
   tested all endpoints for compatibility with original Perl versions..


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh closed pull request #1890: Updated /asns, /cdns and /divisions to use the CRUD interface

2018-02-22 Thread GitBox
dangogh closed pull request #1890: Updated /asns, /cdns and /divisions to use 
the CRUD interface
URL: https://github.com/apache/incubator-trafficcontrol/pull/1890
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/client/asn.go b/traffic_ops/client/asn.go
new file mode 100644
index 00..fefeeae32a
--- /dev/null
+++ b/traffic_ops/client/asn.go
@@ -0,0 +1,132 @@
+/*
+
+   Licensed 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.
+*/
+
+package client
+
+import (
+   "encoding/json"
+   "fmt"
+   "net"
+   "net/http"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+)
+
+const (
+   API_v2_ASNs = "/api/1.3/asns"
+)
+
+// Create a ASN
+func (to *Session) CreateASN(entity tc.ASN) (tc.Alerts, ReqInf, error) {
+
+   var remoteAddr net.Addr
+   reqBody, err := json.Marshal(entity)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   resp, remoteAddr, err := to.request(http.MethodPost, API_v2_ASNs, 
reqBody)
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   defer resp.Body.Close()
+   var alerts tc.Alerts
+   err = json.NewDecoder(resp.Body).Decode(&alerts)
+   return alerts, reqInf, nil
+}
+
+// Update a ASN by ID
+func (to *Session) UpdateASNByID(id int, entity tc.ASN) (tc.Alerts, ReqInf, 
error) {
+
+   var remoteAddr net.Addr
+   reqBody, err := json.Marshal(entity)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   route := fmt.Sprintf("%s/%d", API_v2_ASNs, id)
+   resp, remoteAddr, err := to.request(http.MethodPut, route, reqBody)
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   defer resp.Body.Close()
+   var alerts tc.Alerts
+   err = json.NewDecoder(resp.Body).Decode(&alerts)
+   return alerts, reqInf, nil
+}
+
+// Returns a list of ASNs
+func (to *Session) GetASNs() ([]tc.ASN, ReqInf, error) {
+   resp, remoteAddr, err := to.request(http.MethodGet, API_v2_ASNs, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.ASNsResponse
+   err = json.NewDecoder(resp.Body).Decode(&data)
+   return data.Response, reqInf, nil
+}
+
+// GET a ASN by the id
+func (to *Session) GetASNByID(id int) ([]tc.ASN, ReqInf, error) {
+   route := fmt.Sprintf("%s/%d", API_v2_ASNs, id)
+   resp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.ASNsResponse
+   if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
+   return nil, reqInf, err
+   }
+
+   return data.Response, reqInf, nil
+}
+
+// GET an ASN by the asn number
+func (to *Session) GetASNByASN(asn int) ([]tc.ASN, ReqInf, error) {
+   url := fmt.Sprintf("%s?asn=%d", API_v2_ASNs, asn)
+   resp, remoteAddr, err := to.request(http.MethodGet, url, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.ASNsResponse
+   if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
+   return nil, reqInf, err
+   }
+
+   return data.Response, reqInf, nil
+}
+
+// DELETE an ASN by asn number
+func (to *Session) DeleteASNByASN(asn int) (tc.Alerts, ReqInf, error) {
+   route := fmt.Sprintf("%s/asn/%d", API_v2_ASNs, asn)
+   resp, remoteAddr, err := to.request(http.MethodDelete, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   defer resp.Body.Close()
+   var alerts

[GitHub] limited commented on issue #1907: Deterministic Cachegroup failover

2018-02-22 Thread GitBox
limited commented on issue #1907: Deterministic Cachegroup failover
URL: 
https://github.com/apache/incubator-trafficcontrol/issues/1907#issuecomment-367748136
 
 
   We just completed work on a feature very similar to this based on this old 
email thread:
   
https://lists.apache.org/thread.html/7ebadacc6d1f8cf9fd230910faa1950638c7bdbb1ff7007a540446eb@%3Cdev.trafficcontrol.apache.org%3E
   
   Our implementation places the backup policy in the CZF instead of the TO. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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 : incubator-trafficcontrol-traffic_ops-test #435

2018-02-22 Thread Apache Jenkins Server
See 




[GitHub] asfgit commented on issue #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1895: Updated /regions to use the CRUD interface 
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1895#issuecomment-367752315
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1085/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] Vijay-1 opened a new pull request #1908: Changes for Backup Edge Cache Group

2018-02-22 Thread GitBox
Vijay-1 opened a new pull request #1908: Changes for Backup Edge Cache Group
URL: https://github.com/apache/incubator-trafficcontrol/pull/1908
 
 
   This PR implements solution for the issue: 
https://github.com/apache/incubator-trafficcontrol/issues/1907
   
   It places the backup policy in the CZF file
   
   
   {
 "coverageZones": {
   "GROUP2": {
   "backupList": ["GROUP1"],
 "network6": [
   "1234:567a::\/64",
   "1234:567b::\/64"
 ],
 "network": [
   "10.197.69.0\/24"
 ]
   },
   "GROUP1": {
  "backupList": ["GROUP2"],
 "network6": [
   "1234:5677::\/64",
   "1234:5676::\/64"
 ],
 "network": [
   "10.126.250.0\/24"
 ]
   }
 }
   }
   
   
   
   The following test cases has been executed successfully for both DNS and 
HTTP Routing:
   Test Setup
   ---
   GROUP1 : Two cache Servers
   Group2 : One Cache Server
   GEO Limit set to CZF only
   
   Request from GROUP1's subnet , with one server in GROUP1 down and make sure 
the request is getting redirected to the remaining server in GROUP1
   Request from GROUP1's subnet , with both servers in GROUP1 down and make 
sure the request is getting redirected to the GROUP2
   
   **Regression cases**
   Set GEO limit to None without backup list configured in CZF
   Request from GROUP1's subnet , with both servers in GROUP1 down and make 
sure the request is getting redirected to the GROUP2


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1892: Updated /statuses to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1892: Updated /statuses to use the CRUD interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1892#issuecomment-367755603
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1086/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1908: Changes for Backup Edge Cache Group

2018-02-22 Thread GitBox
asfgit commented on issue #1908: Changes for Backup Edge Cache Group
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1908#issuecomment-367755889
 
 
   Can one of the admins verify this patch?


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1896: Updated /phys_locations to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1896: Updated /phys_locations to use the CRUD 
interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1896#issuecomment-367758541
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1087/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] mitchell852 opened a new pull request #1909: updates traffic portal install instructions and changes the defaults ?

2018-02-22 Thread GitBox
mitchell852 opened a new pull request #1909: updates traffic portal install 
instructions and changes the defaults ?
URL: https://github.com/apache/incubator-trafficcontrol/pull/1909
 
 
   ?of the server config file


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] limited commented on issue #1908: Changes for Backup Edge Cache Group

2018-02-22 Thread GitBox
limited commented on issue #1908: Changes for Backup Edge Cache Group
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1908#issuecomment-367762273
 
 
   add to whitelist


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dewrich closed pull request #1909: updates traffic portal install instructions and changes the defaults ?

2018-02-22 Thread GitBox
dewrich closed pull request #1909: updates traffic portal install instructions 
and changes the defaults ?
URL: https://github.com/apache/incubator-trafficcontrol/pull/1909
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/source/admin/traffic_portal/installation.rst 
b/docs/source/admin/traffic_portal/installation.rst
index ea7a303530..55b064bab3 100644
--- a/docs/source/admin/traffic_portal/installation.rst
+++ b/docs/source/admin/traffic_portal/installation.rst
@@ -23,7 +23,7 @@ The following are requirements to ensure an accurate set up:
 
 **Installing Traffic Portal**
 
-   - Download the Traffic Portal RPM from `Apache Jenkins 
`_
 or build from source (./pkg traffic_portal_build).
+   - Download the Traffic Portal RPM from `Apache Jenkins 
`_
 or build the Traffic Portal RPM from source (./pkg -v traffic_portal_build).
- Copy the Traffic Portal RPM to your server
- curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo 
bash -
- sudo yum install -y nodejs
diff --git a/traffic_portal/conf/config.js b/traffic_portal/conf/config.js
index c5067f9191..9830667739 100644
--- a/traffic_portal/conf/config.js
+++ b/traffic_portal/conf/config.js
@@ -17,29 +17,31 @@
  * under the License.
  */
 
-// this is the config that is consumed by /server.js on application startup
+// this is the config that is consumed by /server.js on traffic portal startup 
(sudo service traffic_portal start)
 module.exports = {
 timeout: '120s',
 useSSL: true, // set to true if you plan to use https (self-signed or 
trusted certs).
-port: 8080, // set to http port. i.e. 80
-sslPort: 8443, // set to https port. i.e. 443
+port: 80, // set to http port
+sslPort: 443, // set to https port
 // if useSSL is true, generate ssl certs and provide the proper locations.
 ssl: {
 key:'/etc/pki/tls/private/localhost.key',
 cert:   '/etc/pki/tls/certs/localhost.crt',
 ca: [ '/etc/pki/tls/certs/ca-bundle.crt' ]
 },
-// set api 'base_url' to the traffic ops api (all api calls made from the 
traffic portal will be proxied to the api base_url)
+// set api 'base_url' to the traffic ops api url (all api calls made from 
the traffic portal will be proxied to the api base_url)
 api: {
-base_url: 'https://localhost:8444/api/'
+base_url: 'https://trafficops.CHANGEME.domain.com/api/'
 },
 // default static files location (this is where the traffic portal html, 
css and javascript was installed. rpm installs these files at 
/opt/traffic_portal/public
+// change this to ./app/dist/public/ if you are running locally for 
development
 files: {
-static: './app/dist/public/'
+static: '/opt/traffic_portal/public'
 },
-// default log location (this is where traffic_portal logs are written) - 
/var/log/traffic_portal/access.log is a nice location
+// default log location (this is where traffic_portal logs are written)
+// change this to ./server/log/access.log if you are running traffic 
portal locally for development
 log: {
-stream: './server/log/access.log'
+stream: '/var/log/traffic_portal/access.log'
 },
 reject_unauthorized: 0 // 0 if using self-signed certs, 1 if trusted certs
 };


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] limited commented on issue #1908: Changes for Backup Edge Cache Group

2018-02-22 Thread GitBox
limited commented on issue #1908: Changes for Backup Edge Cache Group
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1908#issuecomment-367762832
 
 
   test this please
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1909: updates traffic portal install instructions and changes the defaults ?

2018-02-22 Thread GitBox
asfgit commented on issue #1909: updates traffic portal install instructions 
and changes the defaults ?
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1909#issuecomment-367763287
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1088/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dewrich commented on issue #1779: TO API and TO Client Golang Structs need to deal with nil's for validation rules

2018-02-22 Thread GitBox
dewrich commented on issue #1779: TO API and TO Client Golang Structs need to 
deal with nil's for validation rules
URL: 
https://github.com/apache/incubator-trafficcontrol/issues/1779#issuecomment-367764619
 
 
   Solved with the Delivery Service Request feature


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dewrich closed issue #1779: TO API and TO Client Golang Structs need to deal with nil's for validation rules

2018-02-22 Thread GitBox
dewrich closed issue #1779: TO API and TO Client Golang Structs need to deal 
with nil's for validation rules
URL: https://github.com/apache/incubator-trafficcontrol/issues/1779
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh closed pull request #1892: Updated /statuses to use the CRUD interface

2018-02-22 Thread GitBox
dangogh closed pull request #1892: Updated /statuses to use the CRUD interface
URL: https://github.com/apache/incubator-trafficcontrol/pull/1892
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/client/status.go b/traffic_ops/client/status.go
new file mode 100644
index 00..1145d8631c
--- /dev/null
+++ b/traffic_ops/client/status.go
@@ -0,0 +1,132 @@
+/*
+
+   Licensed 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.
+*/
+
+package client
+
+import (
+   "encoding/json"
+   "fmt"
+   "net"
+   "net/http"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+)
+
+const (
+   API_v13_STATUSES = "/api/1.3/statuses"
+)
+
+// Create a Status
+func (to *Session) CreateStatus(status tc.Status) (tc.Alerts, ReqInf, error) {
+
+   var remoteAddr net.Addr
+   reqBody, err := json.Marshal(status)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   resp, remoteAddr, err := to.request(http.MethodPost, API_v13_STATUSES, 
reqBody)
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   defer resp.Body.Close()
+   var alerts tc.Alerts
+   err = json.NewDecoder(resp.Body).Decode(&alerts)
+   return alerts, reqInf, nil
+}
+
+// Update a Status by ID
+func (to *Session) UpdateStatusByID(id int, status tc.Status) (tc.Alerts, 
ReqInf, error) {
+
+   var remoteAddr net.Addr
+   reqBody, err := json.Marshal(status)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   route := fmt.Sprintf("%s/%d", API_v13_STATUSES, id)
+   resp, remoteAddr, err := to.request(http.MethodPut, route, reqBody)
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   defer resp.Body.Close()
+   var alerts tc.Alerts
+   err = json.NewDecoder(resp.Body).Decode(&alerts)
+   return alerts, reqInf, nil
+}
+
+// Returns a list of Statuses
+func (to *Session) GetStatuses() ([]tc.Status, ReqInf, error) {
+   resp, remoteAddr, err := to.request(http.MethodGet, API_v13_STATUSES, 
nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.StatusesResponse
+   err = json.NewDecoder(resp.Body).Decode(&data)
+   return data.Response, reqInf, nil
+}
+
+// GET a Status by the Status id
+func (to *Session) GetStatusByID(id int) ([]tc.Status, ReqInf, error) {
+   route := fmt.Sprintf("%s/%d", API_v13_STATUSES, id)
+   resp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.StatusesResponse
+   if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
+   return nil, reqInf, err
+   }
+
+   return data.Response, reqInf, nil
+}
+
+// GET a Status by the Status name
+func (to *Session) GetStatusByName(name string) ([]tc.Status, ReqInf, error) {
+   url := fmt.Sprintf("%s?name=%s", API_v13_STATUSES, name)
+   resp, remoteAddr, err := to.request(http.MethodGet, url, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.StatusesResponse
+   if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
+   return nil, reqInf, err
+   }
+
+   return data.Response, reqInf, nil
+}
+
+// DELETE a Status by id
+func (to *Session) DeleteStatusByID(id int) (tc.Alerts, ReqInf, error) {
+   route := fmt.Sprintf("%s/%d", API_v13_STATUSES, id)
+   resp, remoteAddr, err := to.request(http.MethodDelete, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+  

[GitHub] dangogh commented on issue #1892: Updated /statuses to use the CRUD interface

2018-02-22 Thread GitBox
dangogh commented on issue #1892: Updated /statuses to use the CRUD interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1892#issuecomment-367774471
 
 
   tested get/post/put/delete


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh opened a new pull request #1910: fix ds request status change sql

2018-02-22 Thread GitBox
dangogh opened a new pull request #1910: fix ds request status change sql
URL: https://github.com/apache/incubator-trafficcontrol/pull/1910
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] mitchell852 closed pull request #1910: fix ds request status change sql

2018-02-22 Thread GitBox
mitchell852 closed pull request #1910: fix ds request status change sql
URL: https://github.com/apache/incubator-trafficcontrol/pull/1910
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/testing/api/v13/deliveryservice_requests_test.go 
b/traffic_ops/testing/api/v13/deliveryservice_requests_test.go
index b9301ae178..193f03c6c9 100644
--- a/traffic_ops/testing/api/v13/deliveryservice_requests_test.go
+++ b/traffic_ops/testing/api/v13/deliveryservice_requests_test.go
@@ -134,7 +134,7 @@ func TestDeliveryServiceRequestBad(t *testing.T) {
t.Errorf("Error creating DeliveryServiceRequest %v", err)
}
expected := []string{
-   `invalid initial request status pending.  Must be 'draft' or 
'submitted'`,
+   `'status' invalid transition from draft to pending`,
}
utils.Compare(t, expected, alerts.ToStrings())
 }
diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go 
b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
index aff46781bd..8cbbafc8b1 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
@@ -538,7 +538,7 @@ func (req *deliveryServiceRequestAssignment) Update(db 
*sqlx.DB, user auth.Curre
if req.AssigneeID != nil {
v = strconv.Itoa(*req.AssigneeID)
}
-   query := fmt.Sprintf(`UPDATE deliveryservice_request SET assignee_id = 
%s WHERE id=%d`, v, req.ID)
+   query := `UPDATE deliveryservice_request SET assignee_id = ` + v + ` 
WHERE id=` + strconv.Itoa(*req.ID)
_, err = tx.Exec(query)
if err != nil {
if pqErr, ok := err.(*pq.Error); ok {
@@ -632,7 +632,7 @@ func (req *deliveryServiceRequestStatus) Update(db 
*sqlx.DB, user auth.CurrentUs
}
 
// LastEditedBy field should not change with status update
-   query := fmt.Sprintf(`UPDATE deliveryservice_request SET status = '%v' 
WHERE id=%d`, req.Status, req.ID)
+   query := `UPDATE deliveryservice_request SET status = '` + 
string(*req.Status) + `' WHERE id=` + strconv.Itoa(*req.ID)
_, err = tx.Exec(query)
if err != nil {
if pqErr, ok := err.(*pq.Error); ok {


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1910: fix ds request status change sql

2018-02-22 Thread GitBox
asfgit commented on issue #1910: fix ds request status change sql
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1910#issuecomment-367781237
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1089/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] mitchell852 closed pull request #877: [Issue-876] - adds roles and capabilities tables to TP

2018-02-22 Thread GitBox
mitchell852 closed pull request #877: [Issue-876] - adds roles and capabilities 
tables to TP
URL: https://github.com/apache/incubator-trafficcontrol/pull/877
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_portal/app/src/app.js b/traffic_portal/app/src/app.js
index e2f44b3c56..1f61926066 100644
--- a/traffic_portal/app/src/app.js
+++ b/traffic_portal/app/src/app.js
@@ -167,6 +167,13 @@ var trafficPortal = angular.module('trafficPortal', [
 require('./modules/private/monitor/dashboard/view').name,
 require('./modules/private/monitor/map').name,
 
+// permissions
+require('./modules/private/permissions').name,
+require('./modules/private/permissions/capabilities').name,
+require('./modules/private/permissions/capabilities/list').name,
+require('./modules/private/permissions/roles').name,
+require('./modules/private/permissions/roles/list').name,
+
 // tools
 require('./modules/private/tools').name,
 require('./modules/private/tools/iso').name,
@@ -244,6 +251,7 @@ var trafficPortal = angular.module('trafficPortal', [
 require('./common/modules/table/cacheGroupParameters').name,
 require('./common/modules/table/cacheGroupServers').name,
 require('./common/modules/table/cacheGroupStaticDnsEntries').name,
+require('./common/modules/table/capabilities').name,
 require('./common/modules/table/changeLogs').name,
 require('./common/modules/table/asns').name,
 require('./common/modules/table/cdns').name,
@@ -271,6 +279,7 @@ var trafficPortal = angular.module('trafficPortal', [
 require('./common/modules/table/profiles').name,
 require('./common/modules/table/regions').name,
 require('./common/modules/table/regionPhysLocations').name,
+require('./common/modules/table/roles').name,
 require('./common/modules/table/servers').name,
 require('./common/modules/table/serverDeliveryServices').name,
 require('./common/modules/table/statuses').name,
diff --git a/traffic_portal/app/src/common/api/CapabilityService.js 
b/traffic_portal/app/src/common/api/CapabilityService.js
new file mode 100644
index 00..da8df4ffd1
--- /dev/null
+++ b/traffic_portal/app/src/common/api/CapabilityService.js
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+var CapabilityService = function(Restangular, messageModel) {
+
+   this.getCapabilities = function(queryParams) {
+   return Restangular.all('capabilities').getList(queryParams);
+   };
+
+   this.getCapability = function(id) {
+   return Restangular.one("capabilities", id).get();
+   };
+
+   this.updateCapability = function(capability) {
+   return capability.put()
+   .then(
+   function() {
+   messageModel.setMessages([ { level: 
'success', text: 'Capability updated' } ], false);
+   },
+   function(fault) {
+   
messageModel.setMessages(fault.data.alerts, false);
+   }
+   );
+   };
+
+   this.deleteCapability = function(capability) {
+   return capability.remove()
+   .then(
+   function() {
+   messageModel.setMessages([ { level: 
'success', text: 'Capability deleted' } ], true);
+   },
+   function(fault) {
+   
messageModel.setMessages(fault.data.alerts, true);
+   }
+   );
+   };
+
+};
+
+CapabilityService.$inject = ['Restangular', 'messageModel'];
+module.exports = CapabilityService;
diff --git a/traffic_portal/app/src/common/api/Rol

[GitHub] limited commented on issue #1908: Changes for Backup Edge Cache Group

2018-02-22 Thread GitBox
limited commented on issue #1908: Changes for Backup Edge Cache Group
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1908#issuecomment-367795403
 
 
   Code looks good. 
   
   Please also add a section to CHANGELOG.md at the top-level with a few line 
description of the feature and a link to the new docs. 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] limited commented on issue #1908: Changes for Backup Edge Cache Group

2018-02-22 Thread GitBox
limited commented on issue #1908: Changes for Backup Edge Cache Group
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1908#issuecomment-367795289
 
 
   @rawlinp  This backupList would be used to gain more control over which CGs 
can be a backup for a group. If a CG is not in the backup list, it won't be 
used, even if that means the request will be rejected. 
   
   We specifically implemented this code to not fall back to 
getClosestAvailableCachegroup(). This allows operators to compartmentalize 
traffic within portions of their network. (For example, if all the east coast 
caches go down, bandwidth-limited backbone/cross-country links will not be 
overwhelmed by all the requests going from east clients to west-coast caches). 
(This was actually the driving reason for this feature and why the existing 
getClosest... isn't sufficient in some cases).


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] mitchell852 opened a new pull request #1911: Adds roles and capabilities tables to TP

2018-02-22 Thread GitBox
mitchell852 opened a new pull request #1911: Adds roles and capabilities tables 
to TP
URL: https://github.com/apache/incubator-trafficcontrol/pull/1911
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1911: Adds roles and capabilities tables to TP

2018-02-22 Thread GitBox
asfgit commented on issue #1911: Adds roles and capabilities tables to TP
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1911#issuecomment-367806222
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1090/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh opened a new pull request #1912: TO Golang -- return empty slice for empty ds request list

2018-02-22 Thread GitBox
dangogh opened a new pull request #1912: TO Golang -- return empty slice for 
empty ds request list
URL: https://github.com/apache/incubator-trafficcontrol/pull/1912
 
 
   fix ds request reader.  if empty list, return empty slice rather than nil.
   Add empty list test to api handlers


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1912: TO Golang -- return empty slice for empty ds request list

2018-02-22 Thread GitBox
asfgit commented on issue #1912: TO Golang -- return empty slice for empty ds 
request list
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1912#issuecomment-367818145
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1091/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh commented on a change in pull request #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
dangogh commented on a change in pull request #1895: Updated /regions to use 
the CRUD interface 
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1895#discussion_r170089763
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/region/regions.go
 ##
 @@ -0,0 +1,322 @@
+package region
+
+/*
+ * 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 (
+   "errors"
+   "fmt"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+//we need a type alias to define functions on
+type TORegion tc.Region
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TORegion(tc.Region{})
+
+func GetRefType() *TORegion {
+   return &refType
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (region *TORegion) GetID() (int, bool) {
+   return region.ID, true
+}
+
+func (region *TORegion) GetAuditName() string {
+   return region.Name
+}
+
+func (region *TORegion) GetType() string {
+   return "region"
+}
+
+func (region *TORegion) SetID(i int) {
+   region.ID = i
+}
+
+func (region *TORegion) Validate(db *sqlx.DB) []error {
+   errs := []error{}
+   if len(region.Name) < 1 {
+   errs = append(errs, errors.New(`Region 'name' is required.`))
+   }
+   return errs
+}
+
+func (region *TORegion) Read(db *sqlx.DB, parameters map[string]string, user 
auth.CurrentUser) ([]interface{}, []error, tc.ApiErrorType) {
+   var rows *sqlx.Rows
+
+   // Query Parameters to Database Query column mappings
+   // see the fields mapped in the SQL query
+   queryParamsToQueryCols := map[string]dbhelpers.WhereColumnInfo{
+   "name": dbhelpers.WhereColumnInfo{"name", nil},
+   "division": dbhelpers.WhereColumnInfo{"division", nil},
+   "id":   dbhelpers.WhereColumnInfo{"id", api.IsInt},
+   }
+   where, orderBy, queryValues, errs := 
dbhelpers.BuildWhereAndOrderBy(parameters, queryParamsToQueryCols)
+   if len(errs) > 0 {
+   return nil, errs, tc.DataConflictError
+   }
+
+   query := selectQuery() + where + orderBy
+   log.Debugln("Query is ", query)
+
+   rows, err := db.NamedQuery(query, queryValues)
+   if err != nil {
+   log.Errorf("Error querying Regions: %v", err)
+   return nil, []error{tc.DBError}, tc.SystemError
+   }
+   defer rows.Close()
+
+   Regions := []interface{}{}
 
 Review comment:
   should be lowercase -- `regions`.  It's a local var, but upcase makes it 
look like it's exported


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh commented on a change in pull request #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
dangogh commented on a change in pull request #1895: Updated /regions to use 
the CRUD interface 
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1895#discussion_r170090849
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/region/regions.go
 ##
 @@ -0,0 +1,322 @@
+package region
+
+/*
+ * 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 (
+   "errors"
+   "fmt"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-log"
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/auth"
+   
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
+   "github.com/jmoiron/sqlx"
+   "github.com/lib/pq"
+)
+
+//we need a type alias to define functions on
+type TORegion tc.Region
+
+//the refType is passed into the handlers where a copy of its type is used to 
decode the json.
+var refType = TORegion(tc.Region{})
+
+func GetRefType() *TORegion {
+   return &refType
+}
+
+//Implementation of the Identifier, Validator interface functions
+func (region *TORegion) GetID() (int, bool) {
+   return region.ID, true
+}
+
+func (region *TORegion) GetAuditName() string {
+   return region.Name
+}
+
+func (region *TORegion) GetType() string {
+   return "region"
+}
+
+func (region *TORegion) SetID(i int) {
+   region.ID = i
+}
+
+func (region *TORegion) Validate(db *sqlx.DB) []error {
+   errs := []error{}
+   if len(region.Name) < 1 {
+   errs = append(errs, errors.New(`Region 'name' is required.`))
+   }
+   return errs
+}
+
+func (region *TORegion) Read(db *sqlx.DB, parameters map[string]string, user 
auth.CurrentUser) ([]interface{}, []error, tc.ApiErrorType) {
+   var rows *sqlx.Rows
+
+   // Query Parameters to Database Query column mappings
+   // see the fields mapped in the SQL query
+   queryParamsToQueryCols := map[string]dbhelpers.WhereColumnInfo{
+   "name": dbhelpers.WhereColumnInfo{"name", nil},
+   "division": dbhelpers.WhereColumnInfo{"division", nil},
+   "id":   dbhelpers.WhereColumnInfo{"id", api.IsInt},
+   }
+   where, orderBy, queryValues, errs := 
dbhelpers.BuildWhereAndOrderBy(parameters, queryParamsToQueryCols)
+   if len(errs) > 0 {
+   return nil, errs, tc.DataConflictError
+   }
+
+   query := selectQuery() + where + orderBy
+   log.Debugln("Query is ", query)
+
+   rows, err := db.NamedQuery(query, queryValues)
+   if err != nil {
+   log.Errorf("Error querying Regions: %v", err)
+   return nil, []error{tc.DBError}, tc.SystemError
+   }
+   defer rows.Close()
+
+   Regions := []interface{}{}
+   for rows.Next() {
+   var s tc.Region
+   if err = rows.StructScan(&s); err != nil {
+   log.Errorf("error parsing Region rows: %v", err)
+   return nil, []error{tc.DBError}, tc.SystemError
+   }
+   Regions = append(Regions, s)
+   }
+
+   return Regions, []error{}, tc.NoError
+}
+
+func selectQuery() string {
+
+   query := `SELECT
+r.division,
+d.name as divisionname,
+r.id,
+r.last_updated,
+r.name
+FROM region r
+JOIN division d ON r.division = d.id`
+   return query
+}
+
+//The TORegion implementation of the Updater interface
+//all implementations of Updater should use transactions and return the proper 
errorType
+//ParsePQUniqueConstraintError is used to determine if a region with 
conflicting values exists
+//if so, it will return an errorType of DataConflict and the type should be 
appended to the
+//generic error message returned
+func (region *TORegion) Update(db *sqlx.DB, user auth.CurrentUser) (error, 
tc.ApiErrorType) {
+   rollbackTransaction := true
+   tx, err := db.Beginx()
+   defer func() {
+   if tx == nil || !rollbackTransaction {
+   return
+   }
+   err := tx.Rollback()
+   if err != ni

[GitHub] dangogh commented on a change in pull request #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
dangogh commented on a change in pull request #1895: Updated /regions to use 
the CRUD interface 
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1895#discussion_r170091590
 
 

 ##
 File path: traffic_ops/traffic_ops_golang/routes.go
 ##
 @@ -102,13 +103,16 @@ func Routes(d ServerData) ([]Route, http.Handler, error) 
{
//HwInfo
{1.2, http.MethodGet, `hwinfo-wip/?(\.json)?$`, 
hwInfoHandler(d.DB), auth.PrivLevelReadOnly, Authenticated, nil},
 
+   //Regions
+   {1.3, http.MethodGet, `regions/?(\.json)?$`, 
api.ReadHandler(region.GetRefType(), d.DB), auth.PrivLevelReadOnly, 
Authenticated, nil},
+   {1.3, http.MethodGet, `regions/{id}$`, 
api.ReadHandler(region.GetRefType(), d.DB), auth.PrivLevelReadOnly, 
Authenticated, nil},
+   {1.3, http.MethodPut, `regions/{id}$`, 
api.UpdateHandler(region.GetRefType(), d.DB), auth.PrivLevelOperations, 
Authenticated, nil},
+   {1.3, http.MethodPost, `regions/?$`, 
api.CreateHandler(region.GetRefType(), d.DB), auth.PrivLevelOperations, 
Authenticated, nil},
+   {1.3, http.MethodDelete, `regions/{id}$`, 
api.DeleteHandler(region.GetRefType(), d.DB), auth.PrivLevelOperations, 
Authenticated, nil},
+
 
 Review comment:
   don't we want these to be alphabetized?


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dewrich closed pull request #1912: TO Golang -- return empty slice for empty ds request list

2018-02-22 Thread GitBox
dewrich closed pull request #1912: TO Golang -- return empty slice for empty ds 
request list
URL: https://github.com/apache/incubator-trafficcontrol/pull/1912
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/traffic_ops_golang/api/shared_handlers_test.go 
b/traffic_ops/traffic_ops_golang/api/shared_handlers_test.go
index 51b3aa641e..50ee9edde9 100644
--- a/traffic_ops/traffic_ops_golang/api/shared_handlers_test.go
+++ b/traffic_ops/traffic_ops_golang/api/shared_handlers_test.go
@@ -41,6 +41,8 @@ type tester struct {
errorType tc.ApiErrorType //only for testing
 }
 
+type emptyTester tester
+
 //Identifier interface functions
 func (i *tester) GetID() (int, bool) {
return i.ID, true
@@ -76,6 +78,11 @@ func (i *tester) Read(db *sqlx.DB, v map[string]string, user 
auth.CurrentUser) (
return []interface{}{tester{ID: 1}}, nil, tc.NoError
 }
 
+//Reader interface functions
+func (i *emptyTester) Read(db *sqlx.DB, v map[string]string, user 
auth.CurrentUser) ([]interface{}, []error, tc.ApiErrorType) {
+   return []interface{}{}, nil, tc.NoError
+}
+
 //Updater interface functions
 func (i *tester) Update(db *sqlx.DB, user auth.CurrentUser) (error, 
tc.ApiErrorType) {
return i.error, i.errorType
@@ -131,6 +138,41 @@ func TestCreateHandler(t *testing.T) {
}
 }
 
+func TestEmptyReadHandler(t *testing.T) {
+   mockDB, _, err := sqlmock.New()
+   if err != nil {
+   t.Fatalf("an error '%s' was not expected when opening a stub 
database connection", err)
+   }
+   defer mockDB.Close()
+
+   db := sqlx.NewDb(mockDB, "sqlmock")
+   defer db.Close()
+
+   w := httptest.NewRecorder()
+   r, err := http.NewRequest("", "", nil)
+   if err != nil {
+   t.Error("Error creating new request")
+   }
+
+   ctx := r.Context()
+   ctx = context.WithValue(ctx, auth.CurrentUserKey,
+   auth.CurrentUser{UserName: "username", ID: 1, PrivLevel: 
auth.PrivLevelAdmin})
+   ctx = context.WithValue(ctx, PathParamsKey, map[string]string{})
+   // Add our context to the request
+   r = r.WithContext(ctx)
+
+   typeRef := emptyTester{}
+   readFunc := ReadHandler(&typeRef, db)
+
+   readFunc(w, r)
+
+   //verifies the body is in the expected format
+   body := `{"response":[]}`
+   if w.Body.String() != body {
+   t.Error("Expected body", body, "got", w.Body.String())
+   }
+}
+
 func TestReadHandler(t *testing.T) {
mockDB, _, err := sqlmock.New()
if err != nil {
diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go 
b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
index 8cbbafc8b1..ed984e3a11 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
@@ -112,7 +112,7 @@ func (req *TODeliveryServiceRequest) Read(db *sqlx.DB, 
parameters map[string]str
}
defer rows.Close()
 
-   var deliveryServiceRequests []interface{}
+   deliveryServiceRequests := []interface{}{}
for rows.Next() {
var s TODeliveryServiceRequest
if err = rows.StructScan(&s); err != nil {


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dg4prez commented on a change in pull request #1898: prevents parent.config failure when no delivery services assinged

2018-02-22 Thread GitBox
dg4prez commented on a change in pull request #1898: prevents parent.config 
failure when no delivery services assinged
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1898#discussion_r170095508
 
 

 ##
 File path: traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
 ##
 @@ -2465,40 +2465,43 @@ sub parent_dot_config { #fix qstring - should be 
ignore for quika
if ( !defined($data) ) {
$data = $self->parent_ds_data($server_obj);
}
-   foreach my $ds ( sort @{ $data->{dslist} } ) {
-   my $text;
-   my $org = $ds->{org};
-   next if !defined $org || $org eq "";
-   next if $done{$org};
-   my $org_uri = URI->new($org);
-   if ( $ds->{type} eq "HTTP_NO_CACHE" || $ds->{type} eq 
"HTTP_LIVE" || $ds->{type} eq "DNS_LIVE" ) {
-   $text .= "dest_domain=" . $org_uri->host . " 
port=" . $org_uri->port . " go_direct=true\n";
-   }
-   else {
-   # check for profile psel.qstring_handling.  If 
this parameter is assigned to the server profile,
-   # then edges will use the qstring handling 
value specified in the parameter for all profiles.
-
-   # If there is no defined parameter in the 
profile, then check the delivery service profile.
-   # If psel.qstring_handling exists in the DS 
profile, then we use that value for the specified DS only.
-   # This is used only if not overridden by a 
server profile qstring handling parameter.
-   my $ds_qsh = $qsh;
-   if (!defined($qsh)) {
-   $ds_qsh = 
$ds->{'param'}->{'parent.config'}->{'psel.qstring_handling'};
-   }
-   my $parent_qstring = defined($ds_qsh) ? $ds_qsh 
: "ignore";
 
-   if ( $ds->{qstring_ignore} == 0 && 
!defined($ds_qsh) ) {
-   $parent_qstring = "consider";
+   unless (!defined($data->{dslist})) {
 
 Review comment:
   Can't really argue with that.  Updated.


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1898: prevents parent.config failure when no delivery services assinged

2018-02-22 Thread GitBox
asfgit commented on issue #1898: prevents parent.config failure when no 
delivery services assinged
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1898#issuecomment-367826458
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1092/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1896: Updated /phys_locations to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1896: Updated /phys_locations to use the CRUD 
interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1896#issuecomment-367829425
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1093/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1895: Updated /regions to use the CRUD interface 
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1895#issuecomment-367830202
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1094/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1895: Updated /regions to use the CRUD interface 
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1895#issuecomment-367832319
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1095/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1895: Updated /regions to use the CRUD interface 
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1895#issuecomment-367833546
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1096/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1900: moved into systeminfo package for handler consistency

2018-02-22 Thread GitBox
asfgit commented on issue #1900: moved into systeminfo package for handler 
consistency
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1900#issuecomment-367834912
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1097/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dewrich opened a new issue #1913: Traffic OPs API in Golang needs to support pagination

2018-02-22 Thread GitBox
dewrich opened a new issue #1913: Traffic OPs API in Golang needs to support 
pagination
URL: https://github.com/apache/incubator-trafficcontrol/issues/1913
 
 
   limit=X (The number of results returned)
   page=X (Which page of those results you are on)


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] dangogh closed pull request #1895: Updated /regions to use the CRUD interface

2018-02-22 Thread GitBox
dangogh closed pull request #1895: Updated /regions to use the CRUD interface 
URL: https://github.com/apache/incubator-trafficcontrol/pull/1895
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/go-tc/regions.go b/lib/go-tc/regions.go
index 9c4edc3f2f..d32556cd11 100644
--- a/lib/go-tc/regions.go
+++ b/lib/go-tc/regions.go
@@ -24,7 +24,7 @@ type RegionsResponse struct {
 }
 
 type Region struct {
-   DivisionName string `json:"divisionName" db:"divisionname"`
+   DivisionName string `json:"divisionName"`
Division int`json:"division" db:"division"`
ID   int`json:"id" db:"id"`
LastUpdated  Time   `json:"lastUpdated" db:"last_updated"`
diff --git a/traffic_ops/client/region.go b/traffic_ops/client/region.go
new file mode 100644
index 00..f3e39f16b0
--- /dev/null
+++ b/traffic_ops/client/region.go
@@ -0,0 +1,132 @@
+/*
+
+   Licensed 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.
+*/
+
+package client
+
+import (
+   "encoding/json"
+   "fmt"
+   "net"
+   "net/http"
+
+   "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+)
+
+const (
+   API_v13_REGIONS = "/api/1.3/regions"
+)
+
+// Create a Region
+func (to *Session) CreateRegion(region tc.Region) (tc.Alerts, ReqInf, error) {
+
+   var remoteAddr net.Addr
+   reqBody, err := json.Marshal(region)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   resp, remoteAddr, err := to.request(http.MethodPost, API_v13_REGIONS, 
reqBody)
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   defer resp.Body.Close()
+   var alerts tc.Alerts
+   err = json.NewDecoder(resp.Body).Decode(&alerts)
+   return alerts, reqInf, nil
+}
+
+// Update a Region by ID
+func (to *Session) UpdateRegionByID(id int, region tc.Region) (tc.Alerts, 
ReqInf, error) {
+
+   var remoteAddr net.Addr
+   reqBody, err := json.Marshal(region)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   route := fmt.Sprintf("%s/%d", API_v13_REGIONS, id)
+   resp, remoteAddr, err := to.request(http.MethodPut, route, reqBody)
+   if err != nil {
+   return tc.Alerts{}, reqInf, err
+   }
+   defer resp.Body.Close()
+   var alerts tc.Alerts
+   err = json.NewDecoder(resp.Body).Decode(&alerts)
+   return alerts, reqInf, nil
+}
+
+// Returns a list of regions
+func (to *Session) GetRegions() ([]tc.Region, ReqInf, error) {
+   resp, remoteAddr, err := to.request(http.MethodGet, API_v13_REGIONS, 
nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.RegionsResponse
+   err = json.NewDecoder(resp.Body).Decode(&data)
+   return data.Response, reqInf, nil
+}
+
+// GET a Region by the Region id
+func (to *Session) GetRegionByID(id int) ([]tc.Region, ReqInf, error) {
+   route := fmt.Sprintf("%s/%d", API_v13_REGIONS, id)
+   resp, remoteAddr, err := to.request(http.MethodGet, route, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.RegionsResponse
+   if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
+   return nil, reqInf, err
+   }
+
+   return data.Response, reqInf, nil
+}
+
+// GET a Region by the Region name
+func (to *Session) GetRegionByName(name string) ([]tc.Region, ReqInf, error) {
+   url := fmt.Sprintf("%s?name=%s", API_v13_REGIONS, name)
+   resp, remoteAddr, err := to.request(http.MethodGet, url, nil)
+   reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr: 
remoteAddr}
+   if err != nil {
+   return nil, reqInf, err
+   }
+   defer resp.Body.Close()
+
+   var data tc.RegionsResponse
+   if err := json.NewDec

[GitHub] asfgit commented on issue #1896: Updated /phys_locations to use the CRUD interface

2018-02-22 Thread GitBox
asfgit commented on issue #1896: Updated /phys_locations to use the CRUD 
interface
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1896#issuecomment-367856343
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1098/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] mitchell852 opened a new pull request #1914: [Issue-1687] - DS Requests - adds stronger confirm when creating a request to delete a ds

2018-02-22 Thread GitBox
mitchell852 opened a new pull request #1914: [Issue-1687] - DS Requests - adds 
stronger confirm when creating a request to delete a ds
URL: https://github.com/apache/incubator-trafficcontrol/pull/1914
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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] asfgit commented on issue #1914: [Issue-1687] - DS Requests - adds stronger confirm when creating a request to delete a ds

2018-02-22 Thread GitBox
asfgit commented on issue #1914: [Issue-1687] - DS Requests - adds stronger 
confirm when creating a request to delete a ds
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1914#issuecomment-367899410
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/incubator-trafficcontrol-PR/1099/
   Test PASSed.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on 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