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 2016/11/04 20:27:59 UTC

[1/6] incubator-trafficcontrol git commit: changed the response structure of api routes introducted in 1.8 to ease testing. the response is hierarchical now instead of flat. i.e. a region will have a nested division property

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master a8244f733 -> a1ed75564


changed the response structure of api routes introducted in 1.8 to ease testing. the response is hierarchical now instead of flat. i.e. a region will have a nested division property


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

Branch: refs/heads/master
Commit: 64588e7e31c8228420802cb49c641bcced79fa29
Parents: 49da9a8
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Fri Nov 4 12:34:23 2016 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Nov 4 14:25:40 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Asn.pm             |  28 ++---
 traffic_ops/app/lib/API/Cachegroup.pm      | 108 ++++++++----------
 traffic_ops/app/lib/API/Deliveryservice.pm |  78 ++++++-------
 traffic_ops/app/lib/API/PhysLocation.pm    |  32 +++---
 traffic_ops/app/lib/API/Region.pm          |   8 +-
 traffic_ops/app/lib/API/Server.pm          | 146 ++++++++++++------------
 traffic_ops/app/lib/API/User.pm            |  17 +--
 7 files changed, 206 insertions(+), 211 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/64588e7e/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 080099a..958ebf9 100644
--- a/traffic_ops/app/lib/API/Asn.pm
+++ b/traffic_ops/app/lib/API/Asn.pm
@@ -29,12 +29,12 @@ sub index {
 	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 ) {
+		my $cachegroup = { "id" => $row->cachegroup->id, "name" => $row->cachegroup->name };
 		push(
 			@data, {
 				"id"           => $row->id,
 				"asn"          => $row->asn,
-				"cachegroupId" => $row->cachegroup->id,
-				"cachegroup"   => $row->cachegroup->name,
+				"cachegroup"   => $cachegroup,
 				"lastUpdated"  => $row->last_updated
 			}
 		);
@@ -50,12 +50,12 @@ sub show {
 	my $rs_data = $self->db->resultset("Asn")->search( { 'me.id' => $id }, { prefetch => ['cachegroup'] } );
 	my @data = ();
 	while ( my $row = $rs_data->next ) {
+		my $cachegroup = { "id" => $row->cachegroup->id, "name" => $row->cachegroup->name };
 		push(
 			@data, {
 				"id"           => $row->id,
 				"asn"          => $row->asn,
-				"cachegroupId" => $row->cachegroup->id,
-				"cachegroup"   => $row->cachegroup->name,
+				"cachegroup"   => $cachegroup,
 				"lastUpdated"  => $row->last_updated
 			}
 		);
@@ -85,22 +85,23 @@ sub update {
 		return $self->alert("ASN is required.");
 	}
 
-	if ( !defined( $params->{cachegroupId} ) ) {
+	if ( !defined( $params->{cachegroup} ) ) {
 		return $self->alert("Cachegroup is required.");
 	}
 
 	my $values = {
 		asn        => $params->{asn},
-		cachegroup => $params->{cachegroupId}
+		cachegroup => $params->{cachegroup}->{id}
 	};
 
 	my $rs = $asn->update($values);
 	if ( $rs ) {
 		my $response;
+		my $cachegroup = { "id" => $rs->cachegroup->id, "name" => $rs->cachegroup->name };
+
 		$response->{id}           = $rs->id;
 		$response->{asn}          = $rs->asn;
-		$response->{cachegroupId} = $rs->cachegroup->id;
-		$response->{cachegroup}   = $rs->cachegroup->name;
+		$response->{cachegroup}   = $cachegroup;
 		$response->{lastUpdated}  = $rs->last_updated;
 		&log( $self, "Updated ASN name '" . $rs->asn . "' for id: " . $rs->id, "APICHANGE" );
 		return $self->success( $response, "ASN update was successful." );
@@ -123,23 +124,24 @@ sub create {
 		return $self->alert("ASN is required.");
 	}
 
-	if ( !defined($params->{cachegroupId}) ) {
-		return $self->alert("Cachegroup Id is required.");
+	if ( !defined($params->{cachegroup}) ) {
+		return $self->alert("Cachegroup is required.");
 	}
 
 	my $values = {
 		asn 		=> $params->{asn} ,
-		cachegroup 	=> $params->{cachegroupId}
+		cachegroup 	=> $params->{cachegroup}->{id}
 	};
 
 	my $insert = $self->db->resultset('Asn')->create($values);
 	my $rs = $insert->insert();
 	if ($rs) {
 		my $response;
+		my $cachegroup = { "id" => $rs->cachegroup->id, "name" => $rs->cachegroup->name };
+
 		$response->{id}          	= $rs->id;
 		$response->{asn}        	= $rs->asn;
-		$response->{cachegroupId}   = $rs->cachegroup->id;
-		$response->{cachegroup}   	= $rs->cachegroup->name;
+		$response->{cachegroup}   	= $cachegroup;
 		$response->{lastUpdated} 	= $rs->last_updated;
 
 		&log( $self, "Created ASN name '" . $rs->asn . "' for id: " . $rs->id, "APICHANGE" );

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/64588e7e/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 8b4bb61..4a9db04 100644
--- a/traffic_ops/app/lib/API/Cachegroup.pm
+++ b/traffic_ops/app/lib/API/Cachegroup.pm
@@ -41,6 +41,9 @@ sub index {
 
 	my $rs_data = $self->db->resultset("Cachegroup")->search( undef, { prefetch => [ { 'type' => undef, } ], order_by => 'me.' . $orderby } );
 	while ( my $row = $rs_data->next ) {
+		my $parent_cachegroup = ( defined $row->parent_cachegroup_id ) ? { "id" => $row->parent_cachegroup_id, "name" => $idnames{ $row->parent_cachegroup_id } } : undef;
+		my $secondary_parent_cachegroup = ( defined $row->secondary_parent_cachegroup_id ) ? { "id" => $row->secondary_parent_cachegroup_id, "name" => $idnames{ $row->secondary_parent_cachegroup_id } } : undef;
+		my $type = { "id" => $row->type->id, "name" => $row->type->name };
 		push(
 			@data, {
 				"id"                            => $row->id,
@@ -49,14 +52,9 @@ sub index {
 				"latitude"                      => $row->latitude,
 				"longitude"                     => $row->longitude,
 				"lastUpdated"                   => $row->last_updated,
-				"parentCachegroupId"            => $row->parent_cachegroup_id,
-				"parentCachegroupName"          => ( defined $row->parent_cachegroup_id ) ? $idnames{ $row->parent_cachegroup_id } : undef,
-				"secondaryParentCachegroupId"   => $row->secondary_parent_cachegroup_id,
-				"secondaryParentCachegroupName" => ( defined $row->secondary_parent_cachegroup_id )
-				? $idnames{ $row->secondary_parent_cachegroup_id }
-				: undef,
-				"typeId"   => $row->type->id,
-				"typeName" => $row->type->name
+				"parentCachegroup"            	=> $parent_cachegroup,
+				"secondaryParentCachegroup"   	=> $secondary_parent_cachegroup,
+				"type"   						=> $type
 			}
 		);
 	}
@@ -94,6 +92,9 @@ sub show {
 	}
 
 	while ( my $row = $rs_data->next ) {
+		my $parent_cachegroup = ( defined $row->parent_cachegroup_id ) ? { "id" => $row->parent_cachegroup_id, "name" => $idnames{ $row->parent_cachegroup_id } } : undef;
+		my $secondary_parent_cachegroup = ( defined $row->secondary_parent_cachegroup_id ) ? { "id" => $row->secondary_parent_cachegroup_id, "name" => $idnames{ $row->secondary_parent_cachegroup_id } } : undef;
+		my $type = { "id" => $row->type->id, "name" => $row->type->name };
 		push(
 			@data, {
 				"id"                            => $row->id,
@@ -102,14 +103,9 @@ sub show {
 				"latitude"                      => $row->latitude,
 				"longitude"                     => $row->longitude,
 				"lastUpdated"                   => $row->last_updated,
-				"parentCachegroupId"            => $row->parent_cachegroup_id,
-				"parentCachegroupName"          => ( defined $row->parent_cachegroup_id ) ? $idnames{ $row->parent_cachegroup_id } : undef,
-				"secondaryParentCachegroupId"   => $row->secondary_parent_cachegroup_id,
-				"secondaryParentCachegroupName" => ( defined $row->secondary_parent_cachegroup_id )
-				? $idnames{ $row->secondary_parent_cachegroup_id }
-				: undef,
-				"typeId"   => $row->type->id,
-				"typeName" => $row->type->name
+				"parentCachegroup"            	=> $parent_cachegroup,
+				"secondaryParentCachegroup"   	=> $secondary_parent_cachegroup,
+				"type"   						=> $type
 			}
 		);
 	}
@@ -157,9 +153,9 @@ sub update {
 		short_name                     => $params->{shortName},
 		latitude                       => $params->{latitude},
 		longitude                      => $params->{longitude},
-		parent_cachegroup_id           => $params->{parentCachegroupId},
-		secondary_parent_cachegroup_id => $params->{secondaryParentCachegroupId},
-		type                           => $params->{typeId}
+		parent_cachegroup_id           => ( defined $params->{parentCachegroup} ) ? $params->{parentCachegroup}->{id} : undef,
+		secondary_parent_cachegroup_id => ( defined $params->{secondaryParentCachegroup} ) ? $params->{secondaryParentCachegroup}->{id} : undef,
+		type                           => $params->{type}->{id}
 	};
 
 	my $rs = $cachegroup->update($values);
@@ -172,24 +168,19 @@ sub update {
 			$idnames{ $row->id } = $row->name;
 		}
 
-		$response->{id}                 = $rs->id;
-		$response->{name}               = $rs->name;
-		$response->{shortName}          = $rs->short_name;
-		$response->{latitude}           = $rs->latitude;
-		$response->{longitude}          = $rs->longitude;
-		$response->{lastUpdated}        = $rs->last_updated;
-		$response->{parentCachegroupId} = $rs->parent_cachegroup_id;
-		$response->{parentCachegroupName} =
-			( defined $rs->parent_cachegroup_id )
-			? $idnames{ $rs->parent_cachegroup_id }
-			: undef;
-		$response->{secondaryParentCachegroupId} = $rs->secondary_parent_cachegroup_id;
-		$response->{secondaryParentCachegroupName} =
-			( defined $rs->secondary_parent_cachegroup_id )
-			? $idnames{ $rs->secondary_parent_cachegroup_id }
-			: undef;
-		$response->{typeId}   = $rs->type->id;
-		$response->{typeName} = $rs->type->name;
+		my $parent_cachegroup = ( defined $rs->parent_cachegroup_id ) ? { "id" => $rs->parent_cachegroup_id, "name" => $idnames{ $rs->parent_cachegroup_id } } : undef;
+		my $secondary_parent_cachegroup = ( defined $rs->secondary_parent_cachegroup_id ) ? { "id" => $rs->secondary_parent_cachegroup_id, "name" => $idnames{ $rs->secondary_parent_cachegroup_id } } : undef;
+		my $type = { "id" => $rs->type->id, "name" => $rs->type->name };
+
+		$response->{id}                 			= $rs->id;
+		$response->{name}               			= $rs->name;
+		$response->{shortName}          			= $rs->short_name;
+		$response->{latitude}           			= $rs->latitude;
+		$response->{longitude}          			= $rs->longitude;
+		$response->{lastUpdated}        			= $rs->last_updated;
+		$response->{parentCachegroup} 				= $parent_cachegroup;
+		$response->{secondaryParentCachegroup} 		= $secondary_parent_cachegroup;
+		$response->{type}   						= $type;
 
 		&log( $self, "Updated Cachegroup name '" . $rs->name . "' for id: " . $rs->id, "APICHANGE" );
 
@@ -232,9 +223,9 @@ sub create {
 		short_name                     => $params->{shortName},
 		latitude                       => $params->{latitude},
 		longitude                      => $params->{longitude},
-		parent_cachegroup_id           => $params->{parentCachegroupId},
-		secondary_parent_cachegroup_id => $params->{secondaryParentCachegroupId},
-		type                           => $params->{typeId}
+		parent_cachegroup_id           => ( defined $params->{parentCachegroup} ) ? $params->{parentCachegroup}->{id} : undef,
+		secondary_parent_cachegroup_id => ( defined $params->{secondaryParentCachegroup} ) ? $params->{secondaryParentCachegroup}->{id} : undef,
+		type                           => $params->{type}->{id}
 	};
 
 	my $insert = $self->db->resultset('Cachegroup')->create($values);
@@ -248,24 +239,19 @@ sub create {
 			$idnames{ $row->id } = $row->name;
 		}
 
-		$response->{id}                 = $rs->id;
-		$response->{name}               = $rs->name;
-		$response->{shortName}          = $rs->short_name;
-		$response->{latitude}           = $rs->latitude;
-		$response->{longitude}          = $rs->longitude;
-		$response->{lastUpdated}        = $rs->last_updated;
-		$response->{parentCachegroupId} = $rs->parent_cachegroup_id;
-		$response->{parentCachegroupName} =
-			( defined $rs->parent_cachegroup_id )
-			? $idnames{ $rs->parent_cachegroup_id }
-			: undef;
-		$response->{secondaryParentCachegroupId} = $rs->secondary_parent_cachegroup_id;
-		$response->{secondaryParentCachegroupName} =
-			( defined $rs->secondary_parent_cachegroup_id )
-			? $idnames{ $rs->secondary_parent_cachegroup_id }
-			: undef;
-		$response->{typeId}   = $rs->type->id;
-		$response->{typeName} = $rs->type->name;
+		my $parent_cachegroup = ( defined $rs->parent_cachegroup_id ) ? { "id" => $rs->parent_cachegroup_id, "name" => $idnames{ $rs->parent_cachegroup_id } } : undef;
+		my $secondary_parent_cachegroup = ( defined $rs->secondary_parent_cachegroup_id ) ? { "id" => $rs->secondary_parent_cachegroup_id, "name" => $idnames{ $rs->secondary_parent_cachegroup_id } } : undef;
+		my $type = { "id" => $rs->type->id, "name" => $rs->type->name };
+
+		$response->{id}                 			= $rs->id;
+		$response->{name}               			= $rs->name;
+		$response->{shortName}          			= $rs->short_name;
+		$response->{latitude}           			= $rs->latitude;
+		$response->{longitude}          			= $rs->longitude;
+		$response->{lastUpdated}        			= $rs->last_updated;
+		$response->{parentCachegroup} 				= $parent_cachegroup;
+		$response->{secondaryParentCachegroup} 		= $secondary_parent_cachegroup;
+		$response->{type}   						= $type;
 
 		&log( $self, "Updated Cachegroup name '" . $rs->name . "' for id: " . $rs->id, "APICHANGE" );
 
@@ -443,18 +429,18 @@ sub is_cachegroup_valid {
 	my $self   = shift;
 	my $params = shift;
 
-	if (!$self->is_valid_cachegroup_type($params->{typeId})) {
+	if (!$self->is_valid_cachegroup_type($params->{type}->{id})) {
 		return ( 0, "Invalid cachegroup type" );
 	}
 
 	my $rules = {
-		fields => [ qw/name shortName latitude longitude parentCachegroupId secondaryParentCachegroupId typeId/ ],
+		fields => [ qw/name shortName latitude longitude parentCachegroup secondaryParentCachegroup type/ ],
 
 		# Validation checks to perform
 		checks => [
 			name => [ is_required("is required"), \&is_alphanumeric ],
 			shortName => [ is_required("is required"), \&is_alphanumeric ],
-			typeId => [ is_required("is required") ],
+			type => [ is_required("is required") ],
 			latitude => [ \&is_valid_lat ],
 			longitude => [ \&is_valid_long ]
 		]

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/64588e7e/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 27ee53c..143ea71 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -53,13 +53,16 @@ sub index {
 		my $regexp_set   = &UI::DeliveryService::get_regexp_set( $self, $row->id );
 		my @example_urls = &UI::DeliveryService::get_example_urls( $self, $row->id, $regexp_set, $row, $cdn_domain, $row->protocol );
 
+		my $cdn 		= { "id" => $row->cdn->id, "name" => $row->cdn->name };
+		my $profile 	= { "id" => $row->profile->id, "name" => $row->profile->name };
+		my $type 		= { "id" => $row->type->id, "name" => $row->type->name };
+
 		push(
 			@data, {
 				"active"                   => \$row->active,
 				"cacheurl"                 => $row->cacheurl,
 				"ccrDnsTtl"                => $row->ccr_dns_ttl,
-				"cdnId"                    => $row->cdn->id,
-				"cdnName"                  => $row->cdn->name,
+				"cdn"                 	   => $cdn,
 				"checkPath"                => $row->check_path,
 				"displayName"              => $row->display_name,
 				"dnsBypassCname"           => $row->dns_bypass_cname,
@@ -93,9 +96,7 @@ sub index {
 				"multiSiteOriginAlgorithm" => $row->multi_site_origin_algorithm,
 				"orgServerFqdn"            => $row->org_server_fqdn,
 				"originShield"             => $row->origin_shield,
-				"profileId"                => $row->profile->id,
-				"profileName"              => $row->profile->name,
-				"profileDescription"       => $row->profile->description,
+				"profile"         	       => $profile,
 				"protocol"                 => $row->protocol,
 				"qstringIgnore"            => $row->qstring_ignore,
 				"rangeRequestHandling"     => $row->range_request_handling,
@@ -106,8 +107,7 @@ sub index {
 				"sslKeyVersion"            => $row->ssl_key_version,
 				"trRequestHeaders"         => $row->tr_request_headers,
 				"trResponseHeaders"        => $row->tr_response_headers,
-				"type"                     => $row->type->name,
-				"typeId"                   => $row->type->id,
+				"type"                     => $type,
 				"xmlId"                    => $row->xml_id
 			}
 		);
@@ -149,13 +149,16 @@ sub show {
 		my $regexp_set   = &UI::DeliveryService::get_regexp_set( $self, $row->id );
 		my @example_urls = &UI::DeliveryService::get_example_urls( $self, $row->id, $regexp_set, $row, $cdn_domain, $row->protocol );
 
+		my $cdn 		= { "id" => $row->cdn->id, "name" => $row->cdn->name };
+		my $profile 	= { "id" => $row->profile->id, "name" => $row->profile->name };
+		my $type 		= { "id" => $row->type->id, "name" => $row->type->name };
+
 		push(
 			@data, {
 				"active"                   => \$row->active,
 				"cacheurl"                 => $row->cacheurl,
 				"ccrDnsTtl"                => $row->ccr_dns_ttl,
-				"cdnId"                    => $row->cdn->id,
-				"cdnName"                  => $row->cdn->name,
+				"cdn"	                   => $cdn,
 				"checkPath"                => $row->check_path,
 				"displayName"              => $row->display_name,
 				"dnsBypassCname"           => $row->dns_bypass_cname,
@@ -190,9 +193,7 @@ sub show {
 				"multiSiteOriginAlgorithm" => $row->multi_site_origin_algorithm,
 				"orgServerFqdn"            => $row->org_server_fqdn,
 				"originShield"             => $row->origin_shield,
-				"profileId"                => $row->profile->id,
-				"profileName"              => $row->profile->name,
-				"profileDescription"       => $row->profile->description,
+				"profile"         	       => $profile,
 				"protocol"                 => $row->protocol,
 				"qstringIgnore"            => $row->qstring_ignore,
 				"rangeRequestHandling"     => $row->range_request_handling,
@@ -203,8 +204,7 @@ sub show {
 				"sslKeyVersion"            => $row->ssl_key_version,
 				"trRequestHeaders"         => $row->tr_request_headers,
 				"trResponseHeaders"        => $row->tr_response_headers,
-				"type"                     => $row->type->name,
-				"typeId"                   => $row->type->id,
+				"type"                     => $type,
 				"xmlId"                    => $row->xml_id
 			}
 		);
@@ -244,7 +244,7 @@ sub update {
 		active => $params->{active} ? 1 : 0,
 		cacheurl                    => $params->{cacheurl},
 		ccr_dns_ttl                 => $params->{ccrDnsTtl},
-		cdn_id                      => $params->{cdnId},
+		cdn_id                      => $params->{cdn}->{id},
 		check_path                  => $params->{checkPath},
 		display_name                => $params->{displayName},
 		dns_bypass_cname            => $params->{dnsBypassCname},
@@ -275,7 +275,7 @@ sub update {
 		multi_site_origin_algorithm => $params->{multiSiteOriginAlgorithm},
 		org_server_fqdn             => $params->{orgServerFqdn},
 		origin_shield               => $params->{originShield},
-		profile                     => $params->{profileId},
+		profile                     => $params->{profile}->{id},
 		protocol                    => $params->{protocol},
 		qstring_ignore              => $params->{qstringIgnore},
 		range_request_handling      => $params->{rangeRequestHandling},
@@ -286,20 +286,23 @@ sub update {
 		ssl_key_version             => $params->{sslKeyVersion},
 		tr_request_headers          => $params->{trRequestHeaders},
 		tr_response_headers         => $params->{trResponseHeaders},
-		type                        => $params->{typeId},
+		type                        => $params->{type}->{id},
 		xml_id                      => $params->{xmlId}
 	};
 
 	my $rs = $ds->update($values);
 	if ($rs) {
 		my @response;
+		my $cdn 		= { "id" => $rs->cdn->id, "name" => $rs->cdn->name };
+		my $profile 	= { "id" => $rs->profile->id, "name" => $rs->profile->name };
+		my $type 		= { "id" => $rs->type->id, "name" => $rs->type->name };
+
 		push(
 			@response, {
 				"active"                   => \$rs->active,
 				"cacheurl"                 => $rs->cacheurl,
 				"ccrDnsTtl"                => $rs->ccr_dns_ttl,
-				"cdnId"                    => $rs->cdn->id,
-				"cdnName"                  => $rs->cdn->name,
+				"cdn"  		               => $cdn,
 				"checkPath"                => $rs->check_path,
 				"displayName"              => $rs->display_name,
 				"dnsBypassCname"           => $rs->dns_bypass_cname,
@@ -332,9 +335,7 @@ sub update {
 				"multiSiteOriginAlgorithm" => $rs->multi_site_origin_algorithm,
 				"orgServerFqdn"            => $rs->org_server_fqdn,
 				"originShield"             => $rs->origin_shield,
-				"profileId"                => $rs->profile->id,
-				"profileName"              => $rs->profile->name,
-				"profileDescription"       => $rs->profile->description,
+				"profile"                  => $profile,
 				"protocol"                 => $rs->protocol,
 				"qstringIgnore"            => $rs->qstring_ignore,
 				"rangeRequestHandling"     => $rs->range_request_handling,
@@ -345,8 +346,7 @@ sub update {
 				"sslKeyVersion"            => $rs->ssl_key_version,
 				"trRequestHeaders"         => $rs->tr_request_headers,
 				"trResponseHeaders"        => $rs->tr_response_headers,
-				"type"                     => $rs->type->name,
-				"typeId"                   => $rs->type->id,
+				"type"                     => $type,
 				"xmlId"                    => $rs->xml_id
 			}
 		);
@@ -384,7 +384,7 @@ sub create {
 		active => $params->{active} ? 1 : 0,
 		cacheurl                    => $params->{cacheurl},
 		ccr_dns_ttl                 => $params->{ccrDnsTtl},
-		cdn_id                      => $params->{cdnId},
+		cdn_id                      => $params->{cdn}->{id},
 		check_path                  => $params->{checkPath},
 		display_name                => $params->{displayName},
 		dns_bypass_cname            => $params->{dnsBypassCname},
@@ -415,7 +415,7 @@ sub create {
 		multi_site_origin_algorithm => $params->{multiSiteOriginAlgorithm},
 		org_server_fqdn             => $params->{orgServerFqdn},
 		origin_shield               => $params->{originShield},
-		profile                     => $params->{profileId},
+		profile                     => $params->{profile}->{id},
 		protocol                    => $params->{protocol},
 		qstring_ignore              => $params->{qstringIgnore},
 		range_request_handling      => $params->{rangeRequestHandling},
@@ -426,7 +426,7 @@ sub create {
 		ssl_key_version             => $params->{sslKeyVersion},
 		tr_request_headers          => $params->{trRequestHeaders},
 		tr_response_headers         => $params->{trResponseHeaders},
-		type                        => $params->{typeId},
+		type                        => $params->{type}->{id},
 		xml_id                      => $params->{xmlId}
 	};
 
@@ -434,13 +434,16 @@ sub create {
 	my $rs     = $insert->insert();
 	if ($rs) {
 		my @response;
+		my $cdn 		= { "id" => $rs->cdn->id, "name" => $rs->cdn->name };
+		my $profile 	= { "id" => $rs->profile->id, "name" => $rs->profile->name };
+		my $type 		= { "id" => $rs->type->id, "name" => $rs->type->name };
+
 		push(
 			@response, {
 				"active"                   => \$rs->active,
 				"cacheurl"                 => $rs->cacheurl,
 				"ccrDnsTtl"                => $rs->ccr_dns_ttl,
-				"cdnId"                    => $rs->cdn->id,
-				"cdnName"                  => $rs->cdn->name,
+				"cdn"                      => $cdn,
 				"checkPath"                => $rs->check_path,
 				"displayName"              => $rs->display_name,
 				"dnsBypassCname"           => $rs->dns_bypass_cname,
@@ -473,9 +476,7 @@ sub create {
 				"multiSiteOriginAlgorithm" => $rs->multi_site_origin_algorithm,
 				"orgServerFqdn"            => $rs->org_server_fqdn,
 				"originShield"             => $rs->origin_shield,
-				"profileId"                => $rs->profile->id,
-				"profileName"              => $rs->profile->name,
-				"profileDescription"       => $rs->profile->description,
+				"profile"                  => $profile,
 				"protocol"                 => $rs->protocol,
 				"qstringIgnore"            => $rs->qstring_ignore,
 				"rangeRequestHandling"     => $rs->range_request_handling,
@@ -486,8 +487,7 @@ sub create {
 				"sslKeyVersion"            => $rs->ssl_key_version,
 				"trRequestHeaders"         => $rs->tr_request_headers,
 				"trResponseHeaders"        => $rs->tr_response_headers,
-				"type"                     => $rs->type->name,
-				"typeId"                   => $rs->type->id,
+				"type"                     => $type,
 				"xmlId"                    => $rs->xml_id
 			}
 		);
@@ -755,19 +755,19 @@ sub is_deliveryservice_valid {
 	my $self   = shift;
 	my $params = shift;
 
-	if ( !$self->is_valid_deliveryservice_type( $params->{typeId} ) ) {
+	if ( !$self->is_valid_deliveryservice_type( $params->{type}->{id} ) ) {
 		return ( 0, "Invalid deliveryservice type" );
 	}
 
 	my $rules = {
 		fields => [
-			qw/active cacheurl ccrDnsTtl cdnId checkPath displayName dnsBypassCname dnsBypassIp dnsBypassIp6 dnsBypassTtl dscp edgeHeaderRewrite geoLimitRedirectURL geoLimit geoLimitCountries geoProvider globalMaxMbps globalMaxTps httpBypassFqdn infoUrl initialDispersion ipv6RoutingEnabled logsEnabled longDesc longDesc1 longDesc2 maxDnsAnswers midHeaderRewrite missLat missLong multiSiteOrigin multiSiteOriginAlgorithm orgServerFqdn originShield profileId protocol qstringIgnore rangeRequestHandling regexRemap regionalGeoBlocking remapText signed sslKeyVersion trRequestHeaders trResponseHeaders typeId xmlId/
+			qw/active cacheurl ccrDnsTtl cdn checkPath displayName dnsBypassCname dnsBypassIp dnsBypassIp6 dnsBypassTtl dscp edgeHeaderRewrite geoLimitRedirectURL geoLimit geoLimitCountries geoProvider globalMaxMbps globalMaxTps httpBypassFqdn infoUrl initialDispersion ipv6RoutingEnabled logsEnabled longDesc longDesc1 longDesc2 maxDnsAnswers midHeaderRewrite missLat missLong multiSiteOrigin multiSiteOriginAlgorithm orgServerFqdn originShield profile protocol qstringIgnore rangeRequestHandling regexRemap regionalGeoBlocking remapText signed sslKeyVersion trRequestHeaders trResponseHeaders type xmlId/
 		],
 
 		# Validation checks to perform
 		checks => [
 			active               => [ is_required("is required") ],
-			cdnId                => [ is_required("is required") ],
+			cdn                  => [ is_required("is required") ],
 			displayName          => [ is_required("is required"), is_long_at_most( 48, 'too long' ) ],
 			dscp                 => [ is_required("is required") ],
 			geoLimit             => [ is_required("is required") ],
@@ -779,13 +779,13 @@ sub is_deliveryservice_valid {
 			missLong             => [ \&is_valid_long ],
 			multiSiteOrigin      => [ is_required("is required") ],
 			orgServerFqdn        => [ is_required("is required"), is_like( qr/^(https?:\/\/)/, "must start with http:// or https://" ) ],
-			profileId            => [ is_required("is required") ],
+			profile              => [ is_required("is required") ],
 			protocol             => [ is_required("is required") ],
 			qstringIgnore        => [ is_required("is required") ],
 			rangeRequestHandling => [ is_required("is required") ],
 			regionalGeoBlocking  => [ is_required("is required") ],
 			signed               => [ is_required("is required") ],
-			typeId               => [ is_required("is required") ],
+			type                 => [ is_required("is required") ],
 			xmlId                => [ is_required("is required"), is_like( qr/^\S*$/, "no spaces" ), is_long_at_most( 48, 'too long' ) ],
 		]
 	};

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/64588e7e/traffic_ops/app/lib/API/PhysLocation.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/PhysLocation.pm b/traffic_ops/app/lib/API/PhysLocation.pm
index 419b07b..6b22f31 100644
--- a/traffic_ops/app/lib/API/PhysLocation.pm
+++ b/traffic_ops/app/lib/API/PhysLocation.pm
@@ -33,7 +33,9 @@ sub index {
 	my $rs_data = $self->db->resultset("PhysLocation")->search( undef, { prefetch => ['region'], order_by => 'me.' . $orderby } );
 	while ( my $row = $rs_data->next ) {
 
-		next if $row->short_name eq 'UNDEF';
+		next if $row->short_name eq 'UNDEF'; # not sure what this is all about
+
+		my $region = { "id" => $row->region->id, "name" => $row->region->name };
 
 		push(
 			@data, {
@@ -46,8 +48,7 @@ sub index {
 				"name"        => $row->name,
 				"phone"       => $row->phone,
 				"poc"         => $row->poc,
-				"region"      => $row->region->name,
-				"regionId"    => $row->region->id,
+				"region"      => $region,
 				"shortName"   => $row->short_name,
 				"state"       => $row->state,
 				"zip"         => $row->zip
@@ -64,6 +65,8 @@ sub show {
 	my $rs_data = $self->db->resultset("PhysLocation")->search( { 'me.id' => $id }, { prefetch => ['region'] } );
 	my @data = ();
 	while ( my $row = $rs_data->next ) {
+		my $region = { "id" => $row->region->id, "name" => $row->region->name };
+
 		push(
 			@data, {
 				"address"     => $row->address,
@@ -75,8 +78,7 @@ sub show {
 				"name"        => $row->name,
 				"phone"       => $row->phone,
 				"poc"         => $row->poc,
-				"region"      => $row->region->name,
-				"regionId"    => $row->region->id,
+				"region"      => $region,
 				"shortName"   => $row->short_name,
 				"state"       => $row->state,
 				"zip"         => $row->zip
@@ -93,7 +95,7 @@ sub index_trimmed {
 	my $rs_data = $self->db->resultset("PhysLocation")->search( undef, { prefetch => ['region'], order_by => 'me.' . $orderby } );
 	while ( my $row = $rs_data->next ) {
 
-		next if $row->short_name eq 'UNDEF';
+		next if $row->short_name eq 'UNDEF'; # not sure what this is all about
 
 		push(
 			@data, {
@@ -148,7 +150,7 @@ sub update {
 		name       => $name,
 		phone      => $params->{phone},
 		poc        => $params->{poc},
-		region     => $params->{regionId},
+		region     => $params->{region}->{id},
 		short_name => $short_name,
 		state      => $params->{state},
 		zip        => $params->{zip}
@@ -157,6 +159,8 @@ sub update {
 	my $rs = $phys_location->update($values);
 	if ($rs) {
 		my $response;
+		my $region = { "id" => $rs->region->id, "name" => $rs->region->name };
+
 		$response->{address}     = $rs->address;
 		$response->{city}        = $rs->city;
 		$response->{comments}    = $rs->comments;
@@ -166,8 +170,7 @@ sub update {
 		$response->{name}        = $rs->name;
 		$response->{phone}       = $rs->phone;
 		$response->{poc}         = $rs->poc;
-		$response->{region}      = $rs->region->name;
-		$response->{regionId}    = $rs->region->id;
+		$response->{region}      = $region;
 		$response->{shortName}   = $rs->short_name;
 		$response->{state}       = $rs->state;
 		$response->{zip}         = $rs->zip;
@@ -215,7 +218,7 @@ sub create {
 		name       => $name,
 		phone      => $params->{phone},
 		poc        => $params->{poc},
-		region     => $params->{regionId},
+		region     => $params->{region}->{id},
 		short_name => $short_name,
 		state      => $params->{state},
 		zip        => $params->{zip}
@@ -225,6 +228,8 @@ sub create {
 	my $rs = $insert->insert();
 	if ($rs) {
 		my $response;
+		my $region = { "id" => $rs->region->id, "name" => $rs->region->name };
+
 		$response->{address}     = $rs->address;
 		$response->{city}        = $rs->city;
 		$response->{comments}    = $rs->comments;
@@ -234,8 +239,7 @@ sub create {
 		$response->{name}        = $rs->name;
 		$response->{phone}       = $rs->phone;
 		$response->{poc}         = $rs->poc;
-		$response->{region}      = $rs->region->name;
-		$response->{regionId}    = $rs->region->id;
+		$response->{region}      = $region;
 		$response->{shortName}   = $rs->short_name;
 		$response->{state}       = $rs->state;
 		$response->{zip}         = $rs->zip;
@@ -337,13 +341,13 @@ sub is_phys_location_valid {
 	my $params = shift;
 
 	my $rules = {
-		fields => [ qw/address city comments email name phone poc regionId shortName state zip/ ],
+		fields => [ qw/address city comments email name phone poc region shortName state zip/ ],
 
 		# Validation checks to perform
 		checks => [
 
 			# required fields
-			[ qw/address city name regionId shortName state zip/ ] => is_required("is required")
+			[ qw/address city name region shortName state zip/ ] => is_required("is required")
 
 		]
 	};

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/64588e7e/traffic_ops/app/lib/API/Region.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Region.pm b/traffic_ops/app/lib/API/Region.pm
index ec6ff06..69543ab 100644
--- a/traffic_ops/app/lib/API/Region.pm
+++ b/traffic_ops/app/lib/API/Region.pm
@@ -111,12 +111,12 @@ sub update {
 	}
 
 	if ( !defined( $params->{division} ) ) {
-		return $self->alert("Division Id is required.");
+		return $self->alert("Division is required.");
 	}
 
 	my $values = {
 		name     => $params->{name},
-		division => $params->{division}
+		division => $params->{division}->{id}
 	};
 
 	my $rs = $region->update($values);
@@ -151,7 +151,7 @@ sub create {
 
 	my $division_id = $params->{division};
 	if ( !defined($division_id) ) {
-		return $self->alert("Division Id is required.");
+		return $self->alert("Division is required.");
 	}
 
 	my $existing = $self->db->resultset('Region')->search( { name => $name } )->get_column('name')->single();
@@ -161,7 +161,7 @@ sub create {
 
 	my $values = {
 		name 		=> $params->{name} ,
-		division 	=> $params->{division}
+		division 	=> $params->{division}->{id}
 	};
 
 	my $insert = $self->db->resultset('Region')->create($values);

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/64588e7e/traffic_ops/app/lib/API/Server.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Server.pm b/traffic_ops/app/lib/API/Server.pm
index c7c7cab..6877676 100644
--- a/traffic_ops/app/lib/API/Server.pm
+++ b/traffic_ops/app/lib/API/Server.pm
@@ -60,12 +60,17 @@ sub index {
 	if ( defined($servers) ) {
 		my $is_admin = &is_admin($self);
 		while ( my $row = $servers->next ) {
+			my $cachegroup 		= { "id" => $row->cachegroup->id, "name" => $row->cachegroup->name };
+			my $cdn 			= { "id" => $row->cdn->id, "name" => $row->cdn->name };
+			my $physLocation 	= { "id" => $row->phys_location->id, "name" => $row->phys_location->name };
+			my $profile 		= { "id" => $row->profile->id, "name" => $row->profile->name };
+			my $status 			= { "id" => $row->status->id, "name" => $row->status->name };
+			my $type 			= { "id" => $row->type->id, "name" => $row->type->name };
+
 			push(
 				@data, {
-					"cachegroup"     => $row->cachegroup->name,
-					"cachegroupId"   => $row->cachegroup->id,
-					"cdnId"          => $row->cdn->id,
-					"cdnName"        => $row->cdn->name,
+					"cachegroup"     => $cachegroup,
+					"cdn" 	         => $cdn,
 					"domainName"     => $row->domain_name,
 					"guid"           => $row->guid,
 					"hostName"       => $row->host_name,
@@ -87,20 +92,15 @@ sub index {
 					"mgmtIpAddress"  => $row->mgmt_ip_address,
 					"mgmtIpNetmask"  => $row->mgmt_ip_netmask,
 					"mgmtIpGateway"  => $row->mgmt_ip_gateway,
-					"offlineReason" => $row->offline_reason,
-					"physLocation"   => $row->phys_location->name,
-					"physLocationId" => $row->phys_location->id,
-					"profile"        => $row->profile->name,
-					"profileId"      => $row->profile->id,
-					"profileDesc"    => $row->profile->description,
+					"offlineReason"  => $row->offline_reason,
+					"physLocation"   => $physLocation,
+					"profile"        => $profile,
 					"rack"           => $row->rack,
 					"routerHostName" => $row->router_host_name,
 					"routerPortName" => $row->router_port_name,
-					"status"         => $row->status->name,
-					"statusId"       => $row->status->id,
+					"status"         => $status,
 					"tcpPort"        => $row->tcp_port,
-					"type"           => $row->type->name,
-					"typeId"         => $row->type->id,
+					"type"           => $type,
 					"updPending"     => \$row->upd_pending
 				}
 			);
@@ -118,12 +118,17 @@ sub show {
 	my @data     = ();
 	my $is_admin = &is_admin($self);
 	while ( my $row = $rs_data->next ) {
+		my $cachegroup 		= { "id" => $row->cachegroup->id, "name" => $row->cachegroup->name };
+		my $cdn 			= { "id" => $row->cdn->id, "name" => $row->cdn->name };
+		my $physLocation 	= { "id" => $row->phys_location->id, "name" => $row->phys_location->name };
+		my $profile 		= { "id" => $row->profile->id, "name" => $row->profile->name };
+		my $status 			= { "id" => $row->status->id, "name" => $row->status->name };
+		my $type 			= { "id" => $row->type->id, "name" => $row->type->name };
+
 		push(
 			@data, {
-				"cachegroup"     => $row->cachegroup->name,
-				"cachegroupId"   => $row->cachegroup->id,
-				"cdnId"          => $row->cdn->id,
-				"cdnName"        => $row->cdn->name,
+				"cachegroup"     => $cachegroup,
+				"cdn"     	     => $cdn,
 				"domainName"     => $row->domain_name,
 				"guid"           => $row->guid,
 				"hostName"       => $row->host_name,
@@ -146,19 +151,14 @@ sub show {
 				"mgmtIpNetmask"  => $row->mgmt_ip_netmask,
 				"mgmtIpGateway"  => $row->mgmt_ip_gateway,
 				"offline_reason" => $row->offline_reason,
-				"physLocation"   => $row->phys_location->name,
-				"physLocationId" => $row->phys_location->id,
-				"profile"        => $row->profile->name,
-				"profileId"      => $row->profile->id,
-				"profileDesc"    => $row->profile->description,
+				"physLocation"   => $physLocation,
+				"profile"        => $profile,
 				"rack"           => $row->rack,
 				"routerHostName" => $row->router_host_name,
 				"routerPortName" => $row->router_port_name,
-				"status"         => $row->status->name,
-				"statusId"       => $row->status->id,
+				"status"         => $status,
 				"tcpPort"        => $row->tcp_port,
-				"type"           => $row->type->name,
-				"typeId"         => $row->type->id,
+				"type"           => $type,
 				"updPending"     => \$row->upd_pending
 			}
 		);
@@ -187,8 +187,8 @@ sub update {
 	}
 
 	my $values = {
-		cachegroup               	=> $params->{cachegroupId},
-		cdn_id                     	=> $params->{cdnId},
+		cachegroup               	=> $params->{cachegroup}->{id},
+		cdn_id                     	=> $params->{cdn}->{id},
 		domain_name               	=> $params->{domainName},
 		host_name                   => $params->{hostName},
 		https_port           		=> $params->{httpsPort},
@@ -208,26 +208,31 @@ sub update {
 		mgmt_ip_netmask          	=> $params->{mgmtIpNetmask},
 		mgmt_ip_gateway           	=> $params->{mgmtIpGateway},
 		offline_reason            	=> $params->{offlineReason},
-		phys_location            	=> $params->{physLocationId},
-		profile             		=> $params->{profileId},
+		phys_location            	=> $params->{physLocation}->{id},
+		profile             		=> $params->{profile}->{id},
 		rack                     	=> $params->{rack},
 		router_host_name       		=> $params->{routerHostName},
 		router_port_name          	=> $params->{routerPortName},
-		status                   	=> $params->{statusId},
+		status                   	=> $params->{status}->{id},
 		tcp_port                 	=> $params->{tcpPort},
-		type                     	=> $params->{typeId},
+		type                     	=> $params->{type}->{id},
 		upd_pending               	=> $params->{updPending}
 	};
 
 	my $rs = $server->update($values);
 	if ($rs) {
 		my @response;
+		my $cachegroup 		= { "id" => $rs->cachegroup->id, "name" => $rs->cachegroup->name };
+		my $cdn 			= { "id" => $rs->cdn->id, "name" => $rs->cdn->name };
+		my $physLocation 	= { "id" => $rs->phys_location->id, "name" => $rs->phys_location->name };
+		my $profile 		= { "id" => $rs->profile->id, "name" => $rs->profile->name };
+		my $status 			= { "id" => $rs->status->id, "name" => $rs->status->name };
+		my $type 			= { "id" => $rs->type->id, "name" => $rs->type->name };
+
 		push(
 			@response, {
-				"cachegroup"     => $rs->cachegroup->name,
-				"cachegroupId"   => $rs->cachegroup->id,
-				"cdnId"          => $rs->cdn->id,
-				"cdnName"        => $rs->cdn->name,
+				"cachegroup"     => $cachegroup,
+				"cdn"          	 => $cdn,
 				"domainName"     => $rs->domain_name,
 				"guid"           => $rs->guid,
 				"hostName"       => $rs->host_name,
@@ -250,19 +255,14 @@ sub update {
 				"mgmtIpNetmask"  => $rs->mgmt_ip_netmask,
 				"mgmtIpGateway"  => $rs->mgmt_ip_gateway,
 				"offlineReason"  => $rs->offline_reason,
-				"physLocation"   => $rs->phys_location->name,
-				"physLocationId" => $rs->phys_location->id,
-				"profile"        => $rs->profile->name,
-				"profileId"      => $rs->profile->id,
-				"profileDesc"    => $rs->profile->description,
+				"physLocation"   => $physLocation,
+				"profile"        => $profile,
 				"rack"           => $rs->rack,
 				"routerHostName" => $rs->router_host_name,
 				"routerPortName" => $rs->router_port_name,
-				"status"         => $rs->status->name,
-				"statusId"       => $rs->status->id,
+				"status"         => $status,
 				"tcpPort"        => $rs->tcp_port,
-				"type"           => $rs->type->name,
-				"typeId"         => $rs->type->id,
+				"type"           => $type,
 				"updPending"     => \$rs->upd_pending
 			}
 		);
@@ -291,8 +291,8 @@ sub create {
 	}
 
 	my $values = {
-		cachegroup               	=> $params->{cachegroupId},
-		cdn_id                     	=> $params->{cdnId},
+		cachegroup               	=> $params->{cachegroup}->{id},
+		cdn_id                     	=> $params->{cdn}->{id},
 		domain_name               	=> $params->{domainName},
 		host_name                   => $params->{hostName},
 		https_port           		=> $params->{httpsPort},
@@ -312,14 +312,14 @@ sub create {
 		mgmt_ip_netmask          	=> $params->{mgmtIpNetmask},
 		mgmt_ip_gateway           	=> $params->{mgmtIpGateway},
 		offline_reason            	=> $params->{offlineReason},
-		phys_location            	=> $params->{physLocationId},
-		profile             		=> $params->{profileId},
+		phys_location            	=> $params->{physLocation}->{id},
+		profile             		=> $params->{profile}->{id},
 		rack                     	=> $params->{rack},
 		router_host_name       		=> $params->{routerHostName},
 		router_port_name          	=> $params->{routerPortName},
-		status                   	=> $params->{statusId},
+		status                   	=> $params->{status}->{id},
 		tcp_port                 	=> $params->{tcpPort},
-		type                     	=> $params->{typeId},
+		type                     	=> $params->{type}->{id},
 		upd_pending               	=> $params->{updPending}
 	};
 
@@ -327,12 +327,17 @@ sub create {
 	my $rs = $insert->insert();
 	if ($rs) {
 		my @response;
+		my $cachegroup 		= { "id" => $rs->cachegroup->id, "name" => $rs->cachegroup->name };
+		my $cdn 			= { "id" => $rs->cdn->id, "name" => $rs->cdn->name };
+		my $physLocation 	= { "id" => $rs->phys_location->id, "name" => $rs->phys_location->name };
+		my $profile 		= { "id" => $rs->profile->id, "name" => $rs->profile->name };
+		my $status 			= { "id" => $rs->status->id, "name" => $rs->status->name };
+		my $type 			= { "id" => $rs->type->id, "name" => $rs->type->name };
+
 		push(
 			@response, {
-				"cachegroup"     => $rs->cachegroup->name,
-				"cachegroupId"   => $rs->cachegroup->id,
-				"cdnId"          => $rs->cdn->id,
-				"cdnName"        => $rs->cdn->name,
+				"cachegroup"     => $cachegroup,
+				"cdn"          	 => $cdn,
 				"domainName"     => $rs->domain_name,
 				"guid"           => $rs->guid,
 				"hostName"       => $rs->host_name,
@@ -355,19 +360,14 @@ sub create {
 				"mgmtIpNetmask"  => $rs->mgmt_ip_netmask,
 				"mgmtIpGateway"  => $rs->mgmt_ip_gateway,
 				"offlineReason"  => $rs->offline_reason,
-				"physLocation"   => $rs->phys_location->name,
-				"physLocationId" => $rs->phys_location->id,
-				"profile"        => $rs->profile->name,
-				"profileId"      => $rs->profile->id,
-				"profileDesc"    => $rs->profile->description,
+				"physLocation"   => $physLocation,
+				"profile"        => $profile,
 				"rack"           => $rs->rack,
 				"routerHostName" => $rs->router_host_name,
 				"routerPortName" => $rs->router_port_name,
-				"status"         => $rs->status->name,
-				"statusId"       => $rs->status->id,
+				"status"         => $status,
 				"tcpPort"        => $rs->tcp_port,
-				"type"           => $rs->type->name,
-				"typeId"         => $rs->type->id,
+				"type"           => $type,
 				"updPending"     => \$rs->upd_pending
 			}
 		);
@@ -759,17 +759,17 @@ sub is_server_valid {
 	my $self   = shift;
 	my $params = shift;
 
-	if (!$self->is_valid_server_type($params->{typeId})) {
+	if (!$self->is_valid_server_type($params->{type}->{id})) {
 		return ( 0, "Invalid server type" );
 	}
 
 	my $rules = {
-		fields => [ qw/cachegroupId cdnId domainName hostName httpsPort iloIpAddress iloIpNetmask iloIpGateway iloUsername iloPassword interfaceMtu interfaceName ip6Address ip6Gateway ipAddress ipNetmask ipGateway mgmtIpAddress mgmtIpNetmask mgmtIpGateway offlineReason physLocationId profileId rack routerHostName routerPortName statusId tcpPort typeId updPending/ ],
+		fields => [ qw/cachegroup cdn domainName hostName httpsPort iloIpAddress iloIpNetmask iloIpGateway iloUsername iloPassword interfaceMtu interfaceName ip6Address ip6Gateway ipAddress ipNetmask ipGateway mgmtIpAddress mgmtIpNetmask mgmtIpGateway offlineReason physLocation profile rack routerHostName routerPortName status tcpPort type updPending/ ],
 
 		# Validation checks to perform
 		checks => [
-			cachegroupId => [ is_required("is required") ],
-			cdnId => [ is_required("is required") ],
+			cachegroup => [ is_required("is required") ],
+			cdn => [ is_required("is required") ],
 			domainName => [ is_required("is required") ],
 			hostName => [ is_required("is required") ],
 			interfaceMtu => [ is_required("is required") ],
@@ -777,10 +777,10 @@ sub is_server_valid {
 			ipAddress => [ is_required("is required") ],
 			ipNetmask => [ is_required("is required") ],
 			ipGateway => [ is_required("is required") ],
-			physLocationId => [ is_required("is required") ],
-			profileId => [ is_required("is required") ],
-			statusId => [ is_required("is required") ],
-			typeId => [ is_required("is required") ],
+			physLocation => [ is_required("is required") ],
+			profile => [ is_required("is required") ],
+			status => [ is_required("is required") ],
+			type => [ is_required("is required") ],
 			updPending => [ is_required("is required") ]
 		]
 	};

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/64588e7e/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 fab4b85..9bb7e8e 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -76,6 +76,8 @@ sub index {
 	}
 
 	while ( my $row = $dbh->next ) {
+		my $role = { "id" => $row->role->id, "name" => $row->role->name };
+
 		push(
 			@data, {
 				"addressLine1"    => $row->address_line1,
@@ -93,8 +95,7 @@ sub index {
 				"postalCode"      => $row->postal_code,
 				"publicSshKey"    => $row->public_ssh_key,
 				"registrationSent"=> \$row->registration_sent,
-				"role"            => $row->role->id,
-				"rolename"        => $row->role->name,
+				"role"            => $role,
 				"stateOrProvince" => $row->state_or_province,
 				"uid"             => $row->uid,
 				"username"        => $row->username
@@ -111,6 +112,8 @@ sub show {
 	my $rs_data = $self->db->resultset("TmUser")->search( { 'me.id' => $id }, { prefetch => [ 'role' ] } );
 	my @data = ();
 	while ( my $row = $rs_data->next ) {
+		my $role = { "id" => $row->role->id, "name" => $row->role->name };
+
 		push(
 			@data, {
 				"addressLine1"    => $row->address_line1,
@@ -128,8 +131,7 @@ sub show {
 				"postalCode"      => $row->postal_code,
 				"publicSshKey"    => $row->public_ssh_key,
 				"registrationSent"=> \$row->registration_sent,
-				"role"            => $row->role->id,
-				"rolename"        => $row->role->name,
+				"role"            => $role,
 				"stateOrProvince" => $row->state_or_province,
 				"uid"             => $row->uid,
 				"username"        => $row->username
@@ -172,7 +174,7 @@ sub update {
 		postal_code 			=> $params->{postalCode},
 		public_ssh_key 			=> $params->{publicSshKey},
 		registration_sent 		=> ( $params->{registrationSent} ) ? 1 : 0,
-		role 					=> $params->{role},
+		role 					=> $params->{role}->{id},
 		state_or_province 		=> $params->{stateOrProvince},
 		username 				=> $params->{username}
 	};
@@ -187,6 +189,8 @@ sub update {
 	my $rs = $user->update($values);
 	if ($rs) {
 		my $response;
+		my $role = { "id" => $rs->role->id, "name" => $rs->role->name };
+
 		$response->{addressLine1}        	= $rs->address_line1;
 		$response->{addressLine2} 			= $rs->address_line2;
 		$response->{city} 					= $rs->city;
@@ -202,8 +206,7 @@ sub update {
 		$response->{postalCode} 			= $rs->postal_code;
 		$response->{publicSshKey} 			= $rs->public_ssh_key;
 		$response->{registrationSent} 		= \$rs->registration_sent;
-		$response->{role} 					= $rs->role->id;
-		$response->{roleName} 				= $rs->role->name;
+		$response->{role} 					= $role;
 		$response->{stateOrProvince} 		= $rs->state_or_province;
 		$response->{uid} 					= $rs->uid;
 		$response->{username} 				= $rs->username;


[3/6] incubator-trafficcontrol git commit: added _by_name functionality for testing

Posted by de...@apache.org.
added _by_name functionality for 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/132c40cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/132c40cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/132c40cd

Branch: refs/heads/master
Commit: 132c40cd863540a8473e0d61ce75cfafaba8d6d4
Parents: a8244f7
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Nov 2 14:22:20 2016 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Nov 4 14:25:40 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Region.pm       | 80 ++++++++++++++++++++++------
 traffic_ops/app/lib/TrafficOpsRoutes.pm |  8 ++-
 2 files changed, 70 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/132c40cd/traffic_ops/app/lib/API/Region.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Region.pm b/traffic_ops/app/lib/API/Region.pm
index d8a23cd..ec6ff06 100644
--- a/traffic_ops/app/lib/API/Region.pm
+++ b/traffic_ops/app/lib/API/Region.pm
@@ -31,18 +31,42 @@ sub index {
 	my $orderby = $self->param('orderby') || "name";
 	my $rs_data = $self->db->resultset("Region")->search( undef, { prefetch => ['division'], order_by => 'me.' . $orderby } );
 	while ( my $row = $rs_data->next ) {
+	    my $division = { "id"     => $row->division->id, 
+		                 "name"   => $row->division->name 
+	   };
 		push(
 			@data, {
 				"id"           => $row->id,
 				"name"         => $row->name,
-				"division"     => $row->division->id,
-				"divisionName" => $row->division->name
+				"division"     => $division,
 			}
 		);
 	}
 	$self->success( \@data );
 }
 
+sub index_by_name {
+	my $self = shift;
+	my $name   = $self->param('name');
+
+	my $rs_data = $self->db->resultset("Region")->search( { 'me.name' => $name }, { prefetch => ['division'] } );
+	my @data = ();
+	while ( my $row = $rs_data->next ) {
+	    my $division = { "id"     => $row->division->id, 
+		                 "name"   => $row->division->name 
+	   };
+		push(
+			@data, {
+				"id"           => $row->id,
+				"name"         => $row->name,
+				"division"     => $division,
+			}
+		);
+	}
+	$self->success( \@data );
+}
+
+
 sub show {
 	my $self = shift;
 	my $id   = $self->param('id');
@@ -50,12 +74,14 @@ sub show {
 	my $rs_data = $self->db->resultset("Region")->search( { 'me.id' => $id }, { prefetch => ['division'] } );
 	my @data = ();
 	while ( my $row = $rs_data->next ) {
+	    my $division = { "id"     => $row->division->id, 
+		                 "name"   => $row->division->name 
+	   };
 		push(
 			@data, {
 				"id"           => $row->id,
 				"name"         => $row->name,
-				"division"     => $row->division->id,
-				"divisionName" => $row->division->name
+				"division"     => $division,
 			}
 		);
 	}
@@ -96,11 +122,11 @@ sub update {
 	my $rs = $region->update($values);
 	if ($rs) {
 		my $response;
-		$response->{id}          = $rs->id;
-		$response->{name}        = $rs->name;
-		$response->{division}    = $rs->division->id;
-		$response->{divisionName}= $rs->division->name;
-		$response->{lastUpdated} = $rs->last_updated;
+		$response->{id}              = $rs->id;
+		$response->{name}            = $rs->name;
+		$response->{division}{id}    = $rs->division->id;
+		$response->{division}{name}  = $rs->division->name;
+		$response->{lastUpdated}     = $rs->last_updated;
 		&log( $self, "Updated Region name '" . $rs->name . "' for id: " . $rs->id, "APICHANGE" );
 		return $self->success( $response, "Region update was successful." );
 	}
@@ -144,8 +170,8 @@ sub create {
 		my $response;
 		$response->{id}          	= $rs->id;
 		$response->{name}        	= $rs->name;
-		$response->{division}       = $rs->division->id;
-		$response->{divisionName}   = $rs->division->name;
+		$response->{division}{id}       = $rs->division->id;
+		$response->{division}{name} = $rs->division->name;
 		$response->{lastUpdated} 	= $rs->last_updated;
 
 		&log( $self, "Created Region name '" . $rs->name . "' for id: " . $rs->id, "APICHANGE" );
@@ -158,7 +184,7 @@ sub create {
 
 }
 
-sub create_for_div {
+sub create_for_division {
 	my $self          = shift;
 	my $division_name = $self->param('division_name');
 	my $params        = $self->req->json;
@@ -190,10 +216,10 @@ sub create_for_div {
 	my $response;
 	my $rs = $self->db->resultset('Region')->find( { id => $insert->id } );
 	if ( defined($rs) ) {
-		$response->{id}           = $rs->id;
-		$response->{name}         = $rs->name;
-		$response->{divisionName} = $division_name;
-		$response->{divsionId}    = $rs->division->id;
+		$response->{id}             = $rs->id;
+		$response->{name}           = $rs->name;
+		$response->{division}{id}   = $rs->division->id;
+		$response->{division}{name} = $division_name;
 		return $self->success($response);
 	}
 	return $self->alert( "create region " . $params->{name} . " failed." );
@@ -220,5 +246,27 @@ sub delete {
 	}
 }
 
+sub delete_by_name {
+	my $self = shift;
+	my $name     = $self->param('name');
+
+	if ( !&is_oper($self) ) {
+		return $self->forbidden();
+	}
+
+	my $region = $self->db->resultset('Region')->find( { name => $name } );
+	if ( !defined($region) ) {
+		return $self->not_found();
+	}
+
+	my $rs = $region->delete();
+	if ($rs) {
+		return $self->success_message("Region deleted.");
+	} else {
+		return $self->alert( "Region delete failed." );
+	}
+}
+
+
 
 1;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/132c40cd/traffic_ops/app/lib/TrafficOpsRoutes.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm b/traffic_ops/app/lib/TrafficOpsRoutes.pm
index 6d23600..0534318 100644
--- a/traffic_ops/app/lib/TrafficOpsRoutes.pm
+++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm
@@ -549,9 +549,11 @@ sub api_routes {
 	# -- 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->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/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 );
@@ -601,7 +603,6 @@ 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->post("/api/$version/regions/:region_name/phys_locations")->over( authenticated => 1 )->to( 'PhysLocation#create_for_reg', 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 );
 
@@ -623,10 +624,13 @@ sub api_routes {
 	# 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->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_div', 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/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


[2/6] incubator-trafficcontrol git commit: resolves conflict

Posted by de...@apache.org.
resolves conflict


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

Branch: refs/heads/master
Commit: 49da9a834be68f778699524ea20558a7107e60fa
Parents: de10f93
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Nov 2 14:20:56 2016 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Nov 4 14:25:40 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Cdn.pm | 37 ++++++++++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/49da9a83/traffic_ops/app/lib/API/Cdn.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Cdn.pm b/traffic_ops/app/lib/API/Cdn.pm
index e3a8b73..e8cfd8c 100644
--- a/traffic_ops/app/lib/API/Cdn.pm
+++ b/traffic_ops/app/lib/API/Cdn.pm
@@ -108,7 +108,7 @@ sub create {
 
 	my $value = { name => $params->{name}, };
 	if ( defined( $params->{dnssecEnabled} ) ) {
-		$value->{dnssec_enabled} = $params->{dnssecEnabled};
+		$value->{dnssec_enabled} = lc( $params->{dnssecEnabled} ) ne 'false' ? 1 : 0;
 	}
 
 	my $insert = $self->db->resultset('Cdn')->create($value);
@@ -119,7 +119,7 @@ sub create {
 		my $response;
 		$response->{id}            = $rs->id;
 		$response->{name}          = $rs->name;
-		$response->{dnssecEnabled} = $rs->dnssec_enabled;
+		$response->{dnssecEnabled} = \$rs->dnssec_enabled;
 		&log( $self, "Created CDN with id: " . $rs->id . " and name: " . $rs->name, "APICHANGE" );
 		return $self->success( $response, "cdn was created." );
 	}
@@ -156,7 +156,7 @@ sub update {
 
 	my $value = { name => $params->{name}, };
 	if ( defined( $params->{dnssecEnabled} ) ) {
-		$value->{dnssec_enabled} = $params->{dnssecEnabled};
+		$value->{dnssec_enabled} = lc( $params->{dnssecEnabled} ) ne 'false' ? 1 : 0;
 	}
 
 	my $rs = $cdn->update($value);
@@ -202,6 +202,37 @@ sub delete {
 	return $self->success_message("cdn was deleted.");
 }
 
+sub delete_by_name {
+	my $self = shift;
+	my $cdn_name   = $self->param('name');
+
+	if ( !&is_oper($self) ) {
+		return $self->forbidden();
+	}
+
+	my $cdn = $self->db->resultset('Cdn')->find( { name => $cdn_name } );
+	if ( !defined($cdn) ) {
+		return $self->not_found();
+	}
+	my $id = $cdn->id;
+
+	my $rs = $self->db->resultset('Server')->search( { cdn_id => $id } );
+	if ( $rs->count() > 0 ) {
+		$self->app->log->error("Failed to delete cdn id = $id has servers");
+		return $self->alert("Failed to delete cdn id = $id has servers");
+	}
+
+	$rs = $self->db->resultset('Deliveryservice')->search( { cdn_id => $id } );
+	if ( $rs->count() > 0 ) {
+		$self->app->log->error("Failed to delete cdn id = $id has delivery services");
+		return $self->alert("Failed to delete cdn id = $id has delivery services");
+	}
+
+	$cdn->delete();
+	&log( $self, "Delete cdn " . $cdn_name, "APICHANGE" );
+	return $self->success_message("cdn was deleted.");
+}
+
 sub configs_monitoring {
 	my $self      = shift;
 	my $cdn_name  = $self->param('name');


[4/6] incubator-trafficcontrol git commit: added _by_name functionality for testing

Posted by de...@apache.org.
added _by_name functionality for 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/eec561e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/eec561e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/eec561e1

Branch: refs/heads/master
Commit: eec561e1d94a52c68f5ba708deb2130223d215ce
Parents: 132c40c
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Nov 2 14:21:27 2016 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Nov 4 14:25:40 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Division.pm | 47 ++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/eec561e1/traffic_ops/app/lib/API/Division.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Division.pm b/traffic_ops/app/lib/API/Division.pm
index c59e345..a7360b7 100644
--- a/traffic_ops/app/lib/API/Division.pm
+++ b/traffic_ops/app/lib/API/Division.pm
@@ -24,6 +24,25 @@ sub index {
 	$self->success( \@data );
 }
 
+sub index_by_name {
+	my $self = shift;
+	my $name   = $self->param('name');
+
+	my $rs_data = $self->db->resultset("Division")->search( { name => $name } );
+	my @data = ();
+	while ( my $row = $rs_data->next ) {
+		push(
+			@data, {
+				"id"          => $row->id,
+				"name"        => $row->name,
+				"lastUpdated" => $row->last_updated
+			}
+		);
+	}
+	$self->success( \@data );
+}
+
+
 sub show {
 	my $self = shift;
 	my $id   = $self->param('id');
@@ -142,5 +161,33 @@ sub delete {
 	}
 }
 
+sub delete_by_name {
+	my $self = shift;
+	my $name     = $self->param('name');
+
+	if ( !&is_oper($self) ) {
+		return $self->forbidden();
+	}
+
+	my $division = $self->db->resultset('Division')->find( { name => $name } );
+	if ( !defined($division) ) {
+		return $self->not_found();
+	}
+
+	my $regions = $self->db->resultset('Region')->find( { division => $division->id } );
+	if ( defined($regions) ) {
+		return $self->alert("This division is currently used by regions.");
+	}
+
+
+	my $rs = $division->delete();
+	if ($rs) {
+		return $self->success_message("Division deleted.");
+	} else {
+		return $self->alert( "Division delete failed." );
+	}
+}
+
+
 
 1;


[5/6] incubator-trafficcontrol git commit: fixed PUT dnsssec_enabled boolean response

Posted by de...@apache.org.
fixed PUT dnsssec_enabled boolean response


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

Branch: refs/heads/master
Commit: de10f93d6f45ba80715d2fc797d62f707ca7b0af
Parents: eec561e
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri Oct 28 17:40:05 2016 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Nov 4 14:25:40 2016 -0600

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


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/de10f93d/traffic_ops/app/lib/API/Cdn.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Cdn.pm b/traffic_ops/app/lib/API/Cdn.pm
index 3d742cf..e3a8b73 100644
--- a/traffic_ops/app/lib/API/Cdn.pm
+++ b/traffic_ops/app/lib/API/Cdn.pm
@@ -164,7 +164,7 @@ sub update {
 		my $response;
 		$response->{id}            = $rs->id;
 		$response->{name}          = $rs->name;
-		$response->{dnssecEnabled} = $rs->dnssec_enabled;
+		$response->{dnssecEnabled} = \$rs->dnssec_enabled;
 		&log( $self, "Updated CDN name '" . $rs->name . "' for id: " . $rs->id, "APICHANGE" );
 		return $self->success( $response, "CDN update was successful." );
 	}


[6/6] incubator-trafficcontrol git commit: The closes #47

Posted by de...@apache.org.
The closes #47


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

Branch: refs/heads/master
Commit: a1ed755641ea62ca2c4ab3ce606ee0c22ba9fff0
Parents: 64588e7
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri Nov 4 14:27:32 2016 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Nov 4 14:27:32 2016 -0600

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

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