anchor.diff:      ['GET'].
   
   -spec content_types_provided(#wm_reqdata{}, #context{}) -> {[{string(), atom()}], #wm_reqdata{}, #context{}}.
  -content_types_provided(RD,Ctx) ->        
  +content_types_provided(RD,Ctx) ->
       {[{"application/xml", to_xml}], RD, Ctx}.
   
   
  
positive.code:                         bucket=Bucket,
                          requested_perm='READ',
                          riakc_pid=RiakPid}) ->
      riak_cs_dtrace:dt_bucket_entry(?MODULE, <<"bucket_list_keys">>, 
                                        [], [riak_cs_wm_utils:extract_name(User), Bucket]),
      StrBucket = binary_to_list(Bucket),
      case [B || B <- riak_cs_utils:get_buckets(User),
                 B?RCS_BUCKET.name =:= StrBucket] of
  
negative.code:             CodeName = no_such_bucket,
              Res = riak_cs_s3_response:api_error(CodeName, RD, Ctx),
              Code = riak_cs_s3_response:status_code(CodeName),
              riak_cs_dtrace:dt_wm_return(?MODULE, <<"to_xml">>, [Code], [riak_cs_wm_utils:extract_name(User), Bucket]),
              riak_cs_dtrace:dt_bucket_return(?MODULE, <<"list_keys">>, [Code], [riak_cs_wm_utils:extract_name(User), Bucket]),
              Res;
          [_BucketRecord] ->
              Marker = case wrq:get_qs_value("marker", RD) of
                           undefined ->
                               undefined;
                           M ->
                               list_to_binary(M)
                       end,
              MaxKeys = case wrq:get_qs_value("max-keys", RD) of
                            undefined ->
                                ?DEFAULT_LIST_OBJECTS_MAX_KEYS;
                            StringKeys ->
                                erlang:min(list_to_integer(StringKeys),
                                           ?DEFAULT_LIST_OBJECTS_MAX_KEYS)
                        end,
              Options = [{marker, Marker}],
              ListKeysRequest = riak_cs_list_objects:new_request(Bucket, MaxKeys,
                                                                 Options),
              BinPid = riak_cs_utils:pid_to_binary(self()),
              CacheKey = << BinPid/binary, <<":">>/binary, Bucket/binary >>,
              case riak_cs_list_objects_fsm:start_link(RiakPid, ListKeysRequest, CacheKey) of
                  {ok, ListFSMPid} ->
                      {ok, ListObjectsResponse} = riak_cs_list_objects_fsm:get_object_list(ListFSMPid),
                      Response = riak_cs_xml:to_xml(ListObjectsResponse),
                      ok = riak_cs_stats:update_with_start(bucket_list_keys,
                                                           StartTime),
                      riak_cs_dtrace:dt_wm_return(?MODULE, <<"to_xml">>, [200], [riak_cs_wm_utils:extract_name(User), Bucket]),
                      riak_cs_dtrace:dt_bucket_return(?MODULE, <<"list_keys">>, [200], [riak_cs_wm_utils:extract_name(User), Bucket]),
                      riak_cs_s3_response:respond(200, Response, RD, Ctx);
                  {error, Reason} ->
                      Code = riak_cs_s3_response:status_code(Reason),
                      Response = riak_cs_s3_response:api_error(Reason, RD, Ctx),
                      riak_cs_dtrace:dt_wm_return(?MODULE, <<"to_xml">>, [Code], [riak_cs_wm_utils:extract_name(User), Bucket]),
                      riak_cs_dtrace:dt_bucket_return(?MODULE, <<"list_keys">>, [Code], [riak_cs_wm_utils:extract_name(User), Bucket]),
                      Response
              end
      end.
  