You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2017/04/18 16:32:20 UTC

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

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master f9990769b -> 23e673006


This closes #478


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

Branch: refs/heads/master
Commit: 23e6730067d6f1e2883721f16721ab96721f05e2
Parents: c0f4254
Author: Dewayne Richardson <de...@apache.org>
Authored: Tue Apr 18 10:32:12 2017 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Tue Apr 18 10:32:12 2017 -0600

----------------------------------------------------------------------

----------------------------------------------------------------------



[2/2] incubator-trafficcontrol git commit: cleans up trafficopsroutes file - reorganizes, adds parameter constraints where necessary, additional comments, etc.

Posted by de...@apache.org.
cleans up trafficopsroutes file - reorganizes, adds parameter constraints where necessary, additional comments, etc.


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

Branch: refs/heads/master
Commit: c0f42544ea500ddd1acda881b1c86da864dfac64
Parents: f999076
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Tue Apr 18 09:33:32 2017 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Tue Apr 18 10:32:12 2017 -0600

----------------------------------------------------------------------
 .../development/traffic_ops_api/v12/user.rst    |   4 +-
 traffic_ops/app/lib/API/Asn.pm                  |  21 ---
 traffic_ops/app/lib/API/Parameter.pm            |  54 +++---
 traffic_ops/app/lib/TrafficOpsRoutes.pm         | 163 ++++++++++---------
 4 files changed, 111 insertions(+), 131 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c0f42544/docs/source/development/traffic_ops_api/v12/user.rst
----------------------------------------------------------------------
diff --git a/docs/source/development/traffic_ops_api/v12/user.rst b/docs/source/development/traffic_ops_api/v12/user.rst
index 281ce3e..36e08a7 100644
--- a/docs/source/development/traffic_ops_api/v12/user.rst
+++ b/docs/source/development/traffic_ops_api/v12/user.rst
@@ -446,7 +446,7 @@ Users
 |
 
 
-**GET /api/1.2/user/current.json**
+**GET /api/1.2/user/current**
 
   Retrieves the profile for the authenticated user.
 
@@ -524,7 +524,7 @@ Users
 
 |
   
-**POST /api/1.2/user/current/update**
+**PUT /api/1.2/user/current**
 
   Updates the date for the authenticated user.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c0f42544/traffic_ops/app/lib/API/Asn.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Asn.pm b/traffic_ops/app/lib/API/Asn.pm
index 0880222..a271a96 100644
--- a/traffic_ops/app/lib/API/Asn.pm
+++ b/traffic_ops/app/lib/API/Asn.pm
@@ -179,25 +179,4 @@ sub delete {
 		return $self->alert( "ASN delete failed." );
 	}
 }
-
-
-
-# Index
-sub v11_index {
-	my $self = shift;
-	my @data;
-	my $orderby = $self->param('orderby') || "asn";
-	my $rs_data = $self->db->resultset("Asn")->search( undef, { prefetch => [ { 'cachegroup' => undef } ], order_by => "me." . $orderby } );
-	while ( my $row = $rs_data->next ) {
-		push(
-			@data, {
-				"id"          => $row->id,
-				"asn"         => $row->asn,
-				"cachegroup"  => $row->cachegroup->name,
-				"lastUpdated" => $row->last_updated,
-			}
-		);
-	}
-	$self->success( { "asns" => \@data } );
-}
 1;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c0f42544/traffic_ops/app/lib/API/Parameter.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Parameter.pm b/traffic_ops/app/lib/API/Parameter.pm
index c9019c3..daa76b3 100644
--- a/traffic_ops/app/lib/API/Parameter.pm
+++ b/traffic_ops/app/lib/API/Parameter.pm
@@ -48,6 +48,32 @@ sub index {
 	$self->success( \@data );
 }
 
