cdnId can be passed in in place of cdn name if desired
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/064b26b0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/064b26b0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/064b26b0 Branch: refs/heads/master Commit: 064b26b051594749582cda87be138af4091136e2 Parents: 96d134a Author: Jeremy Mitchell <mitchell...@gmail.com> Authored: Thu Feb 16 19:30:43 2017 -0700 Committer: Dewayne Richardson <dewr...@apache.org> Committed: Fri Feb 17 08:33:17 2017 -0700 ---------------------------------------------------------------------- docs/source/development/traffic_ops_api/v12/cachegroup.rst | 4 +++- traffic_ops/app/lib/API/Cachegroup.pm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/064b26b0/docs/source/development/traffic_ops_api/v12/cachegroup.rst ---------------------------------------------------------------------- diff --git a/docs/source/development/traffic_ops_api/v12/cachegroup.rst b/docs/source/development/traffic_ops_api/v12/cachegroup.rst index 391c278..bc9f775 100644 --- a/docs/source/development/traffic_ops_api/v12/cachegroup.rst +++ b/docs/source/development/traffic_ops_api/v12/cachegroup.rst @@ -636,7 +636,9 @@ Cache Group +==============+=========+===============================================+ | action | string | queue or dequeue | +--------------+---------+-----------------------------------------------+ - | cdn | string | cdn name | + | cdn | string | cdn name or cdn ID is required | + +--------------+---------+-----------------------------------------------+ + | cdnId | string | cdn ID or cdn name is required | +--------------+---------+-----------------------------------------------+ **Response Properties** http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/064b26b0/traffic_ops/app/lib/API/Cachegroup.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Cachegroup.pm b/traffic_ops/app/lib/API/Cachegroup.pm index fb7e4e1..2a4a359 100644 --- a/traffic_ops/app/lib/API/Cachegroup.pm +++ b/traffic_ops/app/lib/API/Cachegroup.pm @@ -390,7 +390,7 @@ sub postupdatequeue { } my $cdn = $params->{cdn}; - my $cdn_id = $self->db->resultset('Cdn')->search( { name => $cdn } )->get_column('id')->single(); + my $cdn_id = $params->{cdnId} // $self->db->resultset('Cdn')->search( { name => $cdn } )->get_column('id')->single(); if ( !defined($cdn_id) ) { return $self->alert( "cdn " . $cdn . " does not exist." ); }