You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/01/05 17:45:35 UTC
[1/3] incubator-trafficcontrol git commit: Change "status" from id to
name in server update Restful API
Repository: incubator-trafficcontrol
Updated Branches:
refs/heads/master f79c2f8a8 -> 4c95beebd
Change "status" from id to name in server update Restful API
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/5d7b18f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/5d7b18f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/5d7b18f6
Branch: refs/heads/master
Commit: 5d7b18f6d8b0da6511e2caa240b27711189dac0c
Parents: 21f90c1
Author: Jifeng Yang <ji...@cisco.com>
Authored: Fri Nov 18 17:15:19 2016 -0500
Committer: Jifeng Yang <ji...@cisco.com>
Committed: Fri Nov 18 17:15:19 2016 -0500
----------------------------------------------------------------------
traffic_ops/app/lib/API/Server2.pm | 7 +++++++
traffic_ops/app/t/api/1.2/server_create.t | 2 ++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/5d7b18f6/traffic_ops/app/lib/API/Server2.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Server2.pm b/traffic_ops/app/lib/API/Server2.pm
index b13fba5..11cbcf7 100644
--- a/traffic_ops/app/lib/API/Server2.pm
+++ b/traffic_ops/app/lib/API/Server2.pm
@@ -110,6 +110,13 @@ sub check_server_params {
return ( \%params, "'type' $json->{'type'} not found!" );
}
+ if ( defined( $json->{'status'} ) ) {
+ eval { $params{'status'} = &admin_status_id( $self, $json->{'status'} ); };
+ if ( $@ || ( !defined( $params{'status'} ) ) ) {
+ return ( \%params, "'status' $json->{'status'} not found!" );
+ }
+ }
+
eval { $params{'profile'} = &profile_id( $self, $json->{'profile'} ); };
if ( $@ || ( !defined( $params{'profile'} ) ) ) { # $@ holds Perl errors
return ( \%params, "'profile' $json->{'profile'} not found!" );
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/5d7b18f6/traffic_ops/app/t/api/1.2/server_create.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/server_create.t b/traffic_ops/app/t/api/1.2/server_create.t
index 80178f8..c6c3c05 100644
--- a/traffic_ops/app/t/api/1.2/server_create.t
+++ b/traffic_ops/app/t/api/1.2/server_create.t
@@ -106,6 +106,7 @@ ok $t->put_ok('/api/1.2/servers/' . $svr_id . '/update' => {Accept => 'applicat
"interfaceMtu" => "1500",
"physLocation" => "Denver",
"type" => "EDGE",
+ "status" => "OFFLINE",
"profile" => "EDGE1" })
->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_is( "/response/hostName" => "tc1_ats3")
@@ -118,6 +119,7 @@ ok $t->put_ok('/api/1.2/servers/' . $svr_id . '/update' => {Accept => 'applicat
->json_is( "/response/interfaceMtu" => "1500")
->json_is( "/response/physLocation" => "Denver")
->json_is( "/response/type" => "EDGE")
+ ->json_is( "/response/status" => "OFFLINE")
->json_is( "/response/profile" => "EDGE1")
, 'Does the server details return?';
[2/3] incubator-trafficcontrol git commit: Merge branch 'master' of
https://github.com/jifyang/incubator-trafficcontrol
Posted by mi...@apache.org.
Merge branch 'master' of https://github.com/jifyang/incubator-trafficcontrol
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/942d45ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/942d45ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/942d45ad
Branch: refs/heads/master
Commit: 942d45ad62e4f23ac63553f4cf2be14749a90729
Parents: f79c2f8 5d7b18f
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Jan 5 10:34:18 2017 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Jan 5 10:34:18 2017 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/API/Server2.pm | 7 +++++++
traffic_ops/app/t/api/1.2/server_create.t | 2 ++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
[3/3] incubator-trafficcontrol git commit: This closes #95
Posted by mi...@apache.org.
This closes #95
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/4c95beeb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/4c95beeb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/4c95beeb
Branch: refs/heads/master
Commit: 4c95beebdb56ecf2bbf57529e77487ba4a6c9a75
Parents: 942d45a
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Jan 5 10:44:52 2017 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Jan 5 10:44:52 2017 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------