+sub show {
+    my $self = shift;
+    my $id     = $self->param('id');
+
+    my $find = $self->db->resultset('Parameter')->find({ id => $id } );
+    if ( !defined($find) ) {
+        return $self->not_found("parameter [id:".$id."] does not exist.");
+    }
+    if ( $find->secure != 0 && !&is_admin($self)) {
+        return $self->forbidden("You must be an admin to perform this operation!");
+    }
+
+    my @data = ();
+    push(
+        @data, {
+            "id"          => $find->id,
+            "name"        => $find->name,
+            "configFile"  => $find->config_file,
+            "value"       => $find->value,
+            "secure"      => \$find->secure,
+            "lastUpdated" => $find->last_updated
+        }
+    );
+    $self->success( \@data );
+}
+
 sub get_profile_params {
 	my $self         = shift;
 	my $profile_id   = $self->param('id');
@@ -199,33 +225,7 @@ sub create {
     return $self->success($response, "Create ". scalar(@new_parameters) . " parameters successfully.");
 }
 
-sub get {
-    my $self = shift;
-    my $id     = $self->param('id');
-
-    my $find = $self->db->resultset('Parameter')->find({ id => $id } );
-    if ( !defined($find) ) {
-        return $self->not_found("parameter [id:".$id."] does not exist.");
-    }
-    if ( $find->secure != 0 && !&is_admin($self)) {
-        return $self->forbidden("You must be an admin to perform this operation!");
-    }
-
-	my @data = ();
-	push(
-		@data, {
-			"id"          => $find->id,
-			"name"        => $find->name,
-			"configFile"  => $find->config_file,
-			"value"       => $find->value,
-			"secure"      => \$find->secure,
-			"lastUpdated" => $find->last_updated
-		}
-	);
-	$self->success( \@data );
-}
-
-sub edit {
+sub update {
     my $self = shift;
     my $id     = $self->param('id');
     my $params = $self->req->json;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c0f42544/traffic_ops/app/lib/TrafficOpsRoutes.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm b/traffic_ops/app/lib/TrafficOpsRoutes.pm
index c873da8..05dbd1b 100644
--- a/traffic_ops/app/lib/TrafficOpsRoutes.pm
+++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm
@@ -377,12 +377,11 @@ sub api_routes {
 	my $namespace = shift;
 
 	# -- ASNS (CRANS)
-	$r->get("/api/1.1/asns")->over( authenticated => 1 )->to( 'Asn#v11_index', namespace => $namespace );
-	$r->get("/api/1.2/asns")->over( authenticated => 1 )->to( 'Asn#index',     namespace => $namespace );
-	$r->get( "/api/1.2/asns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Asn#show', namespace => $namespace );
+	$r->get("/api/$version/asns")->over( authenticated => 1 )->to( 'Asn#index',     namespace => $namespace );
+	$r->get("/api/$version/asns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Asn#show', namespace => $namespace );
 	$r->post("/api/$version/asns")->over( authenticated => 1 )->to( 'Asn#create', namespace => $namespace );
-	$r->put("/api/$version/asns/:id")->over( authenticated => 1 )->to( 'Asn#update', namespace => $namespace );
-	$r->delete("/api/$version/asns/:id")->over( authenticated => 1 )->to( 'Asn#delete', namespace => $namespace );
+	$r->put("/api/$version/asns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Asn#update', namespace => $namespace );
+	$r->delete("/api/$version/asns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Asn#delete', namespace => $namespace );
 
 	# -- CACHEGROUPS
 	# -- CACHEGROUPS: CRUD
@@ -390,12 +389,10 @@ sub api_routes {
 	# -- query parameter options ?orderby=key&keys=name (where key is the database column)
 	$r->get("/api/$version/cachegroups")->over( authenticated => 1 )->to( 'Cachegroup#index', namespace => $namespace );
 	$r->get("/api/$version/cachegroups/trimmed")->over( authenticated => 1 )->to( 'Cachegroup#index_trimmed', namespace => $namespace );
-	$r->get( "/api/$version/cachegroups/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cachegroup#show', namespace => $namespace );
+	$r->get("/api/$version/cachegroups/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cachegroup#show', namespace => $namespace );
 	$r->post("/api/$version/cachegroups")->over( authenticated => 1 )->to( 'Cachegroup#create', namespace => $namespace );
-	$r->put("/api/$version/cachegroups/:id")->over( authenticated => 1 )->to( 'Cachegroup#update', namespace => $namespace );
-	$r->delete("/api/$version/cachegroups/:id")->over( authenticated => 1 )->to( 'Cachegroup#delete', namespace => $namespace );
-
-	$r->get( "/api/$version/cachegroups/:id/parameters")->over( authenticated => 1 )->to( 'Parameter#get_cachegroup_params', namespace => $namespace );
+	$r->put("/api/$version/cachegroups/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cachegroup#update', namespace => $namespace );
+	$r->delete("/api/$version/cachegroups/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cachegroup#delete', namespace => $namespace );
 
 	# alternate cachegroup routes
 	$r->get("/api/$version/cachegroups/list")->over( authenticated => 1 )->to( 'Cachegroup2#index', namespace => $namespace );
@@ -404,23 +401,23 @@ sub api_routes {
 	$r->delete("/api/$version/cachegroups/:id/delete")->over( authenticated => 1 )->to( 'Cachegroup2#delete', namespace => $namespace );
 
 	# -- CACHEGROUPS: ASSIGN DELIVERYSERVICES
-	$r->post("/api/$version/cachegroups/:id/deliveryservices")->over( authenticated => 1 )
+	$r->post("/api/$version/cachegroups/:id/deliveryservices" => [ id => qr/\d+/ ] )->over( authenticated => 1 )
 		->to( 'DeliveryServiceServer#assign_ds_to_cachegroup', namespace => $namespace );
 
-	# -- CACHEGROUPS: QUEUE UPDATES
-	$r->post("/api/$version/cachegroups/:id/queue_update")->over( authenticated => 1 )->to( 'Cachegroup#postupdatequeue', namespace => $namespace );
+	# -- CACHEGROUPS: QUEUE/DEQUEUE CACHE GROUP SERVER UPDATES
+	$r->post("/api/$version/cachegroups/:id/queue_update" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cachegroup#postupdatequeue', namespace => $namespace );
 
 	# -- CDNS
 	# -- CDNS: CRUD
 	$r->get("/api/$version/cdns")->over( authenticated => 1 )->to( 'Cdn#index', namespace => $namespace );
-	$r->get( "/api/$version/cdns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cdn#show', namespace => $namespace );
+	$r->get("/api/$version/cdns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cdn#show', namespace => $namespace );
 	$r->get("/api/$version/cdns/name/:name")->over( authenticated => 1 )->to( 'Cdn#name', namespace => $namespace );
 	$r->post("/api/$version/cdns")->over( authenticated => 1 )->to( 'Cdn#create', namespace => $namespace );
-	$r->put("/api/$version/cdns/:id")->over( authenticated => 1 )->to( 'Cdn#update', namespace => $namespace );
-	$r->delete("/api/$version/cdns/:id")->over( authenticated => 1 )->to( 'Cdn#delete', namespace => $namespace );
+	$r->put("/api/$version/cdns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cdn#update', namespace => $namespace );
+	$r->delete("/api/$version/cdns/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cdn#delete', namespace => $namespace );
 
-	# -- CDNS: QUEUE UPDATES
-	$r->post("/api/$version/cdns/:id/queue_update")->over( authenticated => 1 )->to( 'Cdn#queue_updates', namespace => $namespace );
+	# -- CDNS: QUEUE/DEQUEUE CDN SERVER UPDATES
+	$r->post("/api/$version/cdns/:id/queue_update" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Cdn#queue_updates', namespace => $namespace );
 
 	# -- CDNS: HEALTH
 	$r->get("/api/$version/cdns/health")->over( authenticated => 1 )->to( 'Cdn#health', namespace => $namespace );
@@ -482,11 +479,18 @@ sub api_routes {
 	$r->get("/api/$version/deliveryservices")->over( authenticated => 1 )->to( 'Deliveryservice#index', namespace => $namespace );
 	$r->get( "/api/$version/deliveryservices/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#show', namespace => $namespace );
 	$r->post("/api/$version/deliveryservices")->over( authenticated => 1 )->to( 'Deliveryservice#create', namespace => $namespace );
-	$r->put("/api/$version/deliveryservices/:id")->over( authenticated => 1 )->to( 'Deliveryservice#update', namespace => $namespace );
-	$r->delete("/api/$version/deliveryservices/:id")->over( authenticated => 1 )->to( 'Deliveryservice#delete', namespace => $namespace );
+	$r->put("/api/$version/deliveryservices/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#update', namespace => $namespace );
+	$r->delete("/api/$version/deliveryservices/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#delete', namespace => $namespace );
 
-	# get all edge servers associated with a delivery service (from deliveryservice_server table)
-	$r->get( "/api/$version/deliveryservices/:id/servers")->over( authenticated => 1 )->to( 'Server#get_edge_servers_by_dsid', namespace => $namespace );
+	# get all delivery services associated with a server (from deliveryservice_server table)
+	$r->get( "/api/$version/servers/:id/deliveryservices" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#get_deliveryservices_by_serverId', namespace => $namespace );
+
+	# get all deliveryservices assigned to a user (from deliveryservice_tmuser table)
+	$r->get( "/api/$version/users/:id/deliveryservices" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#get_deliveryservices_by_userId', namespace => $namespace );
+
+	# get all deliveryservices available (not assigned) to a user
+	$r->get("/api/$version/user/:id/deliveryservices/available" => [ id => qr/\d+/ ] )->over( authenticated => 1 )
+		->to( 'User#get_available_deliveryservices', namespace => $namespace );
 
 	# alternate deliveryservice routes
 	$r->get("/api/$version/deliveryservices/list")->over( authenticated => 1 )->to( 'Deliveryservice2#delivery_services', namespace => $namespace );
@@ -498,16 +502,16 @@ sub api_routes {
 		->to( 'Deliveryservice2#assign_servers', namespace => $namespace );
 
 	# -- DELIVERYSERVICES: HEALTH
-	$r->get("/api/$version/deliveryservices/:id/health")->over( authenticated => 1 )->to( 'Deliveryservice#health', namespace => $namespace );
+	$r->get("/api/$version/deliveryservices/:id/health" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#health', namespace => $namespace );
 
 	# -- DELIVERYSERVICES: CAPACITY
-	$r->get("/api/$version/deliveryservices/:id/capacity")->over( authenticated => 1 )->to( 'Deliveryservice#capacity', namespace => $namespace );
+	$r->get("/api/$version/deliveryservices/:id/capacity" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#capacity', namespace => $namespace );
 
 	# -- DELIVERYSERVICES: ROUTING
-	$r->get("/api/$version/deliveryservices/:id/routing")->over( authenticated => 1 )->to( 'Deliveryservice#routing', namespace => $namespace );
+	$r->get("/api/$version/deliveryservices/:id/routing" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#routing', namespace => $namespace );
 
 	# -- DELIVERYSERVICES: STATE
-	$r->get("/api/$version/deliveryservices/:id/state")->over( authenticated => 1 )->to( 'Deliveryservice#state', namespace => $namespace );
+	$r->get("/api/$version/deliveryservices/:id/state" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Deliveryservice#state', namespace => $namespace );
 
 	# -- DELIVERYSERVICES: REQUEST NEW DELIVERY SERVICE
 	$r->post("/api/$version/deliveryservices/request")->over( authenticated => 1 )->to( 'Deliveryservice#request', namespace => $namespace );
@@ -544,11 +548,11 @@ sub api_routes {
 
 	# -- DELIVERY SERVICE: REGEXES
 	$r->get("/api/$version/deliveryservices_regexes")->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#all', namespace => $namespace );
-	$r->get("/api/$version/deliveryservices/:dsId/regexes")->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#index', namespace => $namespace );
-	$r->get("/api/$version/deliveryservices/:dsId/regexes/:id")->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#show', namespace => $namespace );
-	$r->post("/api/$version/deliveryservices/:dsId/regexes")->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#create', namespace => $namespace );
-	$r->put("/api/$version/deliveryservices/:dsId/regexes/:id")->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#update', namespace => $namespace );
-	$r->delete("/api/$version/deliveryservices/:dsId/regexes/:id")->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#delete', namespace => $namespace );
+	$r->get("/api/$version/deliveryservices/:dsId/regexes" => [ dsId => qr/\d+/ ] )->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#index', namespace => $namespace );
+	$r->get("/api/$version/deliveryservices/:dsId/regexes/:id" => [ dsId => qr/\d+/, id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#show', namespace => $namespace );
+	$r->post("/api/$version/deliveryservices/:dsId/regexes" => [ dsId => qr/\d+/ ] )->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#create', namespace => $namespace );
+	$r->put("/api/$version/deliveryservices/:dsId/regexes/:id" => [ dsId => qr/\d+/, id => qr/\d+/ ])->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#update', namespace => $namespace );
+	$r->delete("/api/$version/deliveryservices/:dsId/regexes/:id" => [ dsId => qr/\d+/, id => qr/\d+/ ])->over( authenticated => 1 )->to( 'DeliveryServiceRegexes#delete', namespace => $namespace );
 
 	# -- DELIVERY SERVICE: MATCHES
 	$r->get("/api/$version/deliveryservice_matches")->over( authenticated => 1 )->to( 'DeliveryServiceMatches#index', namespace => $namespace );
@@ -557,57 +561,51 @@ sub api_routes {
 	# Supports ?orderby=key
 	$r->get("/api/$version/deliveryserviceserver")->over( authenticated => 1 )->to( 'DeliveryServiceServer#index', namespace => $namespace );
 
-	# -- TENANTS
-	$r->get("/api/$version/tenants")->over( authenticated => 1 )->to( 'Tenant#index', namespace => $namespace );
-	$r->get( "/api/$version/tenants/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Tenant#show', namespace => $namespace );
-	$r->put("/api/$version/tenants/:id")->over( authenticated => 1 )->to( 'Tenant#update', namespace => $namespace );
-	$r->post("/api/$version/tenants")->over( authenticated => 1 )->to( 'Tenant#create', namespace => $namespace );
-	$r->delete("/api/$version/tenants/:id")->over( authenticated => 1 )->to( 'Tenant#delete', namespace => $namespace );
-
 	# -- DIVISIONS
 	$r->get("/api/$version/divisions")->over( authenticated => 1 )->to( 'Division#index', namespace => $namespace );
 	$r->get( "/api/$version/divisions/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Division#show', namespace => $namespace );
 	$r->get( "/api/$version/divisions/name/:name")->over( authenticated => 1 )->to( 'Division#index_by_name', namespace => $namespace );
-	$r->put("/api/$version/divisions/:id")->over( authenticated => 1 )->to( 'Division#update', namespace => $namespace );
+	$r->put("/api/$version/divisions/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Division#update', namespace => $namespace );
 	$r->post("/api/$version/divisions")->over( authenticated => 1 )->to( 'Division#create', namespace => $namespace );
-	$r->delete("/api/$version/divisions/:id")->over( authenticated => 1 )->to( 'Division#delete', namespace => $namespace );
+	$r->delete("/api/$version/divisions/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Division#delete', namespace => $namespace );
 	$r->delete("/api/$version/divisions/name/:name")->over( authenticated => 1 )->to( 'Division#delete_by_name', namespace => $namespace );
 
 	# -- FEDERATIONS
 	$r->get("/internal/api/$version/federations")->over( authenticated => 1 )->to( 'Federation#index', namespace => $namespace );
 	$r->get("/api/$version/federations")->over( authenticated => 1 )->to( 'Federation#external_index', namespace => $namespace );
 	$r->post("/api/$version/federations")->over( authenticated => 1 )->to( 'Federation#add', namespace => $namespace );
-	$r->delete("/api/$version/federations")->over( authenticated => 1 )->to( 'Federation#delete', namespace => $namespace );
 	$r->put("/api/$version/federations")->over( authenticated => 1 )->to( 'Federation#update', namespace => $namespace );
+	$r->delete("/api/$version/federations")->over( authenticated => 1 )->to( 'Federation#delete', namespace => $namespace );
 
 	# -- HARDWARE INFO
 	# Supports: ?orderby=key
 	$r->get("/api/$version/hwinfo/dtdata")->over( authenticated => 1 )->to( 'HwInfo#data', namespace => $namespace );
 	$r->get("/api/$version/hwinfo")->over( authenticated => 1 )->to( 'HwInfo#index', namespace => $namespace );
 
-	# -- JOBS
+	# -- JOBS (CURRENTLY LIMITED TO INVALIDATE CONTENT (PURGE) JOBS)
 	$r->get("/api/$version/jobs")->over( authenticated => 1 )->to( 'Job#index', namespace => $namespace );
-	$r->get("/api/$version/jobs/:id")->over( authenticated => 1 )->to( 'Job#show', namespace => $namespace );
+	$r->get("/api/$version/jobs/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Job#show', namespace => $namespace );
+
+	# -- JOBS: CURRENT USER (CURRENTLY LIMITED TO INVALIDATE CONTENT (PURGE) JOBS)
+	$r->get("/api/$version/user/current/jobs")->over( authenticated => 1 )->to( 'Job#get_current_user_jobs', namespace => $namespace );
+	$r->post("/api/$version/user/current/jobs")->over( authenticated => 1 )->to( 'Job#create_current_user_job', namespace => $namespace );
 
 	# -- PARAMETERS
 	# Supports ?orderby=key
 	$r->get("/api/$version/parameters")->over( authenticated => 1 )->to( 'Parameter#index', namespace => $namespace );
-	$r->get( "/api/$version/parameters/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Parameter#get', namespace => $namespace );
+	$r->get( "/api/$version/parameters/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Parameter#show', namespace => $namespace );
 	$r->post("/api/$version/parameters")->over( authenticated => 1 )->to( 'Parameter#create', namespace => $namespace );
-	$r->put("/api/$version/parameters/:id")->over( authenticated => 1 )->to( 'Parameter#edit', namespace => $namespace );
-	$r->delete("/api/$version/parameters/:id")->over( authenticated => 1 )->to( 'Parameter#delete', namespace => $namespace );
+	$r->put("/api/$version/parameters/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Parameter#update', namespace => $namespace );
+	$r->delete("/api/$version/parameters/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Parameter#delete', namespace => $namespace );
 	$r->post("/api/$version/parameters/validate")->over( authenticated => 1 )->to( 'Parameter#validate', namespace => $namespace );
 
-	# get all profiles associated with a parameter (from profile_parameter table)
-	$r->get( "/api/$version/parameters/:id/profiles")->over( authenticated => 1 )->to( 'Profile#get_profiles_by_paramId', namespace => $namespace );
-
 	# parameters for a profile
 	$r->get( "/api/$version/profiles/:id/parameters" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Parameter#get_profile_params', namespace => $namespace );
 	$r->get("/api/$version/profiles/name/:name/parameters")->over( authenticated => 1 )->to( 'Parameter#get_profile_params', namespace => $namespace );
 	$r->get( "/api/$version/parameters/profile/:name")->over( authenticated => 1 )->to( 'Parameter#get_profile_params', namespace => $namespace );
 	$r->post("/api/$version/profiles/name/:name/parameters")->over( authenticated => 1 )
 		->to( 'ProfileParameter#create_param_for_profile_name', namespace => $namespace );
-	$r->post("/api/$version/profiles/:id/parameters")->over( authenticated => 1 )
+	$r->post("/api/$version/profiles/:id/parameters" => [ id => qr/\d+/ ] )->over( authenticated => 1 )
 		->to( 'ProfileParameter#create_param_for_profile_id', namespace => $namespace );
 
 	# -- PARAMETERS: PROFILE PARAMETERS
@@ -617,6 +615,7 @@ sub api_routes {
 		->to( 'ProfileParameter#delete', namespace => $namespace );
 
 	# -- PARAMETERS: CACHEGROUP PARAMETERS
+	$r->get("/api/$version/cachegroups/:id/parameters" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Parameter#get_cachegroup_params', namespace => $namespace );
 	$r->get("/api/$version/cachegroup/:parameter_id/parameter")->over( authenticated => 1 )->to( 'Cachegroup#by_parameter_id', namespace => $namespace );
 	$r->get("/api/$version/cachegroupparameters")->over( authenticated => 1 )->to( 'CachegroupParameter#index', namespace => $namespace );
 	$r->get("/api/$version/cachegroups/:parameter_id/parameter/available")->over( authenticated => 1 )
@@ -628,8 +627,9 @@ sub api_routes {
 	$r->get("/api/$version/phys_locations/trimmed")->over( authenticated => 1 )->to( 'PhysLocation#index_trimmed', namespace => $namespace );
 	$r->get( "/api/$version/phys_locations/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'PhysLocation#show', namespace => $namespace );
 	$r->post("/api/$version/phys_locations")->over( authenticated => 1 )->to( 'PhysLocation#create', namespace => $namespace );
-	$r->put("/api/$version/phys_locations/:id")->over( authenticated => 1 )->to( 'PhysLocation#update', namespace => $namespace );
-	$r->delete("/api/$version/phys_locations/:id")->over( authenticated => 1 )->to( 'PhysLocation#delete', namespace => $namespace );
+	$r->post("/api/$version/regions/:region_name/phys_locations")->over( authenticated => 1 )->to( 'PhysLocation#create_for_region', namespace => $namespace );
+	$r->put("/api/$version/phys_locations/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'PhysLocation#update', namespace => $namespace );
+	$r->delete("/api/$version/phys_locations/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'PhysLocation#delete', namespace => $namespace );
 
 	# -- PROFILES
 	# -- PROFILES: CRUD
@@ -638,24 +638,26 @@ sub api_routes {
 	$r->get("/api/$version/profiles/trimmed")->over( authenticated => 1 )->to( 'Profile#index_trimmed', namespace => $namespace );
 	$r->get( "/api/$version/profiles/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Profile#show', namespace => $namespace );
 	$r->post("/api/$version/profiles")->over( authenticated => 1 )->to( 'Profile#create', namespace => $namespace );
-	$r->put("/api/$version/profiles/:id")->over( authenticated => 1 )->to( 'Profile#update', namespace => $namespace );
-	$r->delete("/api/$version/profiles/:id")->over( authenticated => 1 )->to( 'Profile#delete', namespace => $namespace );
+	$r->put("/api/$version/profiles/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Profile#update', namespace => $namespace );
+	$r->delete("/api/$version/profiles/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Profile#delete', namespace => $namespace );
 
 	# -- PROFILES: COPY
 	$r->post("/api/$version/profiles/name/:profile_name/copy/:profile_copy_from")->over( authenticated => 1 )
 		->to( 'Profile#copy', namespace => $namespace );
 
+	# get all profiles associated with a parameter (from profile_parameter table)
+	$r->get( "/api/$version/parameters/:id/profiles" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Profile#get_profiles_by_paramId', namespace => $namespace );
+
 	# -- REGIONS
 	# Supports ?orderby=key
 	$r->get("/api/$version/regions")->over( authenticated => 1 )->to( 'Region#index', namespace => $namespace );
 	$r->get( "/api/$version/regions/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Region#show', namespace => $namespace );
 	$r->get( "/api/$version/regions/name/:name" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Region#index_by_name', namespace => $namespace );
-	$r->put("/api/$version/regions/:id")->over( authenticated => 1 )->to( 'Region#update', namespace => $namespace );
+	$r->put("/api/$version/regions/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Region#update', namespace => $namespace );
 	$r->post("/api/$version/regions")->over( authenticated => 1 )->to( 'Region#create', namespace => $namespace );
 	$r->post("/api/$version/divisions/:division_name/regions")->over( authenticated => 1 )->to( 'Region#create_for_division', namespace => $namespace );
-	$r->delete("/api/$version/regions/:id")->over( authenticated => 1 )->to( 'Region#delete', namespace => $namespace );
+	$r->delete("/api/$version/regions/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Region#delete', namespace => $namespace );
 	$r->delete("/api/$version/regions/name/:name")->over( authenticated => 1 )->to( 'Region#delete_by_name', namespace => $namespace );
-	$r->post("/api/$version/regions/:region_name/phys_locations")->over( authenticated => 1 )->to( 'PhysLocation#create_for_region', namespace => $namespace );
 
 	# -- ROLES
 	# Supports ?orderby=key
@@ -666,13 +668,13 @@ sub api_routes {
 	$r->get("/api/$version/servers")->over( authenticated => 1 )->to( 'Server#index', namespace => $namespace );
 	$r->get( "/api/$version/servers/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Server#show', namespace => $namespace );
 	$r->post("/api/$version/servers")->over( authenticated => 1 )->to( 'Server#create', namespace => $namespace );
-	$r->put("/api/$version/servers/:id")->over( authenticated => 1 )->to( 'Server#update', namespace => $namespace );
-	$r->delete("/api/$version/servers/:id")->over( authenticated => 1 )->to( 'Server#delete', namespace => $namespace );
+	$r->put("/api/$version/servers/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Server#update', namespace => $namespace );
+	$r->delete("/api/$version/servers/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Server#delete', namespace => $namespace );
 
-	# get all delivery services associated with a server (from deliveryservice_server table)
-	$r->get( "/api/$version/servers/:id/deliveryservices")->over( authenticated => 1 )->to( 'Deliveryservice#get_deliveryservices_by_serverId', namespace => $namespace );
+	# get all edge servers associated with a delivery service (from deliveryservice_server table)
+	$r->get( "/api/$version/deliveryservices/:id/servers" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Server#get_edge_servers_by_dsid', namespace => $namespace );
 
-	# alernate server routes
+	# alternate server routes
 	$r->post("/api/$version/servers/create")->over( authenticated => 1 )->to( 'Server2#create', namespace => $namespace );
 	$r->put("/api/$version/servers/:id/update")->over( authenticated => 1 )->to( 'Server2#update', namespace => $namespace );
 
@@ -683,8 +685,8 @@ sub api_routes {
 	# -- SERVERS: TOTALS
 	$r->get("/api/$version/servers/totals")->over( authenticated => 1 )->to( 'Server#totals', namespace => $namespace );
 
-	# -- SERVERS: QUEUE UPDATES
-	$r->post("/api/$version/servers/:id/queue_update")->over( authenticated => 1 )->to( 'Server#postupdatequeue', namespace => $namespace );
+	# -- SERVERS: QUEUE/DEQUEUE SERVER UPDATES
+	$r->post("/api/$version/servers/:id/queue_update" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Server#postupdatequeue', namespace => $namespace );
 
 	# -- SERVERS: SERVER CHECKS
 	$r->get("/api/$version/servers/checks")->over( authenticated => 1 )->to( 'ServerCheck#read', namespace => $namespace );
@@ -699,9 +701,9 @@ sub api_routes {
 	# Supports ?orderby=key
 	$r->get("/api/$version/statuses")->over( authenticated => 1 )->to( 'Status#index', namespace => $namespace );
 	$r->get( "/api/$version/statuses/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Status#show', namespace => $namespace );
-	$r->put("/api/$version/statuses/:id")->over( authenticated => 1 )->to( 'Status#update', namespace => $namespace );
+	$r->put("/api/$version/statuses/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Status#update', namespace => $namespace );
 	$r->post("/api/$version/statuses")->over( authenticated => 1 )->to( 'Status#create', namespace => $namespace );
-	$r->delete("/api/$version/statuses/:id")->over( authenticated => 1 )->to( 'Status#delete', namespace => $namespace );
+	$r->delete("/api/$version/statuses/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Status#delete', namespace => $namespace );
 
 	# -- STATIC DNS ENTRIES
 	$r->get("/api/$version/staticdnsentries")->over( authenticated => 1 )->to( 'StaticDnsEntry#index', namespace => $namespace );
@@ -709,32 +711,39 @@ sub api_routes {
 	# -- SYSTEM INFO
 	$r->get("/api/$version/system/info")->over( authenticated => 1 )->to( 'System#get_info', namespace => $namespace );
 
+	# -- TENANTS
+	$r->get("/api/$version/tenants")->over( authenticated => 1 )->to( 'Tenant#index', namespace => $namespace );
+	$r->get( "/api/$version/tenants/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Tenant#show', namespace => $namespace );
+	$r->put("/api/$version/tenants/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Tenant#update', namespace => $namespace );
+	$r->post("/api/$version/tenants")->over( authenticated => 1 )->to( 'Tenant#create', namespace => $namespace );
+	$r->delete("/api/$version/tenants/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Tenant#delete', namespace => $namespace );
+
 	# -- TYPES
 	# Supports ?orderby=key
 	$r->get("/api/$version/types")->over( authenticated => 1 )->to( 'Types#index', namespace => $namespace );
 	$r->get("/api/$version/types/trimmed")->over( authenticated => 1 )->to( 'Types#index_trimmed', namespace => $namespace );
 	$r->get( "/api/$version/types/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Types#show', namespace => $namespace );
 	$r->post("/api/$version/types")->over( authenticated => 1 )->to( 'Types#create', namespace => $namespace );
-	$r->put("/api/$version/types/:id")->over( authenticated => 1 )->to( 'Types#update', namespace => $namespace );
-	$r->delete("/api/$version/types/:id")->over( authenticated => 1 )->to( 'Types#delete', namespace => $namespace );
+	$r->put("/api/$version/types/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Types#update', namespace => $namespace );
+	$r->delete("/api/$version/types/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'Types#delete', namespace => $namespace );
 
 	# -- USERS
 	$r->get("/api/$version/users")->over( authenticated => 1 )->to( 'User#index', namespace => $namespace );
 	$r->get( "/api/$version/users/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'User#show', namespace => $namespace );
-	$r->put("/api/$version/users/:id")->over( authenticated => 1 )->to( 'User#update', namespace => $namespace );
-
-    # get all deliveryservices assigned to a user (from deliveryservice_tmuser table)
-    $r->get( "/api/$version/users/:id/deliveryservices")->over( authenticated => 1 )->to( 'Deliveryservice#get_deliveryservices_by_userId', namespace => $namespace );
+	$r->put("/api/$version/users/:id" => [ id => qr/\d+/ ] )->over( authenticated => 1 )->to( 'User#update', namespace => $namespace );
 
     # -- USERS: CURRENT USER
 	$r->get("/api/$version/user/current")->over( authenticated => 1 )->to( 'User#current', namespace => $namespace );
+	$r->put("/api/$version/user/current")->over( authenticated => 1 )->to( 'User#update_current', namespace => $namespace );
+
+	# alternate current user routes
 	$r->post("/api/$version/user/current/update")->over( authenticated => 1 )->to( 'User#update_current', namespace => $namespace );
 
 	# -- USERS: LOGIN
 	# login w/ username and password
 	$r->post("/api/$version/user/login")->to( 'User#login', namespace => $namespace );
 
-	# login w/ token
+	# -- USERS: LOGIN W/ TOKEN
 	$r->post("/api/$version/user/login/token")->to( 'User#token_login', namespace => $namespace );
 
 	# -- USERS: LOGOUT
@@ -743,14 +752,6 @@ sub api_routes {
 	# -- USERS: RESET PASSWORD
 	$r->post("/api/$version/user/reset_password")->to( 'User#reset_password', namespace => $namespace );
 
-	# -- USERS: ASSIGNED DELIVERYSERVICES
-	$r->get("/api/$version/user/:id/deliveryservices/available")->over( authenticated => 1 )
-		->to( 'User#get_available_deliveryservices', namespace => $namespace );
-
-	# -- USERS: JOBS
-	$r->get("/api/$version/user/current/jobs")->over( authenticated => 1 )->to( 'Job#get_current_user_jobs', namespace => $namespace );
-	$r->post("/api/$version/user/current/jobs")->over( authenticated => 1 )->to( 'Job#create_current_user_job', namespace => $namespace );
-
 	# -- RIAK
 	# -- RIAK: KEYS
 	#ping riak server