[1/2] incubator-trafficcontrol git commit: list artifacts

2017-07-03 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master cddf6db00 -> 36687c4bd


list artifacts


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ba8cab95
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ba8cab95
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ba8cab95

Branch: refs/heads/master
Commit: ba8cab95f0161502e9924a94ced990e20d0235da
Parents: cddf6db
Author: Dan Kirkwood 
Authored: Thu Jun 29 09:58:20 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 09:36:39 2017 -0600

--
 pkg | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ba8cab95/pkg
--
diff --git a/pkg b/pkg
index 2912bcb..0c3cf04 100755
--- a/pkg
+++ b/pkg
@@ -141,4 +141,11 @@ if (( $failure )); then
echo "Failed to build$badproj."
 fi
 
+if [[ -d dist ]]; then
+echo "Results in 'dist':"
+ls -lt dist
+else
+echo "dist artifact directory not found."
+fi
+
 exit $failure



[2/2] incubator-trafficcontrol git commit: This closes #706

2017-07-03 Thread mitchell852
This closes #706


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/36687c4b
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/36687c4b
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/36687c4b

Branch: refs/heads/master
Commit: 36687c4bd0c0ba5873ca795744349d04000f2638
Parents: ba8cab9
Author: Jeremy Mitchell 
Authored: Mon Jul 3 09:37:04 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 09:37:04 2017 -0600

--

--




[4/4] incubator-trafficcontrol git commit: This closes #704

2017-07-03 Thread mitchell852
This closes #704


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/583d8c03
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/583d8c03
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/583d8c03

Branch: refs/heads/master
Commit: 583d8c036494b96b5fc4be57a41ed6f648aa2868
Parents: 9fdab2e
Author: Jeremy Mitchell 
Authored: Mon Jul 3 09:47:19 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 09:47:19 2017 -0600

--

--




[2/4] incubator-trafficcontrol git commit: don't ignore .md files for license

2017-07-03 Thread mitchell852
don't ignore .md files for license


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/0a892f6e
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/0a892f6e
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/0a892f6e

Branch: refs/heads/master
Commit: 0a892f6e74361e7cb4c280a284bd22a5f7efb55a
Parents: 98560e3
Author: Dan Kirkwood 
Authored: Wed Jun 28 17:50:27 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 09:47:02 2017 -0600

--
 .rat-excludes | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/0a892f6e/.rat-excludes
