[GitHub] jifyang opened a new pull request #2295: secondary IPs support: alter server
jifyang opened a new pull request #2295: secondary IPs support: alter server URL: https://github.com/apache/incubator-trafficcontrol/pull/2295 fixes #2293 WIP (Work In Process) This PR is based on #2294 More work is needed for this PR. 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] jifyang opened a new pull request #2294: secondary IPs support: add interface and ip
jifyang opened a new pull request #2294: secondary IPs support: add interface and ip URL: https://github.com/apache/incubator-trafficcontrol/pull/2294 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] jifyang opened a new issue #2293: Add Traffic Server secondary streaming IPs support
jifyang opened a new issue #2293: Add Traffic Server secondary streaming IPs support URL: https://github.com/apache/incubator-trafficcontrol/issues/2293 The design document: https://cwiki.apache.org/confluence/display/TC/Design+Docs (Traffic Server Secondary Streaming IPs Design) 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 #2294: secondary IPs support: add interface and ip
asfgit commented on issue #2294: secondary IPs support: add interface and ip URL: https://github.com/apache/incubator-trafficcontrol/pull/2294#issuecomment-390122448 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1605/ 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] rob05c opened a new pull request #2303: Add TO Go delete cdns/name
rob05c opened a new pull request #2303: Add TO Go delete cdns/name URL: https://github.com/apache/incubator-trafficcontrol/pull/2303 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 #2302: Add TO Go cdns/name
asfgit commented on issue #2302: Add TO Go cdns/name URL: https://github.com/apache/incubator-trafficcontrol/pull/2302#issuecomment-390431136 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1620/ 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] rob05c opened a new pull request #2304: Add TO Go cdns/id/queue_updates
rob05c opened a new pull request #2304: Add TO Go cdns/id/queue_updates URL: https://github.com/apache/incubator-trafficcontrol/pull/2304 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 #2304: Add TO Go cdns/id/queue_updates
asfgit commented on issue #2304: Add TO Go cdns/id/queue_updates URL: https://github.com/apache/incubator-trafficcontrol/pull/2304#issuecomment-390435630 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1622/ 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] rob05c opened a new pull request #2301: Add TO Go cachegroups/id/queue_update
rob05c opened a new pull request #2301: Add TO Go cachegroups/id/queue_update URL: https://github.com/apache/incubator-trafficcontrol/pull/2301 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 #2305: Add TO Go cdns/health
asfgit commented on issue #2305: Add TO Go cdns/health URL: https://github.com/apache/incubator-trafficcontrol/pull/2305#issuecomment-390441233 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1623/ 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 #2305: Add TO Go cdns/health
asfgit commented on issue #2305: Add TO Go cdns/health URL: https://github.com/apache/incubator-trafficcontrol/pull/2305#issuecomment-390446539 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1624/ 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] knutsel opened a new pull request #2284: Remove (Incubating), and some other stuff not needed
knutsel opened a new pull request #2284: Remove (Incubating), and some other stuff not needed URL: https://github.com/apache/incubator-trafficcontrol/pull/2284 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 commented on issue #2229: Add Traffic Ops Golang deliveryservicesregexes
mitchell852 commented on issue #2229: Add Traffic Ops Golang deliveryservicesregexes URL: https://github.com/apache/incubator-trafficcontrol/pull/2229#issuecomment-389882874 @rob05c - can you resolve conflicts and i'll merge 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] jeffmart opened a new pull request #2283: Added rtype and rdtl definition
jeffmart opened a new pull request #2283: Added rtype and rdtl definition URL: https://github.com/apache/incubator-trafficcontrol/pull/2283 Updated additional rtype and rdtl definitions based data being populated in the access.log 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 #2229: Add Traffic Ops Golang deliveryservicesregexes
asfgit commented on issue #2229: Add Traffic Ops Golang deliveryservicesregexes URL: https://github.com/apache/incubator-trafficcontrol/pull/2229#issuecomment-389907537 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1593/ 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 #2284: Remove (Incubating), and some other stuff not needed
asfgit commented on issue #2284: Remove (Incubating), and some other stuff not needed URL: https://github.com/apache/incubator-trafficcontrol/pull/2284#issuecomment-389903661 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1590/ 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 #2283: Added rtype and rdtl definition
asfgit commented on issue #2283: Added rtype and rdtl definition URL: https://github.com/apache/incubator-trafficcontrol/pull/2283#issuecomment-389906196 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1592/ 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] rob05c commented on issue #2229: Add Traffic Ops Golang deliveryservicesregexes
rob05c commented on issue #2229: Add Traffic Ops Golang deliveryservicesregexes URL: https://github.com/apache/incubator-trafficcontrol/pull/2229#issuecomment-389889933 @mitchell852 done 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 #2271: allow the option to immediately fulfill DSR (d…
asfgit commented on issue #2271: allow the option to immediately fulfill DSR (d… URL: https://github.com/apache/incubator-trafficcontrol/pull/2271#issuecomment-389908217 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1594/ Test FAILed. 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] ajschmidt opened a new issue #2285: CDNS API returns a 404 when there are no SSL Keys
ajschmidt opened a new issue #2285: CDNS API returns a 404 when there are no SSL Keys URL: https://github.com/apache/incubator-trafficcontrol/issues/2285 The API method: /api/1.2/cdns/name/{cdn_name}/sslkeys.json returns a 404 if there are no SSL keys defined for the CDN. This should probably return an empty list or an error message. If the CDN does include 'https' delivery services then it should probably return an error. 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 #2283: Added rtype and rdtl definition
asfgit commented on issue #2283: Added rtype and rdtl definition URL: https://github.com/apache/incubator-trafficcontrol/pull/2283#issuecomment-389891494 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1588/ 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 #2283: Added rtype and rdtl definition
asfgit commented on issue #2283: Added rtype and rdtl definition URL: https://github.com/apache/incubator-trafficcontrol/pull/2283#issuecomment-389900096 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1589/ 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 pull request #2286: removed the job_result reference from the rest of the migrations
dewrich opened a new pull request #2286: removed the job_result reference from the rest of the migrations URL: https://github.com/apache/incubator-trafficcontrol/pull/2286 for fresh installs 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 #2286: removed the job_result reference from the rest of the migrations
dewrich closed pull request #2286: removed the job_result reference from the rest of the migrations URL: https://github.com/apache/incubator-trafficcontrol/pull/2286 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/app/db/migrations/20170623144818_lastupdated.sql b/traffic_ops/app/db/migrations/20170623144818_lastupdated.sql index fd1048096..9dfb9a9e4 100644 --- a/traffic_ops/app/db/migrations/20170623144818_lastupdated.sql +++ b/traffic_ops/app/db/migrations/20170623144818_lastupdated.sql @@ -64,9 +64,6 @@ CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON job FOR EACH ROW EXE DROP TRIGGER IF EXISTS on_update_current_timestamp ON job_agent; CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON job_agent FOR EACH ROW EXECUTE PROCEDURE on_update_current_timestamp_last_updated(); -DROP TRIGGER IF EXISTS on_update_current_timestamp ON job_result; -CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON job_result FOR EACH ROW EXECUTE PROCEDURE on_update_current_timestamp_last_updated(); - DROP TRIGGER IF EXISTS on_update_current_timestamp ON job_status; CREATE TRIGGER on_update_current_timestamp BEFORE UPDATE ON job_status FOR EACH ROW EXECUTE PROCEDURE on_update_current_timestamp_last_updated(); diff --git a/traffic_ops/app/db/migrations/2018040600_last_updated_not_null.sql b/traffic_ops/app/db/migrations/2018040600_last_updated_not_null.sql index d5882f975..3a9a7f60b 100644 --- a/traffic_ops/app/db/migrations/2018040600_last_updated_not_null.sql +++ b/traffic_ops/app/db/migrations/2018040600_last_updated_not_null.sql @@ -70,9 +70,6 @@ ALTER TABLE job ALTER COLUMN last_updated SET NOT NULL; UPDATE job_agent SET last_updated = now() WHERE last_updated IS NULL; ALTER TABLE job_agent ALTER COLUMN last_updated SET NOT NULL; -UPDATE job_result SET last_updated = now() WHERE last_updated IS NULL; -ALTER TABLE job_result ALTER COLUMN last_updated SET NOT NULL; - UPDATE job_status SET last_updated = now() WHERE last_updated IS NULL; ALTER TABLE job_status ALTER COLUMN last_updated SET NOT NULL; @@ -155,7 +152,6 @@ ALTER TABLE federation_tmuser ALTER COLUMN last_updated DROP NOT NULL; ALTER TABLE hwinfo ALTER COLUMN last_updated DROP NOT NULL; ALTER TABLE job ALTER COLUMN last_updated DROP NOT NULL; ALTER TABLE job_agent ALTER COLUMN last_updated DROP NOT NULL; -ALTER TABLE job_result ALTER COLUMN last_updated DROP NOT NULL; ALTER TABLE job_status ALTER COLUMN last_updated DROP NOT NULL; ALTER TABLE log ALTER COLUMN last_updated DROP NOT NULL; ALTER TABLE parameter ALTER COLUMN last_updated DROP NOT NULL; 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 #2289: Foundation for Java Api Client
asfgit commented on issue #2289: Foundation for Java Api Client URL: https://github.com/apache/incubator-trafficcontrol/pull/2289#issuecomment-389960436 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 #2288: Fix TO old Perl GUI CRConfig diff
asfgit commented on issue #2288: Fix TO old Perl GUI CRConfig diff URL: https://github.com/apache/incubator-trafficcontrol/pull/2288#issuecomment-389960508 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1601/ 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 #2288: Fix TO old Perl GUI CRConfig diff
asfgit commented on issue #2288: Fix TO old Perl GUI CRConfig diff URL: https://github.com/apache/incubator-trafficcontrol/pull/2288#issuecomment-389951871 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1600/ 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 pull request #2287: Added back the job_result create for fresh installs
dewrich opened a new pull request #2287: Added back the job_result create for fresh installs URL: https://github.com/apache/incubator-trafficcontrol/pull/2287 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 #2289: Foundation for Java Api Client
asfgit commented on issue #2289: Foundation for Java Api Client URL: https://github.com/apache/incubator-trafficcontrol/pull/2289#issuecomment-389961549 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] rob05c opened a new pull request #2288: Fix TO old Perl GUI CRConfig diff
rob05c opened a new pull request #2288: Fix TO old Perl GUI CRConfig diff URL: https://github.com/apache/incubator-trafficcontrol/pull/2288 Fixes the old Perl GUI CRConfig diff, by changing it to fetch the new CRConfig from traffic_ops_golang rather than creating it from the now-unused Perl CRConfig function. 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] nerdynick opened a new pull request #2289: Foundation for Java Api Client
nerdynick opened a new pull request #2289: Foundation for Java Api Client URL: https://github.com/apache/incubator-trafficcontrol/pull/2289 Foundation framework and support for Java based API Client. Currently supports login and fetching of Servers and Delivery Services from TrafficOps API. 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 #2287: Added back the job_result create for fresh installs
asfgit commented on issue #2287: Added back the job_result create for fresh installs URL: https://github.com/apache/incubator-trafficcontrol/pull/2287#issuecomment-389944407 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1599/ 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] rob05c closed pull request #2269: Adds Docker Compose configuration for creating a Traffic_Ops Dev environment
rob05c closed pull request #2269: Adds Docker Compose configuration for creating a Traffic_Ops Dev environment URL: https://github.com/apache/incubator-trafficcontrol/pull/2269 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/infrastructure/docker/traffic_ops/Dockerfile_psql b/infrastructure/docker/traffic_ops/Dockerfile_psql new file mode 100644 index 0..9704aaa6e --- /dev/null +++ b/infrastructure/docker/traffic_ops/Dockerfile_psql @@ -0,0 +1,42 @@ +# 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. + + +# Dockerfile to initialized Traffic Ops Database container +# Based on CentOS 7.2 + + +FROM centos/systemd + +RUN yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm + +RUN yum -y install \ + postgresql96 \ + nmap-ncat \ + cpanminus && \ + yum clean all + +ENV POSTGRES_HOME $POSTGRES_HOME +ENV PGPASSWORD $PGPASSWORD +ENV DB_USERNAME $DB_USERNAME +ENV DB_NAME $DB_NAME +ENV DB_USER_PASS $DB_USER_PASS +ENV DB_SERVER $DB_SERVER +ENV DB_PORT $DB_PORT + +ADD dbInit.sh / +CMD /dbInit.sh diff --git a/infrastructure/docker/traffic_ops/dbInit.sh b/infrastructure/docker/traffic_ops/dbInit.sh new file mode 100755 index 0..80156f53c --- /dev/null +++ b/infrastructure/docker/traffic_ops/dbInit.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# 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. + + +# Script for creating the database user account for traffic +# ops. +# Used while the Docker Image is initializing itself + + +while ! nc $DB_SERVER $DB_PORT /dev/null; do +echo "waiting for $DB_SERVER:$DB_PORT" +sleep 3 +done +psql -h $DB_SERVER -U postgres -c "CREATE USER $DB_USERNAME WITH ENCRYPTED PASSWORD '$DB_USER_PASS'" +createdb $DB_NAME -h $DB_SERVER -U postgres --owner $DB_USERNAME diff --git a/infrastructure/docker/traffic_ops/docker-compose.yml b/infrastructure/docker/traffic_ops/docker-compose.yml new file mode 100644 index 0..8451aae84 --- /dev/null +++ b/infrastructure/docker/traffic_ops/docker-compose.yml @@ -0,0 +1,86 @@ +# 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. +# +# To use this compose you should first build Traffic Ops and then copy the RPM to : +# +#
[GitHub] rob05c commented on issue #2309: Implement /api/1.1/cdns/metric_types
rob05c commented on issue #2309: Implement /api/1.1/cdns/metric_types URL: https://github.com/apache/incubator-trafficcontrol/issues/2309#issuecomment-390683350 Readers, be aware: this route is not currently a priority, and not scheduled to be implemented any time soon. If this route is an issue for you, please let us know, and we can discuss prioritizing it. We would also welcome a pull request implementing the route. 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] rob05c opened a new pull request #2310: Add TO Go cdns/metric_types route 501
rob05c opened a new pull request #2310: Add TO Go cdns/metric_types route 501 URL: https://github.com/apache/incubator-trafficcontrol/pull/2310 The cdns/metric_types route is documented in the API, and has a Perl route, but the Perl function it points to doesn't exist. As such, this adds a note to the docs, and adds a Go route returning an HTTP 501 Not Implemented code. See Github Issue #2309 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] tyagian opened a new issue #2308: missing snapshot in change logs on TO, TP notifications
tyagian opened a new issue #2308: missing snapshot in change logs on TO, TP notifications URL: https://github.com/apache/incubator-trafficcontrol/issues/2308 After few snapshots, none of them were visible on TO change logs or TP notifications but traffic dropped on servers so snapshot worked but not visible on ops/portal. 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 #2311: reset role_id_seq and do not specify id on inserts
dewrich closed pull request #2311: reset role_id_seq and do not specify id on inserts URL: https://github.com/apache/incubator-trafficcontrol/pull/2311 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/todb.go b/traffic_ops/testing/api/v13/todb.go index 303828988..b8d50b0cd 100644 --- a/traffic_ops/testing/api/v13/todb.go +++ b/traffic_ops/testing/api/v13/todb.go @@ -86,12 +86,12 @@ func SetupTestData(*sql.DB) error { func SetupRoles(db *sql.DB) error { sqlStmt := ` -INSERT INTO role (id, name, description, priv_level) VALUES (1, 'disallowed','Block all access',0) ON CONFLICT DO NOTHING; -INSERT INTO role (id, name, description, priv_level) VALUES (2, 'read-only user','Block all access', 10) ON CONFLICT DO NOTHING; -INSERT INTO role (id, name, description, priv_level) VALUES (3, 'operations','Block all access', 20) ON CONFLICT DO NOTHING; -INSERT INTO role (id, name, description, priv_level) VALUES (4, 'admin','super-user', 30) ON CONFLICT DO NOTHING; -INSERT INTO role (id, name, description, priv_level) VALUES (5, 'portal','Portal User', 2) ON CONFLICT DO NOTHING; -INSERT INTO role (id, name, description, priv_level) VALUES (7, 'federation','Role for Secondary CZF', 15) ON CONFLICT DO NOTHING; +INSERT INTO role (name, description, priv_level) VALUES ('disallowed','Block all access',0) ON CONFLICT DO NOTHING; +INSERT INTO role (name, description, priv_level) VALUES ('read-only user','Block all access', 10) ON CONFLICT DO NOTHING; +INSERT INTO role (name, description, priv_level) VALUES ('operations','Block all access', 20) ON CONFLICT DO NOTHING; +INSERT INTO role (name, description, priv_level) VALUES ('admin','super-user', 30) ON CONFLICT DO NOTHING; +INSERT INTO role (name, description, priv_level) VALUES ('portal','Portal User', 2) ON CONFLICT DO NOTHING; +INSERT INTO role (name, description, priv_level) VALUES ('federation','Role for Secondary CZF', 15) ON CONFLICT DO NOTHING; ` err := execSQL(db, sqlStmt, "role") if err != nil { @@ -141,7 +141,7 @@ INSERT INTO tm_user (username, local_passwd, confirm_local_passwd, role, tenant_ INSERT INTO tm_user (username, local_passwd, confirm_local_passwd, role, tenant_id) VALUES ('` + Config.TrafficOps.Users.Operations + `','` + encryptedPassword + `','` + encryptedPassword + `', 3, 3); INSERT INTO tm_user (username, local_passwd, confirm_local_passwd, role, tenant_id) VALUES ('` + Config.TrafficOps.Users.Admin + `','` + encryptedPassword + `','` + encryptedPassword + `', 4, 2); INSERT INTO tm_user (username, local_passwd, confirm_local_passwd, role, tenant_id) VALUES ('` + Config.TrafficOps.Users.Portal + `','` + encryptedPassword + `','` + encryptedPassword + `', 5, 3); -INSERT INTO tm_user (username, local_passwd, confirm_local_passwd, role, tenant_id) VALUES ('` + Config.TrafficOps.Users.Federation + `','` + encryptedPassword + `','` + encryptedPassword + `', 7, 3); +INSERT INTO tm_user (username, local_passwd, confirm_local_passwd, role, tenant_id) VALUES ('` + Config.TrafficOps.Users.Federation + `','` + encryptedPassword + `','` + encryptedPassword + `', 6, 3); ` err = execSQL(db, sqlStmt, "tm_user") if err != nil { @@ -345,6 +345,7 @@ func Teardown(db *sql.DB) error { DELETE FROM deliveryservice_tmuser; DELETE FROM tm_user; DELETE FROM role; + ALTER SEQUENCE role_id_seq RESTART WITH 1; DELETE FROM deliveryservice_regex; DELETE FROM regex; DELETE FROM deliveryservice_server; 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] DylanVolz opened a new pull request #2311: reset role_id_seq and do not specify id on inserts
DylanVolz opened a new pull request #2311: reset role_id_seq and do not specify id on inserts URL: https://github.com/apache/incubator-trafficcontrol/pull/2311 this removes test failures from when role_id_seq is an id already inserted. 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] jhg03a opened a new issue #2312: New Endpoint /api//tenants/children/:id
jhg03a opened a new issue #2312: New Endpoint /api//tenants/children/:id URL: https://github.com/apache/incubator-trafficcontrol/issues/2312 Can you please add a new TO API endpoint /api//tenants/children/:id which returns a list of all tenant ids that are children and requested id. This simplifies TO API users needing to reconstruct the parent chains of all tenants. 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] jhg03a commented on issue #2312: New Endpoint /api//tenants/children/:id
jhg03a commented on issue #2312: New Endpoint /api//tenants/children/:id URL: https://github.com/apache/incubator-trafficcontrol/issues/2312#issuecomment-390754855 Another option would be to add a new parameter ?tenentchildren=true or ?astenant= to applicable endpoints ideally, but that may be more work. 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] rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269
rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269 URL: https://github.com/apache/incubator-trafficcontrol/pull/2282#discussion_r189706518 ## File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go ## @@ -263,7 +243,428 @@ func (dss *TODeliveryServiceServer) Delete(db *sqlx.DB, user auth.CurrentUser) ( rollbackTransaction = false return nil, tc.NoError } -func selectQuery() string { + +func selectQuery(orderBy string, limit string, offset string) (string, error) { + + selectStmt := `SELECT + s.deliveryService, + s.server, + s.last_updated + FROM deliveryservice_server s` + + allowedOrderByCols := map[string]string{ + "":"", + "deliveryservice": "s.deliveryService", + "server": "s.server", + "lastupdated": "s.last_updated", + "deliveryService": "s.deliveryService", + "lastUpdated": "s.last_updated", + "last_updated":"s.last_updated", + } + orderBy, ok := allowedOrderByCols[orderBy] + if !ok { + return "", errors.New("orderBy '" + orderBy + "' not permitted") + } + + if orderBy != "" { + selectStmt += ` ORDER BY ` + orderBy + } + + selectStmt += ` LIMIT ` + limit + ` OFFSET ` + offset + ` ROWS` + return selectStmt, nil +} + +func deleteQuery() string { + query := `DELETE FROM deliveryservice_server + WHERE deliveryservice=:deliveryservice and server=:server` + return query +} + +type DSServers struct { + DsId*int `json:"dsId" db:"deliveryservice"` + Servers []int `json:"servers"` + Replace *bool `json:"replace"` +} + +type TODSServers DSServers + +var dsserversRef = TODSServers(DSServers{}) + +func GetServersForDsIdRef() *TODSServers { + return +} + +func GetReplaceHandler(db *sqlx.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + defer r.Body.Close() + handleErrs := tc.GetHandleErrorsFunc(w, r) + ctx := r.Context() + user, err := auth.GetCurrentUser(ctx) + if err != nil { + log.Errorf("unable to retrieve current user from context: %s", err) + handleErrs(http.StatusInternalServerError, err) + return + } + + // get list of server Ids to insert + payload := GetServersForDsIdRef() + servers := payload.Servers + dsId := payload.DsId + + if err := json.NewDecoder(r.Body).Decode(payload); err != nil { + log.Errorf("Error trying to decode the request body: %s", err) + handleErrs(http.StatusInternalServerError, err) + return + } + + // if the object has tenancy enabled, check that user is able to access the tenant + // check user tenancy access to this resource. + row := db.QueryRow("SELECT xml_id FROM deliveryservice WHERE id = $1", *dsId) + var xmlId string + row.Scan() + hasAccess, err, apiStatus := tenant.HasTenant(*user, xmlId, db) + if !hasAccess { + switch apiStatus { + case tc.SystemError: + handleErrs(http.StatusInternalServerError, err) + return + case tc.DataMissingError: + handleErrs(http.StatusBadRequest, err) + return + case tc.ForbiddenError: + handleErrs(http.StatusForbidden, err) + return + } + } + + // perform the insert transaction + rollbackTransaction := true + tx, err := db.Beginx() + defer func() { + if tx == nil || !rollbackTransaction { + return + } + err := tx.Rollback() + if err != nil { + log.Errorln(errors.New("rolling back transaction: " + err.Error())) + } + }() + + if err != nil { + log.Error.Printf("could not begin transaction: %v", err) + handleErrs(http.StatusInternalServerError, err) + return + } + + if *payload.Replace { + // delete existing + rows, err := db.Queryx("DELETE FROM deliveryservice_server WHERE deliveryservice = $1", *dsId) +
[GitHub] rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269
rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269 URL: https://github.com/apache/incubator-trafficcontrol/pull/2282#discussion_r189707974 ## File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go ## @@ -263,7 +243,428 @@ func (dss *TODeliveryServiceServer) Delete(db *sqlx.DB, user auth.CurrentUser) ( rollbackTransaction = false return nil, tc.NoError } -func selectQuery() string { + +func selectQuery(orderBy string, limit string, offset string) (string, error) { + + selectStmt := `SELECT + s.deliveryService, + s.server, + s.last_updated + FROM deliveryservice_server s` + + allowedOrderByCols := map[string]string{ + "":"", + "deliveryservice": "s.deliveryService", + "server": "s.server", + "lastupdated": "s.last_updated", + "deliveryService": "s.deliveryService", + "lastUpdated": "s.last_updated", + "last_updated":"s.last_updated", + } + orderBy, ok := allowedOrderByCols[orderBy] + if !ok { + return "", errors.New("orderBy '" + orderBy + "' not permitted") + } + + if orderBy != "" { + selectStmt += ` ORDER BY ` + orderBy + } + + selectStmt += ` LIMIT ` + limit + ` OFFSET ` + offset + ` ROWS` + return selectStmt, nil +} + +func deleteQuery() string { + query := `DELETE FROM deliveryservice_server + WHERE deliveryservice=:deliveryservice and server=:server` + return query +} + +type DSServers struct { + DsId*int `json:"dsId" db:"deliveryservice"` + Servers []int `json:"servers"` + Replace *bool `json:"replace"` +} + +type TODSServers DSServers + +var dsserversRef = TODSServers(DSServers{}) + +func GetServersForDsIdRef() *TODSServers { + return +} + +func GetReplaceHandler(db *sqlx.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + defer r.Body.Close() + handleErrs := tc.GetHandleErrorsFunc(w, r) + ctx := r.Context() + user, err := auth.GetCurrentUser(ctx) + if err != nil { + log.Errorf("unable to retrieve current user from context: %s", err) + handleErrs(http.StatusInternalServerError, err) + return + } + + // get list of server Ids to insert + payload := GetServersForDsIdRef() Review comment: Ad above, `GetServersForDsIdRef` is unsafe for concurrent use, and needs to return a new object, i.e. `s := TODSServers(DSServers{}); return ` 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] rawlinp commented on issue #2247: Add an Origin API
rawlinp commented on issue #2247: Add an Origin API URL: https://github.com/apache/incubator-trafficcontrol/pull/2247#issuecomment-390789307 I believe this PR is no longer a WIP. I have tested it pretty well and am now looking for reviews. Note: I also have #2314 which depends on this PR. 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] rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269
rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269 URL: https://github.com/apache/incubator-trafficcontrol/pull/2282#discussion_r189707585 ## File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go ## @@ -97,130 +100,107 @@ func (dss *TODeliveryServiceServer) Validate(db *sqlx.DB) []error { return tovalidate.ToErrors(errs) } -//The TODeliveryServiceServer implementation of the Creator interface -//all implementations of Creator should use transactions and return the proper errorType -//ParsePQUniqueConstraintError is used to determine if a profileparameter 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 -//The insert sql returns the profile and lastUpdated values of the newly inserted profileparameter and have -//to be added to the struct -func (dss *TODeliveryServiceServer) Create(db *sqlx.DB, user auth.CurrentUser) (error, tc.ApiErrorType) { - rollbackTransaction := true - tx, err := db.Beginx() - defer func() { - if tx == nil || !rollbackTransaction { - return +// api/1.1/deliveryserviceserver$ Review comment: This breaks GoDoc parsing, a comment above a function needs to start with the name of the function, i.e. `// ReadDSSHandler is served at api/1.1/deliveryserviceserver`. Alternatively, you can put the comment somewhere else, like inside the function, to avoid breaking GoDoc. 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] rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269
rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269 URL: https://github.com/apache/incubator-trafficcontrol/pull/2282#discussion_r189707285 ## File path: lib/go-tc/deliveryservice_servers.go ## @@ -78,3 +106,63 @@ type DssServer struct { TypeID *int `json:"typeId" db:"server_type_id"` UpdPending *bool`json:"updPending" db:"upd_pending"` } + +// DSSDeliveryService - a version of the deliveryservice that allows for all fields to be null Review comment: GoDoc comments should be complete sentences, i.e. "DSSDeliveryService is a version of..." 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] rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269
rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269 URL: https://github.com/apache/incubator-trafficcontrol/pull/2282#discussion_r189707065 ## File path: lib/go-tc/deliveryservice_servers.go ## @@ -19,21 +21,47 @@ import "time" // DeliveryServiceServerResponse ... type DeliveryServiceServerResponse struct { + Orderby string `json:"orderby"` Response []DeliveryServiceServer `json:"response"` Size int `json:"size"` - OrderBy string `json:"orderby"` Limitint `json:"limit"` } +type DSSMapResponse struct { + DsIdint `json:"dsId"` + Replace bool `json:"replace"` + Servers []int `json:"servers"` +} + +type DSSReplaceResponse struct { + Alerts []Alert`json:"alerts"` + Response DSSMapResponse `json:"response"` +} + +type DSServersResponse struct { + Response DeliveryServiceServers `json:"response"` +} + +type DeliveryServiceServers struct { + ServerNames []string `json:"serverNames"` + XmlId string `json:"xmlId"` +} + // DeliveryServiceServer ... type DeliveryServiceServer struct { - Server *int `json:"server"` - DeliveryService *int `json:"deliveryService"` - LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` + Server *int `json:"server" db:"server"` + DeliveryService *int `json:"deliveryService" db:"deliveryservice"` + LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` } +type Filter int +const ( + ASSIGNED Filter = iota Review comment: Go enums and constants are CamelCased, not ALLCAPS. These should be `Assigned`, `Unassigned`, `Eligible` 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] rawlinp commented on issue #2314: Remove deliveryservice.org_server_fqdn column/compute it from Origin table
rawlinp commented on issue #2314: Remove deliveryservice.org_server_fqdn column/compute it from Origin table URL: https://github.com/apache/incubator-trafficcontrol/pull/2314#issuecomment-390786527 NOTE: this depends on #2247 which would need to be merged before 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] rawlinp opened a new pull request #2314: Remove deliveryservice.org_server_fqdn column/compute it from Origin table
rawlinp opened a new pull request #2314: Remove deliveryservice.org_server_fqdn column/compute it from Origin table URL: https://github.com/apache/incubator-trafficcontrol/pull/2314 With the Origin table now, the deliveryservice.org_server_fqdn column can be removed. First, populate the Origin table from existing deliveryservice.org_server_fqdn columns. Second, delete the deliveryservice.org_server_fqdn column. Third, compute an org_server_fqdn column from a deliveryservice's primary Origin wherever needed. This doesn't affect the API, only the APIs backend implementation, so no new API version is needed. Whenever a DS is created, the DS's corresponding primary Origin is created from the orgServerFqdn request field. When a DS is updated, its primary Origin is also updated using the orgServerFqdn request field. 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 #2088: TO Go: implement tenants CRUD
asfgit commented on issue #2088: TO Go: implement tenants CRUD URL: https://github.com/apache/incubator-trafficcontrol/pull/2088#issuecomment-390807661 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1634/ 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 #2303: Add TO Go delete cdns/name
asfgit commented on issue #2303: Add TO Go delete cdns/name URL: https://github.com/apache/incubator-trafficcontrol/pull/2303#issuecomment-391036756 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1640/ 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 #2302: Add TO Go cdns/name
asfgit commented on issue #2302: Add TO Go cdns/name URL: https://github.com/apache/incubator-trafficcontrol/pull/2302#issuecomment-391038110 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1641/ 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 #2306: Add TO Go cdns/capacity
asfgit commented on issue #2306: Add TO Go cdns/capacity URL: https://github.com/apache/incubator-trafficcontrol/pull/2306#issuecomment-391043703 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1645/ 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 #2270: Add TO Go Servers Details endpoint
asfgit commented on issue #2270: Add TO Go Servers Details endpoint URL: https://github.com/apache/incubator-trafficcontrol/pull/2270#issuecomment-391026097 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1635/ 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 #2300: Add TO Go cachegroups/id/deliveryservices
asfgit commented on issue #2300: Add TO Go cachegroups/id/deliveryservices URL: https://github.com/apache/incubator-trafficcontrol/pull/2300#issuecomment-391028561 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1636/ 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 #2297: Add TO Go cachegroups/trimmed
asfgit commented on issue #2297: Add TO Go cachegroups/trimmed URL: https://github.com/apache/incubator-trafficcontrol/pull/2297#issuecomment-391032108 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1637/ 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 #2278: Add TO Go caches/stats endpoint
asfgit commented on issue #2278: Add TO Go caches/stats endpoint URL: https://github.com/apache/incubator-trafficcontrol/pull/2278#issuecomment-391033553 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1638/ 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 #2304: Add TO Go cdns/id/queue_updates
asfgit commented on issue #2304: Add TO Go cdns/id/queue_updates URL: https://github.com/apache/incubator-trafficcontrol/pull/2304#issuecomment-391034982 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1639/ 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 #2301: Add TO Go cachegroups/id/queue_update
asfgit commented on issue #2301: Add TO Go cachegroups/id/queue_update URL: https://github.com/apache/incubator-trafficcontrol/pull/2301#issuecomment-391039599 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1642/ 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 commented on issue #1616: Traffic Portal GenISO links break with HA
mitchell852 commented on issue #1616: Traffic Portal GenISO links break with HA URL: https://github.com/apache/incubator-trafficcontrol/issues/1616#issuecomment-391046762 @rivasj will be looking at this from the API perspective 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 commented on issue #1616: Traffic Portal GenISO links break with HA
mitchell852 commented on issue #1616: Traffic Portal GenISO links break with HA URL: https://github.com/apache/incubator-trafficcontrol/issues/1616#issuecomment-391046762 @rivasj will be looking at this from the API perspective. If you want to limit TP changes to zero, then find a way to return a link like it does now but ensure that link works in a HA environment? 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 #2305: Add TO Go cdns/health
asfgit commented on issue #2305: Add TO Go cdns/health URL: https://github.com/apache/incubator-trafficcontrol/pull/2305#issuecomment-391044968 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1646/ 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 commented on issue #2291: update portal ds fields
mitchell852 commented on issue #2291: update portal ds fields URL: https://github.com/apache/incubator-trafficcontrol/pull/2291#issuecomment-390840975 you probably want to just open a new PR, right? 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 #2256: Add TO Go profile parameters routes
mitchell852 closed pull request #2256: Add TO Go profile parameters routes URL: https://github.com/apache/incubator-trafficcontrol/pull/2256 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/parameters.go b/lib/go-tc/parameters.go index 5949e89d2..c09928041 100644 --- a/lib/go-tc/parameters.go +++ b/lib/go-tc/parameters.go @@ -50,3 +50,42 @@ type ParameterNullable struct { Secure *bool `json:"secure" db:"secure"` Value *string `json:"value" db:"value"` } + +type ProfileParameterByName struct { + ConfigFile string`json:"configFile"` + ID int `json:"id"` + LastUpdated TimeNoMod `json:"lastUpdated"` + Namestring`json:"name"` + Secure bool `json:"secure"` + Value string`json:"value"` +} + +type ProfileParameterByNamePost struct { + ConfigFile string `json:"configFile"` + Name string `json:"name"` + Secure int`json:"secure"` + Value string `json:"value"` +} + +type ProfileParameterPostRespObj struct { + ProfileParameterByNamePost + ID int64 `json:"id"` +} + +type ProfileParameterPostResp struct { + Parameters []ProfileParameterPostRespObj `json:"parameters"` + ProfileID int `json:"profileId"` + ProfileName string`json:"profileName"` +} + +type PostProfileParam struct { + ProfileID int64 `json:"profileId"` + ParamIDs []int64 `json:"paramIds"` + Replace bool`json:"replace"` +} + +type PostParamProfile struct { + ParamIDint64 `json:"paramId"` + ProfileIDs []int64 `json:"profileIds"` + Replacebool`json:"replace"` +} diff --git a/traffic_ops/traffic_ops_golang/api/shared_handlers.go b/traffic_ops/traffic_ops_golang/api/shared_handlers.go index 865245581..b10e958a2 100644 --- a/traffic_ops/traffic_ops_golang/api/shared_handlers.go +++ b/traffic_ops/traffic_ops_golang/api/shared_handlers.go @@ -415,3 +415,84 @@ func CreateHandler(typeRef Creator, db *sqlx.DB) http.HandlerFunc { fmt.Fprintf(w, "%s", respBts) } } + +// WriteResp takes any object, serializes it as JSON, and writes that to w. Any errors are logged and written to w via tc.GetHandleErrorsFunc. +// This is a helper for the common case; not using this in unusual cases is perfectly acceptable. +func WriteResp(w http.ResponseWriter, r *http.Request, v interface{}) { + resp := struct { + Response interface{} `json:"response"` + }{v} + respBts, err := json.Marshal(resp) + if err != nil { + log.Errorf("marshalling JSON for %T: %v", v, err) + tc.GetHandleErrorsFunc(w, r)(http.StatusInternalServerError, errors.New(http.StatusText(http.StatusInternalServerError))) + return + } + w.Header().Set("Content-Type", "application/json") + w.Write(respBts) +} + +// HandleErr handles an API error, writing the given statusCode and userErr to the user, and logging the sysErr. If userErr is nil, the text of the HTTP statusCode is written. +// This is a helper for the common case; not using this in unusual cases is perfectly acceptable. +func HandleErr(w http.ResponseWriter, r *http.Request, statusCode int, userErr error, sysErr error) { + if sysErr != nil { + log.Errorln(r.RemoteAddr + " " + sysErr.Error()) + } + if userErr == nil { + userErr = errors.New(http.StatusText(statusCode)) + } + respBts, err := json.Marshal(tc.CreateErrorAlerts(userErr)) + if err != nil { + log.Errorln("marshalling error: " + err.Error()) + *r = *r.WithContext(context.WithValue(r.Context(), tc.StatusKey, http.StatusInternalServerError)) + w.Write([]byte(http.StatusText(http.StatusInternalServerError))) + return + } + *r = *r.WithContext(context.WithValue(r.Context(), tc.StatusKey, statusCode)) + w.Header().Set(tc.ContentType, tc.ApplicationJson) + w.Write(respBts) +} + +// RespWriter is a helper to allow a one-line response, for endpoints with a function that returns the object that needs to be written and an error. +// This is a helper for the common case; not using this in unusual cases is perfectly acceptable. +func RespWriter(w http.ResponseWriter, r *http.Request) func(v interface{}, err error) { + return func(v interface{}, err error) { + if err != nil { + HandleErr(w, r, http.StatusInternalServerError, nil, err) + return + } + WriteResp(w, r, v) + } +} + +//
[GitHub] rob05c closed pull request #2322: remove incorrect quotes from insecure boolean field
rob05c closed pull request #2322: remove incorrect quotes from insecure boolean field URL: https://github.com/apache/incubator-trafficcontrol/pull/2322 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/app/conf/example-ldap.conf b/traffic_ops/app/conf/example-ldap.conf index 34ce4b624..00be7b8de 100644 --- a/traffic_ops/app/conf/example-ldap.conf +++ b/traffic_ops/app/conf/example-ldap.conf @@ -4,6 +4,6 @@ "admin_dn" : "user@prefix.domain.suffix", "host" : "ldaps://host:[port]", "search_query" : "(&(objectCategory=person)(objectClass=user)(userName=%s))", - "insecure" : "false", + "insecure" : false, "ldap_timeout_secs" : 20 } 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] jhg03a commented on issue #1104: [TC-196] API endpoint for Traffic Ops version
jhg03a commented on issue #1104: [TC-196] API endpoint for Traffic Ops version URL: https://github.com/apache/incubator-trafficcontrol/issues/1104#issuecomment-391493322 I think this is done @dangogh 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 #2289: Foundation for Java Api Client
dewrich commented on issue #2289: Foundation for Java Api Client URL: https://github.com/apache/incubator-trafficcontrol/pull/2289#issuecomment-391494558 @nerdynick Be sure all your files have the Apache License header in them 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] rob05c commented on a change in pull request #2124: Add TO Go deliveryservices routes
rob05c commented on a change in pull request #2124: Add TO Go deliveryservices routes URL: https://github.com/apache/incubator-trafficcontrol/pull/2124#discussion_r190379804 ## File path: traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go ## @@ -0,0 +1,1109 @@ +package deliveryservice + +/* + * 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" + "fmt" + "strings" + + "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/config" + "github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers" + "github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/riaksvc" + "github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tenant" + "github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/tovalidate" + + "github.com/go-ozzo/ozzo-validation" + "github.com/jmoiron/sqlx" + "github.com/lib/pq" +) + +//we need a type alias to define functions on +type TODeliveryServiceV13 struct { + DS *tc.DeliveryServiceNullableV13 + Cfg config.Config + DB *sqlx.DB +} + +func (tods *TODeliveryServiceV13) V12() *TODeliveryServiceV12 { + return {DS: , DB: tods.DB, Cfg: tods.Cfg} +} + +func (tods TODeliveryServiceV13) MarshalJSON() ([]byte, error) { return json.Marshal(tods.DS) } +func (tods *TODeliveryServiceV13) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, tods.DS) +} + +func GetRefTypeV13(cfg config.Config, db *sqlx.DB) *TODeliveryServiceV13 { + return {Cfg: cfg, DB: db, DS: {}} +} + +func (ds TODeliveryServiceV13) GetKeyFieldsInfo() []api.KeyFieldInfo { + return ds.V12().GetKeyFieldsInfo() +} + +//Implementation of the Identifier, Validator interface functions +func (ds TODeliveryServiceV13) GetKeys() (map[string]interface{}, bool) { + return ds.V12().GetKeys() +} + +func (tods *TODeliveryServiceV13) SetKeys(keys map[string]interface{}) { + tods.V12().SetKeys(keys) +} + +func (ds *TODeliveryServiceV13) GetAuditName() string { + return ds.V12().GetAuditName() +} + +func (ds *TODeliveryServiceV13) GetType() string { + return ds.V12().GetType() +} + +func ValidateV13(db *sqlx.DB, ds *tc.DeliveryServiceNullableV13) []error { + if ds == nil { + return []error{} + } + tods := TODeliveryServiceV13{DS: ds, DB: db} // TODO set Cfg? + return tods.Validate(db) +} + +func (tods *TODeliveryServiceV13) Sanitize(db *sqlx.DB) { + v12 := tods.V12() + v12.Sanitize(db) + tods.DS.DeliveryServiceNullableV12 = tc.DeliveryServiceNullableV12(*v12.DS) // TODO avoid copy + signedAlgorithm := "url_sig" + if tods.DS.Signed && (tods.DS.SigningAlgorithm == nil || *tods.DS.SigningAlgorithm == "") { + tods.DS.SigningAlgorithm = + } + if !tods.DS.Signed && tods.DS.SigningAlgorithm != nil && *tods.DS.SigningAlgorithm == signedAlgorithm { + tods.DS.Signed = true + } + if tods.DS.DeepCachingType == nil { + s := tc.DeepCachingType("") + tods.DS.DeepCachingType = + } + *tods.DS.DeepCachingType = tc.DeepCachingTypeFromString(string(*tods.DS.DeepCachingType)) +} + +func (tods *TODeliveryServiceV13) Validate(db *sqlx.DB) []error { + tods.Sanitize(db) + ds := tods.DS + neverOrAlways := validation.NewStringRule(tovalidate.IsOneOfStringICase("NEVER", "ALWAYS"), + "must be one of 'NEVER' or 'ALWAYS'") + errs := tovalidate.ToErrors(validation.Errors{ + "deepCachingType": validation.Validate(ds.DeepCachingType, neverOrAlways), + }) + + oldErrs := tods.V12().Validate(db) + return append(errs, oldErrs...) +} + +// Create
[GitHub] rivasj opened a new pull request #2325: Updated fixtures to contain anonymous_blocking_enabled field
rivasj opened a new pull request #2325: Updated fixtures to contain anonymous_blocking_enabled field URL: https://github.com/apache/incubator-trafficcontrol/pull/2325 Updated fixtures to contain anonymous_blocking_enabled field to fix failing perl tests 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 issue #2255: Traffic Ops API endpoint for generating SSL keys needs validation
mitchell852 closed issue #2255: Traffic Ops API endpoint for generating SSL keys needs validation URL: https://github.com/apache/incubator-trafficcontrol/issues/2255 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 #2124: Add TO Go deliveryservices routes
asfgit commented on issue #2124: Add TO Go deliveryservices routes URL: https://github.com/apache/incubator-trafficcontrol/pull/2124#issuecomment-391472652 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1660/ 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] DylanVolz opened a new pull request #2322: remove incorrect quotes from insecure boolean field
DylanVolz opened a new pull request #2322: remove incorrect quotes from insecure boolean field URL: https://github.com/apache/incubator-trafficcontrol/pull/2322 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] rob05c closed issue #2308: missing snapshot notification in change logs on TO, TP notifications
rob05c closed issue #2308: missing snapshot notification in change logs on TO, TP notifications URL: https://github.com/apache/incubator-trafficcontrol/issues/2308 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] rob05c commented on issue #2308: missing snapshot notification in change logs on TO, TP notifications
rob05c commented on issue #2308: missing snapshot notification in change logs on TO, TP notifications URL: https://github.com/apache/incubator-trafficcontrol/issues/2308#issuecomment-391492335 Fixed in master, cb671dfd3dc0fc5db47acd55726419badde6d6d5 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] jhg03a opened a new issue #2323: Feature Request: Show delivery services associated with MSO "Server"
jhg03a opened a new issue #2323: Feature Request: Show delivery services associated with MSO "Server" URL: https://github.com/apache/incubator-trafficcontrol/issues/2323 On a normal cache server you have the option to see what delivery services are attached to a server. However if the "server" is actually an MSO origin, this option is missing. 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 #2325: Updated fixtures to contain anonymous_blocking_enabled field
asfgit commented on issue #2325: Updated fixtures to contain anonymous_blocking_enabled field URL: https://github.com/apache/incubator-trafficcontrol/pull/2325#issuecomment-391497366 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 #2322: remove incorrect quotes from insecure boolean field
asfgit commented on issue #2322: remove incorrect quotes from insecure boolean field URL: https://github.com/apache/incubator-trafficcontrol/pull/2322#issuecomment-391492884 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1662/ 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 commented on issue #2053: TO goose migration fails with "permission denied"
mitchell852 commented on issue #2053: TO goose migration fails with "permission denied" URL: https://github.com/apache/incubator-trafficcontrol/issues/2053#issuecomment-391492996 can this be closed @dangogh ? 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 #2324: correct login status codes and enhance ldap logging
asfgit commented on issue #2324: correct login status codes and enhance ldap logging URL: https://github.com/apache/incubator-trafficcontrol/pull/2324#issuecomment-391511496 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1663/ Test FAILed. 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 #2088: TO Go: implement tenants CRUD
asfgit commented on issue #2088: TO Go: implement tenants CRUD URL: https://github.com/apache/incubator-trafficcontrol/pull/2088#issuecomment-391182802 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1652/ 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 commented on issue #2275: Download ISO should actually download the ISO
mitchell852 commented on issue #2275: Download ISO should actually download the ISO URL: https://github.com/apache/incubator-trafficcontrol/issues/2275#issuecomment-391194784 @dneuman64 - this was already captured in #1616 and @rivasj will be looking at this, so i'm going to close 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] mitchell852 closed issue #2275: Download ISO should actually download the ISO
mitchell852 closed issue #2275: Download ISO should actually download the ISO URL: https://github.com/apache/incubator-trafficcontrol/issues/2275 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 #2318: only show ds form field tooltip when label is clicked
mitchell852 opened a new pull request #2318: only show ds form field tooltip when label is clicked URL: https://github.com/apache/incubator-trafficcontrol/pull/2318 fixes #2196 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 #2297: Add TO Go cachegroups/trimmed
mitchell852 closed pull request #2297: Add TO Go cachegroups/trimmed URL: https://github.com/apache/incubator-trafficcontrol/pull/2297 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/v13/cachegroups.go b/lib/go-tc/v13/cachegroups.go index 38ac437ad..ee203fcd5 100644 --- a/lib/go-tc/v13/cachegroups.go +++ b/lib/go-tc/v13/cachegroups.go @@ -56,3 +56,7 @@ type CacheGroupNullable struct { TypeID *int `json:"typeId" db:"type_id"` // aliased to type_id to disambiguate struct scans due join on 'type' table LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` } + +type CachegroupTrimmedName struct { + Name string `json:"name"` +} diff --git a/traffic_ops/traffic_ops_golang/cachegroup/trimmed.go b/traffic_ops/traffic_ops_golang/cachegroup/trimmed.go new file mode 100644 index 0..766c372ec --- /dev/null +++ b/traffic_ops/traffic_ops_golang/cachegroup/trimmed.go @@ -0,0 +1,52 @@ +package cachegroup + +/* + * 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" + "errors" + "net/http" + + tc "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13" + "github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/api" +) + +func TrimmedHandler(db *sql.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + api.RespWriter(w, r)(getCachegroupsTrimmed(db)) + } +} + +func getCachegroupsTrimmed(db *sql.DB) ([]tc.CachegroupTrimmedName, error) { + names := []tc.CachegroupTrimmedName{} + rows, err := db.Query(`SELECT name from cachegroup`) + if err != nil { + return nil, errors.New("selecting cachegroup names: " + err.Error()) + } + defer rows.Close() + for rows.Next() { + name := "" + if err := rows.Scan(); err != nil { + return nil, errors.New("scanning cachegroup names: " + err.Error()) + } + names = append(names, tc.CachegroupTrimmedName{Name: name}) + } + return names, nil +} diff --git a/traffic_ops/traffic_ops_golang/routes.go b/traffic_ops/traffic_ops_golang/routes.go index 8858c327c..d1822bb06 100644 --- a/traffic_ops/traffic_ops_golang/routes.go +++ b/traffic_ops/traffic_ops_golang/routes.go @@ -88,6 +88,7 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) { {1.1, http.MethodDelete, `asns/{id}$`, api.DeleteHandler(asn.GetRefTypeV11(), d.DB), auth.PrivLevelOperations, Authenticated, nil}, //CacheGroup: CRUD + {1.1, http.MethodGet, `cachegroups/trimmed/?(\.json)?$`, cachegroup.TrimmedHandler(d.DB.DB), auth.PrivLevelReadOnly, Authenticated, nil}, {1.1, http.MethodGet, `cachegroups/?(\.json)?$`, api.ReadHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelReadOnly, Authenticated, nil}, {1.1, http.MethodGet, `cachegroups/{id}$`, api.ReadHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelReadOnly, Authenticated, nil}, {1.1, http.MethodPut, `cachegroups/{id}$`, api.UpdateHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations, Authenticated, 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] asfgit commented on issue #2088: TO Go: implement tenants CRUD
asfgit commented on issue #2088: TO Go: implement tenants CRUD URL: https://github.com/apache/incubator-trafficcontrol/pull/2088#issuecomment-391181463 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1651/ 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 #2318: only show ds form field tooltip when label is clicked
asfgit commented on issue #2318: only show ds form field tooltip when label is clicked URL: https://github.com/apache/incubator-trafficcontrol/pull/2318#issuecomment-391201950 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1653/ 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 commented on issue #2029: [Issue 1907] TO API for backup edge cachegroup
Vijay-1 commented on issue #2029: [Issue 1907] TO API for backup edge cachegroup URL: https://github.com/apache/incubator-trafficcontrol/pull/2029#issuecomment-391306197 @mitchell852 Ok. Have to get the required GoLang code inside leaving the API (GoLang) part for now. Will try to get this done. @rawlinp I will address this and let you know. 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 #2324: correct login status codes and enhance ldap logging
asfgit commented on issue #2324: correct login status codes and enhance ldap logging URL: https://github.com/apache/incubator-trafficcontrol/pull/2324#issuecomment-391528681 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1664/ Test FAILed. 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] dneuman64 closed issue #2196: Links in TP help hover text are unclickable
dneuman64 closed issue #2196: Links in TP help hover text are unclickable URL: https://github.com/apache/incubator-trafficcontrol/issues/2196 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 #2310: Add TO Go cdns/metric_types route 501
mitchell852 closed pull request #2310: Add TO Go cdns/metric_types route 501 URL: https://github.com/apache/incubator-trafficcontrol/pull/2310 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/api/v11/cdn.rst b/docs/source/api/v11/cdn.rst index d2f742e42..91c926cc1 100644 --- a/docs/source/api/v11/cdn.rst +++ b/docs/source/api/v11/cdn.rst @@ -384,6 +384,8 @@ Metrics **GET /api/1.1/cdns/metric_types/:metric/start_date/:start/end_date/:end** +*Note: this route is not currently implemented in Traffic Ops. See https://github.com/apache/incubator-trafficcontrol/issues/2309* + Retrieves edge metrics of one or all locations (cache groups). Authentication Required: Yes diff --git a/docs/source/api/v12/cdn.rst b/docs/source/api/v12/cdn.rst index 650b0a97a..7cdf9b084 100644 --- a/docs/source/api/v12/cdn.rst +++ b/docs/source/api/v12/cdn.rst @@ -639,8 +639,11 @@ Routing Metrics +++ + **GET /api/1.2/cdns/metric_types/:metric/start_date/:start/end_date/:end** +*Note: this route is not currently implemented in Traffic Ops. See https://github.com/apache/incubator-trafficcontrol/issues/2309* + Retrieves edge metrics of one or all locations (cache groups). Authentication Required: Yes diff --git a/traffic_ops/traffic_ops_golang/routes.go b/traffic_ops/traffic_ops_golang/routes.go index 8858c327c..25dcee32b 100644 --- a/traffic_ops/traffic_ops_golang/routes.go +++ b/traffic_ops/traffic_ops_golang/routes.go @@ -95,6 +95,7 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) { {1.1, http.MethodDelete, `cachegroups/{id}$`, api.DeleteHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations, Authenticated, nil}, //CDN + {1.1, http.MethodGet, `cdns/metric_types`, notImplementedHandler, 0, NoAuth, nil}, // MUST NOT end in $, because the 1.x route is longer {1.1, http.MethodGet, `cdns/capacity$`, handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}}, {1.1, http.MethodGet, `cdns/configs$`, handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}}, {1.1, http.MethodGet, `cdns/domains$`, handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}}, @@ -316,6 +317,13 @@ func rootHandler(d ServerData) http.Handler { return managerHandler } +// notImplementedHandler returns a 501 Not Implemented to the client. This should be used very rarely, and primarily for old API Perl routes which were broken long ago, which we don't have the resources to rewrite in Go for the time being. +func notImplementedHandler(w http.ResponseWriter, r *http.Request) { + code := http.StatusNotImplemented + w.WriteHeader(code) + w.Write([]byte(http.StatusText(code))) +} + //CreateThrottledHandler takes a handler, and a max and uses a channel to insure the handler is used concurrently by only max number of routines func CreateThrottledHandler(handler http.Handler, maxConcurrentCalls int) ThrottledHandler { return ThrottledHandler{handler, make(chan struct{}, maxConcurrentCalls)} 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] dneuman64 closed pull request #2318: only show ds form field tooltip when label is clicked
dneuman64 closed pull request #2318: only show ds form field tooltip when label is clicked URL: https://github.com/apache/incubator-trafficcontrol/pull/2318 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/common/modules/form/_form.scss b/traffic_portal/app/src/common/modules/form/_form.scss index a35b3c5a1..0869e2f66 100644 --- a/traffic_portal/app/src/common/modules/form/_form.scss +++ b/traffic_portal/app/src/common/modules/form/_form.scss @@ -18,4 +18,8 @@ .btn-link.request-status { font-size: 20px; color: #cd1323; +} + +form .control-label > span:hover { + text-decoration: underline; } \ No newline at end of file diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html index cca6e392e..5725970e6 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html @@ -66,7 +66,7 @@ -* {{label('active', 'title')}} +{{label('active', 'title')}} * @@ -79,7 +79,7 @@ -* {{label('typeId', 'title')}} +{{label('typeId', 'title')}} * @@ -93,7 +93,7 @@ -* {{label('xmlId', 'title')}} +{{label('xmlId', 'title')}} * @@ -107,7 +107,7 @@ -* {{label('displayName', 'title')}} +{{label('displayName', 'title')}} * @@ -120,7 +120,7 @@ -* {{label('tenantId', 'title')}} +{{label('tenantId', 'title')}} * @@ -134,7 +134,7 @@ -* {{label('cdnId', 'title')}} +{{label('cdnId', 'title')}} * @@ -148,7 +148,7 @@ -* {{label('orgServerFqdn', 'title')}} +{{label('orgServerFqdn', 'title')}} * @@ -161,7 +161,7 @@ -* {{label('protocol', 'title')}} +{{label('protocol', 'title')}} * @@ -174,7 +174,7 @@ -* {{label('longDesc', 'title')}} +{{label('longDesc', 'title')}} * @@ -196,7 +196,7 @@ -* {{label('routingName', 'title')}} +{{label('routingName', 'title')}} * Warning: Changing the routing name may require SSL certificates to be updated. @@ -211,7 +211,7 @@ -* {{label('dscp', 'title')}} +{{label('dscp', 'title')}} * @@ -224,7 +224,7 @@ -* {{label('ipv6RoutingEnabled', 'title')}} +{{label('ipv6RoutingEnabled', 'title')}} * @@ -237,7 +237,7 @@ -* {{label('rangeRequestHandling', 'title')}} +{{label('rangeRequestHandling', 'title')}} * @@ -250,7 +250,7 @@ -* {{label('qstringIgnore', 'title')}} +{{label('qstringIgnore', 'title')}} * @@ -263,7 +263,7 @@ -* {{label('multiSiteOrigin', 'title')}} +{{label('multiSiteOrigin', 'title')}} * @@ -276,7 +276,7 @@
[GitHub] rawlinp commented on a change in pull request #2247: Add an Origin API
rawlinp commented on a change in pull request #2247: Add an Origin API URL: https://github.com/apache/incubator-trafficcontrol/pull/2247#discussion_r190044166 ## File path: lib/go-tc/v13/origins.go ## @@ -0,0 +1,150 @@ +package v13 + +import ( + "github.com/apache/incubator-trafficcontrol/lib/go-tc" +) + +/* + * 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. + */ + +type OriginsResponse struct { + Response []OriginNullable `json:"response"` +} + +// OriginDetailResponse is the JSON object returned for a single origin +type OriginDetailResponse struct { + Response OriginNullable `json:"response"` + tc.Alerts +} + +type Origin struct { + Cachegroupstring `json:"cachegroup" db:"cachegroup"` + CachegroupID int `json:"cachegroupId" db:"cachegroup_id"` + Coordinatestring `json:"coordinate" db:"coordinate"` + CoordinateID int `json:"coordinateId" db:"coordinate_id"` + DeliveryService string `json:"deliveryService" db:"deliveryservice"` + DeliveryServiceID int `json:"deliveryServiceId" db:"deliveryservice_id"` + FQDN string `json:"fqdn" db:"fqdn"` + IDint `json:"id" db:"id"` + IP6Addressstring `json:"ip6Address" db:"ip6_address"` + IPAddress string `json:"ipAddress" db:"ip_address"` + IsPrimary bool `json:"isPrimary" db:"is_primary"` + LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` + Name string `json:"name" db:"name"` + Port int `json:"port" db:"port"` + Profile string `json:"profile" db:"profile"` + ProfileID int `json:"profileId" db:"profile_id"` + Protocol string `json:"protocol" db:"protocol"` + Tenantstring `json:"tenant" db:"tenant"` + TenantID int `json:"tenantId" db:"tenant_id"` +} + +type OriginNullable struct { + Cachegroup*string `json:"cachegroup" db:"cachegroup"` + CachegroupID *int `json:"cachegroupId" db:"cachegroup_id"` + Coordinate*string `json:"coordinate" db:"coordinate"` + CoordinateID *int `json:"coordinateId" db:"coordinate_id"` + DeliveryService *string `json:"deliveryService" db:"deliveryservice"` + DeliveryServiceID *int `json:"deliveryServiceId" db:"deliveryservice_id"` + FQDN *string `json:"fqdn" db:"fqdn"` + ID*int `json:"id" db:"id"` + IP6Address*string `json:"ip6Address" db:"ip6_address"` + IPAddress *string `json:"ipAddress" db:"ip_address"` + IsPrimary *bool `json:"isPrimary" db:"is_primary"` + LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` + Name *string `json:"name" db:"name"` + Port *int `json:"port" db:"port"` + Profile *string `json:"profile" db:"profile"` + ProfileID *int `json:"profileId" db:"profile_id"` + Protocol *string `json:"protocol" db:"protocol"` + Tenant*string `json:"tenant" db:"tenant"` + TenantID *int `json:"tenantId" db:"tenant_id"` +} + +type OriginBuilder struct { Review comment: Yeah they're not currently used anywhere in the codebase, but I found it useful when I was implementing a test program using the Origin client. Since none of the other client implementations use the `*Nullable` structs yet, something like this hasn't really been necessary. Without it, you basically have to declare a temporary variable and `&` that variable when setting the pointer in the `*Nullable` struct. Using this Builder pattern you basically just: ``` foo := NewOriginBuilder().CacheGroupID(1).CoordinateID(1).Build() ``` as opposed to: ``` cgID := 1 coordID := 1 foo := OriginNullable{CachegroupID: ,
[GitHub] rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269
rob05c commented on a change in pull request #2282: Deliveryservice_Server API conversion to Go - formerly #2269 URL: https://github.com/apache/incubator-trafficcontrol/pull/2282#discussion_r190064897 ## File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go ## @@ -263,7 +243,428 @@ func (dss *TODeliveryServiceServer) Delete(db *sqlx.DB, user auth.CurrentUser) ( rollbackTransaction = false return nil, tc.NoError } -func selectQuery() string { + +func selectQuery(orderBy string, limit string, offset string) (string, error) { + + selectStmt := `SELECT + s.deliveryService, + s.server, + s.last_updated + FROM deliveryservice_server s` + + allowedOrderByCols := map[string]string{ + "":"", + "deliveryservice": "s.deliveryService", + "server": "s.server", + "lastupdated": "s.last_updated", + "deliveryService": "s.deliveryService", + "lastUpdated": "s.last_updated", + "last_updated":"s.last_updated", + } + orderBy, ok := allowedOrderByCols[orderBy] + if !ok { + return "", errors.New("orderBy '" + orderBy + "' not permitted") + } + + if orderBy != "" { + selectStmt += ` ORDER BY ` + orderBy + } + + selectStmt += ` LIMIT ` + limit + ` OFFSET ` + offset + ` ROWS` + return selectStmt, nil +} + +func deleteQuery() string { + query := `DELETE FROM deliveryservice_server + WHERE deliveryservice=:deliveryservice and server=:server` + return query +} + +type DSServers struct { + DsId*int `json:"dsId" db:"deliveryservice"` + Servers []int `json:"servers"` + Replace *bool `json:"replace"` +} + +type TODSServers DSServers + + +func createServersForDsIdRef() *TODSServers { + var dsserversRef = TODSServers(DSServers{}) + return +} + +func GetReplaceHandler(db *sqlx.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + defer r.Body.Close() + handleErrs := tc.GetHandleErrorsFunc(w, r) + ctx := r.Context() + user, err := auth.GetCurrentUser(ctx) + if err != nil { + log.Errorf("unable to retrieve current user from context: %s", err) + handleErrs(http.StatusInternalServerError, err) + return + } + + // get list of server Ids to insert + payload := createServersForDsIdRef() + servers := payload.Servers + dsId := payload.DsId + + if err := json.NewDecoder(r.Body).Decode(payload); err != nil { + log.Errorf("Error trying to decode the request body: %s", err) + handleErrs(http.StatusInternalServerError, err) + return + } + + // if the object has tenancy enabled, check that user is able to access the tenant + // check user tenancy access to this resource. + row := db.QueryRow("SELECT xml_id FROM deliveryservice WHERE id = $1", *dsId) Review comment: This is panicing. It looks like it's because You're assigning `dsId` above before decoding the JSON, so it's always `nil`. But, even if the JSON has been decoded, you still need to check for nil, because the user POST could be missing that field. In which case, we should return a `http.StatusBadRequest` to the user, with a message explaining that `dsId` is required. The `Replace` field also needs checked that it's not `nil` before dereferencing. 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] rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup
rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup URL: https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r189958107 ## File path: traffic_ops/app/db/migrations/2018052100_cache_group_fallback.sql ## @@ -0,0 +1,38 @@ +/* + +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. +*/ + +-- +goose Up +-- SQL in section 'Up' is executed when this migration is applied + + +-- cachegroup_fallbacks +CREATE TABLE cachegroup_fallbacks ( +primary_cg bigint, +backup_cg bigint CHECK (primary_cg != backup_cg), +set_order bigint NOT NULL, +CONSTRAINT fk_primary_cg FOREIGN KEY (primary_cg) REFERENCES cachegroup(id) ON DELETE CASCADE, +CONSTRAINT fk_backup_cg FOREIGN KEY (backup_cg) REFERENCES cachegroup(id) ON DELETE CASCADE, +UNIQUE (primary_cg, backup_cg), +UNIQUE (primary_cg, set_order) +); + +ALTER TABLE cachegroup ADD COLUMN fallback_to_closest BOOLEAN DEFAULT TRUE; Review comment: This should also probably be NOT NULL? Might save us from a bunch of unnecessary null checks when reading from the DB. 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] rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup
rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup URL: https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r189955184 ## File path: traffic_ops/app/db/migrations/2018052100_cache_group_fallback.sql ## @@ -0,0 +1,38 @@ +/* + +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. +*/ + +-- +goose Up +-- SQL in section 'Up' is executed when this migration is applied + + +-- cachegroup_fallbacks +CREATE TABLE cachegroup_fallbacks ( +primary_cg bigint, Review comment: Should `primary_cg` and `backup_cg` both be `NOT NULL` as well? I'm not sure null values would make sense there. 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] rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup
rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup URL: https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r189953754 ## File path: traffic_ops/app/lib/API/Cachegroup.pm ## @@ -57,6 +57,7 @@ sub index { "lastUpdated" => $row->last_updated, "parentCachegroupId"=> $row->parent_cachegroup_id, "parentCachegroupName" => ( defined $row->parent_cachegroup_id ) ? $idnames{ $row->parent_cachegroup_id } : undef, + "fallbackToClosest" => \$row->fallback_to_closest, Review comment: I saw API reference documentation for the new `cachegroup_fallbacks` endpoint, but the existing cachegroup API reference documentation should also be updated to show this new `fallbackToClosest` field. 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] rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup
rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup URL: https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r189963481 ## File path: traffic_ops/app/lib/API/CachegroupFallback.pm ## @@ -0,0 +1,278 @@ +package API::CachegroupFallback; +# +# +# 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. +# +# +# +# a note about locations and cachegroups. This used to be "Location", before we had physical locations in 12M. Very confusing. +# What used to be called a location is now called a "cache group" and location is now a physical address, not a group of caches working together. +# + +# JvD Note: you always want to put Utils as the first use. Sh*t don't work if it's after the Mojo lines. +use UI::Utils; +use Mojo::Base 'Mojolicious::Controller'; +use Data::Dumper; +use JSON; +use MojoPlugins::Response; +use Validate::Tiny ':all'; + +sub delete { + my $self = shift; + my $cache_id = $self->param('cacheGroupId'); + my $fallback_id = $self->param('fallbackId'); + my $params = $self->req->json; + my $rs_backups = undef; + + if ( !_oper($self) ) { + return $self->forbidden(); + } + + if ( defined ($cache_id) && defined($fallback_id) ) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id , backup_cg => $fallback_id} ); + } elsif (defined ($cache_id)) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id} ); + } elsif (defined ($fallback_id)) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search( { backup_cg => $fallback_id} ); + } + + if ( ($rs_backups->count > 0) ) { + my $del_records = $rs_backups->delete(); + if ($del_records) { + ( $self, "Backup configuration DELETED", "APICHANGE"); + return $self->success_message("Backup configuration DELETED"); + } else { + return $self->alert( "Backup configuration DELETED." ); + } + } else { + ( $self, "No backup Cachegroups found"); + return $self->not_found(); + } +} + +sub show { + my $self = shift; + my $cache_id = $self->param("cacheGroupId"); + my $fallback_id = $self->param("fallbackId"); + my $id = $cache_id ? $cache_id : $fallback_id; + + #only integers + if ( $id !~ /^\d+?$/ ) { + ( $self, "No such Cachegroup id $id"); + return $self->success([]); + } + + my $cachegroup = $self->db->resultset('Cachegroup')->search( { id => $id } )->single(); + if ( !defined($cachegroup) ) { + ( $self, "No such Cachegroup $id"); + return $self->success([]); + } + + if ( ($cachegroup->type->name ne "EDGE_LOC") ) { + ( $self, "cachegroup should be type EDGE_LOC."); + return $self->success([]); + } + + my $rs_backups = undef; + + if ( defined ($cache_id) && defined ($fallback_id)) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id, backup_cg => $fallback_id}, {order_by => 'set_order'}); + } elsif ( defined ($cache_id) ) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id}, {order_by => 'set_order'}); + } elsif ( defined ($fallback_id) ) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search({ backup_cg => $fallback_id}, {order_by => 'set_order'}); + } + + if ( defined ($rs_backups) && ($rs_backups->count > 0) ) { + my $response; + my $backup_cnt = 0; + while ( my $row = $rs_backups->next ) { + $response->[$backup_cnt]{"cacheGroupId"} = $row->primary_cg->id; + $response->[$backup_cnt]{"cacheGroupName"} = $row->primary_cg->name; + $response->[$backup_cnt]{"fallbackName"} = $row->backup_cg->name; + $response->[$backup_cnt]{"fallbackId"} = $row->backup_cg->id; + $response->[$backup_cnt]{"fallbackOrder"} = $row->set_order; + $backup_cnt++; + } + return $self->success(
[GitHub] rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup
rawlinp commented on a change in pull request #2029: [Issue 1907] TO API for backup edge cachegroup URL: https://github.com/apache/incubator-trafficcontrol/pull/2029#discussion_r189971490 ## File path: traffic_ops/app/lib/API/CachegroupFallback.pm ## @@ -0,0 +1,278 @@ +package API::CachegroupFallback; +# +# +# 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. +# +# +# +# a note about locations and cachegroups. This used to be "Location", before we had physical locations in 12M. Very confusing. +# What used to be called a location is now called a "cache group" and location is now a physical address, not a group of caches working together. +# + +# JvD Note: you always want to put Utils as the first use. Sh*t don't work if it's after the Mojo lines. +use UI::Utils; +use Mojo::Base 'Mojolicious::Controller'; +use Data::Dumper; +use JSON; +use MojoPlugins::Response; +use Validate::Tiny ':all'; + +sub delete { + my $self = shift; + my $cache_id = $self->param('cacheGroupId'); + my $fallback_id = $self->param('fallbackId'); + my $params = $self->req->json; + my $rs_backups = undef; + + if ( !_oper($self) ) { + return $self->forbidden(); + } + + if ( defined ($cache_id) && defined($fallback_id) ) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id , backup_cg => $fallback_id} ); + } elsif (defined ($cache_id)) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search( { primary_cg => $cache_id} ); + } elsif (defined ($fallback_id)) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search( { backup_cg => $fallback_id} ); + } + + if ( ($rs_backups->count > 0) ) { + my $del_records = $rs_backups->delete(); + if ($del_records) { + ( $self, "Backup configuration DELETED", "APICHANGE"); + return $self->success_message("Backup configuration DELETED"); + } else { + return $self->alert( "Backup configuration DELETED." ); + } + } else { + ( $self, "No backup Cachegroups found"); + return $self->not_found(); + } +} + +sub show { + my $self = shift; + my $cache_id = $self->param("cacheGroupId"); + my $fallback_id = $self->param("fallbackId"); + my $id = $cache_id ? $cache_id : $fallback_id; + + #only integers + if ( $id !~ /^\d+?$/ ) { + ( $self, "No such Cachegroup id $id"); + return $self->success([]); + } + + my $cachegroup = $self->db->resultset('Cachegroup')->search( { id => $id } )->single(); + if ( !defined($cachegroup) ) { + ( $self, "No such Cachegroup $id"); + return $self->success([]); + } + + if ( ($cachegroup->type->name ne "EDGE_LOC") ) { + ( $self, "cachegroup should be type EDGE_LOC."); + return $self->success([]); + } + + my $rs_backups = undef; + + if ( defined ($cache_id) && defined ($fallback_id)) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id, backup_cg => $fallback_id}, {order_by => 'set_order'}); + } elsif ( defined ($cache_id) ) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search({ primary_cg => $cache_id}, {order_by => 'set_order'}); + } elsif ( defined ($fallback_id) ) { + $rs_backups = $self->db->resultset('CachegroupFallback')->search({ backup_cg => $fallback_id}, {order_by => 'set_order'}); + } + + if ( defined ($rs_backups) && ($rs_backups->count > 0) ) { + my $response; + my $backup_cnt = 0; + while ( my $row = $rs_backups->next ) { + $response->[$backup_cnt]{"cacheGroupId"} = $row->primary_cg->id; + $response->[$backup_cnt]{"cacheGroupName"} = $row->primary_cg->name; + $response->[$backup_cnt]{"fallbackName"} = $row->backup_cg->name; + $response->[$backup_cnt]{"fallbackId"} = $row->backup_cg->id; + $response->[$backup_cnt]{"fallbackOrder"} = $row->set_order; + $backup_cnt++; + } + return $self->success(
[GitHub] rawlinp commented on a change in pull request #2247: Add an Origin API
rawlinp commented on a change in pull request #2247: Add an Origin API URL: https://github.com/apache/incubator-trafficcontrol/pull/2247#discussion_r190041779 ## File path: lib/go-tc/v13/origins.go ## @@ -0,0 +1,150 @@ +package v13 + +import ( + "github.com/apache/incubator-trafficcontrol/lib/go-tc" +) + +/* + * 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. + */ + +type OriginsResponse struct { + Response []OriginNullable `json:"response"` +} + +// OriginDetailResponse is the JSON object returned for a single origin +type OriginDetailResponse struct { + Response OriginNullable `json:"response"` + tc.Alerts +} + +type Origin struct { + Cachegroupstring `json:"cachegroup" db:"cachegroup"` + CachegroupID int `json:"cachegroupId" db:"cachegroup_id"` + Coordinatestring `json:"coordinate" db:"coordinate"` + CoordinateID int `json:"coordinateId" db:"coordinate_id"` + DeliveryService string `json:"deliveryService" db:"deliveryservice"` + DeliveryServiceID int `json:"deliveryServiceId" db:"deliveryservice_id"` + FQDN string `json:"fqdn" db:"fqdn"` + IDint `json:"id" db:"id"` + IP6Addressstring `json:"ip6Address" db:"ip6_address"` + IPAddress string `json:"ipAddress" db:"ip_address"` + IsPrimary bool `json:"isPrimary" db:"is_primary"` + LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` + Name string `json:"name" db:"name"` + Port int `json:"port" db:"port"` + Profile string `json:"profile" db:"profile"` + ProfileID int `json:"profileId" db:"profile_id"` + Protocol string `json:"protocol" db:"protocol"` + Tenantstring `json:"tenant" db:"tenant"` + TenantID int `json:"tenantId" db:"tenant_id"` +} + +type OriginNullable struct { Review comment: Ok I believe just the unit tests are using `Origin`, so I should be able to just swap that out with `OriginNullable` then rename that to `Origin`. 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] rob05c commented on a change in pull request #2247: Add an Origin API
rob05c commented on a change in pull request #2247: Add an Origin API URL: https://github.com/apache/incubator-trafficcontrol/pull/2247#discussion_r190046195 ## File path: lib/go-tc/v13/origins.go ## @@ -0,0 +1,150 @@ +package v13 + +import ( + "github.com/apache/incubator-trafficcontrol/lib/go-tc" +) + +/* + * 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. + */ + +type OriginsResponse struct { + Response []OriginNullable `json:"response"` +} + +// OriginDetailResponse is the JSON object returned for a single origin +type OriginDetailResponse struct { + Response OriginNullable `json:"response"` + tc.Alerts +} + +type Origin struct { + Cachegroupstring `json:"cachegroup" db:"cachegroup"` + CachegroupID int `json:"cachegroupId" db:"cachegroup_id"` + Coordinatestring `json:"coordinate" db:"coordinate"` + CoordinateID int `json:"coordinateId" db:"coordinate_id"` + DeliveryService string `json:"deliveryService" db:"deliveryservice"` + DeliveryServiceID int `json:"deliveryServiceId" db:"deliveryservice_id"` + FQDN string `json:"fqdn" db:"fqdn"` + IDint `json:"id" db:"id"` + IP6Addressstring `json:"ip6Address" db:"ip6_address"` + IPAddress string `json:"ipAddress" db:"ip_address"` + IsPrimary bool `json:"isPrimary" db:"is_primary"` + LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` + Name string `json:"name" db:"name"` + Port int `json:"port" db:"port"` + Profile string `json:"profile" db:"profile"` + ProfileID int `json:"profileId" db:"profile_id"` + Protocol string `json:"protocol" db:"protocol"` + Tenantstring `json:"tenant" db:"tenant"` + TenantID int `json:"tenantId" db:"tenant_id"` +} + +type OriginNullable struct { + Cachegroup*string `json:"cachegroup" db:"cachegroup"` + CachegroupID *int `json:"cachegroupId" db:"cachegroup_id"` + Coordinate*string `json:"coordinate" db:"coordinate"` + CoordinateID *int `json:"coordinateId" db:"coordinate_id"` + DeliveryService *string `json:"deliveryService" db:"deliveryservice"` + DeliveryServiceID *int `json:"deliveryServiceId" db:"deliveryservice_id"` + FQDN *string `json:"fqdn" db:"fqdn"` + ID*int `json:"id" db:"id"` + IP6Address*string `json:"ip6Address" db:"ip6_address"` + IPAddress *string `json:"ipAddress" db:"ip_address"` + IsPrimary *bool `json:"isPrimary" db:"is_primary"` + LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` + Name *string `json:"name" db:"name"` + Port *int `json:"port" db:"port"` + Profile *string `json:"profile" db:"profile"` + ProfileID *int `json:"profileId" db:"profile_id"` + Protocol *string `json:"protocol" db:"protocol"` + Tenant*string `json:"tenant" db:"tenant"` + TenantID *int `json:"tenantId" db:"tenant_id"` +} + +type OriginBuilder struct { Review comment: I'm a -1 on this. I can see the convenience, but it's very non-standard. The benefit isn't worth the readability cost, for new devs to figure out. To avoid multiple lines, the Go idiom is to have a `NewOrigin()` func, that either takes values to set, or takes no parameters and initializes all the pointers. I'm guessing most usages will be loading from SQL and parsing JSON from POSTs, so it probably won't be used enough to justify the learning curve, either. This is an automated message from the Apache Git Service. To respond to the message, please log on
[GitHub] asfgit commented on issue #2317: Add TO Go cdns/name/dnsseckeys
asfgit commented on issue #2317: Add TO Go cdns/name/dnsseckeys URL: https://github.com/apache/incubator-trafficcontrol/pull/2317#issuecomment-391160661 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/incubator-trafficcontrol-PR/1649/ 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