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/12 15:05:06 UTC

[3/3] incubator-trafficcontrol git commit: adds ability to filter delivery services by profile

adds ability to filter delivery services by profile


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

Branch: refs/heads/master
Commit: 958511e26276e33934ca144f5a46b8566fdc8593
Parents: ab89c76
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Mon Apr 10 20:44:11 2017 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Wed Apr 12 09:04:56 2017 -0600

----------------------------------------------------------------------
 .../traffic_ops_api/v12/deliveryservice.rst         |  2 ++
 traffic_ops/app/lib/API/Deliveryservice.pm          | 16 ++++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/958511e2/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 b1176e2..c157dd8 100644
--- a/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
+++ b/docs/source/development/traffic_ops_api/v12/deliveryservice.rst
@@ -39,6 +39,8 @@ Delivery Service
   +=================+==========+===================================================+
   | ``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).              |

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/958511e2/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 0dd09ed..311a6a5 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -30,18 +30,22 @@ use UI::DeliveryService;
 use Validate::Tiny ':all';
 
 sub index {
-	my $self         = shift;
-	my $orderby      = $self->param('orderby') || "xml_id";
-	my $cdn_id		 = $self->param('cdn');
-	my $type_id 	 = $self->param('type');
-	my $logs_enabled = $self->param('logsEnabled');
-	my $current_user = $self->current_user()->{username};
+	my $self			= shift;
+	my $orderby			= $self->param('orderby') || "xml_id";
+	my $cdn_id			= $self->param('cdn');
+	my $profile_id		= $self->param('profile');
+	my $type_id			= $self->param('type');
+	my $logs_enabled	= $self->param('logsEnabled');
+	my $current_user	= $self->current_user()->{username};
 	my @data;
 
 	my %criteria;
 	if ( defined $cdn_id ) {
 		$criteria{'cdn_id'} = $cdn_id;
 	}
+	if ( defined $profile_id ) {
+		$criteria{'profile'} = $profile_id;
+	}
 	if ( defined $type_id ) {
 		$criteria{'type'} = $type_id;
 	}