--
diff --git a/.rat-excludes b/.rat-excludes
index 652f50d..f5ae80c 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -1,4 +1,3 @@
-.*\.md(?:Markdown files aren't usually code. ){0}
 BUILD_NUMBER(?:  This very short file doesn't support 
comments and doesn't constitute code. ){0}
 VERSION(?:   This very short file doesn't support 
comments and doesn't constitute code. ){0}
 .*\.min\.css(?:  minified files are generated files, more 
akin to compiled binaries. Their source bears the license. ){0}



[1/4] incubator-trafficcontrol git commit: don't ignore .md files for license requirement

2017-07-03 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 36687c4bd -> 583d8c036


don't ignore .md files for license requirement


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9fdab2ee
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9fdab2ee
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9fdab2ee

Branch: refs/heads/master
Commit: 9fdab2eec6a6bc28f39f17add5fbdb057ae81794
Parents: 0a892f6
Author: Dan Kirkwood 
Authored: Wed Jun 28 17:52:04 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 09:47:02 2017 -0600

--
 BUILD.md | 19 +++
 CONTRIBUTING.md  | 19 +++
 README.md| 19 +++
 build/README.md  | 19 +++
 infrastructure/docker/README.md  | 19 +++
 infrastructure/docker/build/README.md| 19 +++
 infrastructure/test/README.md| 19 +++
 misc/git/README.md   | 19 +++
 test/router/Readme.md| 19 +++
 test/router/dnssec/Readme.md | 19 +++
 test/traffic_ops_cfg/Readme.md   | 19 +++
 traffic_monitor/README.md| 19 +++
 traffic_monitor_golang/traffic_monitor/README.md | 19 +++
 traffic_ops/INSTALL.md   | 19 +++
 traffic_ops/build/README.md  | 19 +++
 traffic_ops/client/tests/integration/Readme.md   | 19 +++
 traffic_ops/experimental/auth/README.md  | 19 +++
 traffic_ops/experimental/server/README.md| 19 +++
 traffic_ops/experimental/webfront/README.md  | 19 +++
 traffic_ops/goto/README.md   | 19 +++
 traffic_ops_db/pg-migration/README.md| 19 +++
 traffic_portal/README.md | 19 +++
 traffic_portal/build/README.md   | 19 +++
 traffic_router/core/src/test/resources/Readme.md | 19 +++
 traffic_router/neustar/README.md | 19 +++
 traffic_server/README.md | 19 +++
 .../plugins/astats_over_http/README.md   | 19 +++
 27 files changed, 513 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9fdab2ee/BUILD.md
--
diff --git a/BUILD.md b/BUILD.md
index 0ef5eae..db544d5 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -1,3 +1,22 @@
+
+
 
 See the build instructions at ./docs/source/development/building.rst or at
 
http://trafficcontrol.incubator.apache.org/docs/latest/development/building.html

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9fdab2ee/CONTRIBUTING.md
--
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9e3e13a..f5bb103 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,22 @@
+
+
 **Contributing to Traffic Control**
 =
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9fdab2ee/README.md
--
diff --git a/README.md b/README.md
index a36a72d..c2150e4 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,22 @@
+
+
 Build: [![Build 
Status](https://builds.apache.org/buildStatus/icon?job=incubator-trafficcontrol-master-build)](https://builds.apache.org/view/Incubator%20Projects/job/incubator-trafficcontrol-master-build/)
 
 Apache Traffic Control (incubating) is an Open Source implementation of a 
Content Delivery Network.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9fdab2ee/build/README.md
--
diff --git a/build/README.md b/build/README.md
index 0766a69..d7e7994 100644
--- a/build/README.md
+++ b/build/README.md
@@ -1,3 +1,22 @@
+
+
 
 # Rpm Build Instructions
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9fdab2ee/infrastructure/docker/README.md
--
diff --git a/infrastructure/docker/README.md b/infrastructure/docker/README.md
index eee24f0..7a8b6a4 100644
--- a/infrastructure/docker/README.md
+++ b/infrastructure/doc

[3/4] incubator-trafficcontrol git commit: remove copyright

2017-07-03 Thread mitchell852
remove copyright


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/98560e33
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/98560e33
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/98560e33

Branch: refs/heads/master
Commit: 98560e339e7175c8ef4c3ed7b0c27040d91d8a23
Parents: 36687c4
Author: Dan Kirkwood 
Authored: Wed Jun 28 17:50:21 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 09:47:02 2017 -0600

--
 traffic_ops/app/t/api/1.1/cdn.t  | 1 -
 traffic_ops/client/delivery_service_resources.go | 1 -
 traffic_ops/install/lib/WebDep.pm| 2 --
 3 files changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/98560e33/traffic_ops/app/t/api/1.1/cdn.t
--
diff --git a/traffic_ops/app/t/api/1.1/cdn.t b/traffic_ops/app/t/api/1.1/cdn.t
index a3cf9ef..4df0c53 100644
--- a/traffic_ops/app/t/api/1.1/cdn.t
+++ b/traffic_ops/app/t/api/1.1/cdn.t
@@ -1,6 +1,5 @@
 package main;
 #
-# Copyright 2015 Comcast Cable Communications Management, LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/98560e33/traffic_ops/client/delivery_service_resources.go
--
diff --git a/traffic_ops/client/delivery_service_resources.go 
b/traffic_ops/client/delivery_service_resources.go
index 54d635f..ce4d58b 100644
--- a/traffic_ops/client/delivery_service_resources.go
+++ b/traffic_ops/client/delivery_service_resources.go
@@ -1,5 +1,4 @@
 /*
-   Copyright 2015 Comcast Cable Communications Management, LLC
 
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/98560e33/traffic_ops/install/lib/WebDep.pm
--
diff --git a/traffic_ops/install/lib/WebDep.pm 
b/traffic_ops/install/lib/WebDep.pm
index a899ac9..c8c11be 100644
--- a/traffic_ops/install/lib/WebDep.pm
+++ b/traffic_ops/install/lib/WebDep.pm
@@ -1,8 +1,6 @@
 package WebDep;
 
 #
-# Copyright 2015 Comcast Cable Communications Management, LLC
-#
 # 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



[2/2] incubator-trafficcontrol git commit: This closes #710

2017-07-03 Thread mitchell852
This closes #710


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9e94ce37
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9e94ce37
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9e94ce37

Branch: refs/heads/master
Commit: 9e94ce3764b86cc373ff42815642f1f47d2004fc
Parents: b575712
Author: Jeremy Mitchell 
Authored: Mon Jul 3 10:39:14 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 10:39:14 2017 -0600

--

--




[1/2] incubator-trafficcontrol git commit: fix portal build script

2017-07-03 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 583d8c036 -> 9e94ce376


fix portal build script


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b5757129
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b5757129
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b5757129

Branch: refs/heads/master
Commit: b5757129848e00c542608146804e46325612c932
Parents: 583d8c0
Author: Dan Kirkwood 
Authored: Mon Jul 3 10:23:01 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 3 10:38:45 2017 -0600

--
 traffic_portal/build/build_rpm.sh | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b5757129/traffic_portal/build/build_rpm.sh
--
diff --git a/traffic_portal/build/build_rpm.sh 
b/traffic_portal/build/build_rpm.sh
index 9542f14..a30f6f0 100755
--- a/traffic_portal/build/build_rpm.sh
+++ b/traffic_portal/build/build_rpm.sh
@@ -13,15 +13,14 @@
 # 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.
+#
 
+#
 function importFunctions() {
local script=$(readlink -f "$0")
-   local suff=${script##*control/}
-   local tcdirlen=$[${#script} - ${#suff}]
-   export TC_DIR=${script:0:$tcdirlen}
local scriptdir=$(dirname "$script")
-   export TS_DIR=$(dirname "$scriptdir")
-
+   export TP_DIR=$(dirname "$scriptdir")
+   export TC_DIR=$(dirname "$TP_DIR")
functions_sh="$TC_DIR/build/functions.sh"
if [[ ! -r $functions_sh ]]; then
echo "error: can't find $functions_sh"
@@ -30,21 +29,22 @@ function importFunctions() {
. "$functions_sh"
 }
 
-#
+
+# ---
 function initBuildArea() {
echo "Initializing the build area."
mkdir -p "$RPMBUILD"/{SPECS,SOURCES,RPMS,SRPMS,BUILD,BUILDROOT} || { 
echo "Could not create $RPMBUILD: $?"; exit 1; }
 
# tar/gzip the source
local ts_dest=$(createSourceDir traffic_portal)
-   cd "$TS_DIR" || \
-{ echo "Could not cd to $TS_DIR: $?"; exit 1; }
+   cd "$TP_DIR" || \
+{ echo "Could not cd to $TP_DIR: $?"; exit 1; }
rsync -av ./ "$ts_dest"/ || \
 { echo "Could not copy to $to_dest: $?"; exit 1; }
-   cp -r "$TS_DIR"/ "$ts_dest" || { echo "Could not copy $TS_DIR to 
$ts_dest: $?"; exit 1; }
+   cp -r "$TP_DIR"/ "$ts_dest" || { echo "Could not copy $TP_DIR to 
$ts_dest: $?"; exit 1; }
 
tar -czvf "$ts_dest".tgz -C "$RPMBUILD"/SOURCES $(basename $ts_dest) || 
{ echo "Could not create tar archive $ts_dest.tgz: $?"; exit 1; }
-   cp "$TS_DIR"/build/*.spec "$RPMBUILD"/SPECS/. || { echo "Could not copy 
spec files: $?"; exit 1; }
+   cp "$TP_DIR"/build/*.spec "$RPMBUILD"/SPECS/. || { echo "Could not copy 
spec files: $?"; exit 1; }
 
echo "The build area has been initialized."
 }



[1/2] incubator-trafficcontrol git commit: docker-compose to run unit tests

2017-07-10 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master c80e72d5f -> 4e4eac88d


docker-compose to run unit tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/f46665db
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/f46665db
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/f46665db

Branch: refs/heads/master
Commit: f46665db30cf58a38e62ace02487332ebb7cea0a
Parents: c80e72d
Author: Dan Kirkwood 
Authored: Fri Jul 7 15:09:44 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 12:20:11 2017 -0600

--
 traffic_ops/app/bin/tests/Dockerfile-unittest | 66 
 traffic_ops/app/bin/tests/docker-compose.yml  | 34 
 traffic_ops/app/bin/tests/runtests.sh | 92 ++
 traffic_ops/app/cpanfile  |  2 +-
 4 files changed, 193 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f46665db/traffic_ops/app/bin/tests/Dockerfile-unittest
--
diff --git a/traffic_ops/app/bin/tests/Dockerfile-unittest 
b/traffic_ops/app/bin/tests/Dockerfile-unittest
new file mode 100644
index 000..0333b0d
--- /dev/null
+++ b/traffic_ops/app/bin/tests/Dockerfile-unittest
@@ -0,0 +1,66 @@
+#
+# 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.
+#
+FROM centos:7
+MAINTAINER Dan Kirkwood 
+
+RUN yum -y install \
+
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
+
+RUN yum -y install \
+cpanminus \
+expat-devel \
+gcc-c++ \
+libcurl \
+libcurl-devel \
+libidn-devel \
+libpcap-devel \
+mkisofs \
+nmap-ncat \
+openssl-devel \
+perl \
+perl-App-cpanminus \
+perl-DBD-Pg \
+perl-DBI \
+perl-Digest-SHA1 \
+perl-JSON \
+perl-TermReadKey \
+perl-Test-CPAN-Meta \
+perl-WWW-Curl \
+perl-core \
+perl-libwww-perl \
+postgresql96 \
+postgresql96-devel && \
+yum clean all
+
+RUN curl -o - https://www.kernel.org/pub/software/scm/git/git-2.12.2.tar.gz | 
tar xzvf - -C /tmp && \
+cd /tmp/git-2.12.2/ && \
+make -i prefix=/usr install && \
+rm -rf /tmp/git-2.12.2
+
+RUN cpanm -n Carton
+
+ADD install/bin/install_goose.sh /
+RUN /install_goose.sh
+
+ADD app /opt/traffic_ops/app
+WORKDIR /opt/traffic_ops/app
+RUN POSTGRES_HOME=/usr/pgsql-9.6 carton
+
+RUN rm -rf /root/.cpan*
+
+ADD app/bin/tests/runtests.sh /
+CMD [ "/runtests.sh", "/opt/traffic_ops/app/t", "test", "db", "5432" ]
+
+#
+# vi:syntax=Dockerfile

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f46665db/traffic_ops/app/bin/tests/docker-compose.yml
--
diff --git a/traffic_ops/app/bin/tests/docker-compose.yml 
b/traffic_ops/app/bin/tests/docker-compose.yml
new file mode 100644
index 000..f464144
--- /dev/null
+++ b/traffic_ops/app/bin/tests/docker-compose.yml
@@ -0,0 +1,34 @@
+# 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.
+---
+version: '2'
+
+volumes:
+  traffic_ops:
+
+services:
+  db:
+image: postgres:9.6
+
+  unit:
+build:
+  context: ../../..
+  dockerfile: app/bin/tests/Dockerfile-unittest
+links:
+  - db
+volumes:
+  - traffic_ops:/opt/traffic_ops

http://git-wip-us.ap

[2/2] incubator-trafficcontrol git commit: This closes #716

2017-07-10 Thread mitchell852
This closes #716


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/4e4eac88
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/4e4eac88
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/4e4eac88

Branch: refs/heads/master
Commit: 4e4eac88d876e17ab40f3db5cb046bec0e9e9993
Parents: f46665d
Author: Jeremy Mitchell 
Authored: Mon Jul 10 12:20:36 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 12:20:36 2017 -0600

--

--




[12/14] incubator-trafficcontrol git commit: org-tenancy - comments removal

2017-07-10 Thread mitchell852
org-tenancy - comments removal


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/6fbab5d4
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/6fbab5d4
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/6fbab5d4

Branch: refs/heads/master
Commit: 6fbab5d40dce6a3fbbb80aa2b3fb65b433bb73e3
Parents: 80d586f
Author: nir-sopher 
Authored: Sun Apr 2 15:10:18 2017 +0300
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 traffic_ops/app/lib/API/Deliveryservice.pm  | 4 ++--
 traffic_ops/app/lib/API/Deliveryservice2.pm | 4 ++--
 traffic_ops/app/t/api/1.2/tenant.t  | 1 -
 3 files changed, 4 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6fbab5d4/traffic_ops/app/lib/API/Deliveryservice.pm
--
diff --git a/traffic_ops/app/lib/API/Deliveryservice.pm 
b/traffic_ops/app/lib/API/Deliveryservice.pm
index 0b5fa5e..8d7f1cd 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -288,7 +288,7 @@ sub update {
}
}

-   #setting tenant_id to undef if tenant is not set. TODO(nirs): remove 
when tenancy is no longer optional in the API
+   #setting tenant_id to undef if tenant is not set. 
my $tenant_id = exists($params->{tenantId}) ? $params->{tenantId} :  
undef; 
 
my $values = {
@@ -460,7 +460,7 @@ sub create {
return $self->alert( "A deliveryservice with xmlId " . $xml_id 
. " already exists." );
}

-   #setting tenant_id to the user id if tenant is not set. TODO(nirs): 
remove when tenancy is no longer optional in the API
+   #setting tenant_id to the user id if tenant is not set. 
my $tenant_id = exists($params->{tenantId}) ? $params->{tenantId} :  
$self->current_user_tenant();
 
my $values = {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6fbab5d4/traffic_ops/app/lib/API/Deliveryservice2.pm
--
diff --git a/traffic_ops/app/lib/API/Deliveryservice2.pm 
b/traffic_ops/app/lib/API/Deliveryservice2.pm
index 8b3846e..bce272a 100644
--- a/traffic_ops/app/lib/API/Deliveryservice2.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice2.pm
@@ -451,11 +451,11 @@ sub _check_params {
 
if (defined($ds_id)) {
#update
-   #setting tenant_id to undef if tenant is not set. TODO(nirs): 
remove when tenancy is no longer optional in the API
+   #setting tenant_id to undef if tenant is not set. 
$transformed_params->{tenantId} = exists($params->{tenantId}) ? 
$params->{tenantId}  :  undef;
} else {
#create 
-   #setting tenant_id to the runing user if tenant is not set. 
TODO(nirs): remove when tenancy is no longer optional in the API
+   #setting tenant_id to the runing user if tenant is not set. 
$transformed_params->{tenantId} = exists($params->{tenantId}) ? 
$params->{tenantId}  :  $self->current_user_tenant();
}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6fbab5d4/traffic_ops/app/t/api/1.2/tenant.t
--
diff --git a/traffic_ops/app/t/api/1.2/tenant.t 
b/traffic_ops/app/t/api/1.2/tenant.t
index ece6d3e..384c407 100644
--- a/traffic_ops/app/t/api/1.2/tenant.t
+++ b/traffic_ops/app/t/api/1.2/tenant.t
@@ -152,7 +152,6 @@ ok $t->delete_ok('/api/1.2/tenants/' . 
$tenantE_id)->status_is(200)->or( sub { d
 ok $t->delete_ok('/api/1.2/tenants/' . $tenantD_id)->status_is(200)->or( sub { 
diag $t->tx->res->content->asset->{content}; } );
 ok $t->delete_ok('/api/1.2/tenants/' . $tenantA_id)->status_is(200)->or( sub { 
diag $t->tx->res->content->asset->{content}; } );
 
-#TODO(nirs): move to a "tenancy" UT when written
 #cannot delete a tenant that have a delivery-service
 ok $t->delete_ok('/api/1.2/tenants/' . 10**9)->status_is(400)
->json_is( "/alerts/0/text" => "Tenant 'root' is assign with 
delivery-services(s): e.g. 'test-ds1-root'. Please update/delete these 
delivery-services and retry." )



[02/14] incubator-trafficcontrol git commit: Adjust deliveryservice_user.t due to recently added DSs to the fixture

2017-07-10 Thread mitchell852
Adjust deliveryservice_user.t due to recently added DSs to the fixture


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e5f054ba
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e5f054ba
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e5f054ba

Branch: refs/heads/master
Commit: e5f054ba4bb46e5ba45bf84aeb823e267184ecad
Parents: 1e361b7
Author: nir-sopher 
Authored: Wed Jun 21 02:20:42 2017 +0300
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 traffic_ops/app/t/api/1.2/deliveryservice_user.t | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e5f054ba/traffic_ops/app/t/api/1.2/deliveryservice_user.t
--
diff --git a/traffic_ops/app/t/api/1.2/deliveryservice_user.t 
b/traffic_ops/app/t/api/1.2/deliveryservice_user.t
index 5419383..725cc39 100644
--- a/traffic_ops/app/t/api/1.2/deliveryservice_user.t
+++ b/traffic_ops/app/t/api/1.2/deliveryservice_user.t
@@ -54,8 +54,8 @@ my $count_response = sub {
 
$t->get_ok('/api/1.2/users/200/deliveryservices')->status_is(200)->$count_response(1)
 ->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
-# there are currently 12 delivery services NOT assigned to user with id=200
-$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(12)
+# there are currently 13 delivery services NOT assigned to user with id=200
+$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(13)
 ->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 # assign one ds to user with id=200
@@ -75,7 +75,7 @@ 
$t->get_ok('/api/1.2/users/200/deliveryservices')->status_is(200)->$count_respon
 ->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 # there are now 11 delivery services NOT assigned to user with id=200
-$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(11)
+$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(12)
 ->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 # now remove ds=300 from user=200
@@ -88,8 +88,8 @@ ok 
$t->delete_ok('/api/1.2/deliveryservice_user/200/200')->status_is(404)->or( s
 
$t->get_ok('/api/1.2/users/200/deliveryservices')->status_is(200)->$count_response(1)
 ->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
-# there are now 12 delivery services NOT assigned to user with id=200
-$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(12)
+# there are now 13 delivery services NOT assigned to user with id=200
+$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(13)
 ->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 ok $t->get_ok('/logout')->status_is(302)->or( sub { diag 
$t->tx->res->content->asset->{content}; } );



[13/14] incubator-trafficcontrol git commit: Migration file rename

2017-07-10 Thread mitchell852
Migration file rename


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/6d67f5f7
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/6d67f5f7
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/6d67f5f7

Branch: refs/heads/master
Commit: 6d67f5f771e4678f4e1d54d981d810ab550e3552
Parents: 0b0d9e5
Author: nir-sopher 
Authored: Thu Apr 20 13:38:08 2017 +0300
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 .../2017040400_delivery_service_tenancy.sql | 30 
 .../2017060200_delivery_service_tenancy.sql | 30 
 2 files changed, 30 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6d67f5f7/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql
deleted file mode 100644
index a737d0c..000
--- a/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-
-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
-
-ALTER TABLE deliveryservice
-ADD tenant_id BIGINT,
-ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
-ALTER COLUMN tenant_id SET DEFAULT NULL;
-CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
-
--- +goose Down
--- SQL section 'Down' is executed when this migration is rolled back
-
-ALTER TABLE deliveryservice
-DROP COLUMN tenant_id;
-

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6d67f5f7/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql
new file mode 100644
index 000..a737d0c
--- /dev/null
+++ b/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql
@@ -0,0 +1,30 @@
+/*
+
+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
+
+ALTER TABLE deliveryservice
+ADD tenant_id BIGINT,
+ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
+ALTER COLUMN tenant_id SET DEFAULT NULL;
+CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+
+ALTER TABLE deliveryservice
+DROP COLUMN tenant_id;
+



[08/14] incubator-trafficcontrol git commit: A tenant cannot be deleted if a ds is assigned to it

2017-07-10 Thread mitchell852
A tenant cannot be deleted if a ds is assigned to it


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/7d4ea45e
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/7d4ea45e
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/7d4ea45e

Branch: refs/heads/master
Commit: 7d4ea45e53dd67926d80f43640dc8c2343cac091
Parents: dc000f8
Author: nir-sopher 
Authored: Wed Mar 22 23:00:54 2017 +0200
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm  | 5 +
 traffic_ops/app/t/api/1.2/tenant.t | 8 
 2 files changed, 13 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/7d4ea45e/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index c09df37..784cb67 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -255,6 +255,11 @@ sub delete {
return $self->alert("Tenant '$name' has children tenant(s): e.g 
'$existing_child'. Please update these tenants and retry.");
}
 
+   #The order of the below tests is intentional - allowing UT to cover all 
cases - TODO(nirs) remove this comment when a full "tenancy" UT is added, 
including permissions and such (no use in putting effort into it yet)
+   my $existing_ds = $self->db->resultset('Deliveryservice')->search( { 
tenant_id => $id })->get_column('xml_id')->first();
+   if ($existing_ds) {
+   return $self->alert("Tenant '$name' is assign with 
delivery-services(s): e.g. '$existing_ds'. Please update/delete these 
delivery-services and retry.");
+
my $existing_user = $self->db->resultset('TmUser')->search( { tenant_id 
=> $id }, {order_by => 'me.username' })->get_column('username')->first();
if ($existing_user) {
return $self->alert("Tenant '$name' is assign with user(s): 
e.g. '$existing_user'. Please update these users and retry.");

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/7d4ea45e/traffic_ops/app/t/api/1.2/tenant.t
--
diff --git a/traffic_ops/app/t/api/1.2/tenant.t 
b/traffic_ops/app/t/api/1.2/tenant.t
index a66a8a3..ece6d3e 100644
--- a/traffic_ops/app/t/api/1.2/tenant.t
+++ b/traffic_ops/app/t/api/1.2/tenant.t
@@ -152,6 +152,14 @@ ok $t->delete_ok('/api/1.2/tenants/' . 
$tenantE_id)->status_is(200)->or( sub { d
 ok $t->delete_ok('/api/1.2/tenants/' . $tenantD_id)->status_is(200)->or( sub { 
diag $t->tx->res->content->asset->{content}; } );
 ok $t->delete_ok('/api/1.2/tenants/' . $tenantA_id)->status_is(200)->or( sub { 
diag $t->tx->res->content->asset->{content}; } );
 
+#TODO(nirs): move to a "tenancy" UT when written
+#cannot delete a tenant that have a delivery-service
+ok $t->delete_ok('/api/1.2/tenants/' . 10**9)->status_is(400)
+   ->json_is( "/alerts/0/text" => "Tenant 'root' is assign with 
delivery-services(s): e.g. 'test-ds1-root'. Please update/delete these 
delivery-services and retry." )
+   ->or( sub { diag $t->tx->res->content->asset->{content}; } );
+
+ok $t->delete_ok('/api/1.2/deliveryservices/' . 2100)->status_is(200)
+
 #cannot delete a tenant that have a user
 ok $t->delete_ok('/api/1.2/tenants/' . 10**9)->status_is(400)
->json_is( "/alerts/0/text" => "Tenant 'root' is assign with user(s): 
e.g. 'admin-root'. Please update these users and retry." )



[06/14] incubator-trafficcontrol git commit: Test fix following DS addition

2017-07-10 Thread mitchell852
Test fix following DS addition


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/23806cef
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/23806cef
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/23806cef

Branch: refs/heads/master
Commit: 23806cefb99247c4329af83f1bb344a2fb2dc6f2
Parents: 17ff770
Author: nir-sopher 
Authored: Mon Mar 20 19:46:52 2017 +0200
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/23806cef/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
--
diff --git a/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t 
b/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
index d5cb58f..9ec9ecf 100644
--- a/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
+++ b/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
@@ -71,7 +71,7 @@ my $count_response = sub {
return $t->success( is( scalar(@$r), $count ) );
 };
 
-$t->get_ok('/api/1.2/deliveryservices/list?logsEnabled=true')->status_is(200)->$count_response(2)
+$t->get_ok('/api/1.2/deliveryservices/list?logsEnabled=true')->status_is(200)->$count_response(3)
->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 ok $t->put_ok('/api/1.2/snapshot/cdn1')->status_is(200)->or( sub { diag 
$t->tx->res->content->asset->{content}; } );



[09/14] incubator-trafficcontrol git commit: DS API added tenant - Doc

2017-07-10 Thread mitchell852
DS API added tenant - Doc


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/80d586fd
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/80d586fd
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/80d586fd

Branch: refs/heads/master
Commit: 80d586fde606805b624e5bdc96a5e4c71970d8a4
Parents: 7d4ea45
Author: nir-sopher 
Authored: Wed Mar 22 23:02:09 2017 +0200
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 .../traffic_ops_api/v12/deliveryservice.rst   | 14 ++
 .../source/development/traffic_ops_api/v12/server.rst |  3 +++
 2 files changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/80d586fd/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
--
diff --git a/docs/source/development/traffic_ops_api/v12/deliveryservice.rst 
b/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
index 694436a..2d04604 100644
--- a/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
+++ b/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
@@ -174,6 +174,8 @@ Delivery Service
   
+--++--+
   | ``sslKeyVersion``|  int   |

  |
   
+--++--+
+  | ``tenantId`` | int| Owning tenant ID   

  |
+  
+--++--+
   | ``trRequestHeaders`` | string |

  |
   
+--++--+
   | ``trResponseHeaders``| string |

  |
@@ -238,6 +240,7 @@ Delivery Service
 "remapText": null,
 "signed": false,
 "sslKeyVersion": "0",
+"tenantId": 1,
 "trRequestHeaders": null,
 "trResponseHeaders": "Access-Control-Allow-Origin: *",
 "type": "HTTP",
@@ -403,6 +406,8 @@ Delivery Service
   
+--++--+
   | ``sslKeyVersion``|  int   |

  |
   
+--++--+
+  | ``tenantId`` | int| Owning tenant ID   

  |
+  
+--++--+
   | ``trRequestHeaders`` | string |

  |
   
+--++--+
   | ``trResponseHeaders``| string |

  |
@@ -474,6 +479,7 @@ Delivery Service
 "remapText": null,
 "signed": false,
 "sslKeyVersion": "0",
+"tenantId": 1,
 "trRequestHeaders": null,
 "trResponseHeaders": "Access-Control-Allow-Origin: *",
 "type": "HTTP",
@@ -1877,6 +1883,8 @@ SSL Keys
   
+==

[10/14] incubator-trafficcontrol git commit: tenancy ds test - verify stability

2017-07-10 Thread mitchell852
tenancy ds test - verify stability


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/0b0d9e54
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/0b0d9e54
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/0b0d9e54

Branch: refs/heads/master
Commit: 0b0d9e5411f863059e5667ae49f29c7ca2b2dcfe
Parents: c9d117c
Author: nir-sopher 
Authored: Thu Apr 6 19:36:47 2017 +0300
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/0b0d9e54/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index c21528b..3bcdd0f 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -256,7 +256,7 @@ sub delete {
}
 
#The order of the below tests is intentional
-   my $existing_ds = $self->db->resultset('Deliveryservice')->search( { 
tenant_id => $id })->get_column('xml_id')->first();
+   my $existing_ds = $self->db->resultset('Deliveryservice')->search( { 
tenant_id => $id }, {order_by => 'me.xml_id' })->get_column('xml_id')->first();
if ($existing_ds) {
return $self->alert("Tenant '$name' is assign with 
delivery-services(s): e.g. '$existing_ds'. Please update/delete these 
delivery-services and retry.");
}



[01/14] incubator-trafficcontrol git commit: Org tenancy - rename migration file

2017-07-10 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 4e4eac88d -> 7d0883914


Org tenancy - rename migration file


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b34693ee
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b34693ee
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b34693ee

Branch: refs/heads/master
Commit: b34693ee9f9fd15104b8e461513b54bce78cbb21
Parents: e5f054b
Author: nir-sopher 
Authored: Mon Jun 26 11:32:28 2017 +0300
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 .../2017062100_delivery_service_tenancy.sql | 30 
 .../2017062800_delivery_service_tenancy.sql | 30 
 2 files changed, 30 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b34693ee/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql
deleted file mode 100644
index a737d0c..000
--- a/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-
-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
-
-ALTER TABLE deliveryservice
-ADD tenant_id BIGINT,
-ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
-ALTER COLUMN tenant_id SET DEFAULT NULL;
-CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
-
--- +goose Down
--- SQL section 'Down' is executed when this migration is rolled back
-
-ALTER TABLE deliveryservice
-DROP COLUMN tenant_id;
-

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b34693ee/traffic_ops/app/db/migrations/2017062800_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017062800_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017062800_delivery_service_tenancy.sql
new file mode 100644
index 000..a737d0c
--- /dev/null
+++ b/traffic_ops/app/db/migrations/2017062800_delivery_service_tenancy.sql
@@ -0,0 +1,30 @@
+/*
+
+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
+
+ALTER TABLE deliveryservice
+ADD tenant_id BIGINT,
+ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
+ALTER COLUMN tenant_id SET DEFAULT NULL;
+CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+
+ALTER TABLE deliveryservice
+DROP COLUMN tenant_id;
+



[11/14] incubator-trafficcontrol git commit: Rename the delivery_service_tenancy migration file, waiting for the pull

2017-07-10 Thread mitchell852
Rename the delivery_service_tenancy migration file, waiting for the pull


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/1e361b73
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/1e361b73
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/1e361b73

Branch: refs/heads/master
Commit: 1e361b736678b182ed153483d65e133444277b90
Parents: 6d67f5f
Author: nir-sopher 
Authored: Wed Jun 21 00:15:33 2017 +0300
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 .../2017060200_delivery_service_tenancy.sql | 30 
 .../2017062100_delivery_service_tenancy.sql | 30 
 2 files changed, 30 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/1e361b73/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql
deleted file mode 100644
index a737d0c..000
--- a/traffic_ops/app/db/migrations/2017060200_delivery_service_tenancy.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-
-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
-
-ALTER TABLE deliveryservice
-ADD tenant_id BIGINT,
-ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
-ALTER COLUMN tenant_id SET DEFAULT NULL;
-CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
-
--- +goose Down
--- SQL section 'Down' is executed when this migration is rolled back
-
-ALTER TABLE deliveryservice
-DROP COLUMN tenant_id;
-

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/1e361b73/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql
new file mode 100644
index 000..a737d0c
--- /dev/null
+++ b/traffic_ops/app/db/migrations/2017062100_delivery_service_tenancy.sql
@@ -0,0 +1,30 @@
+/*
+
+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
+
+ALTER TABLE deliveryservice
+ADD tenant_id BIGINT,
+ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
+ALTER COLUMN tenant_id SET DEFAULT NULL;
+CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+
+ALTER TABLE deliveryservice
+DROP COLUMN tenant_id;
+



[05/14] incubator-trafficcontrol git commit: Delivery service tenancy - API

2017-07-10 Thread mitchell852
Delivery service tenancy - API


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/17ff770e
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/17ff770e
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/17ff770e

Branch: refs/heads/master
Commit: 17ff770ec09e3f66be2710c67e17feac4d675324
Parents: c041291
Author: nir-sopher 
Authored: Mon Mar 20 19:36:31 2017 +0200
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 traffic_ops/app/lib/API/Deliveryservice.pm  |  17 +-
 traffic_ops/app/lib/API/Deliveryservice2.pm |  13 +
 traffic_ops/app/lib/Fixtures/Deliveryservice.pm |  40 +++
 traffic_ops/app/t/api/1.2/deliveryservice.t | 116 +++-
 .../app/t/api/1.2/deliveryservice_crud.t| 296 +++
 5 files changed, 475 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/17ff770e/traffic_ops/app/lib/API/Deliveryservice.pm
--
diff --git a/traffic_ops/app/lib/API/Deliveryservice.pm 
b/traffic_ops/app/lib/API/Deliveryservice.pm
index ee68788..0b5fa5e 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -133,6 +133,7 @@ sub index {
"remapText"=> $row->remap_text,
"signed"   => \$row->signed,
"sslKeyVersion"=> $row->ssl_key_version,
+   "tenantId" => $row->tenant_id,
"trRequestHeaders" => 
$row->tr_request_headers,
"trResponseHeaders"=> 
$row->tr_response_headers,
"type" => $row->type->name,
@@ -248,6 +249,7 @@ sub show {
"remapText"=> $row->remap_text,
"signed"   => \$row->signed,
"sslKeyVersion"=> $row->ssl_key_version,
+   "tenantId" => $row->tenant_id,
"trRequestHeaders" => 
$row->tr_request_headers,
"trResponseHeaders"=> 
$row->tr_response_headers,
"type" => $row->type->name,
@@ -285,6 +287,9 @@ sub update {
return $self->alert( "A deliveryservice with xmlId " . 
$xml_id . " already exists." );
}
}
+   
+   #setting tenant_id to undef if tenant is not set. TODO(nirs): remove 
when tenancy is no longer optional in the API
+   my $tenant_id = exists($params->{tenantId}) ? $params->{tenantId} :  
undef; 
 
my $values = {
active => $params->{active},
@@ -329,6 +334,7 @@ sub update {
remap_text => $params->{remapText},
signed => $params->{signed},
ssl_key_version=> $params->{sslKeyVersion},
+   tenant_id  => $tenant_id,
tr_request_headers => $params->{trRequestHeaders},
tr_response_headers=> $params->{trResponseHeaders},
type   => $params->{typeId},
@@ -415,6 +421,7 @@ sub update {
"remapText"=> $rs->remap_text,
"signed"   => $rs->signed,
"sslKeyVersion"=> 
$rs->ssl_key_version,
+   "tenantId" => $rs->tenant_id,
"trRequestHeaders" => 
$rs->tr_request_headers,
"trResponseHeaders"=> 
$rs->tr_response_headers,
"type" => $rs->type->name,
@@ -446,11 +453,15 @@ sub create {
return $self->alert($result);
}
 
+
my $xml_id = $params->{xmlId};
my $existing = $self->db->resultset('Deliveryservice')->find( { xml_id 
=> $xml_id } );
if ($existing) {
return $self->alert( "A deliveryservice with xmlId " . $xml_id 
. " already exists." );
}
+   
+   #setting tenant_id to the user id if tenant is not set. TODO(nirs): 
remove when tenancy is no longer optional in the API
+   my $tenant_id = exists($params->{tenantId}) ? $params->{tenantId} :  
$self->current_user_tenant();
 
my $values = {
active => $params->{active},
@@ -495,6 +506,7 @@ sub create {

[03/14] incubator-trafficcontrol git commit: Org tenancy - nerge users & ds tenancy

2017-07-10 Thread mitchell852
Org tenancy - nerge users & ds tenancy

adding deliveryservice.t back


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c9d117cb
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c9d117cb
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c9d117cb

Branch: refs/heads/master
Commit: c9d117cb1f77e521a2695604bb45d3c5f030015d
Parents: 6fbab5d
Author: nir-sopher 
Authored: Tue Apr 4 20:55:32 2017 +0300
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 .../2017031503_delivery_service_tenancy.sql | 30 
 .../2017040400_delivery_service_tenancy.sql | 30 
 traffic_ops/app/lib/API/Tenant.pm   |  3 +-
 traffic_ops/app/lib/Fixtures/Deliveryservice.pm |  2 +-
 traffic_ops/app/lib/Schema/Result/Tenant.pm |  4 +--
 traffic_ops/app/t/api/1.2/deliveryservice.t |  3 +-
 .../app/t/api/1.2/deliveryservice_crud.t|  3 +-
 traffic_ops/app/t/api/1.2/tenant.t  |  1 +
 8 files changed, 40 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c9d117cb/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql
deleted file mode 100644
index a737d0c..000
--- a/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-
-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
-
-ALTER TABLE deliveryservice
-ADD tenant_id BIGINT,
-ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
-ALTER COLUMN tenant_id SET DEFAULT NULL;
-CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
-
--- +goose Down
--- SQL section 'Down' is executed when this migration is rolled back
-
-ALTER TABLE deliveryservice
-DROP COLUMN tenant_id;
-

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c9d117cb/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql
new file mode 100644
index 000..a737d0c
--- /dev/null
+++ b/traffic_ops/app/db/migrations/2017040400_delivery_service_tenancy.sql
@@ -0,0 +1,30 @@
+/*
+
+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
+
+ALTER TABLE deliveryservice
+ADD tenant_id BIGINT,
+ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
+ALTER COLUMN tenant_id SET DEFAULT NULL;
+CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+
+ALTER TABLE deliveryservice
+DROP COLUMN tenant_id;
+

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c9d117cb/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 784cb67..c21528b 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -255,10 +255

[07/14] incubator-trafficcontrol git commit: UI: Added elivery service has the creating user tenancy

2017-07-10 Thread mitchell852
UI: Added elivery service has the creating user tenancy


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/dc000f8f
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/dc000f8f
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/dc000f8f

Branch: refs/heads/master
Commit: dc000f8f9117d30fe75051588c3a7b6d68400240
Parents: 23806ce
Author: nir-sopher 
Authored: Wed Mar 22 22:59:57 2017 +0200
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 traffic_ops/app/lib/UI/DeliveryService.pm | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dc000f8f/traffic_ops/app/lib/UI/DeliveryService.pm
--
diff --git a/traffic_ops/app/lib/UI/DeliveryService.pm 
b/traffic_ops/app/lib/UI/DeliveryService.pm
index 51d7840..b9e33e5 100644
--- a/traffic_ops/app/lib/UI/DeliveryService.pm
+++ b/traffic_ops/app/lib/UI/DeliveryService.pm
@@ -1054,6 +1054,7 @@ sub create {
remap_text => $self->paramAsScalar( 
'ds.remap_text', undef ),
initial_dispersion => $self->paramAsScalar( 
'ds.initial_dispersion', 1 ),
logs_enabled   => 
$self->paramAsScalar('ds.logs_enabled'),
+   tenant_id => 
current_user_tenant($self),#Tenancy is not dealt by the UI for now. getting the 
tenancy from the user
}
);
$insert->insert();



[14/14] incubator-trafficcontrol git commit: This closes #403

2017-07-10 Thread mitchell852
This closes #403


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/7d088391
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/7d088391
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/7d088391

Branch: refs/heads/master
Commit: 7d088391459a600b3b53a872135d10054c185daa
Parents: b34693e
Author: Jeremy Mitchell 
Authored: Mon Jul 10 14:49:38 2017 -0600
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:49:38 2017 -0600

--

--




[04/14] incubator-trafficcontrol git commit: Add tenancy to delivery service table

2017-07-10 Thread mitchell852
Add tenancy to delivery service table


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c0412919
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c0412919
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c0412919

Branch: refs/heads/master
Commit: c04129197aaac163113f08f58be0e0b44ae018c3
Parents: 4e4eac8
Author: nir-sopher 
Authored: Mon Mar 20 19:33:28 2017 +0200
Committer: Jeremy Mitchell 
Committed: Mon Jul 10 14:41:42 2017 -0600

--
 .../2017031503_delivery_service_tenancy.sql | 30 +
 traffic_ops/app/lib/Fixtures/Deliveryservice.pm | 13 ++
 .../lib/Fixtures/Integration/Deliveryservice.pm |  8 
 .../app/lib/Schema/Result/Deliveryservice.pm| 47 +---
 traffic_ops/app/lib/Schema/Result/Tenant.pm | 16 ++-
 5 files changed, 107 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c0412919/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql
--
diff --git 
a/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql 
b/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql
new file mode 100644
index 000..a737d0c
--- /dev/null
+++ b/traffic_ops/app/db/migrations/2017031503_delivery_service_tenancy.sql
@@ -0,0 +1,30 @@
+/*
+
+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
+
+ALTER TABLE deliveryservice
+ADD tenant_id BIGINT,
+ADD CONSTRAINT fk_tenantid FOREIGN KEY (tenant_id) REFERENCES tenant (id) 
MATCH FULL,
+ALTER COLUMN tenant_id SET DEFAULT NULL;
+CREATE INDEX idx_k_deliveryservice_tenant_idx ON deliveryservice USING btree 
(tenant_id);
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+
+ALTER TABLE deliveryservice
+DROP COLUMN tenant_id;
+

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c0412919/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
--
diff --git a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm 
b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
index 28953d0..0f91ede 100644
--- a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
+++ b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
@@ -25,6 +25,7 @@ my %definition_for = (
id=> 100,
xml_id=> 'test-ds1',
active=> 1,
+   tenant_id => undef,
dscp  => 40,
signed=> 0,
qstring_ignore=> 0,
@@ -63,6 +64,7 @@ my %definition_for = (
id=> 200,
xml_id=> 'test-ds2',
active=> 1,
+   tenant_id => undef,
dscp  => 40,
signed=> 0,
qstring_ignore=> 0,
@@ -101,6 +103,7 @@ my %definition_for = (
id=> 300,
xml_id=> 'test-ds3',
active=> 1,
+   tenant_id => undef,
dscp  => 40,
signed=> 0,
qstring_ignore=> 0,
@@ -139,6 +142,7 @@ my %definition_for = (
id=> 400,
xml_id=> 'test-ds4',
active=> 1,
+   tenant_id => undef,
dscp  => 40,
signed=> 0,
qstring_ignore=> 0,
@@ -177,6 +181,7 @@ my %definition_for = (
id=> 500,
   

[1/2] incubator-trafficcontrol git commit: Tenant col in DS - tenant name in API

2017-07-13 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 12e6c826f -> ebaa01425


Tenant col in DS - tenant name in API


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/79349536
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/79349536
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/79349536

Branch: refs/heads/master
Commit: 793495361e90a742f0af33920e7fe4056255d5a9
Parents: 12e6c82
Author: nir-sopher 
Authored: Mon Jun 26 06:17:53 2017 +0300
Committer: Jeremy Mitchell 
Committed: Thu Jul 13 14:32:09 2017 -0600

--
 .../traffic_ops_api/v12/deliveryservice.rst   |  6 ++
 .../source/development/traffic_ops_api/v12/server.rst |  3 +++
 docs/source/development/traffic_ops_api/v12/user.rst  |  5 +++--
 traffic_ops/app/lib/API/Deliveryservice.pm| 14 +-
 traffic_ops/app/lib/API/Deliveryservice2.pm   | 11 ++-
 traffic_ops/app/t/api/1.2/deliveryservice.t   |  1 +
 traffic_ops/app/t/api/1.2/deliveryservice_crud.t  |  3 ++-
 7 files changed, 30 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/79349536/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
--
diff --git a/docs/source/development/traffic_ops_api/v12/deliveryservice.rst 
b/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
index 2d04604..ecb17bc 100644
--- a/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
+++ b/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
@@ -174,6 +174,8 @@ Delivery Service
   
+--++--+
   | ``sslKeyVersion``|  int   |

  |
   
+--++--+
+  | ``tenant``   | string | Owning tenant name 

  |
+  
+--++--+
   | ``tenantId`` | int| Owning tenant ID   

  |
   
+--++--+
   | ``trRequestHeaders`` | string |

  |
@@ -240,6 +242,7 @@ Delivery Service
 "remapText": null,
 "signed": false,
 "sslKeyVersion": "0",
+"tenant": "root",
 "tenantId": 1,
 "trRequestHeaders": null,
 "trResponseHeaders": "Access-Control-Allow-Origin: *",
@@ -406,6 +409,8 @@ Delivery Service
   
+--++--+
   | ``sslKeyVersion``|  int   |

  |
   
+--++--+
+  | ``tenant``   | string | Owning tenant name 

  |
+  
+--++--+
   | ``tenantId`` | int| Owning tenant ID   

  |
   
+--++--+
   | ``trRequestHeaders`` | string |

[2/2] incubator-trafficcontrol git commit: This closes #718

2017-07-13 Thread mitchell852
This closes #718


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ebaa0142
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ebaa0142
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ebaa0142

Branch: refs/heads/master
Commit: ebaa0142535e842e54cb332b52d5566f17c29927
Parents: 7934953
Author: Jeremy Mitchell 
Authored: Thu Jul 13 14:32:45 2017 -0600
Committer: Jeremy Mitchell 
Committed: Thu Jul 13 14:32:45 2017 -0600

--

--




[3/3] incubator-trafficcontrol git commit: This closes #732

2017-07-14 Thread mitchell852
This closes #732


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c7fe073b
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c7fe073b
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c7fe073b

Branch: refs/heads/master
Commit: c7fe073b440f47c6e2eef480ed902e75bbddaace
Parents: 71c1aec
Author: Jeremy Mitchell 
Authored: Fri Jul 14 08:24:26 2017 -0600
Committer: Jeremy Mitchell 
Committed: Fri Jul 14 08:24:26 2017 -0600

--

--




[2/3] incubator-trafficcontrol git commit: adds integration tests to docker setup for traffic_ops

2017-07-14 Thread mitchell852
adds integration tests to docker setup for traffic_ops


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/0e95708c
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/0e95708c
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/0e95708c

Branch: refs/heads/master
Commit: 0e95708c73806aaad9743c69cf072130ea397684
Parents: 291cf29
Author: Dan Kirkwood 
Authored: Thu Jul 13 16:17:46 2017 -0600
Committer: Jeremy Mitchell 
Committed: Fri Jul 14 08:24:04 2017 -0600

--
 traffic_ops/app/bin/tests/Dockerfile-test | 71 ++
 traffic_ops/app/bin/tests/Dockerfile-unittest | 66 
 traffic_ops/app/bin/tests/docker-compose.yml  | 21 ++-
 traffic_ops/app/bin/tests/runtests.sh | 33 +-
 4 files changed, 105 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/0e95708c/traffic_ops/app/bin/tests/Dockerfile-test
--
diff --git a/traffic_ops/app/bin/tests/Dockerfile-test 
b/traffic_ops/app/bin/tests/Dockerfile-test
new file mode 100644
index 000..10018da
--- /dev/null
+++ b/traffic_ops/app/bin/tests/Dockerfile-test
@@ -0,0 +1,71 @@
+#
+# 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.
+#
+FROM centos:7
+MAINTAINER Dan Kirkwood 
+
+RUN yum -y install \
+
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
+
+RUN yum -y install \
+cpanminus \
+expat-devel \
+gcc-c++ \
+libcurl \
+libcurl-devel \
+libidn-devel \
+libpcap-devel \
+mkisofs \
+nmap-ncat \
+openssl-devel \
+perl \
+perl-App-cpanminus \
+perl-DBD-Pg \
+perl-DBI \
+perl-Digest-SHA1 \
+perl-JSON \
+perl-TermReadKey \
+perl-Test-CPAN-Meta \
+perl-WWW-Curl \
+perl-core \
+perl-libwww-perl \
+postgresql96 \
+postgresql96-devel && \
+yum clean all
+
+RUN cpanm -n Carton
+
+ADD install/bin/install_goose.sh /
+RUN /install_goose.sh
+
+ADD app /opt/traffic_ops/app
+WORKDIR /opt/traffic_ops/app
+RUN POSTGRES_HOME=/usr/pgsql-9.6 carton
+
+RUN rm -rf /root/.cpan*
+
+ADD app/bin/tests/runtests.sh /
+ARG TESTDIR
+ARG TESTENV
+ENV TESTDIR=$TESTDIR
+ENV TESTENV=$TESTENV
+ARG DBHOST
+ARG DBPORT
+ENV DBHOST=$DBHOST
+ENV DBPORT=$DBPORT
+
+ENTRYPOINT /runtests.sh $DBHOST $DBPORT
+CMD $TESTENV $TESTDIR
+
+#
+# vi:syntax=Dockerfile

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/0e95708c/traffic_ops/app/bin/tests/Dockerfile-unittest
--
diff --git a/traffic_ops/app/bin/tests/Dockerfile-unittest 
b/traffic_ops/app/bin/tests/Dockerfile-unittest
deleted file mode 100644
index 0333b0d..000
--- a/traffic_ops/app/bin/tests/Dockerfile-unittest
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# 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.
-#
-FROM centos:7
-MAINTAINER Dan Kirkwood 
-
-RUN yum -y install \
-
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
-
-RUN yum -y install \
-cpanminus \
-expat-devel \
-gcc-c++ \
-libcurl \
-libcurl-devel \
-libidn-devel \
-libpcap-devel \
-mkisofs \
-nmap-ncat \
-openssl-devel \
-perl \
-perl-App-cpanminus \
-perl-DBD-Pg \
-perl-DBI \
-perl-Digest-SHA1 \
-perl-JSON \
-perl-TermReadKey \
-perl-Test-CPAN-Meta \
-perl-WWW-Curl \
-perl-core \
-perl-libwww-pe

[1/3] incubator-trafficcontrol git commit: fix test script

2017-07-14 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 291cf29e5 -> c7fe073b4


fix test script


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/71c1aeca
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/71c1aeca
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/71c1aeca

Branch: refs/heads/master
Commit: 71c1aecadfc5c20533ef8d8ae74d1eee6e4311dc
Parents: 0e95708
Author: Dan Kirkwood 
Authored: Thu Jul 13 16:37:21 2017 -0600
Committer: Jeremy Mitchell 
Committed: Fri Jul 14 08:24:04 2017 -0600

--
 traffic_ops/app/bin/tests/runtests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/71c1aeca/traffic_ops/app/bin/tests/runtests.sh
--
diff --git a/traffic_ops/app/bin/tests/runtests.sh 
b/traffic_ops/app/bin/tests/runtests.sh
index 1e0329d..d71d668 100755
--- a/traffic_ops/app/bin/tests/runtests.sh
+++ b/traffic_ops/app/bin/tests/runtests.sh
@@ -74,8 +74,8 @@ export USER=root
 echo "/opt/traffic_ops/app/db/dbconf.yml"
 cat /opt/traffic_ops/app/db/dbconf.yml
 
-echo "/opt/traffic_ops/app/conf/$dbenv/database.conf"
-cat "/opt/traffic_ops/app/conf/$dbenv/database.conf"
+echo "/opt/traffic_ops/app/conf/$TESTENV/database.conf"
+cat "/opt/traffic_ops/app/conf/$TESTENV/database.conf"
 
 export GOROOT=/usr/local/go
 export GOPATH=/opt/traffic_ops/go



[07/25] incubator-trafficcontrol git commit: Tenancy utils - is_root_tenant

2017-07-18 Thread mitchell852
Tenancy utils - is_root_tenant


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/40375e63
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/40375e63
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/40375e63

Branch: refs/heads/master
Commit: 40375e630ccdd730737105dbf5b96d8b1737c713
Parents: ed323e8
Author: nir-sopher 
Authored: Thu Jun 1 16:23:16 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 18 +-
 traffic_ops/app/lib/UI/TenantUtils.pm | 15 +++
 2 files changed, 20 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/40375e63/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index c1974ca..71c8afc 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -27,17 +27,11 @@ use MojoPlugins::Response;
 my $finfo = __FILE__ . ":";
 
 sub getTenantName {
-   my $self= shift;
+   my $self= shift;
my $tenant_id   = shift;
return defined($tenant_id) ? $self->db->resultset('Tenant')->search( { 
id => $tenant_id } )->get_column('name')->single() : "n/a";
 }
 
-sub isRootTenant {
-   my $self= shift;
-   my $tenant_id   = shift;
-   return !defined($self->db->resultset('Tenant')->search( { id => 
$tenant_id } )->get_column('parent_id')->single());
-}
-
 sub index {
my $self= shift;
 
@@ -122,7 +116,9 @@ sub update {
}   
}   
 
-   if ( !defined( $params->{parentId}) && !$self->isRootTenant($id) ) {
+   my $tenantUtils = UI::TenantUtils->new($self);
+
+   if ( !defined( $params->{parentId}) && 
!$tenantUtils->is_root_tenant($id) ) {
# Cannot turn a simple tenant to a root tenant.
# Practically there is no problem with doing so, but it is to 
risky to be done by mistake. 
return $self->alert("Parent Id is required.");
@@ -134,14 +130,10 @@ sub update {
 
my $is_active = $params->{active};

-   if ( !$params->{active} && $self->isRootTenant($id)) {
+   if ( !$params->{active} && $tenantUtils->is_root_tenant($id)) {
return $self->alert("Root tenant cannot be in-active.");
}
 
-   if ( !defined($params->{parentId}) && !isRootTenant($id) ) {
-   return $self->alert("Only the \"root\" tenant can have no 
parent.");
-   }
-   
#operation  
my $values = {
name  => $params->{name},

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/40375e63/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index 253c588..d40b3ba 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -56,6 +56,21 @@ sub get_hierarchic_tenants_list {
return @result; 
 }
 
+sub is_root_tenant {
+   my $self = shift;
+   my $tenant_id = shift;
+   
+   if (!defined($tenant_id)) {
+   return 0;
+   }
+   
+   if (defined($self->{tenants_dict})) {
+   return !(defined($self->{tenants_dict}{$tenant_id}{parent}));
+   }
+   return !defined($self->{context}->db->resultset('Tenant')->search( { id 
=> $tenant_id } )->get_column('parent_id')->single()); 
+}
+
+
 ##
 
 sub _init_tenants {



[09/25] incubator-trafficcontrol git commit: tenancy utils - get_tenants_list and get_tenant

2017-07-18 Thread mitchell852
tenancy utils - get_tenants_list and get_tenant


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/f5ca6007
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/f5ca6007
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/f5ca6007

Branch: refs/heads/master
Commit: f5ca6007f7e5c7e1ca001f37ebb9b74f5be6e199
Parents: 2dcc139
Author: nir-sopher 
Authored: Fri Jun 2 16:19:58 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 17 ++---
 traffic_ops/app/lib/UI/TenantUtils.pm | 23 +++
 2 files changed, 25 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f5ca6007/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index ab335e2..4812439 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -36,12 +36,6 @@ sub index {
my $self= shift;
my $orderby = $self->param('orderby') || "name";
 
-   my %idnames;
-   my $rs_data = $self->db->resultset("Tenant")->search();
-   while ( my $row = $rs_data->next ) {
-   $idnames{ $row->id } = $row->name;
-   }
-
my @data = ();
my $tenantUtils = UI::TenantUtils->new($self);
my @tenants_list = $tenantUtils->get_hierarchic_tenants_list(undef, 
$orderby);
@@ -53,7 +47,7 @@ sub index {
"name" => $row->name,
"active"   => \$row->active,
"parentId" => $row->parent_id,
-   "parentName"   => ( defined 
$row->parent_id ) ? $idnames{ $row->parent_id } : undef,
+   "parentName"   => ( defined 
$row->parent_id ) ? $tenantUtils->get_tenant($row->parent_id)->name : undef,
}
);
}
@@ -67,13 +61,6 @@ sub show {
my $id   = $self->param('id');
 
my @data = ();
-   my %idnames;
-
-   my $rs_idnames = $self->db->resultset("Tenant")->search( undef, { 
columns => [qw/id name/] } );
-   while ( my $row = $rs_idnames->next ) {
-   $idnames{ $row->id } = $row->name;
-   }
-
my $tenantUtils = UI::TenantUtils->new($self);
my $rs_data = $self->db->resultset("Tenant")->search( { 'me.id' => $id 
});
while ( my $row = $rs_data->next ) {
@@ -84,7 +71,7 @@ sub show {
"name" => $row->name,
"active"   => \$row->active,
"parentId" => $row->parent_id,
-   "parentName"   => ( defined 
$row->parent_id ) ? $idnames{ $row->parent_id } : undef,
+   "parentName"   => ( defined 
$row->parent_id ) ? $tenantUtils->get_tenant($row->parent_id)->name : undef,
}
);
}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f5ca6007/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index 118ba79..d2b1ea5 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -44,6 +44,29 @@ sub current_user_tenant {
return $self->{user_tenant_id};
 }
 
+sub get_tenant {
+   my $self = shift;
+   my $tenant_id = shift;  
+   
+   $self->_init_tenants_if_needed(undef);
+
+   return $self->{tenants_dict}->{$tenant_id}{row};
+}
+
+sub get_tenants_list {
+   my $self = shift;
+   my $order_by = shift;   
+   
+   $self->_init_tenants_if_needed($order_by);
+
+   my @result = ();
+   foreach my $tenant_id (@{ $self->{ordered_by} }) {
+   push @result, $self->{tenants_dict}->{$tenant_id}{row};
+   }
+
+   return @result; 
+}
+
 sub get_hierarchic_tenants_list {
my $self = shift;
my $tree_root = shift;  



[11/25] incubator-trafficcontrol git commit: Tenancy access verification - global disable mechanisem

2017-07-18 Thread mitchell852
Tenancy access verification - global disable mechanisem


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/abd4f7b0
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/abd4f7b0
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/abd4f7b0

Branch: refs/heads/master
Commit: abd4f7b0de2cf640a4792aa50eab18d0a3d960d6
Parents: c72dda5
Author: nir-sopher 
Authored: Mon Jun 26 00:25:10 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/UI/TenantUtils.pm | 11 
 traffic_ops/app/t/api/1.2/tenant.t| 45 +-
 2 files changed, 55 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/abd4f7b0/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index 852380f..8751d76 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -60,6 +60,10 @@ sub new {
 $dbh = $context->db;
 }
 
+my $ignore_tenancy_value = $dbh->resultset("Parameter")->search( { 
config_file => 'global', name => 'ignore-tenancy' } )
+->get_column('value')->single();
+my $ignore_tenancy = defined($ignore_tenancy_value) ? 
$ignore_tenancy_value : 0;
+
 my $self = {
 dbh => $dbh,
 context => $context, #saving the context - use it only for log 
please...
@@ -67,6 +71,7 @@ sub new {
 # In order to reduce the number of calls from the DB, the current user tenant 
is taken in the class creation.
 # the below parameters are held temporarily until the info is taken from the 
jwt
 current_user_tenant => $current_user_tenant,
+ignore_tenancy => $ignore_tenancy,
 };
 bless $self, $class;
 return $self;
@@ -340,6 +345,12 @@ sub _is_resource_accessable {
 my $tenants_data= shift;
 my $resource_tenant = shift;
 
+if ($self->{ignore_tenancy}) {
+#mechanisem disabled
+return 1;
+}
+
+
 my $user_tenant = $self->current_user_tenant();
 if ( defined($user_tenant) ) {
 my $tenant_record= $tenants_data->{tenants_dict}->{$user_tenant};

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/abd4f7b0/traffic_ops/app/t/api/1.2/tenant.t
--
diff --git a/traffic_ops/app/t/api/1.2/tenant.t 
b/traffic_ops/app/t/api/1.2/tenant.t
index 38bf1e2..ced60bd 100644
--- a/traffic_ops/app/t/api/1.2/tenant.t
+++ b/traffic_ops/app/t/api/1.2/tenant.t
@@ -244,7 +244,38 @@ ok 
$tenant_utils_of_e->is_tenant_resource_accessible($tenants_data_of_e, $tenant
 # itself - full access
 ok $tenant_utils_of_e->is_tenant_resource_accessible($tenants_data_of_e, 
$tenantE_id) == 0; 
 # uncle - no access
-ok $tenant_utils_of_e->is_tenant_resource_accessible($tenants_data_of_e, 
$tenantB_id) == 0; 
+ok $tenant_utils_of_e->is_tenant_resource_accessible($tenants_data_of_e, 
$tenantB_id) == 0;
+
+
+#Test disable capabilities
+ok $t->post_ok('/api/1.2/parameters' => {Accept => 'application/json'} => json 
=>
+{
+'name'  => 'ignore-tenancy',
+'configFile' => 'global',
+'value'  => '1',
+'secure' => '0'
+}
+)->status_is(200)
+, 'Was the disabling paramter created?';
+
+my $tenant_utils_of_d_disabled = UI::TenantUtils->new(undef, $tenantD_id, 
$schema);
+my $tenants_data_of_d_disabled = 
$tenant_utils_of_d_disabled->create_tenants_data_from_db();
+#anchestor - now can access
+ok 
$tenant_utils_of_d_disabled->is_tenant_resource_accessible($tenants_data_of_d_disabled,
 $root_tenant_id) == 1;
+#undef - all have access
+ok 
$tenant_utils_of_d_disabled->is_tenant_resource_accessible($tenants_data_of_d_disabled,
 undef) == 1;
+# parent - now can access
+ok 
$tenant_utils_of_d_disabled->is_tenant_resource_accessible($tenants_data_of_d_disabled,
 $tenantA_id) == 1;
+# itself - full access
+ok 
$tenant_utils_of_d_disabled->is_tenant_resource_accessible($tenants_data_of_d_disabled,
 $tenantD_id) == 1;
+# uncle - now can access
+ok 
$tenant_utils_of_d_disabled->is_tenant_resource_accessible($tenants_data_of_d_disabled,
 $tenantB_id) == 1;
+
+ok $t->delete_ok('/api/1.2/parameters/' . &get_param_id('ignore-tenancy') 
)->status_is(200)
+->or( sub { diag $t->tx->res->content->asset->{content}; } )
+, 'Was the disabling paramter deleted?';
+
+
 
 
 #
@@ -344,3 +375,15 @@ sub get_tenant_id {
return $id;
 }
 
+sub get_param_id {
+my $name = shift;
+my $q  = "select id from parameter where na

[19/25] incubator-trafficcontrol git commit: tenant utils - no special treatment for ldap

2017-07-18 Thread mitchell852
tenant utils - no special treatment for ldap


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/4d2951c8
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/4d2951c8
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/4d2951c8

Branch: refs/heads/master
Commit: 4d2951c84edd828509ee6812cb3475162db90a21
Parents: 9061217
Author: nir-sopher 
Authored: Tue Jun 6 07:32:49 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/UI/TenantUtils.pm | 13 -
 1 file changed, 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4d2951c8/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index c49bb14..d21505f 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -67,7 +67,6 @@ sub new {
 # In order to reduce the number of calls from the DB, the current user tenant 
is taken in the class creation.
 # the below parameters are held temporarily until the info is taken from the 
jwt
 current_user_tenant => $current_user_tenant,
-is_ldap => defined($context) ? $context->is_ldap() : 0,
 };
 bless $self, $class;
 return $self;
@@ -369,18 +368,6 @@ sub _is_resource_accessable {
 return 1;
 }
 
-if ( $self->{is_ldap} ) {
-if ( $operation eq "r" ) {
-
-#ldap user, can read all tenants - temporary for now as an LDAP user as no 
tenant and is part of the TC operator.
-# should be removed when LDAP is gone
-return 1;
-}
-
-#ldap user, has no tenancy, cannot write anything
-return 0;
-}
-
 my $user_tenant = $self->current_user_tenant();
 if ( !defined($user_tenant) ) {
 



[21/25] incubator-trafficcontrol git commit: Moving UI::TenantUtils to Utils::Tenant

2017-07-18 Thread mitchell852
Moving UI::TenantUtils to Utils::Tenant


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2be62a6b
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2be62a6b
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2be62a6b

Branch: refs/heads/master
Commit: 2be62a6bc0942bffa125466c4e108f1310c923ba
Parents: ab80179
Author: nir-sopher 
Authored: Mon Jun 26 21:03:55 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm |  12 +-
 traffic_ops/app/lib/API/User.pm   |   6 +-
 traffic_ops/app/lib/UI/TenantUtils.pm | 403 -
 traffic_ops/app/lib/UI/User.pm|   4 +-
 traffic_ops/app/lib/Utils/Tenant.pm   | 403 +
 traffic_ops/app/t/api/1.2/tenant.t|  12 +-
 6 files changed, 420 insertions(+), 420 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2be62a6b/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 932ab0f..8600871 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -17,7 +17,7 @@ package API::Tenant;
 #
 
 use UI::Utils;
-use UI::TenantUtils;
+use Utils::Tenant;
 
 use Mojo::Base 'Mojolicious::Controller';
 use Data::Dumper;
@@ -36,7 +36,7 @@ sub index {
my $self= shift;
my $orderby = $self->param('orderby') || "name";
 
-   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenant_utils = Utils::Tenant->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db($orderby);
 
my @data = ();
@@ -63,7 +63,7 @@ sub show {
my $self = shift;
my $id   = $self->param('id');
 
-   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenant_utils = Utils::Tenant->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);
 
my @data = ();
@@ -116,7 +116,7 @@ sub update {
}
 
 
-   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenant_utils = Utils::Tenant->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);
 
if ( $tenant_utils->is_root_tenant($tenants_data, $id) ) {
@@ -243,7 +243,7 @@ sub create {
return $self->alert("Parent Id is required.");
}
 
-   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenant_utils = Utils::Tenant->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);

if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$params->{parentId})) {
@@ -328,7 +328,7 @@ sub delete {
 
my $parent_tenant = $tenant->parent_id; 

-   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenant_utils = Utils::Tenant->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);

if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$parent_tenant)) {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2be62a6b/traffic_ops/app/lib/API/User.pm
--
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index e98f969..9f905d6 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -18,7 +18,7 @@ package API::User;
 
 # 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 UI::TenantUtils;
+use Utils::Tenant;
 
 use Mojo::Base 'Mojolicious::Controller';
 use Utils::Helper;
@@ -250,7 +250,7 @@ sub create {
}
 
#setting tenant_id to the user's tenant if tenant is not set. 
TODO(nirs): remove when tenancy is no longer optional in the API
-   my $tenantUtils = UI::TenantUtils->new($self);
+   my $tenantUtils = Utils::Tenant->new($self);
my $tenant_id = exists( $params->{tenantId} ) ? $params->{tenantId} : 
$tenantUtils->current_user_tenant();
 
my $values = {
@@ -406,7 +406,7 @@ sub current {
my $self = shift;
my @data;
my $current_username = $self->current_user()->{username};
-it if ( &is_ldap($self) ) {
+   if ( &is_ldap($self) ) {
my $role = $self->db->resultset('Role')->search( { name => 
"read-only" } )->get_column('id')->single;
 
push(

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2be62a6b/traffic_ops/app/lib/UI/TenantUtils.pm
---

[22/25] incubator-trafficcontrol git commit: Tenant utils - rebase fixes

2017-07-18 Thread mitchell852
Tenant utils - rebase fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/90612170
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/90612170
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/90612170

Branch: refs/heads/master
Commit: 90612170441e3400fef3fb3271234184dffa0c29
Parents: f35a77f
Author: nir-sopher 
Authored: Mon Jun 5 22:19:15 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/User.pm | 3 ++-
 traffic_ops/app/lib/UI/Utils.pm | 5 -
 2 files changed, 2 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90612170/traffic_ops/app/lib/API/User.pm
--
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index 91b56fd..3f03ad2 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -250,7 +250,8 @@ sub create {
}
 
#setting tenant_id to the user's tenant if tenant is not set. 
TODO(nirs): remove when tenancy is no longer optional in the API
-   my $tenant_id = exists( $params->{tenantId} ) ? $params->{tenantId} : 
$self->current_user_tenant();
+   my $tenantUtils = UI::TenantUtils->new($self);
+   my $tenant_id = exists( $params->{tenantId} ) ? $params->{tenantId} : 
$tenantUtils->current_user_tenant();
 
my $values = {
address_line1=> $params->{addressLine1},

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/90612170/traffic_ops/app/lib/UI/Utils.pm
--
diff --git a/traffic_ops/app/lib/UI/Utils.pm b/traffic_ops/app/lib/UI/Utils.pm
index 2b22726..2dba89f 100644
--- a/traffic_ops/app/lib/UI/Utils.pm
+++ b/traffic_ops/app/lib/UI/Utils.pm
@@ -408,9 +408,4 @@ sub defined_or_default {
return defined($val) ? $val : $default;
 }
 
-sub current_user_tenant {
-my $self = shift;
-return $self->db->resultset('TmUser')->search( { username => 
$self->current_user()->{username} } )->get_column('tenant_id')->single();
-}
-
 1;



[05/25] incubator-trafficcontrol git commit: TenantUtils - tenant resource tenancy test

2017-07-18 Thread mitchell852
TenantUtils - tenant resource tenancy test


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2eb94bff
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2eb94bff
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2eb94bff

Branch: refs/heads/master
Commit: 2eb94bff31f038d4755c42491b447e3766a8e840
Parents: 731ceb1
Author: nir-sopher 
Authored: Thu Jun 1 16:46:30 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 69 +++---
 traffic_ops/app/lib/UI/TenantUtils.pm | 79 ++
 2 files changed, 130 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2eb94bff/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 265aad5..ca67365 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -45,15 +45,17 @@ sub index {
my $tenantUtils = UI::TenantUtils->new($self);
my @tenants_list = $tenantUtils->get_hierarchic_tenants_list();
foreach my $row (@tenants_list) {
-   push(
-   @data, {
-   "id"   => $row->id,
-   "name" => $row->name,
-   "active"   => \$row->active,
-   "parentId" => $row->parent_id,
-   "parentName"   => ( defined $row->parent_id ) ? 
$idnames{ $row->parent_id } : undef,
-   }
-   );
+   if ($tenantUtils->is_tenant_resource_readable($row->id)) {
+   push(
+   @data, {
+   "id"   => $row->id,
+   "name" => $row->name,
+   "active"   => \$row->active,
+   "parentId" => $row->parent_id,
+   "parentName"   => ( defined 
$row->parent_id ) ? $idnames{ $row->parent_id } : undef,
+   }
+   );
+   }
}
$self->success( \@data );
 }
@@ -71,17 +73,20 @@ sub show {
$idnames{ $row->id } = $row->name;
}
 
+   my $tenantUtils = UI::TenantUtils->new($self);
my $rs_data = $self->db->resultset("Tenant")->search( { 'me.id' => $id 
});
while ( my $row = $rs_data->next ) {
-   push(
-   @data, {
-   "id"   => $row->id,
-   "name" => $row->name,
-   "active"   => \$row->active,
-   "parentId" => $row->parent_id,
-   "parentName"   => ( defined $row->parent_id ) ? 
$idnames{ $row->parent_id } : undef,
-   }
-   );
+   if ($tenantUtils->is_tenant_resource_readable($row->id)) {
+   push(
+   @data, {
+   "id"   => $row->id,
+   "name" => $row->name,
+   "active"   => \$row->active,
+   "parentId" => $row->parent_id,
+   "parentName"   => ( defined 
$row->parent_id ) ? $idnames{ $row->parent_id } : undef,
+   }
+   );
+   }
}
$self->success( \@data );
 }
@@ -134,6 +139,22 @@ sub update {
return $self->alert("Root tenant cannot be in-active.");
}
 
+   #this is a write operation, allowed only by parents of the tenant 
(which are the owners of the resource of type tenant) 
+   my $current_resource_tenancy = $self->db->resultset('Tenant')->search( 
{ id => $id } )->get_column('parent_id')->single();
+   if (!defined($current_resource_tenancy)) {
+   #no parent - the tenant is its-own owner
+   $current_resource_tenancy = $id;
+   }
+   
+   if 
(!$tenantUtils->is_tenant_resource_writeable($current_resource_tenancy)) {
+   return $self->alert("Current owning tenant is not under user's 
tenancy.");
+   }
+
+   if (!$tenantUtils->is_tenant_resource_writeable($params->{parentId})) {
+   return $self->alert("Parent tenant to 

[03/25] incubator-trafficcontrol git commit: Order tenants list in reply in heirarchic order

2017-07-18 Thread mitchell852
Order tenants list in reply in heirarchic order


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c9181f24
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c9181f24
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c9181f24

Branch: refs/heads/master
Commit: c9181f247714297d0e4f7bb0a9683a56fa97070c
Parents: a1bf58f
Author: nir-sopher 
Authored: Thu Jun 1 16:00:28 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 22 ---
 traffic_ops/app/lib/UI/TenantUtils.pm | 97 ++
 traffic_ops/app/t/api/1.2/tenant.t| 21 +--
 3 files changed, 128 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c9181f24/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 3bcdd0f..79795a4 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -17,6 +17,7 @@ package API::Tenant;
 #
 
 use UI::Utils;
+use UI::TenantUtils;
 
 use Mojo::Base 'Mojolicious::Controller';
 use Data::Dumper;
@@ -26,30 +27,30 @@ use MojoPlugins::Response;
 my $finfo = __FILE__ . ":";
 
 sub getTenantName {
-   my $self= shift;
+   my $self= shift;
my $tenant_id   = shift;
return defined($tenant_id) ? $self->db->resultset('Tenant')->search( { 
id => $tenant_id } )->get_column('name')->single() : "n/a";
 }
 
 sub isRootTenant {
-   my $self= shift;
+   my $self= shift;
my $tenant_id   = shift;
return !defined($self->db->resultset('Tenant')->search( { id => 
$tenant_id } )->get_column('parent_id')->single());
 }
 
 sub index {
my $self= shift;
-   my @data = ();
-   my %idnames;
-   my $orderby = $self->param('orderby') || "name";
 
+   my %idnames;
my $rs_data = $self->db->resultset("Tenant")->search();
while ( my $row = $rs_data->next ) {
$idnames{ $row->id } = $row->name;
}
 
-   my $rs_data = $self->db->resultset("Tenant")->search( undef, {order_by 
=> 'me.' . $orderby } );
-   while ( my $row = $rs_data->next ) {
+   my @data = ();
+   my $tenantUtils = UI::TenantUtils->new($self);
+   my @tenants_list = $tenantUtils->get_hierarchic_tenants_list();
+   foreach my $row (@tenants_list) {
push(
@data, {
"id"   => $row->id,
@@ -122,6 +123,8 @@ sub update {
}   
 
if ( !defined( $params->{parentId}) && !$self->isRootTenant($id) ) {
+   # Cannot turn a simple tenant to a root tenant.
+   # Practically there is no problem with doing so, but it is to 
risky to be done by mistake. 
return $self->alert("Parent Id is required.");
}

@@ -134,12 +137,12 @@ sub update {
if ( !$params->{active} && $self->isRootTenant($id)) {
return $self->alert("Root user cannot be in-active.");
}
-   
 
if ( !defined($params->{parentId}) && !isRootTenant($id) ) {
return $self->alert("Only the \"root\" tenant can have no 
parent.");
}

+   #operation  
my $values = {
name  => $params->{name},
active=> $params->{active},
@@ -185,6 +188,8 @@ sub create {
return $self->alert("Tenant name is required.");
}
 
+   #not allowing to create additional root tenants.
+   #there is no real problem with that, but no real use also
my $parent_id = $params->{parentId};
if ( !defined($parent_id) ) {
return $self->alert("Parent Id is required.");
@@ -248,6 +253,7 @@ sub delete {
if ( !defined($tenant) ) {
return $self->not_found();
}   
+
my $name = $self->db->resultset('Tenant')->search( { id => $id } 
)->get_column('name')->single();

my $existing_child = $self->db->resultset('Tenant')->search( { 
parent_id => $id }, {order_by => 'me.name' } )->get_column('name')->first();

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c9181f24/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
new file mode 100644
index 000..253c588
--- /dev/null
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -0,0 +1,97 @@
+package UI

[16/25] incubator-trafficcontrol git commit: Tenant is the resource owbner of itself + move some 403 to 400 on tenancy checks

2017-07-18 Thread mitchell852
Tenant is the resource owbner of itself + move some 403 to 400 on tenancy checks


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/13b60e64
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/13b60e64
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/13b60e64

Branch: refs/heads/master
Commit: 13b60e6463e46ac25f107121e888b78293e8967e
Parents: 2be62a6
Author: nir-sopher 
Authored: Tue Jun 27 06:46:21 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm  | 51 -
 traffic_ops/app/t/api/1.2/tenant.t |  4 +--
 2 files changed, 26 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/13b60e64/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 8600871..f1c12e5 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -108,18 +108,21 @@ sub update {
}

if ( $params->{name} ne $self->getTenantName($id) ) {
-my $name = $params->{name};
+   my $name = $params->{name};
my $existing = $self->db->resultset('Tenant')->search( { name 
=> $name } )->get_column('name')->single();
if ($existing) {
return $self->alert("A tenant with name \"$name\" 
already exists.");
}   
-   }
-
+   }   
 
my $tenant_utils = Utils::Tenant->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);
 
-   if ( $tenant_utils->is_root_tenant($tenants_data, $id) ) {
+if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, $id)) {
+return $self->forbidden(); #Current owning tenant is not under user's 
tenancy
+}
+
+if ( $tenant_utils->is_root_tenant($tenants_data, $id) ) {
return $self->alert("Root tenant cannot be updated.");
}
 
@@ -137,23 +140,19 @@ sub update {
return $self->alert("Root tenant cannot be in-active.");
}
 
-   #this is a write operation, allowed only by parents of the tenant 
(which are the owners of the resource of type tenant) 
-   my $current_resource_tenancy = $self->db->resultset('Tenant')->search( 
{ id => $id } )->get_column('parent_id')->single();
-
-   if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$current_resource_tenancy)) {
-   return $self->forbidden(); #Current owning tenant is not under 
user's tenancy
-   }
-
-   if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$params->{parentId})) {
-   return $self->forbidden(); #Parent tenant to be set is not 
under user's tenancy
-   }
-
-
if ($params->{parentId} != $tenant->parent) {
#parent replacement
+   if 
(!$tenant_utils->is_tenant_resource_accessible($tenants_data, $tenant->parent)) 
{
+   #Current owning tenant is not under user's tenancy
+   return $self>alert("Invalid parent tenant change. The 
current tenant parent is not avaialble for you to edit");
+   }
if (!defined($tenant_utils->get_tenant_by_id($tenants_data, 
$params->{parentId}))) {
return $self->alert("Parent tenant does not exists.");
}
+   if 
(!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$params->{parentId})) {
+   #Parent tenant to be set is not under user's tenancy
+   return $self->alert("Invalid parent tenant. This tenant 
is not available to you for parent assignment.");
+   }
my $parent_depth = 
$tenant_utils->get_tenant_heirarchy_depth($tenants_data, $params->{parentId});
if (!defined($parent_depth))
{
@@ -242,19 +241,19 @@ sub create {
if ( !defined($parent_id) ) {
return $self->alert("Parent Id is required.");
}
-
+   
my $tenant_utils = Utils::Tenant->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);

-   if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$params->{parentId})) {
-   return $self->forbidden(); #Parent tenant to be set is not 
under user's tenancy
-   }
-
if (!defined($tenant_utils->get_tenant_by_id($tenants_data, 
$params->{parentId}))) {
return $self->alert("Parent tenant does not exists.");
}
-   
-   m

[18/25] incubator-trafficcontrol git commit: Tenant resource tenancy check - style change

2017-07-18 Thread mitchell852
Tenant resource tenancy check - style change


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c72dda5f
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c72dda5f
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c72dda5f

Branch: refs/heads/master
Commit: c72dda5f1678dda6402dd53566cc6679688cfa80
Parents: 0fffefe
Author: nir-sopher 
Authored: Wed Jun 21 05:34:26 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 49 +-
 1 file changed, 24 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c72dda5f/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 1c226b3..3653455 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -42,17 +42,18 @@ sub index {
my @data = ();
my @tenants_list = 
$tenant_utils->get_hierarchic_tenants_list($tenants_data, undef);
foreach my $row (@tenants_list) {
-   if ($tenant_utils->is_tenant_resource_accessible($tenants_data, 
$row->id)) {
-   push(
-   @data, {
-   "id" => $row->id,
-   "name"   => $row->name,
-   "active" => \$row->active,
-   "parentId"   => $row->parent_id,
-   "parentName" => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant_by_id($tenants_data, 
$row->parent_id)->name : undef,
-   }
-   );
-   }
+   if 
(!$tenant_utils->is_tenant_resource_accessible($tenants_data, $row->id)) {
+next;
+}
+push(
+@data, {
+"id" => $row->id,
+"name"   => $row->name,
+"active" => \$row->active,
+"parentId"   => $row->parent_id,
+"parentName" => ( defined $row->parent_id ) ? 
$tenant_utils->get_tenant_by_id($tenants_data, $row->parent_id)->name : undef,
+}
+);
}
$self->success( \@data );
 }
@@ -68,20 +69,18 @@ sub show {
my @data = ();
my $rs_data = $self->db->resultset("Tenant")->search( { 'me.id' => $id 
});
while ( my $row = $rs_data->next ) {
-   if ($tenant_utils->is_tenant_resource_accessible($tenants_data, 
$row->id)) {
-   push(
-   @data, {
-   "id"   => $row->id,
-   "name" => $row->name,
-   "active"   => \$row->active,
-   "parentId" => $row->parent_id,
-   "parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant_by_id($tenants_data, 
$row->parent_id)->name : undef,
-   }
-   );
-   }
-   else {
-   return $self->forbidden();
-   }
+   if 
(!$tenant_utils->is_tenant_resource_accessible($tenants_data, $row->id)) {
+return $self->forbidden();
+}
+push(
+@data, {
+"id"   => $row->id,
+"name" => $row->name,
+"active"   => \$row->active,
+"parentId" => $row->parent_id,
+"parentName"   => ( defined $row->parent_id ) ? 
$tenant_utils->get_tenant_by_id($tenants_data, $row->parent_id)->name : undef,
+}
+);
}
$self->success( \@data );
 }



[23/25] incubator-trafficcontrol git commit: Tenant util - remove readable/writeable separation

2017-07-18 Thread mitchell852
Tenant util - remove readable/writeable separation


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/0fffefea
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/0fffefea
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/0fffefea

Branch: refs/heads/master
Commit: 0fffefea371d4520f972ff7b9fc5e4bd3007a659
Parents: 4d2951c
Author: nir-sopher 
Authored: Tue Jun 6 07:42:37 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 12 +++
 traffic_ops/app/lib/UI/TenantUtils.pm | 15 ++--
 traffic_ops/app/t/api/1.2/tenant.t| 57 ++
 3 files changed, 27 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/0fffefea/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 390b1e5..1c226b3 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -42,7 +42,7 @@ sub index {
my @data = ();
my @tenants_list = 
$tenant_utils->get_hierarchic_tenants_list($tenants_data, undef);
foreach my $row (@tenants_list) {
-   if ($tenant_utils->is_tenant_readable($tenants_data, $row->id)) 
{
+   if ($tenant_utils->is_tenant_resource_accessible($tenants_data, 
$row->id)) {
push(
@data, {
"id" => $row->id,
@@ -68,7 +68,7 @@ sub show {
my @data = ();
my $rs_data = $self->db->resultset("Tenant")->search( { 'me.id' => $id 
});
while ( my $row = $rs_data->next ) {
-   if ($tenant_utils->is_tenant_readable($tenants_data, $row->id)) 
{
+   if ($tenant_utils->is_tenant_resource_accessible($tenants_data, 
$row->id)) {
push(
@data, {
"id"   => $row->id,
@@ -142,11 +142,11 @@ sub update {
$current_resource_tenancy = $id;
}

-   if (!$tenant_utils->is_tenant_writeable($tenants_data, 
$current_resource_tenancy)) {
+   if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$current_resource_tenancy)) {
return $self->forbidden(); #Current owning tenant is not under 
user's tenancy
}
 
-   if (!$tenant_utils->is_tenant_writeable($tenants_data, 
$params->{parentId})) {
+   if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$params->{parentId})) {
return $self->forbidden(); #Parent tenant to be set is not 
under user's tenancy
}
 
@@ -248,7 +248,7 @@ sub create {
my $tenant_utils = UI::TenantUtils->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);

-   if (!$tenant_utils->is_tenant_writeable($tenants_data, 
$params->{parentId})) {
+   if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$params->{parentId})) {
return $self->forbidden(); #Parent tenant to be set is not 
under user's tenancy
}
 
@@ -333,7 +333,7 @@ sub delete {
my $tenant_utils = UI::TenantUtils->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);

-   if (!$tenant_utils->is_tenant_writeable($tenants_data, $parent_tenant)) 
{
+   if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$parent_tenant)) {
return $self->forbidden(); #Parent tenant is not under user's 
tenancy
}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/0fffefea/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index d21505f..852380f 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -190,22 +190,12 @@ sub is_root_tenant {
 return !( defined( $tenants_data->{tenants_dict}{$tenant_id}{parent} ) );
 }
 
-sub is_tenant_readable {
+sub is_tenant_resource_accessible {
 my $self = shift;
 my $tenants_data = shift;
 my $resource_tenancy = shift;
 
-return $self->_is_resource_accessable( $tenants_data, $resource_tenancy,
-"r" );
-}
-
-sub is_tenant_writeable {
-my $self = shift;
-my $tenants_data = shift;
-my $resource_tenancy = shift;
-
-return $self->_is_resource_accessable( $tenants_data, $resource_tenanc

[08/25] incubator-trafficcontrol git commit: Tenant-utils - current_user_tenant

2017-07-18 Thread mitchell852
Tenant-utils - current_user_tenant


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/731ceb14
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/731ceb14
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/731ceb14

Branch: refs/heads/master
Commit: 731ceb1401312dfef3bd96314250dc51fc723b10
Parents: ea12516
Author: nir-sopher 
Authored: Thu Jun 1 16:37:09 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/User.pm   |  3 ++-
 traffic_ops/app/lib/UI/TenantUtils.pm | 10 ++
 traffic_ops/app/lib/UI/User.pm|  4 +++-
 traffic_ops/app/lib/UI/Utils.pm   |  3 ++-
 4 files changed, 17 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/731ceb14/traffic_ops/app/lib/API/User.pm
--
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index c83d9ef..91b56fd 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -18,6 +18,7 @@ package API::User;
 
 # 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 UI::TenantUtils;
 
 use Mojo::Base 'Mojolicious::Controller';
 use Utils::Helper;
@@ -404,7 +405,7 @@ sub current {
my $self = shift;
my @data;
my $current_username = $self->current_user()->{username};
-
+   my $tenantUtils = UI::TenantUtils->new($self);
if ( &is_ldap($self) ) {
my $role = $self->db->resultset('Role')->search( { name => 
"read-only" } )->get_column('id')->single;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/731ceb14/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index d40b3ba..44a7f17 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -32,6 +32,16 @@ sub new {
return bless $self, $class;
 }
 
+
+sub current_user_tenant {
+   my $self = shift;
+   if ($self->{user_tenant_id} == -1) 
+   {
+   $self->{user_tenant_id} = 
$self->{context}->db->resultset('TmUser')->search( { username => 
$self->{context}->current_user()->{username} } 
)->get_column('tenant_id')->single();
+   }
+   return $self->{user_tenant_id};
+}
+
 sub get_hierarchic_tenants_list {
my $self = shift;
my $tree_root = shift;  

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/731ceb14/traffic_ops/app/lib/UI/User.pm
--
diff --git a/traffic_ops/app/lib/UI/User.pm b/traffic_ops/app/lib/UI/User.pm
index f44dab4..2f7c1fe 100644
--- a/traffic_ops/app/lib/UI/User.pm
+++ b/traffic_ops/app/lib/UI/User.pm
@@ -18,6 +18,7 @@ package UI::User;
 
 # 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 UI::TenantUtils;
 
 use Mojo::Base 'Mojolicious::Controller';
 use Utils::Helper;
@@ -285,11 +286,12 @@ sub is_send_register_valid {
 sub create_user {
my $self   = shift;
my $new_id = -1;
+   my $tenantUtils = UI::TenantUtils->new($self);
my $dbh= $self->db->resultset('TmUser')->create(
{
full_name=> 
$self->param('tm_user.full_name'),
username => 
$self->param('tm_user.username'),
-   tenant_id=> current_user_tenant($self), 
#Tenancy is not dealt by the UI for now. getting the tenancy from the user  

+   tenant_id=> 
$tenantUtils->current_user_tenant(), #Tenancy is not dealt by the UI for now. 
getting the tenancy from the user 
public_ssh_key   => 
$self->param('tm_user.public_ssh_key'),
phone_number => 
$self->param('tm_user.phone_number'),
email=> $self->param('tm_user.email'),

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/731ceb14/traffic_ops/app/lib/UI/Utils.pm
--
diff --git a/traffic_ops/app/lib/UI/Utils.pm b/traffic_ops/app/lib/UI/Utils.pm
index 4ac2385..2b22726 100644
--- a/traffic_ops/app/lib/UI/Utils.pm
+++ b/traffic_ops/app/lib/UI/Utils.pm
@@ -42,7 +42,7 @@ use constant ADMIN  => 30;
 our %EXPORT_TAGS = (
'all' => [
qw(

[13/25] incubator-trafficcontrol git commit: tenant utils - perltidy

2017-07-18 Thread mitchell852
tenant utils - perltidy


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/f35a77f9
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/f35a77f9
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/f35a77f9

Branch: refs/heads/master
Commit: f35a77f9cd5a6525867e028a0161e3ce7c64b990
Parents: c8d6029
Author: nir-sopher 
Authored: Mon Jun 5 22:12:59 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/UI/TenantUtils.pm | 620 +++--
 1 file changed, 323 insertions(+), 297 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f35a77f9/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index 25ea905..c49bb14 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -16,20 +16,19 @@ package UI::TenantUtils;
 #
 #
 
-
 #
-# This class provide utilities to examine different tenancy aspects, 
+# This class provide utilities to examine different tenancy aspects,
 # and specifically tenancy based access restrictions.
 #
 # The class itself is almost* stateless. However in order to reduce calls to 
DB, its
-# API allows the user to create the "DATA" object (using 
"create_tenants_data_from_db") 
+# API allows the user to create the "DATA" object (using 
"create_tenants_data_from_db")
 # and run utility functions over it.
 #
 # For now, until the current user tenant ID will come from the jwt, the 
current user tenant is taken from the DB.
 # In order to reduce the number of calls from the DB, the current user tenant 
is taken in the class creation
-# 
 #
-# A usage example - examing if a tenant can update a delivery-service: 
+#
+# A usage example - examing if a tenant can update a delivery-service:
 # my $tenant_utils = UI::TenantUtils->new($self);
 # my $tenants_data = $tenant_utils->create_tenants_data_from_db();
 # if (!$tenant_utils->is_ds_writeable($tenants_data, )) {
@@ -40,343 +39,370 @@ package UI::TenantUtils;
 use Data::Dumper;
 use UI::Utils;
 
-
 sub new {
-   my $class = shift;
-   my $context = shift;
-   my $current_user_tenant = shift; #optional - allowing the user tenancy 
to be set from outside, for testing capabilities 
-   my $dbh = shift;  #optional - allowing the DB handle to be set from 
outside, for testing capabilities   
-
-   if (!defined($current_user_tenant)) {
-   # For now, until the current user tenant ID will come from the 
jwt, the current user tenant is taken from the DB.
-   $current_user_tenant = 
$context->db->resultset('TmUser')->search( { username => 
$context->current_user()->{username} } )->get_column('tenant_id')->single();
-   }
-   
-   if (!defined($dbh)){
-   $dbh = $context->db
-   }
-   
-   my $self  = {   
-   dbh => $dbh,
-   context => $context, #saving the context - use it only for log 
please...
-
-   # In order to reduce the number of calls from the DB, the 
current user tenant is taken in the class creation.
-   # the below parameters are held temporarily until the info is 
taken from the jwt
-   current_user_tenant => $current_user_tenant,
-   is_ldap => defined($context) ? $context->is_ldap() : 0,
-   };
-   bless $self, $class;
-   return $self;
+my $class   = shift;
+my $context = shift;
+my $current_user_tenant = shift
+  ; #optional - allowing the user tenancy to be set from outside, for 
testing capabilities
+my $dbh = shift
+  ; #optional - allowing the DB handle to be set from outside, for testing 
capabilities
+
+if ( !defined($current_user_tenant) ) {
+
+# For now, until the current user tenant ID will come from the jwt, the 
current user tenant is taken from the DB.
+$current_user_tenant =
+  $context->db->resultset('TmUser')
+  ->search( { username => $context->current_user()->{username} } )
+  ->get_column('tenant_id')->single();
+}
+
+if ( !defined($dbh) ) {
+$dbh = $context->db;
+}
+
+my $self = {
+dbh => $dbh,
+context => $context, #saving the context - use it only for log 
please...
+
+# In order to reduce the number of calls from the DB, the current user tenant 
is taken in the class creation.
+# the below parameters are held temporarily until the info is taken from the 
jwt
+current_user_tenant => $current_user_tenant,
+is_ldap => defined($co

[24/25] incubator-trafficcontrol git commit: Tenant-utils PR review changes

2017-07-18 Thread mitchell852
Tenant-utils PR review changes


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ab801791
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ab801791
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ab801791

Branch: refs/heads/master
Commit: ab801791569874ca54771de8e3da41b34fd34529
Parents: e0ae552
Author: nir-sopher 
Authored: Mon Jun 26 20:46:29 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm  | 21 ++---
 traffic_ops/app/lib/API/User.pm|  3 +--
 traffic_ops/app/t/api/1.2/tenant.t |  4 ++--
 3 files changed, 13 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ab801791/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 3653455..932ab0f 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -108,17 +108,22 @@ sub update {
}

if ( $params->{name} ne $self->getTenantName($id) ) {
-   my $name = $params->{name};
+my $name = $params->{name};
my $existing = $self->db->resultset('Tenant')->search( { name 
=> $name } )->get_column('name')->single();
if ($existing) {
return $self->alert("A tenant with name \"$name\" 
already exists.");
}   
-   }   
+   }
+
 
my $tenant_utils = UI::TenantUtils->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);
 
-   if ( !defined( $params->{parentId}) && 
!$tenant_utils->is_root_tenant($tenants_data, $id) ) {
+   if ( $tenant_utils->is_root_tenant($tenants_data, $id) ) {
+   return $self->alert("Root tenant cannot be updated.");
+   }
+
+   if ( !defined( $params->{parentId}) ) {
# Cannot turn a simple tenant to a root tenant.
# Practically there is no problem with doing so, but it is to 
risky to be done by mistake. 
return $self->alert("Parent Id is required.");
@@ -128,19 +133,13 @@ sub update {
return $self->alert("Active field is required.");
}
 
-   my $is_active = $params->{active};
-   
if ( !$params->{active} && $tenant_utils->is_root_tenant($tenants_data, 
$id)) {
return $self->alert("Root tenant cannot be in-active.");
}
 
#this is a write operation, allowed only by parents of the tenant 
(which are the owners of the resource of type tenant) 
my $current_resource_tenancy = $self->db->resultset('Tenant')->search( 
{ id => $id } )->get_column('parent_id')->single();
-   if (!defined($current_resource_tenancy)) {
-   #no parent - the tenant is its-own owner
-   $current_resource_tenancy = $id;
-   }
-   
+
if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, 
$current_resource_tenancy)) {
return $self->forbidden(); #Current owning tenant is not under 
user's tenancy
}
@@ -243,7 +242,7 @@ sub create {
if ( !defined($parent_id) ) {
return $self->alert("Parent Id is required.");
}
-   
+
my $tenant_utils = UI::TenantUtils->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ab801791/traffic_ops/app/lib/API/User.pm
--
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index 3f03ad2..e98f969 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -406,8 +406,7 @@ sub current {
my $self = shift;
my @data;
my $current_username = $self->current_user()->{username};
-   my $tenantUtils = UI::TenantUtils->new($self);
-   if ( &is_ldap($self) ) {
+it if ( &is_ldap($self) ) {
my $role = $self->db->resultset('Role')->search( { name => 
"read-only" } )->get_column('id')->single;
 
push(

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ab801791/traffic_ops/app/t/api/1.2/tenant.t
--
diff --git a/traffic_ops/app/t/api/1.2/tenant.t 
b/traffic_ops/app/t/api/1.2/tenant.t
index ced60bd..08a3913 100644
--- a/traffic_ops/app/t/api/1.2/tenant.t
+++ b/traffic_ops/app/t/api/1.2/tenant.t
@@ -127,7 +127,7 @@ ok $t->put_ok('/api/1.2/tenants/' . $

[02/25] incubator-trafficcontrol git commit: Org-Tenancy Fixing error string

2017-07-18 Thread mitchell852
Org-Tenancy Fixing error string


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ed323e8f
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ed323e8f
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ed323e8f

Branch: refs/heads/master
Commit: ed323e8f2bea46916ae586b33b32753ae7f6ae04
Parents: c9181f2
Author: nir-sopher 
Authored: Thu Jun 1 16:02:06 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm  | 2 +-
 traffic_ops/app/t/api/1.2/tenant.t | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ed323e8f/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 79795a4..c1974ca 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -135,7 +135,7 @@ sub update {
my $is_active = $params->{active};

if ( !$params->{active} && $self->isRootTenant($id)) {
-   return $self->alert("Root user cannot be in-active.");
+   return $self->alert("Root tenant cannot be in-active.");
}
 
if ( !defined($params->{parentId}) && !isRootTenant($id) ) {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ed323e8f/traffic_ops/app/t/api/1.2/tenant.t
--
diff --git a/traffic_ops/app/t/api/1.2/tenant.t 
b/traffic_ops/app/t/api/1.2/tenant.t
index 5d671ba..285ea24 100644
--- a/traffic_ops/app/t/api/1.2/tenant.t
+++ b/traffic_ops/app/t/api/1.2/tenant.t
@@ -126,7 +126,7 @@ ok $t->put_ok('/api/1.2/tenants/' . $tenantA_id  => {Accept 
=> 'application/json
 #cannot change root-tenant to inactive
 ok $t->put_ok('/api/1.2/tenants/' . $root_tenant_id  => {Accept => 
'application/json'} => json => {
"name" => "root", "active" => 0, "parentId" => undef})
-   ->json_is( "/alerts/0/text" => "Root user cannot be 
in-active.")
+   ->json_is( "/alerts/0/text" => "Root tenant cannot be 
in-active.")
->status_is(400);
 
 #adding a child tenant
@@ -148,7 +148,7 @@ ok $t->post_ok('/api/1.2/tenants' => {Accept => 
'application/json'} => json => {
 my $tenantD_id = &get_tenant_id('tenantD');
 my $tenantE_id = &get_tenant_id('tenantE');
 
--#list tenants- verify heirachic order
+#list tenants- verify heirachic order
 $t->get_ok("/api/1.2/tenants")->status_is(200)->json_is( "/response/0/id", 
$root_tenant_id )
->json_is( "/response/1/id", $tenantA_id)
->json_is( "/response/2/id", $tenantD_id)



[25/25] incubator-trafficcontrol git commit: This closes #644

2017-07-18 Thread mitchell852
This closes #644


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/d37e3865
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/d37e3865
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/d37e3865

Branch: refs/heads/master
Commit: d37e3865c7a4dbc10034bc40005e143c3e78e95e
Parents: 6336f9b
Author: Jeremy Mitchell 
Authored: Tue Jul 18 12:13:01 2017 -0600
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:13:01 2017 -0600

--

--




[12/25] incubator-trafficcontrol git commit: tenancy checks - return 403

2017-07-18 Thread mitchell852
tenancy checks - return 403


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/512d1ef5
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/512d1ef5
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/512d1ef5

Branch: refs/heads/master
Commit: 512d1ef51782453cc0f2e23b2b6f3c779d0d872c
Parents: ed169cd
Author: nir-sopher 
Authored: Sun Jun 4 20:14:25 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm  | 13 ---
 traffic_ops/app/t/api/1.2/tenant.t | 65 ++---
 2 files changed, 52 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/512d1ef5/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index f224967..1c583d8 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -83,6 +83,9 @@ sub show {
}
);
}
+   else {
+   return $self->forbidden();
+   }
}
$self->success( \@data );
 }
@@ -144,11 +147,11 @@ sub update {
}

if (!$tenant_utils->is_tenant_resource_writeable($tenants_data, 
$current_resource_tenancy)) {
-   return $self->alert("Current owning tenant is not under user's 
tenancy.");
+   return $self->forbidden(); #Current owning tenant is not under 
user's tenancy
}
 
if (!$tenant_utils->is_tenant_resource_writeable($tenants_data, 
$params->{parentId})) {
-   return $self->alert("Parent tenant to be set is not under 
user's tenancy.");
+   return $self->forbidden(); #Parent tenant to be set is not 
under user's tenancy
}
 
 
@@ -250,7 +253,7 @@ sub create {
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);

if (!$tenant_utils->is_tenant_resource_writeable($tenants_data, 
$params->{parentId})) {
-   return $self->alert("Parent tenant to be set is not under 
user's tenancy.");
+   return $self->forbidden(); #Parent tenant to be set is not 
under user's tenancy
}
 
if (!defined($tenant_utils->get_tenant($tenants_data, 
$params->{parentId}))) {
@@ -329,13 +332,13 @@ sub delete {
return $self->not_found();
}   
 
-   my $parent_tenant = $tenant->parent_id;
+   my $parent_tenant = $tenant->parent_id; 

my $tenant_utils = UI::TenantUtils->new($self);
my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);

if (!$tenant_utils->is_tenant_resource_writeable($tenants_data, 
$parent_tenant)) {
-   return $self->alert("Parent tenant is not under user's 
tenancy.");
+   return $self->forbidden(); #Parent tenant is not under user's 
tenancy
}
 
my $name = $tenant->name;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/512d1ef5/traffic_ops/app/t/api/1.2/tenant.t
--
diff --git a/traffic_ops/app/t/api/1.2/tenant.t 
b/traffic_ops/app/t/api/1.2/tenant.t
index 903b2f1..ac722a7 100644
--- a/traffic_ops/app/t/api/1.2/tenant.t
+++ b/traffic_ops/app/t/api/1.2/tenant.t
@@ -39,7 +39,7 @@ ok $t->post_ok( '/login', => form => { u => 
Test::TestHelper::ADMIN_ROOT_USER, p
->or( sub { diag $t->tx->res->content->asset->{content}; } ), 'Should 
login?';
 
 #verifying the basic cfg
-$t->get_ok("/api/1.2/tenants")->status_is(200)->json_is( "/response/0/name", 
"root" )->or( sub { diag $t->tx->res->content->asset->{content}; } );;
+ok $t->get_ok("/api/1.2/tenants")->status_is(200)->json_is( 
"/response/0/name", "root" )->or( sub { diag 
$t->tx->res->content->asset->{content}; } );;
 
 my $root_tenant_id = &get_tenant_id('root');
 
@@ -149,7 +149,7 @@ my $tenantD_id = &get_tenant_id('tenantD');
 my $tenantE_id = &get_tenant_id('tenantE');
 
 #list tenants- verify heirachic order - order by id
-$t->get_ok("/api/1.2/tenants?orderby=id")->status_is(200)
+ok $t->get_ok("/api/1.2/tenants?orderby=id")->status_is(200)
->json_is( "/response/0/id", $root_tenant_id )
->json_is( "/response/1/id", $tenantA_id)
->json_is( "/response/2/id", $tenantD_id)
@@ -157,7 +157,7 @@ $t->get_ok("/api/1.2/tenants?orderby=id")->status_is(200)
->json_is( "/response/4/id", $tenantB_id)->or( sub { diag 
$t->tx->res->content->asset->{content}; } );;
 
 #list tenants- verify heirachic order - order by

[14/25] incubator-trafficcontrol git commit: Tenant utils - testing capabilities

2017-07-18 Thread mitchell852
Tenant utils - testing capabilities


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/584f7080
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/584f7080
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/584f7080

Branch: refs/heads/master
Commit: 584f7080c7aaf7e4e581b75ee6f36e1717cbeef5
Parents: 512d1ef
Author: nir-sopher 
Authored: Mon Jun 5 00:14:10 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm |   6 +-
 traffic_ops/app/lib/UI/TenantUtils.pm |  35 +---
 traffic_ops/app/t/api/1.2/tenant.t| 133 -
 3 files changed, 118 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/584f7080/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 1c583d8..ab81728 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -40,7 +40,7 @@ sub index {
my $tenants_data = $tenant_utils->create_tenants_data_from_db($orderby);
 
my @data = ();
-   my @tenants_list = 
$tenant_utils->get_hierarchic_tenants_list($tenants_data, undef, $orderby);
+   my @tenants_list = 
$tenant_utils->get_hierarchic_tenants_list($tenants_data, undef);
foreach my $row (@tenants_list) {
if ($tenant_utils->is_tenant_resource_readable($tenants_data, 
$row->id)) {
push(
@@ -50,8 +50,6 @@ sub index {
"active" => \$row->active,
"parentId"   => $row->parent_id,
"parentName" => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
-   "heirarchyDepth" => 
$tenant_utils->get_tenant_heirarchy_depth($tenants_data, $row->id),
-   "heirarchyHeight" => 
$tenant_utils->get_tenant_heirarchy_height($tenants_data, $row->id),
}
);
}
@@ -78,8 +76,6 @@ sub show {
"active"   => \$row->active,
"parentId" => $row->parent_id,
"parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
-   "heirarchyDepth" => 
$tenant_utils->get_tenant_heirarchy_depth($tenants_data, $row->id),
-   "heirarchyHeight" => 
$tenant_utils->get_tenant_heirarchy_height($tenants_data, $row->id),
}
);
}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/584f7080/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index 4c8fc0f..4162c82 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -36,15 +36,23 @@ use UI::Utils;
 sub new {
my $class = shift;
my $context = shift;
-   # For now, until the current user tenant ID will come from the jwt, the 
current user tenant is taken from the DB.
-   my $current_user_tenant = $context->db->resultset('TmUser')->search( { 
username => $context->current_user()->{username} } 
)->get_column('tenant_id')->single();
-   my $dbh = $context->db; 
+   my $current_user_tenant = shift; #optional - allowing the user tenancy 
to be set from outside, for testing capabilities 
+   if (!defined($current_user_tenant)) {
+   # For now, until the current user tenant ID will come from the 
jwt, the current user tenant is taken from the DB.
+   $current_user_tenant = 
$context->db->resultset('TmUser')->search( { username => 
$context->current_user()->{username} } )->get_column('tenant_id')->single();
+   }
+   
+   my $dbh = shift;  #optional - allowing the DB handle to be set from 
outside, for testing capabilities   
+   if (!defined($dbh)){
+   $dbh = $context->db
+   }
+   
my $self  = {   
dbh => $dbh,
# In order to reduce the number of calls from the DB, the 
current user tenant is taken in the class creation.
# the below parameters are held temporarily until the in

[10/25] incubator-trafficcontrol git commit: Tenant list - order by

2017-07-18 Thread mitchell852
Tenant list - order by


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2dcc1394
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2dcc1394
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2dcc1394

Branch: refs/heads/master
Commit: 2dcc1394d3cea970eb42fa6322267062008dd869
Parents: 2eb94bf
Author: nir-sopher 
Authored: Fri Jun 2 15:16:11 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm |  5 +++--
 traffic_ops/app/lib/UI/TenantUtils.pm | 22 ++
 traffic_ops/app/t/api/1.2/tenant.t| 27 ++-
 3 files changed, 39 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2dcc1394/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index ca67365..ab335e2 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -33,7 +33,8 @@ sub getTenantName {
 }
 
 sub index {
-   my $self= shift;
+   my $self= shift;
+   my $orderby = $self->param('orderby') || "name";
 
my %idnames;
my $rs_data = $self->db->resultset("Tenant")->search();
@@ -43,7 +44,7 @@ sub index {
 
my @data = ();
my $tenantUtils = UI::TenantUtils->new($self);
-   my @tenants_list = $tenantUtils->get_hierarchic_tenants_list();
+   my @tenants_list = $tenantUtils->get_hierarchic_tenants_list(undef, 
$orderby);
foreach my $row (@tenants_list) {
if ($tenantUtils->is_tenant_resource_readable($row->id)) {
push(

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2dcc1394/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index a7a33e4..118ba79 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -28,6 +28,8 @@ sub new {
user_tenant_id => -1,   
tenants_dict => undef,
root_tenants => undef,
+   order_by => -1,
+   ordered_by => undef,
};
return bless $self, $class;
 }
@@ -45,8 +47,9 @@ sub current_user_tenant {
 sub get_hierarchic_tenants_list {
my $self = shift;
my $tree_root = shift;  
+   my $order_by = shift;   

-   $self->_init_tenants_if_needed();
+   $self->_init_tenants_if_needed($order_by);
 
my @stack = ();
if (defined($tree_root)){
@@ -100,12 +103,13 @@ sub is_tenant_resource_writeable {
 
 sub _init_tenants {
my $self = shift;
-   my $tenants_table = $self->{context}->db->resultset("Tenant")->search( 
undef, { order_by => "id" });
+   $self->{order_by} = shift || "name";#some default
+   my $tenants_table = $self->{context}->db->resultset("Tenant")->search( 
undef, { order_by => $self->{order_by} });

-   my @ordered_by_id = ();
+   $self->{ordered_by} = ();
$self->{tenants_dict} = {};
while ( my $row = $tenants_table->next ) {
-   push (@ordered_by_id, $row->id);
+   push (@{ $self->{ordered_by} }, $row->id);
$self->{tenants_dict}->{$row->id} = {
row => $row,
parent => $row->parent_id,
@@ -114,7 +118,7 @@ sub _init_tenants {
}

$self->{root_tenants} = ();
-   foreach my $key (@ordered_by_id) {
+   foreach my $key (@{ $self->{ordered_by} }) {
my $value = $self->{tenants_dict}->{$key};
my $parent = $value->{parent};
if (!defined($parent))
@@ -129,8 +133,10 @@ sub _init_tenants {
 
 sub _init_tenants_if_needed {
my $self = shift;
-   if (!defined($self->{tenants_dict})) {
-   $self->_init_tenants();
+   my $order_by = shift;
+   if (($self->{order_by} == -1) || (defined($order_by) && $order_by != 
$self->{order_by})) {
+   ## first run to build the list OR (the order is important AND 
is not the current order)
+   $self->_init_tenants($order_by);
}
 }
 
@@ -165,7 +171,7 @@ sub _is_resource_accessable {
return 0;
}
 
-   $self->_init_tenants_if_needed();
+   $self->_init_tenants_if_needed(undef);
my $tenant_record = $self->{tenants_dict}->{$user_tenant};
my $is_active_tenant = $tenant_record->{row}->active;
if (! $is_

[17/25] incubator-trafficcontrol git commit: Tenant-utils - minor func seperation

2017-07-18 Thread mitchell852
Tenant-utils - minor func seperation


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e0ae5528
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e0ae5528
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e0ae5528

Branch: refs/heads/master
Commit: e0ae55287958361b4e2a4b0393e328250c2f6ca4
Parents: abd4f7b
Author: nir-sopher 
Authored: Mon Jun 26 17:55:01 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/UI/TenantUtils.pm | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e0ae5528/traffic_ops/app/lib/UI/TenantUtils.pm
--
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm 
b/traffic_ops/app/lib/UI/TenantUtils.pm
index 8751d76..bdbe586 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -341,9 +341,18 @@ sub _error {
 }
 
 sub _is_resource_accessable {
+my $self = shift;
+my $tenants_data = shift;
+my $resource_tenant = shift;
+my $user_tenant = $self->current_user_tenant();
+return $self->_is_resource_accessable_to_tenant($tenants_data, 
$resource_tenant, $user_tenant)
+}
+
+sub _is_resource_accessable_to_tenant {
 my $self= shift;
 my $tenants_data= shift;
 my $resource_tenant = shift;
+my $user_tenant = shift;
 
 if ($self->{ignore_tenancy}) {
 #mechanisem disabled
@@ -351,7 +360,6 @@ sub _is_resource_accessable {
 }
 
 
-my $user_tenant = $self->current_user_tenant();
 if ( defined($user_tenant) ) {
 my $tenant_record= $tenants_data->{tenants_dict}->{$user_tenant};
 my $is_active_tenant = $tenant_record->{row}->active;



[04/25] incubator-trafficcontrol git commit: tenantutils - becoming stateless

2017-07-18 Thread mitchell852
tenantutils - becoming stateless


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/16eb2597
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/16eb2597
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/16eb2597

Branch: refs/heads/master
Commit: 16eb2597759ca265fba984f8caf1f0b0d8d1bd50
Parents: f5ca600
Author: nir-sopher 
Authored: Fri Jun 2 16:45:54 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm |  44 +---
 traffic_ops/app/lib/UI/TenantUtils.pm | 171 +++--
 2 files changed, 119 insertions(+), 96 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/16eb2597/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 4812439..e9b9cb5 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -36,18 +36,20 @@ sub index {
my $self= shift;
my $orderby = $self->param('orderby') || "name";
 
+   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db($orderby);
+
my @data = ();
-   my $tenantUtils = UI::TenantUtils->new($self);
-   my @tenants_list = $tenantUtils->get_hierarchic_tenants_list(undef, 
$orderby);
+   my @tenants_list = 
$tenant_utils->get_hierarchic_tenants_list($tenants_data, undef, $orderby);
foreach my $row (@tenants_list) {
-   if ($tenantUtils->is_tenant_resource_readable($row->id)) {
+   if ($tenant_utils->is_tenant_resource_readable($tenants_data, 
$row->id)) {
push(
@data, {
"id"   => $row->id,
"name" => $row->name,
"active"   => \$row->active,
"parentId" => $row->parent_id,
-   "parentName"   => ( defined 
$row->parent_id ) ? $tenantUtils->get_tenant($row->parent_id)->name : undef,
+   "parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
}
);
}
@@ -60,18 +62,20 @@ sub show {
my $self = shift;
my $id   = $self->param('id');
 
+   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);
+
my @data = ();
-   my $tenantUtils = UI::TenantUtils->new($self);
my $rs_data = $self->db->resultset("Tenant")->search( { 'me.id' => $id 
});
while ( my $row = $rs_data->next ) {
-   if ($tenantUtils->is_tenant_resource_readable($row->id)) {
+   if ($tenant_utils->is_tenant_resource_readable($tenants_data, 
$row->id)) {
push(
@data, {
"id"   => $row->id,
"name" => $row->name,
"active"   => \$row->active,
"parentId" => $row->parent_id,
-   "parentName"   => ( defined 
$row->parent_id ) ? $tenantUtils->get_tenant($row->parent_id)->name : undef,
+   "parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
}
);
}
@@ -109,9 +113,10 @@ sub update {
}   
}   
 
-   my $tenantUtils = UI::TenantUtils->new($self);
+   my $tenant_utils = UI::TenantUtils->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);
 
-   if ( !defined( $params->{parentId}) && 
!$tenantUtils->is_root_tenant($id) ) {
+   if ( !defined( $params->{parentId}) && 
!$tenant_utils->is_root_tenant($tenants_data, $id) ) {
# Cannot turn a simple tenant to a root tenant.
# Practically there is no problem with doing so, but it is to 
risky to be done by mistake. 
return $self->alert("Parent Id is required.");
@@ -123,7 +128,7 @@ sub update {
 
my $is_active = $params->{active};

-   if ( !$params->{active} && $tenantUtils->is_root_tenant($id)) 

[15/25] incubator-trafficcontrol git commit: Tenant utils - documentations and changes

2017-07-18 Thread mitchell852
Tenant utils - documentations and changes


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c8d60294
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c8d60294
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c8d60294

Branch: refs/heads/master
Commit: c8d602948866b3b9a79f157bb85c86eb971a6ddf
Parents: 584f708
Author: nir-sopher 
Authored: Mon Jun 5 03:24:05 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 20 +++
 traffic_ops/app/lib/UI/TenantUtils.pm | 88 ++
 traffic_ops/app/t/api/1.2/tenant.t| 76 +-
 3 files changed, 113 insertions(+), 71 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8d60294/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index ab81728..390b1e5 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -42,14 +42,14 @@ sub index {
my @data = ();
my @tenants_list = 
$tenant_utils->get_hierarchic_tenants_list($tenants_data, undef);
foreach my $row (@tenants_list) {
-   if ($tenant_utils->is_tenant_resource_readable($tenants_data, 
$row->id)) {
+   if ($tenant_utils->is_tenant_readable($tenants_data, $row->id)) 
{
push(
@data, {
"id" => $row->id,
"name"   => $row->name,
"active" => \$row->active,
"parentId"   => $row->parent_id,
-   "parentName" => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
+   "parentName" => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant_by_id($tenants_data, 
$row->parent_id)->name : undef,
}
);
}
@@ -68,14 +68,14 @@ sub show {
my @data = ();
my $rs_data = $self->db->resultset("Tenant")->search( { 'me.id' => $id 
});
while ( my $row = $rs_data->next ) {
-   if ($tenant_utils->is_tenant_resource_readable($tenants_data, 
$row->id)) {
+   if ($tenant_utils->is_tenant_readable($tenants_data, $row->id)) 
{
push(
@data, {
"id"   => $row->id,
"name" => $row->name,
"active"   => \$row->active,
"parentId" => $row->parent_id,
-   "parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
+   "parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant_by_id($tenants_data, 
$row->parent_id)->name : undef,
}
);
}
@@ -142,18 +142,18 @@ sub update {
$current_resource_tenancy = $id;
}

-   if (!$tenant_utils->is_tenant_resource_writeable($tenants_data, 
$current_resource_tenancy)) {
+   if (!$tenant_utils->is_tenant_writeable($tenants_data, 
$current_resource_tenancy)) {
return $self->forbidden(); #Current owning tenant is not under 
user's tenancy
}
 
-   if (!$tenant_utils->is_tenant_resource_writeable($tenants_data, 
$params->{parentId})) {
+   if (!$tenant_utils->is_tenant_writeable($tenants_data, 
$params->{parentId})) {
return $self->forbidden(); #Parent tenant to be set is not 
under user's tenancy
}
 
 
if ($params->{parentId} != $tenant->parent) {
#parent replacement
-   if (!defined($tenant_utils->get_tenant($tenants_data, 
$params->{parentId}))) {
+   if (!defined($tenant_utils->get_tenant_by_id($tenants_data, 
$params->{parentId}))) {
return $self->alert("Parent tenant does not exists.");
}
my $parent_depth = 
$tenant_utils->get_tenant_heirarchy_depth($tenants_data, $params->{parentId});
@@ -248,11 +248,11 @@ sub create {
my $tenant_utils = UI::TenantUtils->new($self);
my $tenants_data = $tenant_utils->create_tenants

[20/25] incubator-trafficcontrol git commit: Moving DS creation to use tenant-utils to get current user tenant

2017-07-18 Thread mitchell852
Moving DS creation to use tenant-utils to get current user tenant


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/6336f9b4
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/6336f9b4
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/6336f9b4

Branch: refs/heads/master
Commit: 6336f9b4a7b7872751c8015094790d9d149518c0
Parents: 13b60e6
Author: nir-sopher 
Authored: Tue Jul 11 02:39:35 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:32 2017 -0600

--
 traffic_ops/app/lib/API/Deliveryservice.pm | 4 +++-
 traffic_ops/app/lib/UI/DeliveryService.pm  | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6336f9b4/traffic_ops/app/lib/API/Deliveryservice.pm
--
diff --git a/traffic_ops/app/lib/API/Deliveryservice.pm 
b/traffic_ops/app/lib/API/Deliveryservice.pm
index 1587bed..5e748af 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -21,6 +21,7 @@ package API::Deliveryservice;
 
 # 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 Utils::Tenant;
 
 use Mojo::Base 'Mojolicious::Controller';
 use Data::Dumper;
@@ -463,7 +464,8 @@ sub create {
}

#setting tenant_id to the user id if tenant is not set. 
-   my $tenant_id = exists($params->{tenantId}) ? $params->{tenantId} :  
$self->current_user_tenant();
+   my $tenantUtils = Utils::Tenant->new($self);
+   my $tenant_id = exists($params->{tenantId}) ? $params->{tenantId} :  
$tenantUtils->current_user_tenant();
 
my $values = {
active => $params->{active},

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/6336f9b4/traffic_ops/app/lib/UI/DeliveryService.pm
--
diff --git a/traffic_ops/app/lib/UI/DeliveryService.pm 
b/traffic_ops/app/lib/UI/DeliveryService.pm
index b9e33e5..63af8e3 100644
--- a/traffic_ops/app/lib/UI/DeliveryService.pm
+++ b/traffic_ops/app/lib/UI/DeliveryService.pm
@@ -19,6 +19,7 @@ package UI::DeliveryService;
 
 # 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 Utils::Tenant;
 use Mojo::Base 'Mojolicious::Controller';
 use Data::Dumper;
 use JSON;
@@ -1009,6 +1010,7 @@ sub create {
$self->stash_cdn_selector();
&stash_role($self);
if ( $self->check_deliveryservice_input($cdn_id) ) {
+   my $tenantUtils = Utils::Tenant->new($self);
my $insert = $self->db->resultset('Deliveryservice')->create(
{
xml_id  => 
$self->paramAsScalar('ds.xml_id'),
@@ -1054,7 +1056,7 @@ sub create {
remap_text => $self->paramAsScalar( 
'ds.remap_text', undef ),
initial_dispersion => $self->paramAsScalar( 
'ds.initial_dispersion', 1 ),
logs_enabled   => 
$self->paramAsScalar('ds.logs_enabled'),
-   tenant_id => 
current_user_tenant($self),#Tenancy is not dealt by the UI for now. getting the 
tenancy from the user
+   tenant_id => 
$tenantUtils->current_user_tenant(),#Tenancy is not dealt by the UI for now. 
getting the tenancy from the user
}
);
$insert->insert();



[01/25] incubator-trafficcontrol git commit: tenant utils - depth, height and relations. including temp addition to the API for simple testing

2017-07-18 Thread mitchell852
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master a1bf58f85 -> d37e3865c


tenant utils - depth, height and relations. including temp addition to the API 
for simple testing


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ed169cd8
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ed169cd8
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ed169cd8

Branch: refs/heads/master
Commit: ed169cd8b2e2d2152842b73f03ee513b0b5389b4
Parents: 16eb259
Author: nir-sopher 
Authored: Sun Jun 4 20:05:38 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm |  70 ++--
 traffic_ops/app/lib/UI/TenantUtils.pm | 128 -
 traffic_ops/app/t/api/1.2/tenant.t|  73 
 3 files changed, 247 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ed169cd8/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index e9b9cb5..f224967 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -45,11 +45,13 @@ sub index {
if ($tenant_utils->is_tenant_resource_readable($tenants_data, 
$row->id)) {
push(
@data, {
-   "id"   => $row->id,
-   "name" => $row->name,
-   "active"   => \$row->active,
-   "parentId" => $row->parent_id,
-   "parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
+   "id" => $row->id,
+   "name"   => $row->name,
+   "active" => \$row->active,
+   "parentId"   => $row->parent_id,
+   "parentName" => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
+   "heirarchyDepth" => 
$tenant_utils->get_tenant_heirarchy_depth($tenants_data, $row->id),
+   "heirarchyHeight" => 
$tenant_utils->get_tenant_heirarchy_height($tenants_data, $row->id),
}
);
}
@@ -76,6 +78,8 @@ sub show {
"active"   => \$row->active,
"parentId" => $row->parent_id,
"parentName"   => ( defined 
$row->parent_id ) ? $tenant_utils->get_tenant($tenants_data, 
$row->parent_id)->name : undef,
+   "heirarchyDepth" => 
$tenant_utils->get_tenant_heirarchy_depth($tenants_data, $row->id),
+   "heirarchyHeight" => 
$tenant_utils->get_tenant_heirarchy_height($tenants_data, $row->id),
}
);
}
@@ -148,6 +152,46 @@ sub update {
}
 
 
+   if ($params->{parentId} != $tenant->parent) {
+   #parent replacement
+   if (!defined($tenant_utils->get_tenant($tenants_data, 
$params->{parentId}))) {
+   return $self->alert("Parent tenant does not exists.");
+   }
+   my $parent_depth = 
$tenant_utils->get_tenant_heirarchy_depth($tenants_data, $params->{parentId});
+   if (!defined($parent_depth))
+   {
+   return $self->alert("Failed to retrieve parent tenant 
depth.");
+   }
+
+   my $tenant_height = 
$tenant_utils->get_tenant_heirarchy_height($tenants_data, $id);
+   if (!defined($tenant_height))
+   {
+   return $self->alert("Failed to retrieve tenant 
height.");
+   }
+   
+   if ($parent_depth+$tenant_height+1 > 
$tenant_utils->max_heirarchy_limit())
+   {
+   return $self->alert("Parent tenant is invalid: 
heirarchy limit reached.");
+   }
+   
+   if ($params->{parentId} == $id){
+   return $self->alert("Parent tenant is invalid: same as 
updated tenant.");
+   }
+
+   my $is_tenant_achestor_of_par

[06/25] incubator-trafficcontrol git commit: Org tenancy - removing redundant DB call

2017-07-18 Thread mitchell852
Org tenancy - removing redundant DB call


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ea125163
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ea125163
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ea125163

Branch: refs/heads/master
Commit: ea125163ef4666e72edca442ff591c935cadf6fe
Parents: 40375e6
Author: nir-sopher 
Authored: Thu Jun 1 16:24:00 2017 +0300
Committer: Jeremy Mitchell 
Committed: Tue Jul 18 12:12:31 2017 -0600

--
 traffic_ops/app/lib/API/Tenant.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ea125163/traffic_ops/app/lib/API/Tenant.pm
--
diff --git a/traffic_ops/app/lib/API/Tenant.pm 
b/traffic_ops/app/lib/API/Tenant.pm
index 71c8afc..265aad5 100644
--- a/traffic_ops/app/lib/API/Tenant.pm
+++ b/traffic_ops/app/lib/API/Tenant.pm
@@ -246,7 +246,7 @@ sub delete {
return $self->not_found();
}   
 
-   my $name = $self->db->resultset('Tenant')->search( { id => $id } 
)->get_column('name')->single();
+   my $name = $tenant->name;

my $existing_child = $self->db->resultset('Tenant')->search( { 
parent_id => $id }, {order_by => 'me.name' } )->get_column('name')->first();
if ($existing_child) {



[47/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_ops_install.txt
--
diff --git a/docs/latest/_sources/admin/traffic_ops_install.txt 
b/docs/latest/_sources/admin/traffic_ops_install.txt
new file mode 100644
index 000..d0caaf8
--- /dev/null
+++ b/docs/latest/_sources/admin/traffic_ops_install.txt
@@ -0,0 +1,484 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. index::
+  Traffic Ops - Installing 
+  
+.. _rl-ps:
+
+Installing Traffic Ops
+%%
+
+System Requirements
+---
+The user must have the following for a successful install:
+
+* CentOS 6
+* 4 vCPUs
+* 32GB RAM
+* 20 GB disk space
+* YUM repository with minimally the following dependecies avaliable
+
+  * apr 1.3.9-5 
+  * apr-util 1.3.9-3 
+  * apr-util-ldap 1.3.9-3   
+  * expat-devel 2.0.1-11 
+  * genisoimage 1.1.9-12  
+  * httpd 2.2.15
+  * httpd-tools 2.2.15  
+  * libpcap-devel 14:1.4
+  * mod_ssl  1:2.2.15-29
+  * mysql 5.1.71 
+  * autoconf 2.63-5.1.
+  * automake 1.11.1-4
+  * gcc 4.4.7-4
+  * gettext 0.17-16
+  * libcurl-devel 7.19.7-37
+  * libtool 2.2.6-15.5
+  * mysql-devel 5.1.73-3
+  * perl-CPAN 1.9402-136
+  * libcurl 7.19.7-37
+  * openssl 1.0.1e-30
+  * cloog-ppl 0.15.7-1.2
+  * cpp 4.4.7-4
+  * cvs 1.11.23-16
+  * libgomp 4.4.7-4
+  * libidn-devel 1.18-2
+  * m4 1.4.13-5
+  * mpfr 2.4.1-6
+  * perl-Digest-SHA 1:5.47-136
+  * ppl 0.10.2-11
+  * curl 7.19.7-37
+  * openssl-devel 1.0.1e-30
+ 
+* Access to `The Comprehensive Perl Archive Network (CPAN) 
`_
+
+.. Note:: The above versions are known to work on CentOS 6.5. Higher versions 
may work.
+
+.. Note:: Although Traffic Ops supports both MySQL and Postgres as a database, 
support for MySQL is more mature and better tested. It is best to use MySQL 
when first getting started, and the rest of this guide assumes MySQL as the 
database.
+
+Navigating the Install
+---
+To begin the install:
+
+1. Install Traffic Ops: 
+
+  Download the traffic_ops rpm package from 
http://trafficcontrol.apache.org/downloads/index.html
+  
+  ``sudo rpm -ivh traffic_ops-1.*.*-.x86_64.rpm``
+
+
+
+
+
+2. After installation of Traffic Ops rpm enter the following command: ``sudo 
/opt/traffic_ops/install/bin/postinstall``
+
+  Example output::
+
+
+  trafficops-vm # /opt/traffic_ops/install/bin/postinstall
+
+  This script will build and package the required Traffic Ops perl modules.
+  In order to complete this operation, Development tools such as the gcc
+  compiler must be installed on this machine.
+
+  Hit ENTER to continue:
+
+
+  The first thing postinstall will do is install additional packages needed 
from the yum repo.
+
+  Ater that, it will automatically proceed to installing the required Perl 
packages from CPAN.
+
+  .. Note:: Especially when installing Traffic Ops for the first time on a 
system this can take a long time, since many dependencies for the Mojolicous 
application need to be downloaded. Expect 30 minutes. 
+
+  If there are any prompts in this phase, please just answer with the defaults 
(some CPAN installs can prompt for install questions). 
+
+  When this phase is complete, you will see:: 
+
+  ...
+  Successfully installed Test-Differences-0.63
+  Successfully installed DBIx-Class-Schema-Loader-0.07042
+  Successfully installed Time-HiRes-1.9726 (upgraded from 1.9719)
+  Successfully installed Mojolicious-Plugin-Authentication-1.26
+  113 distributions installed
+  Complete! Modules were installed into /opt/traffic_ops/app/local
+  Linking perl libraries...
+  Installing perl scripts
+
+
+  This script will initialize the Traffic Ops database.
+  Please enter the following information in order to completely
+  configure the Traffic Ops mysql database.
+
+
+  Database type [mysql]:
+
+
+  The next phase of the install will ask you about the local environment for 
your CDN.
+
+  .. Note:: Before proceeding to this step, the database has to have at least 
a root password, and needs to be started. When using mysql, please type 
``service mysqld start`` as root in another terminal and follow the 
instructions on the screen to set the root password.
+
+  .. Note:: CentOS files note.
+
+  Example output::
+
+  Database type [mysql]:
+  Database name [t

[09/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_static/plus.png
--
diff --git a/docs/latest/_static/plus.png b/docs/latest/_static/plus.png
index 7107cec..0cfe084 100644
Binary files a/docs/latest/_static/plus.png and b/docs/latest/_static/plus.png 
differ

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_static/searchtools.js
--
diff --git a/docs/latest/_static/searchtools.js 
b/docs/latest/_static/searchtools.js
index c821573..066857c 100644
--- a/docs/latest/_static/searchtools.js
+++ b/docs/latest/_static/searchtools.js
@@ -4,7 +4,7 @@
  *
  * Sphinx JavaScript utilities for the full-text search.
  *
- * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
  * :license: BSD, see LICENSE for details.
  *
  */
@@ -226,106 +226,6 @@ var Scorer = {
 };
 
 
-
-
-
-var splitChars = (function() {
-var result = {};
-var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 
1014, 1648,
- 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 
2702,
- 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 
2971,
- 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 
3345,
- 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 
3761,
- 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 
4823,
- 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 
8125,
- 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 
11695,
- 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 
43587,
- 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
-var i, j, start, end;
-for (i = 0; i < singles.length; i++) {
-result[singles[i]] = true;
-}
-var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 
184], [706, 709],
- [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 
1161],
- [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], 
[1523, 1568],
- [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], 
[1792, 1807],
- [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], 
[2043, 2047],
- [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], 
[2366, 2383],
- [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], 
[2449, 2450],
- [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], 
[2546, 2547],
- [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], 
[2672, 2673],
- [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], 
[2800, 2820],
- [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], 
[2930, 2946],
- [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], 
[3002, 3023],
- [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], 
[3170, 3173],
- [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], 
[3312, 3332],
- [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], 
[3479, 3481],
- [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], 
[3717, 3718],
- [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], 
[3783, 3791],
- [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], 
[3980, 4095],
- [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], 
[4199, 4205],
- [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], 
[4686, 4687],
- [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], 
[4955, 4968],
- [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], 
[5867, 5869],
- [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], 
[6068, 6102],
- [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], 
[6264, 6271],
- [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], 
[6572, 6592],
- [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], 
[6810, 6822],
- [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], 
[7098, 7167],
- [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], 
[7958, 7959],
- [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], 
[8141, 8143],
- [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], 
[8314, 8318],
- [8330, 8335], [8341, 8449], [8451, 8454], 

[26/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/configfiles-ats.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/configfiles-ats.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/configfiles-ats.txt
new file mode 100644
index 000..1697a5a
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/configfiles-ats.txt
@@ -0,0 +1,212 @@
+.. 
+.. 
+.. 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.
+.. 
+
+
+.. _to-api-v12-configfiles-ats:
+
+Config Files and Config File Metadata
+===
+
+.. _to-api-v12-configfiles-ats-route:
+
+/api/1.2/servers/:hostname/configfiles/ats
+/api/1.2/servers/:host_id/configfiles/ats
++
+
+**GET /api/1.2/servers/:hostname/configfiles/ats**
+**GET /api/1.2/servers/:host_id/configfiles/ats**
+
+
+  Authentication Required: Yes
+
+  Role(s) Required: Operator
+
+  **Request Query Parameters**
+
+  **Response Properties**
+
+  
+==+
+  |Info Section
  |
+  
+---++-+
+  |Parameter  |  Type  |   Description 
  |
+  
+===++=+
+  | ``profileId`` | string | The ID of the profile assigned to the cache.  
  |
+  
+---++-+
+  | ``profileName``   | string | The name of the profile assigned to the 
cache.  |
+  
+---++-+
+  | ``toRevProxyUrl`` | string | The configured reverse proxy cache for 
configfile requests. |
+  
+---++-+
+  | ``toURL`` | string | The configured URL for Traffic Ops.   
  |
+  
+---++-+
+  | ``serverIpv4``| string | The configured IP address of the cache.   
  |
+  
+---++-+
+  | ``serverName``| string | The cache's short form hostname.  
  |
+  
+---++-+
+  | ``serverId``  | string | The cache's Traffic Ops ID.   
  |
+  
+---++-+
+  | ``cdnId`` | string | The ID of the cache's assigned CDN.   
  |
+  
+---++-+
+  | ``cdnName``   | string | The name of the cache's assigned CDN. 
  |
+  
+---++-+
+  | ``serverTcpPort`` | string | The configured port of the server's used by 
ATS.|
+  
+---++-+
+  | ``serverTcpPort`` | string | The configured port of the server's used by 
ATS.|
+  
+---++-+
+  | ``serverTcpPort`` | string | The configured port of the server's used by 
ATS.|
+  
+---++-+
+  | ``serverTcpPort`` | string | The configured port of the server's used by 
ATS.|
+  
+---++-+
+  | ``serverTcpPort`` 

[05/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/admin/traffic_ops/migration_from_10_to_20.html
--
diff --git a/docs/latest/admin/traffic_ops/migration_from_10_to_20.html 
b/docs/latest/admin/traffic_ops/migration_from_10_to_20.html
new file mode 100644
index 000..12d1d49
--- /dev/null
+++ b/docs/latest/admin/traffic_ops/migration_from_10_to_20.html
@@ -0,0 +1,318 @@
+
+
+
+
+  
+
+  
+  
+  
+  Traffic Ops - Migrating from 1.x to 2.x — Traffic Control 
2.1-dev documentation 
+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+ 
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+   Traffic Control
+
+
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+  
+
+  
+
+  
+  
+  
+CDN Basics
+Content Delivery 
Networks
+HTTP 1.1
+Caching Proxies
+Cache Control Headers and 
Revalidation
+
+
+
+
+Traffic Control Overview
+Introduction
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Stats
+Traffic Server
+Traffic Vault
+
+
+
+
+Administrator’s Guide
+Traffic Ops - Installing
+Traffic Ops - Default Profiles
+Traffic Ops - Migrating from 1.x to 2.x
+Traffic Ops - Configuring
+Traffic 
Ops - Using
+Managing Traffic Ops Extensions
+Traffic Portal Administration
+Traffic Monitor Administration
+Traffic Monitor Administration
+Traffic Router Administration
+Traffic Stats Administration
+Traffic Server Administration
+Traffic Vault Administration
+Quick How To Guides
+
+
+
+
+Developer’s Guide
+Building Traffic Control
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Monitor 
Golang
+Traffic Stats
+Traffic Server
+
+
+
+
+FAQ
+General
+Development
+Running a Traffic Control CDN
+
+
+
+
+Glossary
+
+
+  
+
+  
+   
+
+
+
+
+  
+  
+
+Traffic Control
+  
+
+
+  
+  
+
+  
+  
+Traffic Control 2.1-dev »
+  
+  Administrator’s Guide 
»
+  
+Traffic Ops - Migrating from 1.x to 2.x
+  
+
+   View page source
+
+  
+  
+  
+
+ 
+ 
+ 
+ Next 
+ 
+ 
+  Previous
+ 
+ 
+ 
+  
+
+  
+Traffic Ops - Migrating 
from 1.x to 2.x¶
+In Traffic Ops 2.x MySQL was removed and Postgres was replaced as the 
database of choice for the unforeseen future.  A Docker-based migration tool 
was developed to
+help with that conversion using an open source Postgres tool called http://pgloader.io/";>pgloader.  The 
following instructions will help configuring the Migration tool
+
+System Requirements¶
+The user must have the following for a successful minimal install:
+
+CentOS 7.2+
+Docker installed (this migration was tested against version 
docker-engine-selinux-17.05.0.ce-1.el7.centos.noarch.rpm)
+Postgres has been installed according to Traffic Ops - 
Installing
+
+
+
+Setup the traffic_ops_db directory¶
+
+Modify /opt dir permission to make it writable and owned by 
postgres:postgres
+$ sudo 
chmod 755 /opt
+
+
+Download the Traffic Control tarball for 2.0.0
+$ cd 
/opt
+$ wget 
https://dist.apache.org/repos/dist/release/incubator/trafficcontrol/;
+
+
+Extract the traffic_ops_db dir to 
/opt/traffic_ops_db
+$ tar 
-zxvf trafficcontrol-incubating-.tar.gz --strip=1 
trafficcontrol-incubating-/traffic_ops_db
+$ sudo chown -R postgres:postgres /opt/traffic_ops_db
+
+
+
+
+
+Migration Preparation¶
+Be sure there is connectivity between your MySQL server’s IP 
address/port and your Postgres server’s IP address/port.
+
+
+Navigating the Database Migration¶
+Begin the database migration after settings up the 
/opt/traffic_ops_db directory
+
+Switch to the postgres user so permissions stay intact.
+$ su - 
postgres
+$ cd /opt/traffic_ops_db/
+
+
+
+
+Configure the 
/opt/traffic_ops_db/pg-migration/mysql-to-postgres.env 
migration for your source MySQL and target Postgres settings
+
+Run the migration, watch the console output for any 
errors (it may take some time)
+$ 
./migrate.sh
+
+
+
+
+
+Your MySQL data should now be ported into your new instance of 
Postgres!
+
+
+
+
+  
+  
+  
+
+  
+Next 
+  
+  
+ 
Previous
+  
+
+  
+
+  
+
+  
+
+
+  
+  Built with http://sphinx-doc.org/";>Sphinx using a https://github.com/snide/sphinx_rtd_theme";>theme provided by https://readthedocs.org";>Read the Docs.
+
+
+
+
+  
+
+
+
+  
+  
+
+
+  
+
+
+var DOCUMENTATION_OPTIONS = {
+URL_ROOT:'../../',
+VERSION:'2.1-de

[30/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/cache_stats.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/cache_stats.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/cache_stats.txt
new file mode 100644
index 000..dffc9a4
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/cache_stats.txt
@@ -0,0 +1,134 @@
+.. 
+.. 
+.. 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.
+.. 
+
+
+.. _to-api-v12-cache-stats:
+
+Cache Statistics
+===
+
+.. _to-api-v12-cache-stats-route:
+
+/api/1.2/cache_stats
+
+
+**GET /api/1.2/cache_stats.json**
+
+  Retrieves statistics about the CDN. 
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Query Parameters**
+
+  
+--+--+--+
+  |Name  | Required |  Description 

|
+  
+==+==+==+
+  | ``cdnName``  | yes  | The CDN name to return cache stats 
for 
  |
+  
+--+--+--+
+  | ``metricType``   | yes  | The metric type (valid metric types: 
'ats.proxy.process.http.current_client_connections', 'bandwidth', 'maxKbps')
|
+  
+--+--+--+
+  | ``startDate``| yes  | The begin date (Formatted as 
ISO8601, for example: '2015-08-11T12:30:00-06:00')  
|
+  
+--+--+--+
+  | ``endDate``  | yes  | The end date (Formatted as ISO8601, 
for example: '2015-08-12T12:30:00-06:00')   
 |
+  
+--+--+--+
+
+  **Response Properties**
+
+  
++---+-+
+  | Parameter  | Type  | Description   
  |
+  
++===+=+
+  |``summary`` | hash  | Summary data  
  |
+  
++---+-+
+  |``>count``  | int   |   
  |
+  
++---+-+
+  |``>min``| float |   
  |
+  
++---+-+
+  |``>max``| float |   
  |
+  
++-

[04/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/admin/traffic_ops/using.html
--
diff --git a/docs/latest/admin/traffic_ops/using.html 
b/docs/latest/admin/traffic_ops/using.html
new file mode 100644
index 000..d4690b7
--- /dev/null
+++ b/docs/latest/admin/traffic_ops/using.html
@@ -0,0 +1,1726 @@
+
+
+
+
+  
+
+  
+  
+  
+  Traffic Ops - Using — Traffic Control 2.1-dev documentation 

+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+ 
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+   Traffic Control
+
+
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+  
+
+  
+
+  
+  
+  
+CDN Basics
+Content Delivery 
Networks
+HTTP 1.1
+Caching Proxies
+Cache Control Headers and 
Revalidation
+
+
+
+
+Traffic Control Overview
+Introduction
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Stats
+Traffic Server
+Traffic Vault
+
+
+
+
+Administrator’s Guide
+Traffic Ops - Installing
+Traffic Ops - Default Profiles
+Traffic Ops - Migrating from 1.x to 
2.x
+Traffic Ops - Configuring
+Traffic Ops - Using
+Managing Traffic Ops Extensions
+Traffic Portal Administration
+Traffic Monitor Administration
+Traffic Monitor Administration
+Traffic Router Administration
+Traffic Stats Administration
+Traffic Server Administration
+Traffic Vault Administration
+Quick How To Guides
+
+
+
+
+Developer’s Guide
+Building Traffic Control
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Monitor 
Golang
+Traffic Stats
+Traffic Server
+
+
+
+
+FAQ
+General
+Development
+Running a Traffic Control CDN
+
+
+
+
+Glossary
+
+
+  
+
+  
+   
+
+
+
+
+  
+  
+
+Traffic Control
+  
+
+
+  
+  
+
+  
+  
+Traffic Control 2.1-dev »
+  
+  Administrator’s Guide 
»
+  
+Traffic Ops - Using
+  
+
+   
View page source
+
+  
+  
+  
+
+ 
+ 
+ 
+ Next 
+ 
+ 
+  
Previous
+ 
+ 
+ 
+  
+
+  
+Traffic Ops - Using¶
+
+The Traffic Ops Menu¶
+
+The following tabs are available in the menu at the top of the Traffic Ops 
user interface.
+
+Health
+Information on the health of the system. Hover over this tab to get to the 
following options:
+
+
+
+
+
+
+Option
+Description
+
+
+
+Table View
+A real time view into the main performance indicators of the CDNs managed 
by Traffic Control.
+This view is sourced directly by the Traffic Monitor data and is updated every 
10 seconds.
+This is the default screen of Traffic Ops.
+See The Health Table for details.
+
+Graph View
+A real graphical time view into the main performance indicators of the 
CDNs managed by Traffic Control.
+This view is sourced by the Traffic Monitor data and is updated every 10 
seconds.
+On loading, this screen will show a history of 24 hours of data from Traffic 
Stats
+See Graph View for details.
+
+Server Checks
+A table showing the results of the periodic check extension scripts that 
are run. See Server Checks
+
+Daily Summary
+A graph displaying the daily peaks of bandwidth, overall bytes served per 
day, and overall bytes served since initial installation
+per CDN.
+
+
+
+
+Delivery Services
+The main Delivery Service table. This is where you 
Create/Read/Update/Delete Delivery Services of all types. Hover over to get the 
following sub option:
+
+
+
+
+
+
+Option
+Description
+
+
+
+Federations
+Add/Edit/Delete Federation Mappings.
+
+
+
+
+Servers
+The main Servers table. This is where you Create/Read/Update/Delete servers 
of all types.  Click the main tab to get to the main table, and hover over to 
get these sub options:
+
+
+
+
+
+
+Option
+Description
+
+
+
+Upload Server CSV
+Bulk add of servers from a csv file. See Bulk Upload 
Server
+
+
+
+
+Parameters
+Parameters and Profiles can be edited here. Hover over the tab to get the 
following options:
+
+
+
+
+
+
+Option
+Description
+
+
+
+Global Profile
+The table of global parameters. See Profile 
Parameters. This is where you Create/Read/Update/Delete parameters 
in the Global profile
+
+All Cache Groups
+The table of all parameters that are assigned to a cachegroup - 
this may be slow to pull up, as there can be thousands of parameters.
+
+All Profiles
+The table of all parameters that are assigned to a profile - this 
may be slow to pull up, as there can be thousands of parameters.
+
+Select Profile
+Select the parameter list by profile first, then get a table of just the 
parameters for that profile.
+
+Export Profil

[40/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/routes.rst.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/routes.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/routes.rst.txt
deleted file mode 100644
index ec90963..000
--- a/docs/latest/_sources/development/traffic_ops_api/routes.rst.txt
+++ /dev/null
@@ -1,116 +0,0 @@
-.. raw:: html
-
-  
-  table {
-  table-layout: fixed;
-  width: 100%;
-  }
-
-  td {
-  word-wrap:break-word;
-  }
-  table.docutils col:nth-child(1) {
-  width: 30%;
-  }
-  table.docutils col:nth-child(2) {
-  width: 30%;
-  }
-  table.docutils col:nth-child(3) {
-  width: 30%;
-  }
-  .wy-nav-content {
-  max-width: 1200px;
-  width: 90%;
-  }
-  
-
-.. 
-.. 
-.. 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.
-.. 
-
-
-.. _to-api-routes:
-
-API Routes
-==
-
-++++
-| 1.0|   1.1   
   |   1.2  |
-++++
-| /asns  |   :ref:`to-api-v11-asns-route`  
   |   :ref:`to-api-v12-asns-route` |
-++++
-| /availableds   |   :ref:`to-api-v11-ds-route`
   |   :ref:`to-api-v12-ds-route`   |
-++++
-| *Not Implemented*  |   *Not Implemented* 
   |   :ref:`to-api-v12-cache-stats-route`  |
-++++
-| /datacrans |   /api/1.1/crans.json   
   |   /api/1.2/crans.json  |
-++++
-| /datacrans/orderby/:field  |   /api/1.1/crans.json   
   |   /api/1.2/crans.json  |
-++++
-| /datadeliveryservice   |   :ref:`to-api-v11-ds-route`
   |   :ref:`to-api-v12-ds-route`   |
-++++
-| /datadeliveryserviceserver |   /api/1.1/deliveryserviceserver.json   
   |   /api/1.2/deliveryserviceserver.json  |
-++++
-| /datadomains   |   /api/1.1/cdns/domains.json
   |   /api/1.2/cdns/domains.json   |
-++++
-| *Not Implemented*  |  *Not Implemented*  
   |   :ref:`to-api-v12-ds-stats-route` |
-++++
-| /datahwinfo|   :ref:`to-api-v11-hwinfo-route`
   |   :ref:`to-api-v12-hwinfo-route`   |
-++++
-| /datalinks |   /api/1.1/deliveryserviceserver.json   
  

[49/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_ops/using.txt
--
diff --git a/docs/latest/_sources/admin/traffic_ops/using.txt 
b/docs/latest/_sources/admin/traffic_ops/using.txt
new file mode 100644
index 000..0744760
--- /dev/null
+++ b/docs/latest/_sources/admin/traffic_ops/using.txt
@@ -0,0 +1,1106 @@
+..
+..
+.. 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.
+..
+
+.. |graph| image:: ../../../../traffic_ops/app/public/images/graph.png
+.. |info| image:: ../../../../traffic_ops/app/public/images/info.png
+.. |checkmark| image:: ../../../../traffic_ops/app/public/images/good.png
+.. |X| image:: ../../../../traffic_ops/app/public/images/bad.png
+.. |clock| image:: ../../../../traffic_ops/app/public/images/clock-black.png
+
+Traffic Ops - Using
+%%%
+
+
+The Traffic Ops Menu
+
+
+.. image:: ../12m.png
+
+The following tabs are available in the menu at the top of the Traffic Ops 
user interface.
+
+.. index::
+  Health Tab
+
+* **Health**
+
+  Information on the health of the system. Hover over this tab to get to the 
following options:
+
+  
+---++
+  | Option|
Description |
+  
+===++
+  | Table View| A real time view into the main performance indicators of 
the CDNs managed by Traffic Control.  |
+  |   | This view is sourced directly by the Traffic Monitor data 
and is updated every 10 seconds. |
+  |   | This is the default screen of Traffic Ops. 
|
+  |   | See :ref:`rl-health-table` for details.
|
+  
+---++
+  | Graph View| A real graphical time view into the main performance 
indicators of the CDNs managed by Traffic Control.|
+  |   | This view is sourced by the Traffic Monitor data and is 
updated every 10 seconds.  |
+  |   | On loading, this screen will show a history of 24 hours of 
data from Traffic Stats |
+  |   | See :ref:`rl-health-graph` for details.
|
+  
+---++
+  | Server Checks | A table showing the results of the periodic check 
extension scripts that are run. See :ref:`rl-server-checks` 
 |
+  
+---++
+  | Daily Summary | A graph displaying the daily peaks of bandwidth, overall 
bytes served per day, and overall bytes served since initial installation |
+  |   | per CDN.   
|
+  
+---++
+
+* **Delivery Services**
+
+  The main Delivery Service table. This is where you Create/Read/Update/Delete 
Delivery Services of all types. Hover over to get the following sub option:
+
+  +-+--+
+  |Option   | Description  |
+  +=+==+
+  | Federations | Add/Edit/Delete Federation Mappings. |
+  +-+---

[35/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.rst.txt
deleted file mode 100644
index cc45b38..000
--- a/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.rst.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-
-.. _to-api-v11-hwinfo:
-
-Hardware Info
-=
-
-.. _to-api-v11-hwinfo-route:
-
-/api/1.1/hwinfo
-+++
-
-**GET /api/1.1/hwinfo.json**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Response Properties**
-
-  
+++--+
-  | Parameter  | Type   | Description  
|
-  
+++==+
-  | ``serverId``   | string | Local unique identifier for this specific 
server's hardware info |
-  
+++--+
-  | ``serverHostName`` | string | Hostname for this specific server's hardware 
info|
-  
+++--+
-  | ``lastUpdated``| string | The Time and Date for the last update for 
this server.   |
-  
+++--+
-  | ``val``| string | Freeform value used to track anything about 
a server's hardware info |
-  
+++--+
-  | ``description``| string | Freeform description for this specific 
server's hardware info|
-  
+++--+
-
-  **Response Example** ::
-
-{
- "response": [
-{
-   "serverId": "odol-atsmid-cen-09",
-   "lastUpdated": "2014-05-27 09:06:02",
-   "val": "D1S4",
-   "description": "Physical Disk 0:1:0"
-},
-{
-   "serverId": "odol-atsmid-cen-09",
-   "lastUpdated": "2014-05-27 09:06:02",
-   "val": "D1S4",
-   "description": "Physical Disk 0:1:1"
-}
- ],
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.txt
new file mode 100644
index 000..cc45b38
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v11/hwinfo.txt
@@ -0,0 +1,67 @@
+.. 
+.. 
+.. 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.
+.. 
+
+
+.. _to-api-v11-hwinfo:
+
+Hardware Info
+=
+
+.. _to-api-v11-hwinfo-route:
+
+/api/1.1/hwinfo

+
+**GET /api/1.1/hwinfo.json**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+++--+
+  | Parameter  | Type   | Description  
|
+  
+++==+
+  | ``serverId``   | string | Local unique identifier for this specific 
server's hardware info |
+

[34/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/region.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v11/region.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/region.txt
new file mode 100644
index 000..d521f33
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v11/region.txt
@@ -0,0 +1,235 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v11-region:
+
+Regions
+===
+
+.. _to-api-v11-regions-route:
+
+/api/1.1/regions
+
+
+**GET /api/1.1/regions**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+--+++
+  | Parameter| Type   | Description
|
+  
+==+++
+  |``id``| string | Region ID. 
|
+  
+--+++
+  |``name``  | string | Region name.   
|
+  
+--+++
+  |``division``  | string | Division ID.   
|
+  
+--+++
+  |``divisionName``  | string | Division name. 
|
+  
+--+++
+
+  **Response Example** ::
+
+{
+ "response": [
+{
+   "id": "6",
+   "name": "Atlanta",
+   "division": "2",
+   "divisionName": "West"
+},
+{
+   "id": "7",
+   "name": "Denver",
+   "division": "2",
+   "divisionName": "West"
+},
+ ]
+}
+
+
+**GET /api/1.1/regions/:id**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Route Parameters**
+
+  +---+--+-+
+  |   Name| Required |Description  |
+  +===+==+=+
+  |   ``id``  |   yes| Region id.  |
+  +---+--+-+
+
+  **Response Properties**
+
+  
+--+++
+  | Parameter| Type   | Description
|
+  
+==+++
+  |``id``| string | Region ID. 
|
+  
+--+++
+  |``name``  | string | Region name.   
|
+  
+--+++
+  |``division``  | string | Division ID.   
|
+  
+--+++
+  |``divisionName``  | string | Division name. 
|
+  
+--+++
+
+  **Response Example** ::
+
+{
+ "response": [
+{
+   "id": "6",
+   "name": "Atlanta",
+   "division": "2",
+   "divisionName": "West"
+}
+ ]
+}
+
+
+**PUT /api/1.1/regions/:id**
+  Update a region
+
+  Authentication Required: Yes
+
+  Role(s) Required: admin or oper
+
+  **Request Route Parameters**
+
+  
+---+--++
+  | Name  |   Type   | Description 
   |
+  
+===+==++
+  | ``id``| int  | Region id.  
   |
+  
+---+--++
+
+  **Request Properties**
+
+  ++--+-

[25/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.rst.txt
deleted file mode 100644
index 9e81b92..000
--- 
a/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.rst.txt
+++ /dev/null
@@ -1,1942 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-
-.. _to-api-v12-ds:
-
-Delivery Service
-
-
-.. _to-api-v12-ds-route:
-
-/api/1.2/deliveryservices
-+
-
-**GET /api/1.2/deliveryservices**
-
-  Retrieves all delivery services. See also `Using Traffic Ops - Delivery 
Service 
`_.
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Query Parameters**
-
-  
+-+--+---+
-  | Name| Required | Description   
|
-  
+=+==+===+
-  | ``cdn`` | no   | Filter delivery services by CDN ID.   
|
-  
+-+--+---+
-  | ``type``| no   | Filter delivery services by Type ID.  
|
-  
+-+--+---+
-
-
-  **Response Properties**
-
-  
+--++--+
-  |Parameter |  Type  |
 Description
  |
-  
+==++==+
-  | ``active``   |  bool  | true if active, false if inactive. 

  |
-  
+--++--+
-  | ``cacheurl`` | string | Cache URL rule to apply to this 
delivery service.   
 |
-  
+--++--+
-  | ``ccrDnsTtl``| string | The TTL of the DNS response for A or 
 queries requesting the IP address of the tr. host. 
|
-  
+--++--+
-  | ``cdnId``| string | Id of the CDN to which the delivery 
service belongs to. 
 |
-  
+--++--+
-  | ``cdnName``  | string | Name of the CDN to which the delivery 
service belongs to. 
   |
-  
+--++--+
-  | ``checkPath``| string | The path portion of the URL to check 
this deliveryservice for health.
|
-  
+--++--+
-  | ``displayName``  | string | The display name of the delivery 
ser

[24/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.txt
new file mode 100644
index 000..ecb17bc
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice.txt
@@ -0,0 +1,2736 @@
+.. 
+.. 
+.. 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.
+.. 
+
+
+.. _to-api-v12-ds:
+
+Delivery Service
+
+
+.. _to-api-v12-ds-route:
+
+/api/1.2/deliveryservices
++
+
+**GET /api/1.2/deliveryservices**
+
+  Retrieves all delivery services (if admin or ops) or all delivery services 
assigned to user. See also `Using Traffic Ops - Delivery Service 
`_.
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Query Parameters**
+
+  
+-+--+---+
+  | Name| Required | Description   
|
+  
+=+==+===+
+  | ``cdn`` | no   | Filter delivery services by CDN ID.   
|
+  
+-+--+---+
+  | ``profile`` | no   | Filter delivery services by Profile ID.   
|
+  
+-+--+---+
+  | ``type``| no   | Filter delivery services by Type ID.  
|
+  
+-+--+---+
+  | ``logsEnabled`` | no   | Filter by logs enabled (true|false).  
|
+  
+-+--+---+
+
+
+  **Response Properties**
+
+  
+--++--+
+  |Parameter |  Type  |
 Description
  |
+  
+==++==+
+  | ``active``   |  bool  | true if active, false if inactive. 

  |
+  
+--++--+
+  | ``cacheurl`` | string | Cache URL rule to apply to this 
delivery service.   
 |
+  
+--++--+
+  | ``ccrDnsTtl``|  int   | The TTL of the DNS response for A or 
 queries requesting the IP address of the tr. host. 
|
+  
+--++--+
+  | ``cdnId``|  int   | Id of the CDN to which the delivery 
service belongs to. 
 |
+  
+--++--+
+  | ``cdnName``  | string | Name of the CDN to which the delivery 
service belongs to. 
   |
+  
+--++--+
+  | ``checkPath``| string | The p

[11/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_static/jquery-3.1.0.js
--
diff --git a/docs/latest/_static/jquery-3.1.0.js 
b/docs/latest/_static/jquery-3.1.0.js
deleted file mode 100644
index f2fc274..000
--- a/docs/latest/_static/jquery-3.1.0.js
+++ /dev/null
@@ -1,10074 +0,0 @@
-/*eslint-disable no-unused-vars*/
-/*!
- * jQuery JavaScript Library v3.1.0
- * https://jquery.com/
- *
- * Includes Sizzle.js
- * https://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * https://jquery.org/license
- *
- * Date: 2016-07-07T21:44Z
- */
-( function( global, factory ) {
-
-   "use strict";
-
-   if ( typeof module === "object" && typeof module.exports === "object" ) 
{
-
-   // For CommonJS and CommonJS-like environments where a proper 
`window`
-   // is present, execute the factory and get jQuery.
-   // For environments that do not have a `window` with a 
`document`
-   // (such as Node.js), expose a factory as module.exports.
-   // This accentuates the need for the creation of a real 
`window`.
-   // e.g. var jQuery = require("jquery")(window);
-   // See ticket #14549 for more info.
-   module.exports = global.document ?
-   factory( global, true ) :
-   function( w ) {
-   if ( !w.document ) {
-   throw new Error( "jQuery requires a 
window with a document" );
-   }
-   return factory( w );
-   };
-   } else {
-   factory( global );
-   }
-
-// Pass this if window is not defined yet
-} )( typeof window !== "undefined" ? window : this, function( window, noGlobal 
) {
-
-// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 
9.1
-// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict 
mode
-// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict 
mode should be common
-// enough that all such attempts are guarded in a try block.
-"use strict";
-
-var arr = [];
-
-var document = window.document;
-
-var getProto = Object.getPrototypeOf;
-
-var slice = arr.slice;
-
-var concat = arr.concat;
-
-var push = arr.push;
-
-var indexOf = arr.indexOf;
-
-var class2type = {};
-
-var toString = class2type.toString;
-
-var hasOwn = class2type.hasOwnProperty;
-
-var fnToString = hasOwn.toString;
-
-var ObjectFunctionString = fnToString.call( Object );
-
-var support = {};
-
-
-
-   function DOMEval( code, doc ) {
-   doc = doc || document;
-
-   var script = doc.createElement( "script" );
-
-   script.text = code;
-   doc.head.appendChild( script ).parentNode.removeChild( script );
-   }
-/* global Symbol */
-// Defining this global in .eslintrc would create a danger of using the global
-// unguarded in another place, it seems safer to define global only for this 
module
-
-
-
-var
-   version = "3.1.0",
-
-   // Define a local copy of jQuery
-   jQuery = function( selector, context ) {
-
-   // The jQuery object is actually just the init constructor 
'enhanced'
-   // Need init if jQuery is called (just allow error to be thrown 
if not included)
-   return new jQuery.fn.init( selector, context );
-   },
-
-   // Support: Android <=4.0 only
-   // Make sure we trim BOM and NBSP
-   rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
-   // Matches dashed string for camelizing
-   rmsPrefix = /^-ms-/,
-   rdashAlpha = /-([a-z])/g,
-
-   // Used by jQuery.camelCase as callback to replace()
-   fcamelCase = function( all, letter ) {
-   return letter.toUpperCase();
-   };
-
-jQuery.fn = jQuery.prototype = {
-
-   // The current version of jQuery being used
-   jquery: version,
-
-   constructor: jQuery,
-
-   // The default length of a jQuery object is 0
-   length: 0,
-
-   toArray: function() {
-   return slice.call( this );
-   },
-
-   // Get the Nth element in the matched element set OR
-   // Get the whole matched element set as a clean array
-   get: function( num ) {
-   return num != null ?
-
-   // Return just the one element from the set
-   ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
-
-   // Return all the elements in a clean array
-   slice.call( this );
-   },
-
-   // Take an array of elements and push it onto the stack
-   // (returning the new matched element set)
-   pushStack: function( elems ) {
-
-   // Build a new jQuery matched

[07/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/admin/traffic_ops/configuration.html
--
diff --git a/docs/latest/admin/traffic_ops/configuration.html 
b/docs/latest/admin/traffic_ops/configuration.html
new file mode 100644
index 000..3180920
--- /dev/null
+++ b/docs/latest/admin/traffic_ops/configuration.html
@@ -0,0 +1,650 @@
+
+
+
+
+  
+
+  
+  
+  
+  Traffic Ops - Configuring — Traffic Control 2.1-dev 
documentation 
+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+ 
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+   Traffic Control
+
+
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+  
+
+  
+
+  
+  
+  
+CDN Basics
+Content Delivery 
Networks
+HTTP 1.1
+Caching Proxies
+Cache Control Headers and 
Revalidation
+
+
+
+
+Traffic Control Overview
+Introduction
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Stats
+Traffic Server
+Traffic Vault
+
+
+
+
+Administrator’s Guide
+Traffic Ops - Installing
+Traffic Ops - Default Profiles
+Traffic Ops - Migrating from 1.x to 
2.x
+Traffic Ops - Configuring
+Traffic 
Ops - Using
+Managing Traffic Ops Extensions
+Traffic Portal Administration
+Traffic Monitor Administration
+Traffic Monitor Administration
+Traffic Router Administration
+Traffic Stats Administration
+Traffic Server Administration
+Traffic Vault Administration
+Quick How To Guides
+
+
+
+
+Developer’s Guide
+Building Traffic Control
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Monitor 
Golang
+Traffic Stats
+Traffic Server
+
+
+
+
+FAQ
+General
+Development
+Running a Traffic Control CDN
+
+
+
+
+Glossary
+
+
+  
+
+  
+   
+
+
+
+
+  
+  
+
+Traffic Control
+  
+
+
+  
+  
+
+  
+  
+Traffic Control 2.1-dev »
+  
+  Administrator’s Guide 
»
+  
+Traffic Ops - Configuring
+  
+
+   View page source
+
+  
+  
+  
+
+ 
+ 
+ 
+ Next 
+ 
+ 
+  Previous
+ 
+ 
+ 
+  
+
+  
+Traffic Ops - Configuring¶
+Follow the steps below to configure the newly installed Traffic Ops 
Instance.
+
+Installing the SSL Cert¶
+By default, Traffic Ops runs as an SSL web server, and a certificate needs 
to be installed.
+
+Self-signed Certificate (Development)¶
+
+Example Procedure:
+$ 
openssl genrsa -des3 -passout pass:x -out localhost.pass.key 2048
+Generating RSA private key, 2048 bit long modulus
+...
+$ openssl rsa -passin pass:x -in localhost.pass.key -out localhost.key
+writing RSA key
+$ rm localhost.pass.key
+
+$ openssl req -new -key localhost.key -out localhost.csr
+You are about to be asked to enter information that will be incorporated
+into your certificate request.
+What you are about to enter is what is called a Distinguished Name or a DN.
+There are quite a few fields but you can leave some blank
+For some fields there will be a default value,
+If you enter '.', the field will be left blank.
+-
+Country Name (2 letter code) [XX]:US
+State or Province Name (full name) []:CO
+Locality Name (eg, city) [Default City]:Denver
+Organization Name (eg, company) [Default Company Ltd]: 
+Organizational Unit Name (eg, section) []: 
+Common Name (eg, your name or your server's hostname) []: 
+Email Address []: 
+
+Please enter the following 'extra' attributes
+to be sent with your certificate request
+A challenge password []: pass
+An optional company name []: 
+$ openssl x509 -req -sha256 -days 365 -in localhost.csr -signkey localhost.key 
-out localhost.crt
+Signature ok
+subject=/C=US/ST=CO/L=Denver/O=Default Company Ltd
+Getting Private key
+$ sudo cp localhost.crt /etc/pki/tls/certs
+$ sudo cp localhost.key /etc/pki/tls/private
+$ sudo chown trafops:trafops /etc/pki/tls/certs/localhost.crt
+$ sudo chown trafops:trafops /etc/pki/tls/private/localhost.key
+
+
+
+
+
+Certificate from Certificate Authority (Production)¶
+
+Note
+You will need to know the appropriate answers when generating 
the certificate request file trafficopss.csr below.
+
+Example Procedure:
+$ 
openssl genrsa -des3 -passout pass:x -out trafficops.pass.key 2048
+Generating RSA private key, 2048 bit long modulus
+...
+$ openssl rsa -passin pass:x -in trafficops.pass.key -out trafficops.key
+writing RSA key
+$ rm localhost.pass.key
+
+Generate the Certificate Signing Request (CSR) file needed for Certificate 
Authority (CA) request.
+
+$ openssl req -new -key traff

[31/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/user.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v11/user.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/user.txt
new file mode 100644
index 000..2ef5012
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v11/user.txt
@@ -0,0 +1,778 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v11-users:
+
+Users
+=
+
+.. _to-api-v11-users-route:
+
+/api/1.1/users
+++
+
+**GET /api/1.1/users**
+
+  Retrieves all users.
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+--+++
+  | Parameter| Type   | Description
|
+  
+==+++
+  |``addressLine1``  | string |
|
+  
+--+++
+  |``addressLine2``  | string |
|
+  
+--+++
+  |``city``  | string |
|
+  
+--+++
+  |``company``   | string |
|
+  
+--+++
+  |``country``   | string |
|
+  
+--+++
+  |``email`` | string |
|
+  
+--+++
+  |``fullName``  | string |
|
+  
+--+++
+  |``gid``   | string |
|
+  
+--+++
+  |``id``| hash   |
|
+  
+--+++
+  |``lastUpdated``   | string |
|
+  
+--+++
+  |``newUser``   | string |
|
+  
+--+++
+  |``phoneNumber``   | string |
|
+  
+--+++
+  |``postalCode``| string |
|
+  
+--+++
+  |``publicSshKey``  | string |
|
+  
+--+++
+  |``registrationSent``  | string |
|
+  
+--+++
+  |``role``  | string |
|
+  
+--+++
+  |``roleName``  | string |
|
+  
+--+++
+  |``stateOrProvince``   | string |
|
+  
+--+++
+  |``uid``   | string |
|
+  
+--+++
+  |``username``  | string |
|
+  
+---

[42/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_vault.rst.txt
--
diff --git a/docs/latest/_sources/admin/traffic_vault.rst.txt 
b/docs/latest/_sources/admin/traffic_vault.rst.txt
deleted file mode 100644
index d50ef25..000
--- a/docs/latest/_sources/admin/traffic_vault.rst.txt
+++ /dev/null
@@ -1,195 +0,0 @@
-..
-..
-.. 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.
-..
-
-
-Traffic Vault Administration
-
-Installing Traffic Vault
-
-In order to successfully store private keys you will need to install Riak.
-The latest version of Riak can be downloaded on the Riak `website 
`_.
-The installation instructions for Riak can be found `here 
`__.
-
-Production is currently running version 2.0.5 of Riak, but the latest version 
should suffice.
-
-
-Configuring Traffic Vault
-=
-The following steps were taken to configure Riak in our environments.
-
-Riak configuration file configuration
--
-
-The following steps need to be performed on each Riak server in the cluster:
-
-* Log into riak server as root
-
-* cd to /etc/riak/
-
-* Update the following in riak.conf to reflect your IP:
-   - nodename = r...@a-host.sys.kabletown.net
-   - listener.http.internal = a-host.sys.kabletown.net:8098 (can be 80 - 
This endpoint will not work with sec enabled)
-   - listener.protobuf.internal = a-host.sys.kabletown.net:8087 (can be 
different port if you want)
-   - listener.https.internal = a-host.sys.kabletown.net:8088 (can be 443)
-
-* Updated the following conf file to point to your cert files
-   - ssl.certfile = /etc/riak/certs/server.crt
-   - ssl.keyfile = /etc/riak/certs/server.key
-   - ssl.cacertfile = /etc/pki/tls/certs/ca-bundle.crt
-
-* Add a line at the bottom of the config for tlsv1
-   - tls_protocols.tlsv1 = on
-
-* Once the config file has been updated restart riak
-   - ``/etc/init.d/riak restart``
-
-* Validate server is running by going to the following URL:
-   - https://:8088/ping
-
-Riak-admin configuration
--
-
-Riak-admin is a command line utility that needs to be run as root on a server 
in the riak cluster.
-
-Assumptions:
-   * Riak 2.0.2 or greater is installed
-   * SSL Certificates have been generated (signed or self-signed)
-   * Root access to riak servers
-
-Add admin user and riakuser to riak
-   * Admin user will be a super user
-   * Riakuser will be the application user
-
-Login to one of the riak servers in the cluster as root (any will do)
-
-   1. Enable security
-
-   ``riak-admin security enable``
-
-   2. Add groups
-
-   ``riak-admin security add-group admins``
-
-   ``riak-admin security add-group keysusers``
-   3. Add users
-
-.. Note:: username and password should be stored in 
/opt/traffic_ops/app/conf//riak.conf
-..
-
-   ``riak-admin security add-user admin password= 
groups=admins``
-
-   ``riak-admin security add-user riakuser 
password= groups=keysusers``
-
-   4. Grant access for admin and riakuser
-
-   ``riak-admin security add-source riakuser 0.0.0.0/0 password``
-
-   ``riak-admin security add-source admin 0.0.0.0/0 password``
-
-   5. Grant privs to admins for everything
-
-   ``riak-admin security grant 
riak_kv.list_buckets,riak_kv.list_keys,riak_kv.get,riak_kv.put,riak_kv.delete 
on any to admins``
-
-   6. Grant privs to keysuser for ssl, dnssec, and url_sig_keys buckets 
only
-
-   ``riak-admin security grant 
riak_kv.get,riak_kv.put,riak_kv.delete on default ssl to keysusers``
-
-   ``riak-admin security grant 
riak_kv.get,riak_kv.put,riak_kv.delete on default dnssec to keysusers``
-
-   ``riak-admin security grant 
riak_kv.get,riak_kv.put,riak_kv.delete on default url_sig_keys to keysusers``
-
-.. seealso:: For more information on security in Riak, see the `Riak Security 
documentation `_.
-.. seealso:: For more information on authentication and authorization in 

[37/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.rst.txt
deleted file mode 100644
index 373c7ec..000
--- 
a/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.rst.txt
+++ /dev/null
@@ -1,1276 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-
-.. _to-api-v11-ds:
-
-Delivery Service
-
-
-.. _to-api-v11-ds-route:
-
-/api/1.1/deliveryservices
-+
-
-**GET /api/1.1/deliveryservices**
-
-  Retrieves all delivery services. See also `Using Traffic Ops - Delivery 
Service 
`_.
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Response Properties**
-
-  
+--++--+
-  |Parameter |  Type  |
 Description
  |
-  
+==++==+
-  | ``active``   |  bool  | true if active, false if inactive. 

  |
-  
+--++--+
-  | ``cacheurl`` | string | Cache URL rule to apply to this 
delivery service.   
 |
-  
+--++--+
-  | ``ccrDnsTtl``| string | The TTL of the DNS response for A or 
 queries requesting the IP address of the tr. host. 
|
-  
+--++--+
-  | ``cdnId``| string | Id of the CDN to which the delivery 
service belongs to. 
 |
-  
+--++--+
-  | ``cdnName``  | string | Name of the CDN to which the delivery 
service belongs to. 
   |
-  
+--++--+
-  | ``checkPath``| string | The path portion of the URL to check 
this deliveryservice for health.
|
-  
+--++--+
-  | ``displayName``  | string | The display name of the delivery 
service.
|
-  
+--++--+
-  | ``dnsBypassIp``  | string | The IPv4 IP to use for bypass on a DNS 
deliveryservice  - bypass starts when serving more than the 
  |
-  |  || globalMaxMbps traffic on this 
deliveryservice.
   |
-  
+-

[03/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/admin/traffic_ops_config.html
--
diff --git a/docs/latest/admin/traffic_ops_config.html 
b/docs/latest/admin/traffic_ops_config.html
index e20b968..9c86bbb 100644
--- a/docs/latest/admin/traffic_ops_config.html
+++ b/docs/latest/admin/traffic_ops_config.html
@@ -7,7 +7,7 @@
   
   
   
-  Configuring Traffic Ops — Traffic Control 1.8.1 documentation 

+  Configuring Traffic Ops — Traffic Control 1.8-dev documentation 

   
 
   
@@ -33,10 +33,7 @@
   
 
   
-
-
-
+
 
 
  
@@ -111,6 +108,7 @@
 Managing Traffic Ops Extensions
 Traffic Portal Administration
 Traffic Monitor Administration
+Traffic Monitor Administration
 Traffic Router Administration
 Traffic Stats Administration
 Traffic Server Administration
@@ -125,6 +123,7 @@
 Traffic Portal
 Traffic Router
 Traffic Monitor
+Traffic Monitor 
Golang
 Traffic Stats
 Traffic Server
 
@@ -162,14 +161,14 @@
 
   
   
-Traffic Control 1.8.1 »
+Traffic Control 1.8-dev »
   
   Administrator’s Guide »
   
 Configuring Traffic Ops
   
 
-   View page source
+   
View page source
 
   
   
@@ -199,7 +198,7 @@
 
 
 Profile Parameters¶
-Many of the settings for the different servers in a Traffic Control CDN are 
controlled by parameters in the parameter view of Traffic Ops. Parameters are 
grouped in profiles and profiles are assigned to a server. For a typical cache 
there are hundreds of configuration settings to apply. The Traffic Ops 
parameter view contains the defined settings. To make life easier, Traffic Ops 
allows for duplication, comparison, import and export of Profiles. Traffic Ops 
also has a “Global profile” - the parameters in this profile are 
going to be applied to all servers in the Traffic Ops instance, or apply to 
Traffic Ops themselves. These parameters are:
+Many of the settings for the different servers in a Traffic Control CDN are 
controlled by parameters in the parameter view of Traffic Ops. Parameters are 
grouped in profiles and profiles are assigned to a server or a deliveryservice. 
For a typical cache there are hundreds of configuration settings to apply. The 
Traffic Ops parameter view contains the defined settings. To make life easier, 
Traffic Ops allows for duplication, comparison, import and export of Profiles. 
Traffic Ops also has a “Global profile” - the parameters in this 
profile are going to be applied to all servers in the Traffic Ops instance, or 
apply to Traffic Ops themselves. These parameters are:
 
 
 
@@ -217,34 +216,38 @@
 global
 The URL where this Traffic Ops instance is being served from.
 
-tm.toolname
+tm.cache.url
+global
+Not required. The URL where the Traffic Ops Config file cache instance is 
being served from.  Requires Traffic Ops 2.1 and above.
+
+tm.toolname
 global
 The name of the Traffic Ops tool. Usually “Traffic Ops”. Used 
in the About screen and in the comments headers of the files generated.
 
-tm.infourl
+tm.infourl
 global
 This is the “for more information go here” URL, which is 
visible in the About page.
 
-tm.logourl
+tm.logourl
 global
 This is the URL of the logo for Traffic Ops and can be relative if the 
logo is under traffic_ops/app/public.
 
-tm.instance_name
+tm.instance_name
 global
 The name of the Traffic Ops instance. Can be used when multiple instances 
are active. Visible in the About page.
 
-tm.traffic_mon_fwd_proxy
+tm.traffic_mon_fwd_proxy
 global
 When collecting stats from Traffic Monitor, Traffic Ops uses this forward 
proxy to pull the stats through.
 This can be any of the MID tier caches, or a forward cache specifically 
deployed for this purpose. Setting
 this variable can significantly lighten the load on the Traffic Monitor system 
and it is recommended to
 set this parameter on a production system.
 
-geolocation.polling.url
+geolocation.polling.url
 CRConfig.json
 The location to get the GeoLiteCity database from.
 
-geolocation6.polling.url
+geolocation6.polling.url
 CRConfig.json
 The location to get the IPv6 GeoLiteCity database from.
 
@@ -310,11 +313,11 @@ The Traffic Monitor IP addresses have to be included in 
this, if they are using
 
 Drive_Prefix
 storage.config
-JvD/Jeff to supply blurb
+The device path start of the disks. For example, if you have /dev/sda through /dev/sdf set this to 
/dev/sd
 
 Drive_Letters
 storage.config
-JvD/Jeff to supply blurb
+The letter part of the disks, in the same example as above set this to 
a,b,c,d,e,f
 
 purge_allow_ip
 ip_allow.config
@@ -429,6 +432,14 @@ Value is left blank.
 For example: –config regex_revalidate.config
 https://docs.trafficserver.apache.org/en/5.3.x/reference/plugins/regex_remap.en.html";>regex_revalidate
 
+use_reval_pending
+global
+Configures Traffic Ops to use separate
+reval_pending flag for each c

[28/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/cdn.rst.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v12/cdn.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/cdn.rst.txt
deleted file mode 100644
index da10799..000
--- a/docs/latest/_sources/development/traffic_ops_api/v12/cdn.rst.txt
+++ /dev/null
@@ -1,1385 +0,0 @@
-..
-..
-.. 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.
-..
-
-.. _to-api-v12-cdn:
-
-CDN
-===
-
-.. _to-api-v12-cdn-route:
-
-/api/1.2/cdns
-+
-
-**GET /api/1.2/cdns**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Response Properties**
-
-  
+---++-+
-  |Parameter  |  Type  |   Description 
  |
-  
+===++=+
-  | ``id``| string | CDN id.   
  |
-  
+---++-+
-  | ``name``  | string | CDN name. 
  |
-  
+---++-+
-  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
-  
+---++-+
-  | ``lastUpdated``   | string |   
  |
-  
+---++-+
-
-  **Response Example** ::
-
-{
- "response": [
-   {
-  "id": "1"
-  "name": "over-the-top",
-  "dnssecEnabled": false,
-  "lastUpdated": "2014-10-02 08:22:43"
-   },
-   {
-  "id": "2"
-  "name": "cdn2",
-  "dnssecEnabled": true,
-  "lastUpdated": "2014-10-02 08:22:43"
-   }
-]
-}
-
-|
-
-**GET /api/1.2/cdns/:id**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Route Parameters**
-
-  +---+--+-+
-  |   Name| Required |Description  |
-  +===+==+=+
-  |   ``id``  |   yes| CDN id. |
-  +---+--+-+
-
-  **Response Properties**
-
-  
+---++-+
-  |Parameter  |  Type  |   Description 
  |
-  
+===++=+
-  | ``id``| string | CDN id.   
  |
-  
+---++-+
-  | ``name``  | string | CDN name. 
  |
-  
+---++-+
-  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
-  
+---++-+
-  | ``lastUpdated``   | string |   
  |
-  
+---++-+
-
-  **Response Example** ::
-
-{
- "response": [
-   {
-  "id": "2"
-  "name": "cdn2",
-  "dnssecEnabled": false,
-  "lastUpdated": "2014-10-02 08:22:43"
-   }
-]
-}
-
-|
-
-**GET /api/1.2/cdns/name/:name**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Route Parameters**
-
-  +---+--+-+
-  |   Name| Required |Description  |
-  +===+==+=+
-  |  ``name`` |   yes| CDN name.   |
-  +---+--+-+
-
-  **Response Properties**
-
-  
+---++-

[13/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/overview/traffic_router.rst.txt
--
diff --git a/docs/latest/_sources/overview/traffic_router.rst.txt 
b/docs/latest/_sources/overview/traffic_router.rst.txt
deleted file mode 100644
index f9ed1bc..000
--- a/docs/latest/_sources/overview/traffic_router.rst.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-.. _reference-label-tc-tr:
-
-.. |arrow| image:: fwda.png
-
-.. index::
-  Traffic Router - Overview
-
-Traffic Router
-==
-Traffic Router's function is to send clients to the most optimal cache. 
Optimal in this case is based on a number of factors:
-
-* Distance between the cache and the client (not necessarily measured in 
meters, but quite often in layer 3 network hops). Less network distance between 
the client and cache yields better performance, and lower network load. Traffic 
Router helps clients connect to the best performing cache for their location at 
the lowest network cost.
-
-* Availability of caches and health / load on the caches. A common issue in 
Internet and television distribution scenarios is having many clients 
attempting to retrieve the same content at the same time. Traffic Router helps 
clients route around overloaded or down caches.
-
-* Availability of content on a particular cache. Reusing of content through 
cache HITs is the most important performance gain a CDN can offer. Traffic 
Router sends clients to the cache that is most likely to already have the 
desired content.
-
-Traffic routing options are often configured at the Delivery Service level. 
-
-|
-
-
-.. _rl-ds:
-
-|arrow| Delivery Service
-
-  As discussed in the basic concepts section, the EDGE caches are configured 
as reverse proxies, and the Traffic Control CDN looks from the outside as a 
very large reverse proxy. Delivery Services are often referred to a reverse 
proxy remap rule. In most cases, a Delivery Service is a one to one mapping to 
a FQDN that is used as a hostname to deliver the content. Many options and 
settings regarding how to optimize the content delivery, which is configurable 
on a Delivery Service basis. Some examples of these Delivery Service settings 
are:
-
-  * Cache in RAM, cache on disk, or do not cache at all.
-  * Use DNS or HTTP Content routing (see below).
-  * Limits on transactions per second and bandwidth.
-  * Protocol (http or https).
-  * Token based authentication settings. 
-  * Header rewrite rules.
-
-  Delivery Services are also for use in allowing multi-tenants to coexist in 
the Traffic Control CDN without interfering with each other, and to keep 
information about their content separated. 
-
-|
-
-.. _rl-localization:
-
-|arrow| Localization
-
-  Traffic Router uses a JSON input file called the *coverage zone map* to 
determine what *cachegroup* is closest to the client. If the client IP address 
is not in this coverage zone map, it falls back to *geo*, using the maxmind 
database to find the client's location, and the geo coordinates from Traffic 
Ops for the cachegroup.
-
-|
-
-Traffic Router is inserted into the HTTP retrieval process by making it DNS 
authoritative for the domain of the CDN delivery service. In the example of the 
reverse proxy, the client was given the 
``http://www-origin-cache.cdn.com/foo/bar/fun.html`` url. In a Traffic Control 
CDN, URLs start with either ``tr.`` or ``edge.``, for HTTP or DNS content 
routing respectively.  These names are configurable via properties files within 
the Traffic Router installation.
-
-|
-
-.. index::
-  Content Routing
-
-.. _rl-dns-cr:
-
-|arrow| DNS Content Routing

-  For a DNS delivery service the client receives a URL with a hostname 
beginning with ``edge.`` (e.g. http://edge.dsname.cdn.com/foo/bar/fun.html). 
When the LDNS server is resolving this ``edge.dsname.cdn.com`` hostname to an 
IP address, it ends at Traffic Router because it is the authoritative DNS 
server for ``cdn.com`` and the domains below it, and subsequently responds with 
a list of IP addresses from the eligible caches based on the location of the 
LDNS server. When responding, Traffic Router does not know the actual client IP 
address or the path that the client is going to request. The decision on what 
cache IP 

[20/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/profile_parameter.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/profile_parameter.rst.txt
 
b/docs/latest/_sources/development/traffic_ops_api/v12/profile_parameter.rst.txt
deleted file mode 100644
index 31b5789..000
--- 
a/docs/latest/_sources/development/traffic_ops_api/v12/profile_parameter.rst.txt
+++ /dev/null
@@ -1,457 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-.. _to-api-v12-profileparameters:
-
-
-Profile parameters
-==
-
-.. _to-api-v12-profileparameters-route:
-
-/api/1.2/profileparameters
-++
-
-**POST /api/1.2/profileparameters**
-
-Associate parameter to profile.
-
-   Authentication Required: Yes
-
-   Role(s) Required:  admin or oper
-
-   **Request Properties**
-   This accept two formats: single profile-parameter, profile-parameter 
array.
-
-   Single profile-parameter format:
-
-   
+--+--++
-   | Parameter| Required | Description 
   |
-   
+==+==++
-   | ``profileId``| yes  | profile id. 
   |
-   
+--+--++
-   | ``parameterId``  | yes  | parameter id.   
   |
-   
+--+--++
-
-   Profile-parameter array format:
-
-   
+--+--++
-   | Parameter| Required | Description 
   |
-   
+==+==++
-   |  | yes  | profile-parameter array.
   |
-   
+--+--++
-   | ``>profileId``   | yes  | profile id. 
   |
-   
+--+--++
-   | ``>parameterId`` | yes  | parameter id.   
   |
-   
+--+--++
-
-  **Request Example** ::
-
-Single profile-parameter format:
-
-{
-  "profileId": 2,
-  "parameterId": 6
-}
-
-Profile-parameter array format:
-
-[
-{
-  "profileId": 2,
-  "parameterId": 6
-},
-{
-  "profileId": 2,
-  "parameterId": 7
-},
-{
-  "profileId": 3,
-  "parameterId": 6
-}
-]
-
-   **Response Properties**
-
-   
+---+-+-+
-   |  Parameter|  Type   |   Description   
|
-   
+===+=+=+
-   | ``response``  | array   | Profile-parameter associations. 
|
-   
+---+-+-+
-   | ``>profileId``| string  | Profile id. 
|
-   
+---+-+-+
-   | ``>parameterId``  | string  | Parameter id.   
|
-   
+---+-+-+
-   | ``alerts``| array   | A collection of alert messages. 
|
-   
+---+-+-+
-   | ``>level``| string  | success, info, warning or error.
|
-   
+---+-+-+
-   | ``>text`` | string  | Alert message.  
|

[38/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/cdn.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v11/cdn.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/cdn.txt
new file mode 100644
index 000..d2f742e
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v11/cdn.txt
@@ -0,0 +1,1086 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v11-cdn-health:
+
+CDN 
+===
+
+.. _to-api-v11-cdn-health-route:
+
+/api/1.1/cdns
++
+
+**GET /api/1.1/cdns**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+---++-+
+  |Parameter  |  Type  |   Description 
  |
+  
+===++=+
+  | ``id``| string | CDN id.   
  |
+  
+---++-+
+  | ``name``  | string | CDN name. 
  |
+  
+---++-+
+  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
+  
+---++-+
+  | ``lastUpdated``   | string |   
  |
+  
+---++-+
+
+  **Response Example** ::
+
+{
+ "response": [
+   {
+  "id": "1"
+  "name": "over-the-top",
+  "dnssecEnabled": false,
+  "lastUpdated": "2014-10-02 08:22:43"
+   },
+   {
+  "id": "2"
+  "name": "cdn2",
+  "dnssecEnabled": true,
+  "lastUpdated": "2014-10-02 08:22:43"
+   }
+]
+}
+
+|
+
+**GET /api/1.1/cdns/:id**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Route Parameters**
+
+  +---+--+-+
+  |   Name| Required |Description  |
+  +===+==+=+
+  |   ``id``  |   yes| CDN id. |
+  +---+--+-+
+
+  **Response Properties**
+
+  
+---++-+
+  |Parameter  |  Type  |   Description 
  |
+  
+===++=+
+  | ``id``| string | CDN id.   
  |
+  
+---++-+
+  | ``name``  | string | CDN name. 
  |
+  
+---++-+
+  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
+  
+---++-+
+  | ``lastUpdated``   | string |   
  |
+  
+---++-+
+
+  **Response Example** ::
+
+{
+ "response": [
+   {
+  "id": "2"
+  "name": "cdn2",
+  "dnssecEnabled": false,
+  "lastUpdated": "2014-10-02 08:22:43"
+   }
+]
+}
+
+|
+
+**GET /api/1.1/cdns/name/:name**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Route Parameters**
+
+  +---+--+-+
+  |   Name| Required |Description  |
+  +===+==+=+
+  |  ``name`` |   yes| CDN name.   |
+  +---+--+-+
+
+  **Response Properties**
+
+  
+---++-

[29/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/cachegroup.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/cachegroup.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/cachegroup.txt
new file mode 100644
index 000..1831f49
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/cachegroup.txt
@@ -0,0 +1,802 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v12-cachegroup:
+
+Cache Group
+===
+
+.. _to-api-v12-cachegroups-route:
+
+/api/1.2/cachegroups
+
+
+**GET /api/1.1/cachegroups**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Query Parameters**
+
+  
+-+--+---+
+  | Name| Required | Description   
|
+  
+=+==+===+
+  | ``type``| no   | Filter cache groups by Type ID.   
|
+  
+-+--+---+
+
+  **Response Properties**
+
+  
+---++--+
+  | Parameter | Type   | Description   
   |
+  
+===++==+
+  | ``id``| string | Local unique identifier for 
the Cache Group  |
+  
+---++--+
+  | ``lastUpdated``   | string | The Time / Date this entry 
was last updated  |
+  
+---++--+
+  | ``latitude``  | string | Latitude for the Cache Group  
   |
+  
+---++--+
+  | ``longitude`` | string | Longitude for the Cache Group 
   |
+  
+---++--+
+  | ``name``  | string | The name of the Cache Group 
entry|
+  
+---++--+
+  | ``parentCachegroupId``| string | Parent cachegroup ID. 
   |
+  
+---++--+
+  | ``parentCachegroupName``  | string | Parent cachegroup name.   
   |
+  
+---++--+
+  | ``secondaryParentCachegroupId``   | string | Secondary parent cachegroup 
ID.  |
+  
+---++--+
+  | ``secondaryParentCachegroupName`` | string | Secondary parent cachegroup 
name.|
+  
+---++--+
+  | ``shortName`` | string | Abbreviation of the Cache 
Group Name |
+  
+---++--+
+  | ``typeId``| string | Unique identifier for the 
'Type' of Cache Group entry|
+  
+---++--+
+

[27/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/cdn.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v12/cdn.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/cdn.txt
new file mode 100644
index 000..650b0a9
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/cdn.txt
@@ -0,0 +1,1407 @@
+..
+..
+.. 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.
+..
+
+.. _to-api-v12-cdn:
+
+CDN
+===
+
+.. _to-api-v12-cdn-route:
+
+/api/1.2/cdns
++
+
+**GET /api/1.2/cdns**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+---++-+
+  |Parameter  |  Type  |   Description 
  |
+  
+===++=+
+  | ``id``| string | CDN id.   
  |
+  
+---++-+
+  | ``name``  | string | CDN name. 
  |
+  
+---++-+
+  | ``domainName``| string | TLD of the CDN.   
  |
+  
+---++-+
+  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
+  
+---++-+
+  | ``lastUpdated``   | string |   
  |
+  
+---++-+
+
+  **Response Example** ::
+
+{
+ "response": [
+   {
+  "id": "1"
+  "name": "cdn1",
+  "domainName": "cdn1.foo.com",
+  "dnssecEnabled": false,
+  "lastUpdated": "2014-10-02 08:22:43"
+   },
+   {
+  "id": "2"
+  "name": "cdn2",
+  "domainName": "cdn2.foo.com",
+  "dnssecEnabled": true,
+  "lastUpdated": "2014-10-02 08:22:43"
+   }
+]
+}
+
+|
+
+**GET /api/1.2/cdns/:id**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Route Parameters**
+
+  +---+--+-+
+  |   Name| Required |Description  |
+  +===+==+=+
+  |   ``id``  |   yes| CDN id. |
+  +---+--+-+
+
+  **Response Properties**
+
+  
+---++-+
+  |Parameter  |  Type  |   Description 
  |
+  
+===++=+
+  | ``id``| string | CDN id.   
  |
+  
+---++-+
+  | ``name``  | string | CDN name. 
  |
+  
+---++-+
+  | ``domainName``| string | TLD of the CDN.   
  |
+  
+---++-+
+  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
+  
+---++-+
+  | ``lastUpdated``   | string |   
  |
+  
+---++-+
+
+  **Response Example** ::
+
+{
+ "response": [
+   {
+  "id": "2"
+  "name": "cdn2",
+  "domainName": "cdn2.foo.com",
+  "dnssecEnabled": false,
+  "lastUpdated": "2014-10-02 08:22:43"
+   }
+]
+}
+
+|
+
+**GET /api/1.2/cdns/name/:name**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Route Parameters**
+
+  +-

[23/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice_regex.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice_regex.rst.txt
 
b/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice_regex.rst.txt
deleted file mode 100644
index 16697ec..000
--- 
a/docs/latest/_sources/development/traffic_ops_api/v12/deliveryservice_regex.rst.txt
+++ /dev/null
@@ -1,374 +0,0 @@
-..
-..
-.. 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.
-..
-
-
-.. _to-api-v12-ds-regexes:
-
-Delivery Service Regexes
-
-
-.. _to-api-v12-ds-regexes-route:
-
-
-**GET /api/1.2/deliveryservices_regexes**
-
-  Retrieves regexes for all delivery services.
-
-  Authentication Required: Yes
-
-  Role(s) Required: Admin or Oper
-
-  **Response Properties**
-
-  
+--++-+
-  |Parameter |  Type  |   Description  
 |
-  
+==++=+
-  | ``dsName``   | array  | Delivery service name. 
 |
-  
+--++-+
-  | ``regexes``  | array  | An array of regexes for the delivery service.  
 |
-  
+--++-+
-  | ``>type``| string | The regex type.
 |
-  
+--++-+
-  | ``>pattern`` | string | The regex pattern. 
 |
-  
+--++-+
-  | ``>setNumber``   | string | The order in which the regex is evaluated. 
 |
-  
+--++-+
-
-  **Response Example** ::
-
-{
- "response": [
-{
-   "dsName": "foo-bar",
-   "regexes": [
-   {
-   "type": "HOST_REGEXP",
-   "pattern": ".*\.foo-bar\..*",
-   "setNumber": 0
-   },
-   {
-   "type": "HOST_REGEXP",
-   "pattern": "foo.bar.com",
-   "setNumber": 1
-   }
-   ]
-   },
-   { ... }
-  ]
-}
-
-|
-
-**GET /api/1.2/deliveryservices/{:dsId}/regexes**
-
-  Retrieves regexes for a specific delivery service.
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Route Parameters**
-
-  +---+--+-+
-  |   Name| Required |Description  |
-  +===+==+=+
-  |  ``dsId`` |   yes| Delivery service id.|
-  +---+--+-+
-
-  **Response Properties**
-
-  
+--++-+
-  |Parameter |  Type  |   Description  
 |
-  
+==++=+
-  | ``id``   | string | Delivery service regex ID. 
 |
-  
+--++-+
-  | ``type`` | string | Delivery service regex type ID.
 |
-  
+--++---

[48/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_ops_config.rst.txt
--
diff --git a/docs/latest/_sources/admin/traffic_ops_config.rst.txt 
b/docs/latest/_sources/admin/traffic_ops_config.rst.txt
deleted file mode 100644
index 390788c..000
--- a/docs/latest/_sources/admin/traffic_ops_config.rst.txt
+++ /dev/null
@@ -1,194 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-Configuring Traffic Ops
-%%%
-
-Follow the steps below to configure the newly installed Traffic Ops Instance.
-
-Installing the SSL Cert
-===
-By default, Traffic Ops runs as an SSL web server, and a certificate needs to 
be installed.  TBD.
-
-Content Delivery Networks
-=
-
-.. _rl-param-prof:
-
-Profile Parameters
-==
-Many of the settings for the different servers in a Traffic Control CDN are 
controlled by parameters in the parameter view of Traffic Ops. Parameters are 
grouped in profiles and profiles are assigned to a server. For a typical cache 
there are hundreds of configuration settings to apply. The Traffic Ops 
parameter view contains the defined settings. To make life easier, Traffic Ops 
allows for duplication, comparison, import and export of Profiles. Traffic Ops 
also has a "Global profile" - the parameters in this profile are going to be 
applied to all servers in the Traffic Ops instance, or apply to Traffic Ops 
themselves. These parameters are:
-
-
-.. index::
-  Global Profile
-
-+--+---+---+
-|   Name   |  Config file  |   
  Value 
|
-+==+===+===+
-| tm.url   | global| The URL where this Traffic Ops 
instance is being served from.  
   |
-+--+---+---+
-| tm.toolname  | global| The name of the Traffic Ops tool. 
Usually "Traffic Ops". Used in the About screen and in the comments headers of 
the files generated. |
-+--+---+---+
-| tm.infourl   | global| This is the "for more information 
go here" URL, which is visible in the About page.   
|
-+--+---+---+
-| tm.logourl   | global| This is the URL of the logo for 
Traffic Ops and can be relative if the logo is under traffic_ops/app/public.
  |
-+--+---+---+
-| tm.instance_name | global| The name of the Traffic Ops 
instance. Can be used when multiple instances are active. Visible in the About 
page.  |
-+--+---+---+
-| tm.traffic_mon_fwd_proxy | global| When collecting stats from 
Traffic Monitor, Traffic Ops uses this forward proxy to pull the stats through. 
   |
-|  |   | This can be any of the MID tier 
caches, or a forward cache specifically deployed for this purpose. Setting  
  |
-|  |   | this variable can significantly 
lighten the l

[14/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_router.txt
--
diff --git a/docs/latest/_sources/development/traffic_router.txt 
b/docs/latest/_sources/development/traffic_router.txt
new file mode 100644
index 000..383613b
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_router.txt
@@ -0,0 +1,145 @@
+.. 
+.. 
+.. 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.
+.. 
+
+Traffic Router
+**
+Introduction
+
+Traffic Router is a Java Tomcat application that routes clients to the closest 
available cache on the CDN using both HTTP and DNS.  Cache availability is 
determined by Traffic Monitor; consequently Traffic Router polls Traffic 
Monitor for its configuration and cache health state information, and uses this 
data to make routing decisions.  HTTP routing is performed by localizing the 
client based on the request's source IP address (IPv4 or IPv6), and issues an 
HTTP 302 redirect to the nearest cache.  HTTP routing utilizes consistent 
hashing on request URLs to optimize cache performance and request distribution. 
 DNS routing is performed by localizing clients, resolvers in most cases, 
requesting ``A`` and ```` records for a configurable name such as 
``edge.deliveryservice.somecdn.net``. Traffic Router is comprised of four 
separate Maven modules:
+   
+   * api - Provides a simple JSON interface into certain aspects of core 
and is deployed as a WAR to a Service (read: connector/listen port) within 
Tomcat which is separate from core
+   * connector - A JAR that overrides Tomcat's standard Http11Protocol 
Connector class and allows Traffic Router to delay opening listen sockets until 
it is in a state suitable for routing traffic
+   * geolocation - Submodule for defining geolocation services
+   * testServer - A convenience server for easier manual testing of the 
API portion of Traffic Router on a development machine
+   * core - Services DNS and HTTP requests, performs localization on 
routing requests, and is deployed as a WAR to a Service (read: connector/listen 
port) within Tomcat which is separate from api
+   * rpm - A simple Maven project which gathers the artifacts from the 
prior three modules and builds an RPM
+
+Software Requirements
+=
+To work on Traffic Router you need a \*nix (MacOS and Linux are most commonly 
used) environment that has the following installed:
+
+* Eclipse >= Kepler SR2 (or another Java IDE)
+* Maven >= 3.3.1
+* JDK >= 6.0
+
+Traffic Router Project Tree Overview
+=
+* ``traffic_control/traffic_traffic_router/`` - base directory for Traffic 
Router
+
+   * ``api/`` - Source code for Traffic Router API, which is built as its 
own deployable WAR file and communicates with Traffic Router Core using JMX
+
+   * ``src/main`` - Main source directory for Traffic Router API
+
+   * ``java/`` - Java source code for Traffic Router API
+   * ``resources/`` - Spring resources pulled in during an 
RPM build
+   * ``webapp/`` - Java webapp resources
+
+   * ``src/test`` - Test source directory for Traffic Router API
+
+   * ``java/`` - JUnit based unit tests for Traffic Router 
API
+   * ``resources/`` - Resources pulled in by unit tests
+
+   * ``connector/`` - Source code for Traffic Router Connector; 
+
+   * ``src/main/java`` - Java source directory for Traffic Router 
Connector
+
+   * ``core/`` - Source code for Traffic Router Core, which is built as 
its own deployable WAR file and communicates with Traffic Router API using JMX
+
+   * ``src/main`` - Main source directory for Traffic Router Core
+
+   * ``etc/init.d`` - Init script for Tomcat
+   * ``conf/`` - Minimum required configuration files
+   * ``java/`` - Java source code for Traffic Router Core
+   * ``opt/tomcat/conf`` - Contains Tomcat configuration 
file(s) pulled in during an RPM build
+   * ``resources/`` - Resources pulled in during an RPM 
build
+   * ``scripts/`` - Scripts used by the RPM build process
+   * ``webapp/`` - Java webapp re

[41/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_monitor/traffic_monitor_api.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_monitor/traffic_monitor_api.txt 
b/docs/latest/_sources/development/traffic_monitor/traffic_monitor_api.txt
new file mode 100644
index 000..0240fd4
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_monitor/traffic_monitor_api.txt
@@ -0,0 +1,178 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _reference-tm-api:
+
+Traffic Monitor APIs
+
+The Traffic Monitor URLs below allow certain query parameters for use in 
controlling the data returned. The optional query parameters are the *tabbed* 
in values under each URL, if they exist.
+
+|
+
+**/publish/EventLog**
+
+Log of recent events.
+
+|
+
+**/publish/CacheStats**
+
+Statistics gathered for each cache.
+
+**Query Parameters**
+
++--+-++
+|  Parameter   | Type|  Description   |
++==+=++
+| ``hc``   | int | The history count, number of items to display. |
++--+-++
+| ``stats``| string  | A comma separated list of stats to display.|
++--+-++
+| ``wildcard`` | boolean | Controls whether specified stats should be |
+|  | | treated as partial strings.|
++--+-++
+
+|
+
+**/publish/CacheStats/:cache**
+
+Statistics gathered for only this cache.
+
+**Query Parameters**
+
++--+-++
+|  Parameter   | Type|  Description   |
++==+=++
+| ``hc``   | int | The history count, number of items to display. |
++--+-++
+| ``stats``| string  | A comma separated list of stats to display.|
++--+-++
+| ``wildcard`` | boolean | Controls whether specified stats should be |
+|  | | treated as partial strings.|
++--+-++
+
+|
+
+**/publish/DsStats**
+
+Statistics gathered for delivery services.
+
+**Query Parameters**
+
++--+-++
+|  Parameter   | Type|  Description   |
++==+=++
+| ``hc``   | int | The history count, number of items to display. |
++--+-++
+| ``stats``| string  | A comma separated list of stats to display.|
++--+-++
+| ``wildcard`` | boolean | Controls whether specified stats should be |
+|  | | treated as partial strings.|
++--+-++
+
+|
+
+**/publish/DsStats/:deliveryService**
+
+Statistics gathered for this delivery service only.
+
+**Query Parameters**
+
++--+-++
+|  Parameter   | Type|  Description   |
++==+=++
+| ``hc``   | int | The history count, number of items to display. |
++--+-++
+| ``stats``| string  | A comma separated list of stats to display.|
++--+-++
+| ``wildcard`` | boolean | Controls whether specified stats should be |
+|  | | treated as partial strings.|
++--+-++
+
+|
+
+**/publish/CrStates**
+
+

[32/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/to_extension.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v11/to_extension.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/to_extension.txt
new file mode 100644
index 000..5ed2654
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v11/to_extension.txt
@@ -0,0 +1,210 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v11-ext:
+
+TO Extensions
+=
+
+.. _to-api-v11-ext-route:
+
+/api/1.1/to_extensions
+++
+
+**GET /api/1.1/to_extensions.json**
+
+Retrieves the list of extensions.
+
+Authentication Required: Yes
+
+Role(s) Required: None
+
+**Response Properties**
+
++--+++
+| Parameter| Type   | Description  
  |
++==+++
+|``script_file``   | string |  
  |
++--+++
+|``version``   | string |  
  |
++--+++
+|``name``  | string |  
  |
++--+++
+|``description``   | string |  
  |
++--+++
+|``info_url``  | string |  
  |
++--+++
+|``additional_config_json``| string |  
  |
++--+++
+|``isactive``  | string |  
  |
++--+++
+|``id``| string |  
  |
++--+++
+|``type``  | string |  
  |
++--+++
+|``servercheck_short_name``| string |  
  |
++--+++
+
+**Response Example** ::
+
+  {
+ "response": [
+{
+script_file: "ping",
+version: "1.0.0",
+name: "ILO_PING",
+description: null,
+info_url: "http://foo.com/bar.html";,
+additional_config_json: "{ "path": 
"/api/1.1/servers.json", "match": { "type": "EDGE"}, "select": 
"ilo_ip_address", "cron": "9 * * * *" }",
+isactive: "1",
+id: "1",
+type: "CHECK_EXTENSION_BOOL",
+servercheck_short_name: "ILO"
+},
+{
+script_file: "ping",
+version: "1.0.0",
+name: "10G_PING",
+description: null,
+info_url: "http://foo.com/bar.html";,
+additional_config_json: "{ "path": 
"/api/1.1/servers.json", "match": { "type": "EDGE"}, "select": "ip_address", 
"cron": "18 * * * *" }",
+isactive: "1",
+id: "2",
+type: "CHECK_EXTENSION_BOOL",
+servercheck_short_name: "10G"
+}
+ ],
+  }
+
+
+|
+
+**POST /api/1.1/to_extensions**
+
+  Creates a Traffic Ops extension.
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Parameters**
+
+  
+--+++
+  | Parameter| Type   | Descriptio

[02/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/admin/traffic_router.html
--
diff --git a/docs/latest/admin/traffic_router.html 
b/docs/latest/admin/traffic_router.html
index 9724092..ba1ea23 100644
--- a/docs/latest/admin/traffic_router.html
+++ b/docs/latest/admin/traffic_router.html
@@ -7,7 +7,7 @@
   
   
   
-  Traffic Router Administration — Traffic Control 1.8.1 
documentation 
+  Traffic Router Administration — Traffic Control 2.1-dev 
documentation 
   
 
   
@@ -33,13 +33,10 @@
   
 
   
-
-
-
+
 
 
- 
+ 
 
   
   
@@ -105,12 +102,15 @@
 
 
 Administrator’s Guide
-Installing Traffic Ops
-Configuring Traffic Ops
-Using Traffic Ops
-Managing Traffic Ops Extensions
+Traffic Ops - Installing
+Traffic Ops - Default Profiles
+Traffic Ops - Migrating from 
1.x to 2.x
+Traffic Ops - Configuring
+Traffic Ops - Using
+Managing Traffic Ops Extensions
 Traffic Portal Administration
 Traffic Monitor Administration
+Traffic Monitor Administration
 Traffic Router Administration
 Traffic Stats Administration
 Traffic Server Administration
@@ -121,10 +121,12 @@
 
 
 Developer’s Guide
+Building Traffic Control
 Traffic Ops
 Traffic Portal
 Traffic Router
 Traffic Monitor
+Traffic Monitor 
Golang
 Traffic Stats
 Traffic Server
 
@@ -162,14 +164,14 @@
 
   
   
-Traffic Control 1.8.1 »
+Traffic Control 2.1-dev »
   
   Administrator’s Guide »
   
 Traffic Router Administration
   
 
-   
View page source
+   View 
page source
 
   
   
@@ -181,7 +183,7 @@
  Next 
  
  
-  Previous
+  Previous
  
  
  
@@ -239,9 +241,14 @@ 
traffic_monitor.properties=file:/opt/traffic_router/conf/traffic_monitor.propert
 
 
 
-Start Tomcat: sudo service tomcat start, and test 
lookups with dig and curl against that server.
+
+Start Tomcat: sudo 
service tomcat start, and test lookups with dig and curl against 
that server.
+To restart, sudo service tomcat stop, kill the 
traffic router process, and sudo service tomcat start
+Also, crconfig previously recieved will be cached, and needs to be removed 
manually to actually be reloaded /opt/traffic_router/db/cr-config.json
+
+
 
-Snapshot CRConfig; See Snapshot CRConfig
+Snapshot CRConfig; See Snapshot CRConfig
 
 
 
@@ -262,7 +269,7 @@ 
traffic_monitor.properties=file:/opt/traffic_router/conf/traffic_monitor.propert
 Note
 Pre-existing installations having configuration files in /opt/traffic_router/conf will still be used and 
honored for Traffic Router 1.5 and onward.
 
-For the most part, the configuration files and parameters that follow are 
used to get Traffic Router online and communicating with various Traffic 
Control components. Once Traffic Router is successfully communicating with 
Traffic Control, configuration is mostly performed in Traffic Ops, and is 
distributed throughout Traffic Control via the CRConfig snapshot process. See 
Snapshot CRConfig for more information. Please see the 
parameter documentation for Traffic Router in the Using Traffic Ops guide 
documented under CCR 
Profile or Traffic Router Profile for parameters that influence the 
behavior of Traffic Router via the CRConfig.
+For the most part, the configuration files and parameters that follow are 
used to get Traffic Router online and communicating with various Traffic 
Control components. Once Traffic Router is successfully communicating with 
Traffic Control, configuration is mostly performed in Traffic Ops, and is 
distributed throughout Traffic Control via the CRConfig snapshot process. See 
Snapshot CRConfig for more information. Please see the 
parameter documentation for Traffic Router in the Using Traffic Ops guide 
documented under Traffic 
Router Profile for parameters that influence the behavior of Traffic 
Router via the CRConfig.
 
 Configuration files¶
 
@@ -388,7 +395,7 @@ 
traffic_monitor.properties=file:/opt/traffic_router/conf/traffic_monitor.propert
 
 
 Operation¶
-Upon startup or a configuration change, Traffic Router obtains keys from 
the keystore API in Traffic Ops which returns key signing keys (KSK) and zone 
signing keys (ZSK) for each delivery service that is a subdomain off the 
CDN’s top level domain (TLD), in addition to the keys for the CDN TLD 
itself. Each key has timing information that allows Traffic Router to determine 
key validity (expiration, inception, and effective dates) in addition to the 
appropriate TTL to use for the DNSKEY record(s).  All TTLs are configurable 
parameters; see the CCR 
Profile or Traffic Router Profile documentation for more 
information.
+Upon startup or a configuration change, Traffic Router obtains keys from 
the keystore API in Traf

[08/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/admin/quick_howto/multi_site_ats5.html
--
diff --git a/docs/latest/admin/quick_howto/multi_site_ats5.html 
b/docs/latest/admin/quick_howto/multi_site_ats5.html
new file mode 100644
index 000..356cda0
--- /dev/null
+++ b/docs/latest/admin/quick_howto/multi_site_ats5.html
@@ -0,0 +1,344 @@
+
+
+
+
+  
+
+  
+  
+  
+  Configure Multi Site Origin (5.x) — Traffic Control 2.1-dev 
documentation 
+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+ 
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+   Traffic Control
+
+
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+  
+
+  
+
+  
+  
+  
+CDN Basics
+Content Delivery 
Networks
+HTTP 1.1
+Caching Proxies
+Cache Control Headers and 
Revalidation
+
+
+
+
+Traffic Control Overview
+Introduction
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Stats
+Traffic Server
+Traffic Vault
+
+
+
+
+Administrator’s Guide
+Traffic Ops - Installing
+Traffic Ops - Default 
Profiles
+Traffic Ops - Migrating from 
1.x to 2.x
+Traffic Ops - Configuring
+Traffic Ops - Using
+Managing Traffic Ops Extensions
+Traffic Portal Administration
+Traffic Monitor Administration
+Traffic Monitor Administration
+Traffic Router Administration
+Traffic Stats Administration
+Traffic Server Administration
+Traffic Vault Administration
+Quick How To Guides
+
+
+
+
+Developer’s Guide
+Building Traffic Control
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Monitor 
Golang
+Traffic Stats
+Traffic Server
+
+
+
+
+FAQ
+General
+Development
+Running a Traffic Control CDN
+
+
+
+
+Glossary
+
+
+  
+
+  
+   
+
+
+
+
+  
+  
+
+Traffic Control
+  
+
+
+  
+  
+
+  
+  
+Traffic Control 2.1-dev »
+  
+  Administrator’s Guide 
»
+  
+  Quick How To Guides »
+  
+Configure Multi Site Origin (5.x)
+  
+
+   View page source
+
+  
+  
+  
+
+ 
+ 
+ 
+ Next 
+ 
+ 
+  Previous
+ 
+ 
+ 
+  
+
+  
+Configure Multi Site 
Origin (5.x)¶
+
+Create “cachegroups” for the origin locations, and assign the 
appropriate parent-child relationship between the mid cg’s and org cgs 
(click the image to see full size):
+
+
+
+Create a profile to assign to each of the origins:
+
+
+
+Create server entries for the origination vips:
+
+
+
+Check the multi-site check box in the delivery service screen:
+
+
+
+Assign the org servers to the delivery service that will have the multi 
site feature:
+
+
+
+Note
+“Origin Server Base URL” uniqueness: In order to enable 
MID caches to distinguish delivery services by different MSO algorithms while 
performing parent failover, it requires that “Origin Server Base URL” 
(OFQDN) for each MSO enabled delivery service is unique unless the exceptions 
listed afterwards. This means that the OFQDN of a MSO enabled delivery service 
should be different with the OFQDNs of any other delivery service, regardless 
of whether they are MSO enabled or not. The exceptions are:
+1) If there are multiple CDNs created on the same Traffic Ops, delivery 
services across different CDNs may have the same OFQDN configured.
+2) If several delivery services in the same CDN have the same MSO algorithm 
configured, they may share the same OFQDN.
+3) If delivery services are assigned with different MID cache groups 
respectively, they can share the same OFQDN.
+
+
+Select an option from the “Multi Site Origin Algorithm” 
drop-down list. Four MSO algorithms are supported:
+
+
+
+
+
+
+
+Option
+Description
+
+
+
+Consistent hash
+Origin server selection is based on the consistent hash of requested 
URLs.
+
+Primary/back
+Round robin selection does not occur. The first origin server is selected 
unless it fails.
+If the first fails, the second and other following origin servers will be 
tried by order.
+Order is defined by 2 factors - if the origin server’s cachegroup is 
configured as the
+parent cachegroup for the mid, then this server will be used as the primary. 
The same rules
+apply for secondary parents, in order.  Within the cachegroups, the rank 
parameter will sort
+order further. If no parents are defined at the mid, then only rank is 
considered.
+
+Strict
+round-robin
+MID caches serve requests strictly in turn. For example: origin server 1 
serves the first request,
+origin server 2 serves the second request, and so on.
+
+IP based
+r

[39/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/cdn.rst.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v11/cdn.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/cdn.rst.txt
deleted file mode 100644
index d2f742e..000
--- a/docs/latest/_sources/development/traffic_ops_api/v11/cdn.rst.txt
+++ /dev/null
@@ -1,1086 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-.. _to-api-v11-cdn-health:
-
-CDN 
-===
-
-.. _to-api-v11-cdn-health-route:
-
-/api/1.1/cdns
-+
-
-**GET /api/1.1/cdns**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Response Properties**
-
-  
+---++-+
-  |Parameter  |  Type  |   Description 
  |
-  
+===++=+
-  | ``id``| string | CDN id.   
  |
-  
+---++-+
-  | ``name``  | string | CDN name. 
  |
-  
+---++-+
-  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
-  
+---++-+
-  | ``lastUpdated``   | string |   
  |
-  
+---++-+
-
-  **Response Example** ::
-
-{
- "response": [
-   {
-  "id": "1"
-  "name": "over-the-top",
-  "dnssecEnabled": false,
-  "lastUpdated": "2014-10-02 08:22:43"
-   },
-   {
-  "id": "2"
-  "name": "cdn2",
-  "dnssecEnabled": true,
-  "lastUpdated": "2014-10-02 08:22:43"
-   }
-]
-}
-
-|
-
-**GET /api/1.1/cdns/:id**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Route Parameters**
-
-  +---+--+-+
-  |   Name| Required |Description  |
-  +===+==+=+
-  |   ``id``  |   yes| CDN id. |
-  +---+--+-+
-
-  **Response Properties**
-
-  
+---++-+
-  |Parameter  |  Type  |   Description 
  |
-  
+===++=+
-  | ``id``| string | CDN id.   
  |
-  
+---++-+
-  | ``name``  | string | CDN name. 
  |
-  
+---++-+
-  | ``dnssecEnabled`` |  bool  | DNSSEC enabled.   
  |
-  
+---++-+
-  | ``lastUpdated``   | string |   
  |
-  
+---++-+
-
-  **Response Example** ::
-
-{
- "response": [
-   {
-  "id": "2"
-  "name": "cdn2",
-  "dnssecEnabled": false,
-  "lastUpdated": "2014-10-02 08:22:43"
-   }
-]
-}
-
-|
-
-**GET /api/1.1/cdns/name/:name**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Route Parameters**
-
-  +---+--+-+
-  |   Name| Required |Description  |
-  +===+==+=+
-  |  ``name`` |   yes| CDN name.   |
-  +---+--+-+
-
-  **Response Properties**
-
-  
+---++-

[17/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.rst.txt
deleted file mode 100644
index 0e44cec..000
--- a/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.rst.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-.. _to-api-v12-dns:
-
-Static DNS Entries
-==
-
-.. _to-api-v12-static-dns-route:
-
-/api/1.2/staticdnsentries
-+
-
-**GET /api/1.2/staticdnsentries.json**
-
-Authentication Required: Yes
-
-Role(s) Required: None
-
-**Response Properties**
-
-
+-+---++
-| Parameter   |  Type | 
Description|
-
+=+===++
-| ``deliveryservice`` | string|
|
-
+-+---++
-| ``ttl`` | string|
|
-
+-+---++
-| ``type``| string|
|
-
+-+---++
-| ``address`` | string|
|
-
+-+---++
-| ``cachegroup``  | string|
|
-
+-+---++
-| ``host``| string|
|
-
+-+---++
-
-**Response Example** ::
-
-   {
-"response": [
-  {
-"deliveryservice": "foo-ds",
-"ttl": "30",
-"type": "CNAME_RECORD",
-"address": "bar.foo.baz.tv.",
-"cachegroup": "us-co-denver",
-"host": "mm"
-  }
-]
-  }
-
-|
-

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.txt
new file mode 100644
index 000..0e44cec
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/static_dns.txt
@@ -0,0 +1,66 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v12-dns:
+
+Static DNS Entries
+==
+
+.. _to-api-v12-static-dns-route:
+
+/api/1.2/staticdnsentries
++
+
+**GET /api/1.2/staticdnsentries.json**
+
+Authentication Required: Yes
+
+Role(s) Required: None
+
+**Response Properties**
+
+
+-+---++
+| Parameter   |  Type | 
Description|
+
+=+===+==

[43/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_router.txt
--
diff --git a/docs/latest/_sources/admin/traffic_router.txt 
b/docs/latest/_sources/admin/traffic_router.txt
new file mode 100644
index 000..33ba4ee
--- /dev/null
+++ b/docs/latest/_sources/admin/traffic_router.txt
@@ -0,0 +1,514 @@
+..
+..
+.. 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.
+..
+
+*
+Traffic Router Administration
+*
+.. contents::
+  :depth: 2
+  :backlinks: top
+
+Installing Traffic Router
+==
+The following are requirements to ensure an accurate set up:
+
+* CentOS 6
+* 4 vCPUs
+* 8GB RAM
+* Successful install of Traffic Ops
+* Successful install of Traffic Monitor
+* Administrative access to Traffic Ops
+
+.. Note:: Hardware requirements are generally doubled if DNSSEC is enabled
+
+1. If no suitable profile exists, create a new profile for Traffic Router.
+
+2. Enter the Traffic Router server into Traffic Ops, assign it to a Traffic 
Router profile, and ensure that its status is set to ``ONLINE``.
+3. Ensure the FQDN of the Traffic Router is resolvable in DNS. This FQDN must 
be resolvable by the clients expected to use this CDN.
+4. Install a traffic router: ``sudo yum install traffic_router``.
+5. Edit ``/opt/traffic_router/conf/traffic_monitor.properties`` and specify 
the correct online Traffic Monitor(s) for your CDN. See 
:ref:`rl-tr-config-files`
+   # traffic_monitor.properties: url that should normally point to this 
file
+   
traffic_monitor.properties=file:/opt/traffic_router/conf/traffic_monitor.properties
+
+   # Frequency for reloading this file
+   # traffic_monitor.properties.reload.period=6
+
+
+6. Start Tomcat: ``sudo service tomcat start``, and test lookups with dig and 
curl against that server.
+   To restart, ``sudo service tomcat stop``, kill the traffic router 
process, and ``sudo service tomcat start``
+   Also, crconfig previously recieved will be cached, and needs to be 
removed manually to actually be reloaded /opt/traffic_router/db/cr-config.json
+7. Snapshot CRConfig; See :ref:`rl-snapshot-crconfig`
+
+..  Note:: Once the CRConfig is snapshotted, live traffic will be sent to the 
new Traffic Routers provided that their status is set to ``ONLINE``.
+
+8. Ensure that the parent domain (e.g.: kabletown.net) for the CDN's top level 
domain (e.g.: cdn.kabletown.net) contains a delegation (NS records) for the new 
Traffic Router, and that the value specified matches the FQDN used in step 3.
+
+Configuring Traffic Router
+==
+
+.. Note:: Starting with Traffic Router 1.5, many of the configuration files 
under ``/opt/traffic_router/conf`` are only needed to override the default 
configuration values for Traffic Router. Most of the given default values will 
work well for any CDN. Critical values that must be changed are hostnames and 
credentials for communicating with other Traffic Control components such as 
Traffic Ops and Traffic Monitor.
+
+.. Note:: Pre-existing installations having configuration files in 
``/opt/traffic_router/conf`` will still be used and honored for Traffic Router 
1.5 and onward.
+
+For the most part, the configuration files and parameters that follow are used 
to get Traffic Router online and communicating with various Traffic Control 
components. Once Traffic Router is successfully communicating with Traffic 
Control, configuration is mostly performed in Traffic Ops, and is distributed 
throughout Traffic Control via the CRConfig snapshot process. See 
:ref:`rl-snapshot-crconfig` for more information. Please see the parameter 
documentation for Traffic Router in the Using Traffic Ops guide documented 
under :ref:`rl-ccr-profile` for parameters that influence the behavior of 
Traffic Router via the CRConfig.
+
+.. _rl-tr-config-files:
+
+Configuration files
+---
+
+++---+-+---+
+| File name  | Parameter | 
Description 
|   

[45/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_ops_using.txt
--
diff --git a/docs/latest/_sources/admin/traffic_ops_using.txt 
b/docs/latest/_sources/admin/traffic_ops_using.txt
new file mode 100644
index 000..c62704c
--- /dev/null
+++ b/docs/latest/_sources/admin/traffic_ops_using.txt
@@ -0,0 +1,1087 @@
+..
+..
+.. 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.
+..
+
+.. |graph| image:: ../../../traffic_ops/app/public/images/graph.png
+.. |info| image:: ../../../traffic_ops/app/public/images/info.png
+.. |checkmark| image:: ../../../traffic_ops/app/public/images/good.png
+.. |X| image:: ../../../traffic_ops/app/public/images/bad.png
+.. |clock| image:: ../../../traffic_ops/app/public/images/clock-black.png
+
+Using Traffic Ops
+%
+
+
+The Traffic Ops Menu
+
+
+.. image:: 12m.png
+
+The following tabs are available in the menu at the top of the Traffic Ops 
user interface.
+
+.. index::
+  Health Tab
+
+* **Health**
+
+  Information on the health of the system. Hover over this tab to get to the 
following options:
+
+  
+---++
+  | Option|
Description |
+  
+===++
+  | Table View| A real time view into the main performance indicators of 
the CDNs managed by Traffic Control.  |
+  |   | This view is sourced directly by the Traffic Monitor data 
and is updated every 10 seconds. |
+  |   | This is the default screen of Traffic Ops. 
|
+  |   | See :ref:`rl-health-table` for details.
|
+  
+---++
+  | Graph View| A real graphical time view into the main performance 
indicators of the CDNs managed by Traffic Control.|
+  |   | This view is sourced by the Traffic Monitor data and is 
updated every 10 seconds.  |
+  |   | On loading, this screen will show a history of 24 hours of 
data from Traffic Stats |
+  |   | See :ref:`rl-health-graph` for details.
|
+  
+---++
+  | Server Checks | A table showing the results of the periodic check 
extension scripts that are run. See :ref:`rl-server-checks` 
 |
+  
+---++
+  | Daily Summary | A graph displaying the daily peaks of bandwidth, overall 
bytes served per day, and overall bytes served since initial installation |
+  |   | per CDN.   
|
+  
+---++
+
+* **Delivery Services**
+
+  The main Delivery Service table. This is where you Create/Read/Update/Delete 
Delivery Services of all types. Hover over to get the following sub option:
+
+  +-+--+
+  |Option   | Description  |
+  +=+==+
+  | Federations | Add/Edit/Delete Federation Mappings. |
+  +-+--+
+

[15/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/user.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v12/user.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/user.txt
new file mode 100644
index 000..b51291f
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/user.txt
@@ -0,0 +1,1196 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v12-users:
+
+Users
+=
+
+.. _to-api-v12-users-route:
+
+/api/1.2/users
+++
+
+**GET /api/1.2/users**
+
+  Retrieves all users.
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+--+++
+  | Parameter| Type   | Description
|
+  
+==+++
+  |``addressLine1``  | string |
|
+  
+--+++
+  |``addressLine2``  | string |
|
+  
+--+++
+  |``city``  | string |
|
+  
+--+++
+  |``company``   | string |
|
+  
+--+++
+  |``country``   | string |
|
+  
+--+++
+  |``email`` | string |
|
+  
+--+++
+  |``fullName``  | string |
|
+  
+--+++
+  |``gid``   | string |
|
+  
+--+++
+  |``id``| hash   |
|
+  
+--+++
+  |``lastUpdated``   | string |
|
+  
+--+++
+  |``newUser``   | string |
|
+  
+--+++
+  |``phoneNumber``   | string |
|
+  
+--+++
+  |``postalCode``| string |
|
+  
+--+++
+  |``publicSshKey``  | string |
|
+  
+--+++
+  |``registrationSent``  | string |
|
+  
+--+++
+  |``role``  | string |
|
+  
+--+++
+  |``roleName``  | string |
|
+  
+--+++
+  |``stateOrProvince``   | string |
|
+  
+--+++
+  | ``tenant``   | string | Owning tenant name 
|
+  
+--+++
+  | ``tenantId`` | int| Owning tenant ID   
|
+  
+--

[44/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_portal.rst.txt
--
diff --git a/docs/latest/_sources/admin/traffic_portal.rst.txt 
b/docs/latest/_sources/admin/traffic_portal.rst.txt
deleted file mode 100644
index 9e761b8..000
--- a/docs/latest/_sources/admin/traffic_portal.rst.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-..
-..
-.. 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.
-..
-
-*
-Traffic Portal Administration
-*
-The following are requirements to ensure an accurate set up:
-
-* CentOS 6.7 or 7
-* Node.js 6.0.x or above
-
-**Installing Traffic Portal**
-
-   - Download the Traffic Portal RPM from the traffic control `downloads 
`_ page or build from 
`source 
`_.
-   - Copy the Traffic Portal RPM to your server
-   - curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo 
bash -
-   - sudo yum install -y nodejs
-   - sudo yum install -y 
-
-**Configuring Traffic Portal**
-
-   - cd /etc/traffic_portal/conf
-   - sudo cp config-template.js config.js
-   - sudo vi config.js (read the inline comments)
-   - [OPTIONAL] sudo vi 
/opt/traffic_portal/public/traffic_portal_properties.json (to customize traffic 
portal content)
-   - [OPTIONAL] sudo vi 
/opt/traffic_portal/public/resources/assets/css/custom.css (to customize 
traffic portal skin)
-
-**Starting Traffic Portal**
-
-   - sudo service traffic_portal start
-
-**Stopping Traffic Portal**
-
-   - sudo service traffic_portal stop
-
-
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_portal.txt
--
diff --git a/docs/latest/_sources/admin/traffic_portal.txt 
b/docs/latest/_sources/admin/traffic_portal.txt
new file mode 100644
index 000..9e761b8
--- /dev/null
+++ b/docs/latest/_sources/admin/traffic_portal.txt
@@ -0,0 +1,53 @@
+..
+..
+.. 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.
+..
+
+*
+Traffic Portal Administration
+*
+The following are requirements to ensure an accurate set up:
+
+* CentOS 6.7 or 7
+* Node.js 6.0.x or above
+
+**Installing Traffic Portal**
+
+   - Download the Traffic Portal RPM from the traffic control `downloads 
`_ page or build from 
`source 
`_.
+   - Copy the Traffic Portal RPM to your server
+   - curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo 
bash -
+   - sudo yum install -y nodejs
+   - sudo yum install -y 
+
+**Configuring Traffic Portal**
+
+   - cd /etc/traffic_portal/conf
+   - sudo cp config-template.js config.js
+   - sudo vi config.js (read the inline comments)
+   - [OPTIONAL] sudo vi 
/opt/traffic_portal/public/traffic_portal_properties.json (to customize traffic 
portal content)
+   - [OPTIONAL] sudo vi 
/opt/traffic_portal/public/resources/assets/css/custom.css (to customize 
traffic portal skin)
+
+**Starting Traffic Portal**
+
+   - sudo service traffic_portal start
+
+**Stopping Traffic Portal**
+
+   - sudo service traffic_portal stop
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_router.rst.txt
--
diff --git a/docs/latest/_sources/admin/traffic_router.rst.txt 
b/docs/latest/_sources/admin/traffic_router.rst.txt
deleted file mode 100644
index 4fe4759..000
--

[22/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/influxdb.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v12/influxdb.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/influxdb.txt
new file mode 100644
index 000..ca82cf5
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/influxdb.txt
@@ -0,0 +1,65 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v12-influxdb:
+
+InfluxDB
+==
+
+.. Note:: The documentation needs a thorough review!
+
+**GET /api/1.2/traffic_monitor/stats.json**
+
+Authentication Required: Yes
+
+Role(s) Required: None
+
+**Response Properties**
+
++--+++
+| Parameter| Type   | Description  
  |
++==+++
+| ``aaData``   | array  |  
  |
++--+++
+
+**Response Example**
+::
+
+  {
+   "aaData": [
+  [
+ "0",
+ "ALL",
+ "ALL",
+ "ALL",
+ "true",
+ "ALL",
+ "142035",
+ "172365661.85"
+  ],
+  [
+ 1,
+ "EDGE1_TOP_421_PSPP",
+ "odol-atsec-atl-03",
+ "us-ga-atlanta",
+ "1",
+ "REPORTED",
+ "596",
+ "923510.04",
+ "69.241.82.126"
+  ]
+   ],
+  }
+  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/job.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v12/job.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/job.txt
new file mode 100644
index 000..be27309
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/job.txt
@@ -0,0 +1,136 @@
+..
+..
+.. 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.
+..
+
+.. _to-api-v12-job:
+
+Jobs
+
+
+.. _to-api-v12-job-route:
+
+/api/1.2/jobs
+++
+
+**GET /api/1.2/jobs**
+
+  Get all jobs (currently limited to invalidate content (PURGE) jobs) sorted 
by start time (descending).
+
+  Authentication Required: Yes
+
+  Role(s) Required: Operations or Admin
+
+  **Request Query Parameters**
+
+  
+-+--+---+
+  | Name| Required | Description   
|
+  
+=+==+===+
+  | ``dsId``| no   | Filter jobs by Delivery Service ID.   
|
+  
+-+--+---+
+  | ``userId``  | no   | Filter jobs by User ID.   
|
+  
+-+--+---+
+
+  **Response Properties**
+
+  
+--++-+
+  | Parameter| Type   | Description
 |
+  
+==++=+
+  |``id``|  int   | Job id 
 |
+  
+--++-+
+  |``assetUrl``  | string | URL of the asset to invalidate.
 |
+  
+--++-+
+  |``deliveryService``   | string | Unique identifier of the job'

[16/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/type.txt
--
diff --git a/docs/latest/_sources/development/traffic_ops_api/v12/type.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/type.txt
new file mode 100644
index 000..6d614c5
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v12/type.txt
@@ -0,0 +1,151 @@
+.. 
+.. 
+.. 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.
+.. 
+
+.. _to-api-v12-type:
+
+Types
+=
+
+.. _to-api-v12-types-route:
+
+/api/1.2/types
+++
+
+**GET /api/1.1/types**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Query Parameters**
+
+  
++--++
+  |   Name | Required |Description 
|
+  
++==++
+  | ``useInTable`` | no   | Filter types by the table in which they apply  
|
+  
++--++
+
+  **Response Properties**
+
+  
+--+++
+  | Parameter| Type   | Description
|
+  
+==+++
+  |``id``| string |
|
+  
+--+++
+  |``name``  | string |
|
+  
+--+++
+  |``description``   | string |
|
+  
+--+++
+  |``useInTable``| string |
|
+  
+--+++
+  |``lastUpdated``   | string |
|
+  
+--+++
+
+  **Response Example** ::
+
+{
+ "response": [
+{
+   "id": "22",
+   "name": "_RECORD",
+   "description": "Static DNS  entry",
+   "useInTable": "staticdnsentry",
+   "lastUpdated": "2013-10-23 15:28:31"
+}
+ ]
+}
+
+
+|
+
+**GET /api/1.1/types/trimmed**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+--+++
+  | Parameter| Type   | Description
|
+  
+==+++
+  |``name``  | string |
|
+  
+--+++
+
+  **Response Example** ::
+
+{
+ "response": [
+{
+   "name": "_RECORD"
+},
+{
+   "name": "ACTIVE_DIRECTORY"
+},
+{
+   "name": "A_RECORD"
+},
+{
+   "name": "CCR"
+}
+ ],
+}
+
+**GET /api/1.1/types/:id**
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Request Route Parameters**
+
+  
++--++
+  |   Name | Required |Description 
|
+  
++==++
+  | ``id`` | yes  | Type ID.   
|
+  
++--++
+
+  **Response Properties**
+
+  
+--+++
+  | Parameter| Type   | Description
|
+  
+==+++
+  |``id``| string | 

[50/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/quick_howto/steering.txt
--
diff --git a/docs/latest/_sources/admin/quick_howto/steering.txt 
b/docs/latest/_sources/admin/quick_howto/steering.txt
new file mode 100644
index 000..be3c319
--- /dev/null
+++ b/docs/latest/_sources/admin/quick_howto/steering.txt
@@ -0,0 +1,111 @@
+..
+..
+.. 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.
+..
+
+.. _rl-steering-qht:
+
+***
+Configure Delivery Service Steering
+***
+
+1)  Create two target delivery services in Traffic Ops.  They must both be 
HTTP delivery services that are part of the same CDN.
+
+.. image:: steering01.png
+   :scale: 100%
+   :align: center
+
+2) Create a delivery service with type STEERING in Traffic Ops.
+
+.. image:: steering02.png
+   :scale: 100%
+   :align: center
+
+3) Click the 'Manage Steering Assignments' button on the delivery service 
screen to assign targets.
+
+.. image:: steering03.png
+   :scale: 100%
+   :align: center
+
+4) Create a user with the role of Steering.
+
+.. image:: steering04.png
+   :scale: 100%
+   :align: center
+
+5) As the steering user, assign weights or orders to target delivery services. 
 Assignments must either have a value for weight or order, but not both.  The 
value of weight must be a positive integer, while the value of order can be any 
integer.  This will require logging in to Traffic Ops first via 
``http://to.kabletown.net/api/1.2/user/login`` and storing the mojolicious 
cookie.
+
+   Sample cURL: ``curl -H "Cookie: mojolicious=xxxyyy" -XPUT 
"https://to.kabletown.net/internal/api/1.2/steering/steering-ds"; -d 
@/tmp/steering.json``
+
+   Sample JSON body:
+
+::
+
+   {
+"targets": [
+ {
+   "weight": "1000",
+   "deliveryService": "target-deliveryservice-1"
+ },
+ {
+   "weight": "9000",
+   "deliveryService": "target-deliveryservice-2"
+ }
+ {
+   "order": -1,
+   "deliveryService": "target-deliveryservice-3"
+ }
+ {
+   "order": 3,
+   "deliveryService": "target-deliveryservice-4"
+ }
+]
+   }
+
+6) If desired, the steering user can create filters for the target delivery 
services.
+
+   Sample cURL: ``curl -H "Cookie: mojolicious=xxxyyy" -XPUT 
"https://to.kabletown.net/internal/api/1.2/steering/steering-ds"; -d 
@/tmp/steering.json``
+
+   Sample JSON body:
+
+::
+
+   {
+"filters": [
+ {
+   "pattern": ".*\\gototarget1\\..*",
+   "deliveryService": "target-deliveryservice-1"
+ }
+],
+"targets": [
+ {
+   "weight": "1000",
+   "deliveryService": "target-deliveryservice-1"
+ },
+ {
+   "weight": "9000",
+   "deliveryService": "target-deliveryservice-2"
+ }
+ {
+   "order": -1,
+   "deliveryService": "target-deliveryservice-3"
+ }
+ {
+   "order": 3,
+   "deliveryService": "target-deliveryservice-4"
+ }
+]
+   }
+
+7) Any requests to Traffic Router for the steering delivery service should now 
be routed to target delivery services based on configured weight or order.  
Example: ``curl -Lvs http://tr.steering-ds.cdn.kabletown.net/foo``
+

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_monitor.rst.txt
--
diff --git a/docs/latest/_sources/admin/traffic_monitor.rst.txt 
b/docs/latest/_sources/admin/traffic_monitor.rst.txt
deleted file mode 100644
index 3a06e78..000
--- a/docs/latest/_sources/admin/traffic_monitor.rst.txt
+++ /dev/null
@@ -1,142 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-**
-Traffic Monitor Administration

[36/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.txt 
b/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.txt
new file mode 100644
index 000..373c7ec
--- /dev/null
+++ b/docs/latest/_sources/development/traffic_ops_api/v11/deliveryservice.txt
@@ -0,0 +1,1276 @@
+.. 
+.. 
+.. 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.
+.. 
+
+
+.. _to-api-v11-ds:
+
+Delivery Service
+
+
+.. _to-api-v11-ds-route:
+
+/api/1.1/deliveryservices
++
+
+**GET /api/1.1/deliveryservices**
+
+  Retrieves all delivery services. See also `Using Traffic Ops - Delivery 
Service 
`_.
+
+  Authentication Required: Yes
+
+  Role(s) Required: None
+
+  **Response Properties**
+
+  
+--++--+
+  |Parameter |  Type  |
 Description
  |
+  
+==++==+
+  | ``active``   |  bool  | true if active, false if inactive. 

  |
+  
+--++--+
+  | ``cacheurl`` | string | Cache URL rule to apply to this 
delivery service.   
 |
+  
+--++--+
+  | ``ccrDnsTtl``| string | The TTL of the DNS response for A or 
 queries requesting the IP address of the tr. host. 
|
+  
+--++--+
+  | ``cdnId``| string | Id of the CDN to which the delivery 
service belongs to. 
 |
+  
+--++--+
+  | ``cdnName``  | string | Name of the CDN to which the delivery 
service belongs to. 
   |
+  
+--++--+
+  | ``checkPath``| string | The path portion of the URL to check 
this deliveryservice for health.
|
+  
+--++--+
+  | ``displayName``  | string | The display name of the delivery 
service.
|
+  
+--++--+
+  | ``dnsBypassIp``  | string | The IPv4 IP to use for bypass on a DNS 
deliveryservice  - bypass starts when serving more than the 
  |
+  |  || globalMaxMbps traffic on this 
deliveryservice.
   |
+  
+--+---

[10/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_static/jquery.js
--
diff --git a/docs/latest/_static/jquery.js b/docs/latest/_static/jquery.js
index f6a6a99..ab28a24 100644
--- a/docs/latest/_static/jquery.js
+++ b/docs/latest/_static/jquery.js
@@ -1,4 +1,4 @@
-/*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */
-!function(a,b){"use strict";"object"==typeof module&&"object"==typeof 
module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw
 new Error("jQuery requires a window with a document");return 
b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use 
strict";var 
c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function
 p(a,b){b=b||d;var 
c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var
 q="3.1.0",r=function(a,b){return new 
r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return
 
b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return
 f.call(this)},get:function(a){return 
null!=a?a<0?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var 
b=r.merge(this.constructor(),a);return 
b.prevObject=this,b},each:function(a){retu
 rn r.each(this,a)},map:function(a){return 
this.pushStack(r.map(this,function(b,c){return 
a.call(b,c,b)}))},slice:function(){return 
this.pushStack(f.apply(this,arguments))},first:function(){return 
this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var 
b=this.length,c=+a+(a<0?b:0);return 
this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var 
b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new 
Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return 
a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var
 c=0,d=a.length;c
 +~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new 
RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new 
RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new 
RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new 
RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new
 RegExp("^(?:"+J+")$","i"),needsContext:new 
RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native
 \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new 
RegExp("([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var 
d="0x"+b-65536;return 
d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\u\w-]/g,ca=function(a,b){return
 b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"
 +a.charCodeAt(a.length-1).toString(16)+" 
":"\\"+a},da=function(){m()},ea=ta(function(a){return 
a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var
 c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var 
f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof 
a||!a||1!==w&&9!==w&&11!==w)return 
d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return
 d;if(j.id===f)return d.push(j),d}else 
if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return 
d.push(j),d}else{if(l[2])return 
G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return
 G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" 
"]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeNam
 
e.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+"
 "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return 
G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return
 i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return 
a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function 
ia(a){return a[u]=!0,a}function ja(a){var 
b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function
 ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function 
la(a,b){var 
c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return
 d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function 
ma(a){return function(b){var 

[19/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/server.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/server.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/server.rst.txt
deleted file mode 100644
index d49fc75..000
--- a/docs/latest/_sources/development/traffic_ops_api/v12/server.rst.txt
+++ /dev/null
@@ -1,1362 +0,0 @@
-..
-..
-.. 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.
-..
-
-.. _to-api-v12-server:
-
-Server
-==
-
-.. _to-api-v12-servers-route:
-
-/api/1.2/servers
-
-
-**GET /api/1.2/servers**
-
-  Retrieves properties of CDN servers.
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Query Parameters**
-
-  
++--+-+
-  |   Name | Required |Description 
 |
-  
++==+=+
-  | ``dsId``   | no   | Used to filter servers by delivery 
service. |
-  
++--+-+
-  | ``status`` | no   | Used to filter servers by status.  
 |
-  
++--+-+
-  | ``type``   | no   | Used to filter servers by type.
 |
-  
++--+-+
-  | ``profileId``  | no   | Used to filter servers by profile ID.  
 |
-  
++--+-+
-  | ``cdn``| no   | Used to filter servers by CDN ID.  
 |
-  
++--+-+
-  | ``cachegroup`` | no   | Used to filter servers by cache group ID.  
 |
-  
++--+-+
-  | ``physLocation``   | no   | Used to filter servers by phys location 
ID. |
-  
++--+-+
-
-  **Response Properties**
-
-  
++++
-  | Parameter  |  Type  |  
  Description |
-  
++++
-  | ``cachegroup`` | string | The cache group name (see 
:ref:`to-api-v11-cachegroup`).  
 |
-  
++++
-  | ``cachegroupId``   | string | The cache group id.  
  |
-  
++++
-  | ``cdnId``  | string | Id of the CDN to which the server belongs 
to.  |
-  
++++
-  | ``cdnName``| string | Name of the CDN to which the server belongs 
to.|
-  
++++
-  | ``domainName`` | string | The domain name part of the FQDN of the 
cache. |
-  
++++
-  | ``guid``   | string | An identifier used to uniquely identify the 
server.|
-  
+++

[06/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/admin/traffic_ops/extensions.html
--
diff --git a/docs/latest/admin/traffic_ops/extensions.html 
b/docs/latest/admin/traffic_ops/extensions.html
new file mode 100644
index 000..57b84c5
--- /dev/null
+++ b/docs/latest/admin/traffic_ops/extensions.html
@@ -0,0 +1,323 @@
+
+
+
+
+  
+
+  
+  
+  
+  Managing Traffic Ops Extensions — Traffic Control 2.1-dev 
documentation 
+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+ 
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+   Traffic Control
+
+
+
+  
+  
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+  
+
+  
+
+  
+  
+  
+CDN Basics
+Content Delivery 
Networks
+HTTP 1.1
+Caching Proxies
+Cache Control Headers and 
Revalidation
+
+
+
+
+Traffic Control Overview
+Introduction
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Stats
+Traffic Server
+Traffic Vault
+
+
+
+
+Administrator’s Guide
+Traffic Ops - Installing
+Traffic Ops - Default Profiles
+Traffic Ops - Migrating from 1.x to 
2.x
+Traffic Ops - Configuring
+Traffic 
Ops - Using
+Managing Traffic Ops Extensions
+Traffic Portal Administration
+Traffic Monitor Administration
+Traffic Monitor Administration
+Traffic Router Administration
+Traffic Stats Administration
+Traffic Server Administration
+Traffic Vault Administration
+Quick How To Guides
+
+
+
+
+Developer’s Guide
+Building Traffic Control
+Traffic Ops
+Traffic Portal
+Traffic Router
+Traffic Monitor
+Traffic Monitor 
Golang
+Traffic Stats
+Traffic Server
+
+
+
+
+FAQ
+General
+Development
+Running a Traffic Control CDN
+
+
+
+
+Glossary
+
+
+  
+
+  
+   
+
+
+
+
+  
+  
+
+Traffic Control
+  
+
+
+  
+  
+
+  
+  
+Traffic Control 2.1-dev »
+  
+  Administrator’s Guide 
»
+  
+Managing Traffic Ops Extensions
+  
+
+   View page source
+
+  
+  
+  
+
+ 
+ 
+ 
+ Next 
+ 
+ 
+  
Previous
+ 
+ 
+ 
+  
+
+  
+Managing Traffic Ops Extensions¶
+Each script is a separate bash script located in $TO_HOME/bin/checks/.
+The extensions must be registered with Traffic Ops in order to display a 
column on the Server Check page. The list of currently registered extensions 
can be listed by running /opt/traffic_ops/app/bin/extensions -a.
+The below extensions are automatically registered with the Traffic Ops 
database (to_extension table) at install time (see traffic_ops/app/db/seeds.sql). However, cron must 
still be configured to run these checks periodically.
+The scripts are called as follows:
+$TO_HOME/bin/checks/ToCheck.pl  
-c "{\"base_url\": 
\",https://\"\";, \"check_name\": 
\"\"}" -l 
+where:
+
+ is the type of check script
+ is the IP address of the Traffic Ops Server
+ is the name of the check. For example: CDU, CHR, DSCP, MTU, 
etc...
+ is between 1 and 4, with 4 being the most verbose. This 
field is optional
+
+
+
+Example Cron File¶
+Edit with crontab 
-e. You may need to adjust the path to your 
$TO_HOME to match your system.
+PERL5LIB=/opt/traffic_ops/app/local/lib/perl5:/opt/traffic_ops/app/lib
+
+# IPv4 ping examples - The 'select: 
["hostName","domainName"]' works but, if you want to 
check DNS resolution use FQDN.
+*/15 * 
* * * 
root /opt/traffic_ops/app/bin/checks/ToPingCheck.pl 
-c "{\"base_url\": 
\"https://localhost\", \"check_name\": 
\"10G\", \"select\": [\"hostName\",\"domainName\"]}" >> /var/log/traffic_ops/extensionCheck.log 2>&1
+*/15 * 
* * * 
root /opt/traffic_ops/app/bin/checks/ToPingCheck.pl 
-c "{\"base_url\": 
\"https://localhost\", \"check_name\": 
\"10G\", \"select\": \"ipAddress\"}" >> /var/log/traffic_ops/extensionCheck.log 2>&1
+*/15 * 
* * * 
root /opt/traffic_ops/app/bin/checks/ToPingCheck.pl 
-c "{\"base_url\": 
\"https://localhost\", \"check_name\": 
\"10G\", \"name\": \"IPv4 Ping\", \"select\": \"ipAddress\", \"syslog_facility\": \"local0\"}" > /dev/null 2>&1
+
+# IPv6 ping examples
+*/15 * 
* * * 
root /opt/traffic_ops/app/bin/checks/ToPingCheck.pl 
-c "{\"base_url\": 
\"https://localhost\", \"check_name\": 
\"10G6\", \"name\": \"IPv6 Ping\", \"select\": \"ip6Address\", \"syslog_facility\": \"local0\"}" >/dev/null 2&g
 t;&1
+*/15 * 
* * * 
root /opt/traffic_ops/app/bin/checks/ToPingCheck.pl 
-c "{\"base_url\": 
\"https://localhost\", \"check_name\": 
\"10G6\", \"select\": \"ip6Address\"}" >> /v

[46/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/admin/traffic_ops_using.rst.txt
--
diff --git a/docs/latest/_sources/admin/traffic_ops_using.rst.txt 
b/docs/latest/_sources/admin/traffic_ops_using.rst.txt
deleted file mode 100644
index 2bb1749..000
--- a/docs/latest/_sources/admin/traffic_ops_using.rst.txt
+++ /dev/null
@@ -1,1079 +0,0 @@
-..
-..
-.. 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.
-..
-
-.. |graph| image:: ../../../traffic_ops/app/public/images/graph.png
-.. |info| image:: ../../../traffic_ops/app/public/images/info.png
-.. |checkmark| image:: ../../../traffic_ops/app/public/images/good.png
-.. |X| image:: ../../../traffic_ops/app/public/images/bad.png
-.. |clock| image:: ../../../traffic_ops/app/public/images/clock-black.png
-
-Using Traffic Ops
-%
-
-
-The Traffic Ops Menu
-
-
-.. image:: 12m.png
-
-The following tabs are available in the menu at the top of the Traffic Ops 
user interface.
-
-.. index::
-  Health Tab
-
-* **Health**
-
-  Information on the health of the system. Hover over this tab to get to the 
following options:
-
-  
+---++
-  | Option|
Description |
-  
+===++
-  | Table View| A real time view into the main performance indicators of 
the CDNs managed by Traffic Control.  |
-  |   | This view is sourced directly by the Traffic Monitor data 
and is updated every 10 seconds. |
-  |   | This is the default screen of Traffic Ops. 
|
-  |   | See :ref:`rl-health-table` for details.
|
-  
+---++
-  | Graph View| A real graphical time view into the main performance 
indicators of the CDNs managed by Traffic Control.|
-  |   | This view is sourced by the Traffic Monitor data and is 
updated every 10 seconds.  |
-  |   | On loading, this screen will show a history of 24 hours of 
data from Traffic Stats |
-  |   | See :ref:`rl-health-graph` for details.
|
-  
+---++
-  | Server Checks | A table showing the results of the periodic check 
extension scripts that are run. See :ref:`rl-server-checks` 
 |
-  
+---++
-  | Daily Summary | A graph displaying the daily peaks of bandwidth, overall 
bytes served per day, and overall bytes served since initial installation |
-  |   | per CDN.   
|
-  
+---++
-
-* **Delivery Services**
-
-  The main Delivery Service table. This is where you Create/Read/Update/Delete 
Delivery Services of all types. Hover over to get the following sub option:
-
-  +-+--+
-  |Option   | Description  |
-  +=+==+
-  | Federations | Add/Edit/Delete Federation Mappings. |
-  +-+-

[21/51] [partial] incubator-trafficcontrol-website git commit: refreshes docs to latest from master

2017-07-19 Thread mitchell852
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol-website/blob/5521f214/docs/latest/_sources/development/traffic_ops_api/v12/phys_location.rst.txt
--
diff --git 
a/docs/latest/_sources/development/traffic_ops_api/v12/phys_location.rst.txt 
b/docs/latest/_sources/development/traffic_ops_api/v12/phys_location.rst.txt
deleted file mode 100644
index 67359e5..000
--- a/docs/latest/_sources/development/traffic_ops_api/v12/phys_location.rst.txt
+++ /dev/null
@@ -1,456 +0,0 @@
-.. 
-.. 
-.. 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.
-.. 
-
-.. _to-api-v12-phys-loc:
-
-Physical Location
-=
-
-.. _to-api-v12-phys-loc-route:
-
-/api/1.2/phys_locations
-+++
-
-**GET /api/1.2/phys_locations**
-
-  Authentication Required: Yes
-
-  Role(s) Required: None
-
-  **Request Query Parameters**
-
-  +--+--+-+
-  |   Name   | Required |Description  |
-  +==+==+=+
-  |  ``region``  | no   | Filter by Region ID.|
-  +--+--+-+
-
-  **Response Properties**
-
-  
+--+++
-  | Parameter| Type   | Description
|
-  
+==+++
-  |``address``   | string |
|
-  
+--+++
-  |``city``  | string |
|
-  
+--+++
-  |``comments``  | string |
|
-  
+--+++
-  |``email`` | string |
|
-  
+--+++
-  |``id``| string |
|
-  
+--+++
-  |``lastUpdated``   | string |
|
-  
+--+++
-  |``name``  | string |
|
-  
+--+++
-  |``phone`` | string |
|
-  
+--+++
-  |``poc``   | string |
|
-  
+--+++
-  |``region``| string |
|
-  
+--+++
-  |``regionId``  | string |
|
-  
+--+++
-  |``shortName`` | string |
|
-  
+--+++
-  |``state`` | string |
|
-  
+--+++
-  |``zip``   | string |
|
-  
+--+++
-
-  **Response Example** ::
-
-{
- "response": [
-{
-   "region": "Mile High",
-   "region": "4",
-   "poc": "Jane Doe",
-   "lastUpdated": "2014-10-02 08:22:43",
-   "name": "Albuquerque",
-   "comments": "Albuquerque",
-   "phone": "(123) 555-",
-   "state": "NM",
-   "email": "jane@email.com",
-   "city": "Albuquerque",
-   "zip": "87107"

<    1   2   3   4   5   6   7   8   9   10   >