anchor.diff:      %%                    clusterMemberPort=8080&
       %%                    user=admin&password=admin123
       %%
  -    Params = Req:parse_qa(),
  +    Params = Req:parse_qs(),
       OtherHost = proplist:get_value("clusterMemberHostIp", Params),
       OtherPort = proplist:get_value("clusterMemberPort", Params),
       OtherUser = proplist:get_value("user", Params),
  
positive.code:     end,
      ok.
  
  -ifdef(EUNIT).
  
  test() ->
      eunit:test(wrap_tests_with_cache_setup({module, ?MODULE}),
                 [verbose]).
  
  -endif.
  
  handle_traffic_generator_control_post(Req) ->
      PostArgs = Req:parse_post(),
      case proplists:get_value("onOrOff", PostArgs) of
          "off" -> ns_log:log(?MODULE, 100, "Stopping workload from node ~p",
                              erlang:node()),
                   tgen:traffic_stop(),
                   Req:respond({204, [], []});
          "on" -> ns_log:log(?MODULE, 100, "Starting workload from node ~p",
                             erlang:node()),
                  % TODO: Use rpc:multicall here to turn off traffic
                  %       generation across all actual nodes in the cluster.
                  tgen:traffic_start(),
                  Req:respond({204, [], []});
          _ ->
              ns_log:log(?MODULE, 100, "Invalid post to testWorkload controller.  PostArgs ~p evaluated to ~p",
                         [PostArgs, proplists:get_value(PostArgs, "onOrOff")]),
              Req:respond({400, [], "Bad Request\n"})
      end.
  
  handle_bucket_flush(Req, PoolId, Id) ->
      ns_log:log(?MODULE, 100, "Flushing pool ~p bucket ~p from node ~p",
                 [PoolId, Id, erlang:node()]),
      case mc_bucket:bucket_flush(PoolId, Id) of
  
negative.code:                  'DELETE' ->
                       case PathTokens of
                           ["pools", PoolId, "buckets", Id] ->
                               {auth, fun handle_bucket_delete/3, [PoolId, Id]};
                           _ ->
                               ns_log:log(?MODULE, 100, "Invalid delete received: ~p", Req),
                                {done, Req:respond({405, [], "Method Not Allowed"})}
                       end;
                   'PUT' ->
                       case PathTokens of
                           ["pools", PoolId, "buckets", Id] ->
                               {auth, fun handle_bucket_update/3, [PoolId, Id]};
                           _ ->
                               ns_log:log(?MODULE, 100, "Invalid put received: ~p", Req),
                               {done, Req:respond({405, [], "Method Not Allowed"})}
  