=
"n/a";
69 "is not recognized: ";
73shared_ptr<CPSGS_Reply> reply)
75 autonow = psg_clock_t::now();
88reply->GetBytesSent());
96reply->GetBytesSent());
100 if(http_req.
GetPath() ==
"/") {
107reply->Send400(err_msg.c_str());
112reply->GetBytesSent());
116 if(fmt ==
"json") {
126reply->GetBytesSent());
138reply->GetBytesSent());
141}
catch(
constexception & exc) {
143 "Exception when handling no path URL event: "+
144 string(exc.what()));
147reply->GetBytesSent());
150 "Unknown exception when handling no path URL event");
153reply->GetBytesSent());
157 stringbad_url = http_req.
GetPath();
164 autobad_url_size = bad_url.size();
165 if(bad_url_size > 128) {
167bad_url +=
"... (truncated; original length: "+
168to_string(bad_url_size) +
")";
174reply->GetBytesSent());
177}
catch(
constexception & exc) {
179 "Exception when handling a bad URL event: "+
180 string(exc.what()));
183reply->GetBytesSent());
187 "Unknown exception when handling a bad URL event");
190reply->GetBytesSent());
199shared_ptr<CPSGS_Reply> reply)
201 autonow = psg_clock_t::now();
213reply->GetBytesSent());
220reply->GetBytesSent());
227vector<string> enabled_processors;
228vector<string> disabled_processors;
229 boolprocessor_events =
false;
232enabled_processors, disabled_processors,
236reply->GetBytesSent());
245seq_id_type, use_cache)) {
248reply->GetBytesSent());
256reply->GetBytesSent());
267reply->GetBytesSent());
273 doubleresend_timeout;
277reply->GetBytesSent());
281 intsend_blob_if_small = 0;
285reply->GetBytesSent());
289 boolseq_id_resolve =
true;
293reply->GetBytesSent());
297optional<bool> include_hup;
301reply->GetBytesSent());
305unique_ptr<SPSGS_RequestBase>
307 string(seq_id.
data(), seq_id.
size()),
308seq_id_type, exclude_blobs,
309tse_option, use_cache, subst_option,
313send_blob_if_small, seq_id_resolve,
314hops, include_hup,
trace,
316enabled_processors, disabled_processors,
318shared_ptr<CPSGS_Request>
325reply->GetBytesSent());
328}
catch(
constexception & exc) {
330 "Exception when handling a get request: "+
331 string(exc.what()));
334reply->GetBytesSent());
337 "Unknown exception when handling a get request");
340reply->GetBytesSent());
347shared_ptr<CPSGS_Reply> reply)
349 autonow = psg_clock_t::now();
361reply->GetBytesSent());
369reply->GetBytesSent());
376vector<string> enabled_processors;
377vector<string> disabled_processors;
378 boolprocessor_events =
false;
381enabled_processors, disabled_processors,
385reply->GetBytesSent());
394reply->GetBytesSent());
402reply->GetBytesSent());
410reply->GetBytesSent());
414 intsend_blob_if_small = 0;
418reply->GetBytesSent());
425 if(!
x_GetBlobId(http_req, reply, now, blob_id)) {
428reply->GetBytesSent());
432optional<bool> include_hup;
436reply->GetBytesSent());
440unique_ptr<SPSGS_RequestBase>
442blob_id, last_modified,
443tse_option, use_cache,
446send_blob_if_small, hops, include_hup,
trace,
448enabled_processors, disabled_processors, now));
449shared_ptr<CPSGS_Request>
456reply->GetBytesSent());
459}
catch(
constexception & exc) {
461 "Exception when handling a getblob request: "+
462 string(exc.what()));
465reply->GetBytesSent());
468 "Unknown exception when handling a getblob request");
471reply->GetBytesSent());
478shared_ptr<CPSGS_Reply> reply)
480 autonow = psg_clock_t::now();
492reply->GetBytesSent());
500reply->GetBytesSent());
507vector<string> enabled_processors;
508vector<string> disabled_processors;
509 boolprocessor_events =
false;
512enabled_processors, disabled_processors,
516reply->GetBytesSent());
525seq_id_type, use_cache)) {
528reply->GetBytesSent());
537reply->GetBytesSent());
545reply->GetBytesSent());
554reply->GetBytesSent());
558 boolseq_id_resolve =
true;
562reply->GetBytesSent());
567unique_ptr<SPSGS_RequestBase>
569 string(seq_id.
data(), seq_id.
size()),
570seq_id_type, include_data_flags, output_format,
571use_cache, subst_option, seq_id_resolve, hops,
trace,
573enabled_processors, disabled_processors, now));
574shared_ptr<CPSGS_Request>
581reply->GetBytesSent());
584}
catch(
constexception & exc) {
586 "Exception when handling a resolve request: "+
587 string(exc.what()));
590reply->GetBytesSent());
593 "Unknown exception when handling a resolve request");
596reply->GetBytesSent());
603shared_ptr<CPSGS_Reply> reply)
605 autonow = psg_clock_t::now();
617reply->GetBytesSent());
625reply->GetBytesSent());
632vector<string> enabled_processors;
633vector<string> disabled_processors;
634 boolprocessor_events =
false;
637enabled_processors, disabled_processors,
641reply->GetBytesSent());
647 if(!
x_GetId2Chunk(http_req, reply, now, id2_chunk_value)) {
650reply->GetBytesSent());
658reply->GetBytesSent());
666reply->GetBytesSent());
670optional<bool> include_hup;
674reply->GetBytesSent());
679unique_ptr<SPSGS_RequestBase>
681id2_chunk_value, id2_info,
682use_cache, hops, include_hup,
trace, processor_events,
683enabled_processors, disabled_processors, now));
684shared_ptr<CPSGS_Request>
691reply->GetBytesSent());
694}
catch(
constexception & exc) {
696 "Exception when handling a get_tse_chunk request: "+
697 string(exc.what()));
700reply->GetBytesSent());
703 "Unknown exception when handling a get_tse_chunk request");
706reply->GetBytesSent());
713shared_ptr<CPSGS_Reply> reply)
715 autonow = psg_clock_t::now();
727reply->GetBytesSent());
735reply->GetBytesSent());
742vector<string> enabled_processors;
743vector<string> disabled_processors;
744 boolprocessor_events =
false;
747enabled_processors, disabled_processors,
751reply->GetBytesSent());
761seq_id_type, use_cache,
true)) {
764reply->GetBytesSent());
773reply->GetBytesSent());
783 "Invalid 'fmt' parameter value. The 'get_na' " 784 "request supports 'json' and 'native' values");
787reply->GetBytesSent());
793vector<string>
names;
797reply->GetBytesSent());
803vector<string> seq_ids;
810 if(seq_id.
empty() && seq_ids.empty()) {
813 "' are found in the request");
816reply->GetBytesSent());
823 if(!seq_ids.empty()) {
824 sort(seq_ids.begin(), seq_ids.end());
825 auto last= unique(seq_ids.begin(), seq_ids.end());
826seq_ids.erase(
last, seq_ids.end());
829 if(!seq_id.
empty()) {
830 autoit = find(seq_ids.begin(), seq_ids.end(), seq_id);
831 if(it != seq_ids.end()) {
841reply->GetBytesSent());
847 intsend_blob_if_small = 0;
851reply->GetBytesSent());
855 doubleresend_timeout;
859reply->GetBytesSent());
863 boolseq_id_resolve =
true;
867reply->GetBytesSent());
871optional<CSeq_id::ESNPScaleLimit> snp_scale_limit;
875reply->GetBytesSent());
879optional<bool> include_hup;
883reply->GetBytesSent());
888unique_ptr<SPSGS_RequestBase>
890 string(seq_id.
data(), seq_id.
size()),
891seq_id_type,
names, use_cache,
896tse_option, send_blob_if_small, seq_id_resolve,
898hops, include_hup,
trace, processor_events,
899enabled_processors, disabled_processors,
901shared_ptr<CPSGS_Request>
908reply->GetBytesSent());
911}
catch(
constexception & exc) {
913 "Exception when handling a get_na request: "+
914 string(exc.what()));
917reply->GetBytesSent());
920 "Unknown exception when handling a get_na request");
923reply->GetBytesSent());
930shared_ptr<CPSGS_Reply> reply)
932 autonow = psg_clock_t::now();
945reply->GetBytesSent());
953reply->GetBytesSent());
960vector<string> enabled_processors;
961vector<string> disabled_processors;
962 boolprocessor_events =
false;
965enabled_processors, disabled_processors,
970reply->GetBytesSent());
979seq_id_type, use_cache)) {
983reply->GetBytesSent());
988unique_ptr<SPSGS_RequestBase>
990 string(seq_id.
data(), seq_id.
size()),
991seq_id_type, use_cache, hops,
trace, processor_events,
992enabled_processors, disabled_processors,
994shared_ptr<CPSGS_Request>
1002reply->GetBytesSent());
1005}
catch(
constexception & exc) {
1007 "Exception when handling an accession_version_history request: "+
1008 string(exc.what()));
1012reply->GetBytesSent());
1015 "Unknown exception when handling an accession_version_history request");
1019reply->GetBytesSent());
1027shared_ptr<CPSGS_Reply> reply)
1029 autonow = psg_clock_t::now();
1041reply->GetBytesSent());
1049reply->GetBytesSent());
1054vector<string> enabled_processors;
1055vector<string> disabled_processors;
1056 boolprocessor_events =
false;
1059disabled_processors)) {
1062reply->GetBytesSent());
1066processor_events =
false;
1070reply->GetBytesSent());
1074optional<string> protein;
1078reply->GetBytesSent());
1082optional<string> nucleotide;
1086reply->GetBytesSent());
1091 if(!
x_GetIPG(http_req, reply, now, ipg)) {
1094reply->GetBytesSent());
1099 if(nucleotide.has_value()) {
1100 if(!protein.has_value()) {
1102 "If a 'nucleotide' parameter is provided " 1103 "then a 'protein' parameter" 1104 " must be provided as well");
1107reply->GetBytesSent());
1113 if(ipg == -1 && !protein.has_value()) {
1115 "At least one of the 'protein' and 'ipg' " 1116 "parameters must be provided");
1119reply->GetBytesSent());
1127reply->GetBytesSent());
1131 boolseq_id_resolve =
true;
1135reply->GetBytesSent());
1143reply->GetBytesSent());
1148unique_ptr<SPSGS_RequestBase>
1155 trace, processor_events,
1156enabled_processors, disabled_processors,
1158shared_ptr<CPSGS_Request>
1165reply->GetBytesSent());
1168}
catch(
constexception & exc) {
1170 "Exception when handling an IPG resolve request: "+
1171 string(exc.what()));
1174reply->GetBytesSent());
1177 "Unknown exception when handling an IPG resolve request");
1180reply->GetBytesSent());
1195GetConfig().Write(conf);
1201 stringconf_file_content =
string(converter);
1202vector<string> lines;
1204 if(!lines.empty()) {
1205 for(
size_tk = 0; k < lines.size(); ++k) {
1206 autopos = lines[k].find_first_not_of(
" \n\r\t");
1208 if(pos == string::npos) {
1209l_stripped = lines[k];
1211l_stripped = lines[k].substr(pos);
1214 if(
strncasecmp(l_stripped.c_str(),
"auth_token", 10) == 0) {
1215lines[k] =
"auth_token=*****";
1218conf_file_content = lines[k];
1220conf_file_content += lines[k];
1222 if(k != lines.size() - 1) {
1223conf_file_content +=
"\n";
1234shared_ptr<CPSGS_Reply> reply)
1238 autonow = psg_clock_t::now();
1260}
catch(
constexception & exc) {
1262 "Exception when handling a config request: "+
1263 string(exc.what()));
1266reply->GetBytesSent());
1269 "Unknown exception when handling a config request");
1272reply->GetBytesSent());
1308shared_ptr<CPSGS_Reply> reply)
1312 autonow = psg_clock_t::now();
1343 if(process_time_result) {
1354 if(physical_memory > 0)
1361 if(mem_used_result) {
1362 if(mem_usage.
total> 0)
1382 if(mem_usage.
shared> 0)
1387 if(mem_usage.
data> 0)
1392 if(mem_usage.
stack> 0)
1397 if(mem_usage.
text> 0)
1402 if(mem_usage.
lib> 0)
1407 if(mem_usage.
swap> 0)
1424 intproc_fd_soft_limit;
1425 intproc_fd_hard_limit;
1428&proc_fd_hard_limit);
1430 if(proc_fd_soft_limit >= 0)
1435 if(proc_fd_hard_limit >= 0)
1440 if(proc_fd_used >= 0)
1448 if(proc_thread_count >= 1)
1459app->GetExcludeBlobCache()->Size());
1463 for(
autoitem: concurrent_procs) {
1472reply->SetContentLength(content.size());
1473reply->SendOk(content.data(), content.size(),
false);
1477reply->GetBytesSent());
1479}
catch(
constexception & exc) {
1481 "Exception when handling an info request: "+
1482 string(exc.what()));
1485reply->GetBytesSent());
1488 "Unknown exception when handling an info request");
1491reply->GetBytesSent());
1498shared_ptr<CPSGS_Reply> reply)
1502 autonow = psg_clock_t::now();
1552 autonow = psg_clock_t::now();
1553 uint64_tsec = chrono::duration_cast<chrono::seconds>
1567reply->SetContentLength(content.size());
1568reply->SendOk(content.data(), content.size(),
false);
1573}
catch(
constexception & exc) {
1575 "Exception when handling a status request: "+
1576 string(exc.what()));
1579reply->GetBytesSent());
1582 "Unknown exception when handling a status request");
1585reply->GetBytesSent());
1595shared_ptr<CPSGS_Reply> reply)
1599 autonow = psg_clock_t::now();
1617 if(username_param.
m_Found) {
1624 if(timeout_param.
m_Found) {
1626timeout = stoi(
string(timeout_param.
m_Value.
data(),
1629 msg=
"Invalid shutdown request: cannot convert timeout to an integer. ";
1630 if(username.empty())
1631 msg+=
"Unknown user";
1633 msg+=
"User: "+ username;
1639reply, now,
"Invalid timeout (must be a positive integer)",
1644reply->GetBytesSent());
1649 msg=
"Invalid shutdown request: timeout must be >= 0. ";
1650 if(username.empty())
1651 msg+=
"Unknown user";
1653 msg+=
"User: "+ username;
1657reply, now,
"Invalid timeout (must be a positive integer)",
1662reply->GetBytesSent());
1671 msg=
"Shutdown request received from ";
1672 if(username.empty())
1673 msg+=
"an unknown user";
1677 autonow = psg_clock_t::now();
1678 autoexpiration = now;
1680expiration += chrono::seconds(timeout);
1685 msg+=
". The previous shutdown expiration is shorter " 1686 "than this one. Ignored.";
1688reply->Send409(
msg.c_str());
1691reply->GetBytesSent());
1702reply->GetBytesSent());
1707}
catch(
constexception & exc) {
1709 "Exception when handling a shutdown request: "+
1710 string(exc.what()));
1713reply->GetBytesSent());
1716 "Unknown exception when handling a shutdown request");
1719reply->GetBytesSent());
1726shared_ptr<CPSGS_Reply> reply)
1730 autonow = psg_clock_t::now();
1748reply->SetContentLength(content.size());
1749reply->SendOk(content.data(), content.size(),
false);
1754}
catch(
constexception & exc) {
1756 "Exception when handling a get alerts request: "+
1757 string(exc.what()));
1760reply->GetBytesSent());
1763 "Unknown exception when handling a get alerts request");
1766reply->GetBytesSent());
1773shared_ptr<CPSGS_Reply> reply)
1775 autonow = psg_clock_t::now();
1787reply->GetBytesSent());
1795reply->GetBytesSent());
1813reply->GetBytesSent());
1818 if(!username_param.
m_Found) {
1823reply->GetBytesSent());
1840reply->GetBytesSent());
1845 msg=
"Alert "+ alert +
" has already been acknowledged";
1846reply->SendOk(
msg.data(),
msg.size(),
false);
1849reply->GetBytesSent());
1854reply->SendOk(
nullptr, 0,
true);
1857reply->GetBytesSent());
1861}
catch(
constexception & exc) {
1863 "Exception when handling an acknowledge alert request: "+
1864 string(exc.what()));
1867reply->GetBytesSent());
1870 "Unknown exception when handling an acknowledge alert request");
1873reply->GetBytesSent());
1880shared_ptr<CPSGS_Reply> reply)
1882 autonow = psg_clock_t::now();
1894reply->GetBytesSent());
1902reply->GetBytesSent());
1916 boolreset =
false;
1924reply->GetBytesSent());
1927reset = reset_param.
m_Value==
"yes";
1935reply->SendOk(
nullptr, 0,
true);
1938reply->GetBytesSent());
1943 intmost_recent_time = INT_MIN;
1945 if(most_recent_time_param.
m_Found) {
1949 if(most_recent_time < 0)
1952 "). It must be >= 0.";
1956 "). It must be an integer >= 0.";
1959 if(!err_msg.empty()) {
1963reply->GetBytesSent());
1968 intmost_ancient_time = INT_MIN;
1970 if(most_ancient_time_param.
m_Found) {
1974 if(most_ancient_time < 0)
1977 "). It must be >= 0.";
1981 "). It must be an integer >= 0.";
1984 if(!err_msg.empty()) {
1988reply->GetBytesSent());
1993 if(most_ancient_time >= 0 && most_recent_time >= 0) {
1995 if(most_recent_time > most_ancient_time) {
1996 swap(most_recent_time, most_ancient_time);
2000vector<CTempString> histogram_names;
2002 if(histogram_names_param.
m_Found) {
2006vector<pair<int, int>> time_series;
2010reply->GetBytesSent());
2022reply->SetContentLength(content.size());
2023reply->SendOk(content.data(), content.size(),
false);
2028}
catch(
constexception & exc) {
2030 "Exception when handling a statistics request: "+
2031 string(exc.what()));
2034reply->GetBytesSent());
2037 "Unknown exception when handling a statistics request");
2040reply->GetBytesSent());
2047shared_ptr<CPSGS_Reply> reply)
2051 autonow = psg_clock_t::now();
2067reply->SetContentLength(content.size());
2068reply->SendOk(content.data(), content.size(),
false);
2072reply->GetBytesSent());
2074}
catch(
constexception & exc) {
2076 "Exception when handling a dispatcher_status request: "+
2077 string(exc.what()));
2080reply->GetBytesSent());
2083 "Unknown exception when handling a dispatcher_status request");
2086reply->GetBytesSent());
2093shared_ptr<CPSGS_Reply> reply)
2097 autonow = psg_clock_t::now();
2112content.append(1,
'{')
2113.append(
"\"hard_limit_conn_refused_cnt\": ")
2117content.append(
", ")
2118.append(
"\"soft_limit_req_rejected_cnt\": ")
2122content.append(
", ")
2123.append(
"\"incoming_connections_cnt\": ")
2127content.append(
", ")
2128.append(
"\"finished_requests_cnt\": ")
2132content.append(
", ")
2133.append(
"\"conn_alert_limit\": ")
2137content.append(
", ")
2138.append(
"\"conn_soft_limit\": ")
2142content.append(
", ")
2143.append(
"\"conn_hard_limit\": ")
2147content.append(
", ")
2148.append(
"\"conn_throttle_threshold\": ")
2152content.append(
", ")
2153.append(
"\"conn_throttle_by_host\": ")
2157content.append(
", ")
2158.append(
"\"conn_throttle_by_site\": ")
2162content.append(
", ")
2163.append(
"\"conn_throttle_by_process\": ")
2167content.append(
", ")
2168.append(
"\"conn_throttle_by_user_agent\": ")
2172content.append(
", ")
2173.append(
"\"new_throttled_cnt\": ")
2177content.append(
", ")
2178.append(
"\"old_throttled_cnt\": ")
2182content.append(
", ")
2183.append(
"\"conn_throttle_close_idle_ms\": ")
2186content.append(
", ")
2187.append(
"\"conn_info\": ")
2188.append(
m_HttpDaemon->GetConnectionsStatus(reply->GetConnectionId()))
2192reply->SetContentLength(content.size());
2193reply->SendOk(content.data(), content.size(),
false);
2197reply->GetBytesSent());
2199}
catch(
constexception & exc) {
2201 "Exception when handling a connections_status request: "+
2202 string(exc.what()));
2205reply->GetBytesSent());
2208 "Unknown exception when handling a connections_status request");
2211reply->GetBytesSent());
2218shared_ptr<CPSGS_Reply> reply)
2222 autonow = psg_clock_t::now();
2236reply->GetBytesSent());
2240 stringpeer_user_agent;
2244reply->GetBytesSent());
2249reply->UpdatePeerIdAndUserAgent(peer_id, peer_user_agent);
2251reply->SetContentLength(0);
2252reply->SendOk(
"", 0,
true);
2256reply->GetBytesSent());
2258}
catch(
constexception & exc) {
2259 stringerr_msg =
"Exception when handling a hello request: "+
string(exc.what());
2261reply->SetContentLength(err_msg.size());
2262reply->Send500(err_msg.c_str());
2267reply->GetBytesSent());
2269 stringerr_msg =
"Unknown exception when handling a hello request";
2271reply->SetContentLength(err_msg.size());
2272reply->Send500(err_msg.c_str());
2277reply->GetBytesSent());
2284shared_ptr<CPSGS_Reply> reply)
2286 autonow = psg_clock_t::now();
2287 boolneed_log =
false;
2294reply->GetBytesSent());
2302reply->GetBytesSent());
2315need_log = log_param.
m_Value==
"yes";
2329 if(data_size_param.
m_Found) {
2333 "' parameter. Accepted values are 0..."+
2343reply->GetBytesSent());
2358reply->GetBytesSent());
2366reply->SetContentLength(data_size);
2374reply->GetBytesSent());
2377}
catch(
constexception & exc) {
2379 "Exception when handling a test io request: "+
2380 string(exc.what()));
2384reply->GetBytesSent());
2387 "Unknown exception when handling a test io request");
2391reply->GetBytesSent());
2398shared_ptr<CPSGS_Reply> reply)
2400 autonow = psg_clock_t::now();
2412reply->GetBytesSent());
2420reply->GetBytesSent());
2431 int32_tmax_sat = current_schema->GetMaxBlobKeyspaceSat();
2433json.append(1,
'{');
2434 for(
int32_tsat_n = 0; sat_n <= max_sat; ++sat_n) {
2435optional<SSatInfoEntry> entry = current_schema->GetBlobKeyspace(sat_n);
2436 if(entry.has_value()) {
2437 if(some) json.append(1,
',');
2442json.append(1,
'"')
2447.append(entry->keyspace)
2451json.append(1,
'}');
2454reply->SetContentLength(json.size());
2455reply->SendOk(json.data(), json.size(),
false);
2460}
catch(
constexception & exc) {
2462 "Exception when handling a get sat mapping request: "+
2463 string(exc.what()));
2466reply->GetBytesSent());
2469 "Unknown exception when handling a get sat mapping request");
2472reply->GetBytesSent());
2508reply->SetContentLength(content.size());
2513reply->SetContentLength(0);
2528 if(reply->GetExceedSoftLimitFlag()) {
2537reply->ResetExceedSoftLimitFlag();
2538 m_HttpDaemon->MigrateConnectionFromAboveLimitToBelowLimit();
2544 string msg=
"Too many client connections (currently: "+
2545to_string(current_conn_num) +
2546 "; at the time of establishing: "+
2547to_string(reply->GetConnCntAtOpen()) +
2548 "), it is over the limit ("+
2557reply->IncrementRejectedDueToSoftLimit();
2569 if(reply->GetExceedSoftLimitFlag()) {
2578reply->ResetExceedSoftLimitFlag();
2579 m_HttpDaemon->MigrateConnectionFromAboveLimitToBelowLimit();
2585 string msg=
"Too many client connections (currently: "+
2586to_string(current_conn_num) +
2587 "; at the time of establishing: "+
2588to_string(reply->GetConnCntAtOpen()) +
2589 "), it is over the limit ("+
2600reply->SetContentLength(content.size());
2605reply->SetContentLength(0);
2612reply->IncrementRejectedDueToSoftLimit();
2623shared_ptr<CPSGS_Request> request,
2624shared_ptr<CPSGS_Reply> reply)
2626list<string> processor_names =
2628 if(processor_names.empty())
2634reply->SetRequestId(request->GetRequestId());
2636 autohttp_conn = reply->GetHttpReply()->GetHttpConnection();
2637http_conn->Postpone(request, reply, std::move(processor_names));
2646shared_ptr<CPSGS_Reply> reply,
2661 boolauth_good =
false;
2662 if(auth_token.has_value()) {
2674 if(username_param.
m_Found) {
2679 string msg=
"Unauthorized "+ request_name +
" request: ";
2680 if(auth_token.has_value()) {
2681 msg+=
"invalid authorization token. ";
2683 msg+=
"authorization token not found. ";
2686 if(username.empty()) {
2687 msg+=
"Unknown user";
2689 msg+=
"User: "+ username;
2697reply, now,
"Request is not authorized",
2702reply->GetBytesSent());
void PopulatePerRequestMomentousDictionary(CJsonNode &dict)
size_t GetActiveProcGroupCounter(void)
@ ePSGS_AlertAcknowledged
@ ePSGS_AlertAlreadyAcknowledged
@ ePSGS_TcpConnSoftLimitExceeded
optional< string > GetAdminAuthToken(void)
static CJsonNode NewArrayNode()
Create a new JSON array node.
string Repr(TReprFlags flags=0) const
Return a string representation of this node.
void SetString(const string &key, const string &value)
Set a JSON object element to the specified string value.
void SetByKey(const string &key, CJsonNode::TInstance value)
For a JSON object node, insert a new element or update an existing element.
static CJsonNode NewObjectNode()
Create a new JSON object node.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
void Register(EPSGS_AlertType alert_type, const string &message)
CJsonNode Serialize(void) const
EPSGS_AlertAckResult Acknowledge(const string &alert_id, const string &user)
@ ePSGS_MyNCBIErrorCacheSize
@ ePSGS_GracefulShutdownExpiredInSec
@ ePSGS_NumConnHardLimitExceeded
@ ePSGS_CassandraActiveStatements
@ ePSGS_SplitInfoCacheSize
@ ePSGS_ActiveProcessorGroups
@ ePSGS_ShutdownRequested
@ ePSGS_NonProtocolRequests
@ ePSGS_NumConnBadToGoodMigration
@ ePSGS_NumReqRefusedDueToSoftLimit
@ ePSGS_NumberOfConnections
@ ePSGS_MyNCBIOKCacheSize
@ ePSGS_IncomingConnectionsCounter
@ ePSGS_NoProcessorInstantiated
@ ePSGS_SatMappingRequest
@ ePSGS_MyNCBINotFoundCacheSize
@ ePSGS_AnnotationRequest
@ ePSGS_BlobBySatSatKeyRequest
@ ePSGS_IPGResolveRequest
@ ePSGS_AccessionVersionHistoryRequest
@ ePSGS_BlobBySeqIdRequest
void x_Finish500(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, EPSGS_PubseqGatewayErrorCode code, const string &err_msg)
bool x_GetAccessionSubstitutionOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_AccSubstitutioOption &acc_subst_option)
int OnConfig(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< CHttpDaemon > m_HttpDaemon
unique_ptr< CMyNCBIErrorCache > m_MyNCBIErrorCache
int OnGet(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
void x_SendZEndPointReply(CRequestStatus::ECode http_status, shared_ptr< CPSGS_Reply > reply, const string *payload)
bool x_GetIPG(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &ipg)
bool x_GetPeerUserAgentParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &peer_user_agent)
bool x_GetId2Info(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &id2_info)
bool x_IsBoolParamValid(const string ¶m_name, const CTempString ¶m_value, string &err_msg) const
int OnShutdown(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
void x_MalformedArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)
bool x_GetIntrospectionFormat(CHttpRequest &req, string &fmt, string &err_msg)
int OnConnectionsStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnGetBlob(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetLastModified(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &last_modified)
bool x_GetIncludeHUPParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< bool > &include_hup)
bool x_DispatchRequest(CRef< CRequestContext > &context, shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply)
int OnGetAlerts(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetNames(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &names)
void x_PrintRequestStop(CRef< CRequestContext > &context, CPSGS_Request::EPSGS_Type request_type, CRequestStatus::ECode status, size_t bytes_sent)
void x_InsufficientArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)
bool x_CheckAuthorization(const string &request_name, CRef< CRequestContext > context, CHttpRequest &http_req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now)
bool x_GetTSEOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobRequestBase::EPSGS_TSEOption &tse_option)
SPubseqGatewaySettings m_Settings
bool x_GetSeqIdResolveParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &auto_blob_skipping)
int OnStatistics(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnTestIO(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetProcessorEventsParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &processor_events)
int OnAckAlert(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnGetNA(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< COperationTiming > m_Timing
int OnGetSatMapping(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetNucleotide(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &nucleotide)
string x_GetCmdLineArguments(void) const
bool x_GetSNPScaleLimit(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< CSeq_id::ESNPScaleLimit > &snp_scale_limit)
unique_ptr< CMyNCBIOKCache > m_MyNCBIOKCache
shared_ptr< CSatInfoSchemaProvider > m_CassSchemaProvider
bool x_ProcessCommonGetAndResolveParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, CTempString &seq_id, int &seq_id_type, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache, bool seq_id_is_optional=false)
bool x_GetResendTimeout(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, double &resend_timeout)
unique_ptr< CMyNCBINotFoundCache > m_MyNCBINotFoundCache
bool x_GetEnabledAndDisabledProcessors(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &enabled_processors, vector< string > &disabled_processors)
int OnGetTSEChunk(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< CPSGS_Dispatcher > m_RequestDispatcher
int OnStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
void x_SendMessageAndCompletionChunks(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &message, CRequestStatus::ECode status, int code, EDiagSev severity)
CRef< CRequestContext > x_CreateRequestContext(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetResolveFlags(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::TPSGS_BioseqIncludeData &include_data_flags)
unique_ptr< CPSGSCounters > m_Counters
bool x_GetPeerIdParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &peer_id)
unique_ptr< char[]> m_IOTestBuffer
bool x_GetCommonIDRequestParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace, int &hops, vector< string > &enabled_processors, vector< string > &disabled_processors, bool &processor_events)
bool x_GetOutputFormat(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::EPSGS_OutputFormat &output_format)
bool x_IsShuttingDown(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now)
int OnInfo(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_IsConnectionAboveSoftLimitForZEndPoints(shared_ptr< CPSGS_Reply > reply, bool verbose)
static CPubseqGatewayApp * GetInstance(void)
bool x_IsConnectionAboveSoftLimit(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &create_timestamp)
SRequestParameter x_GetParam(CHttpRequest &req, const string &name) const
vector< string > x_GetExcludeBlobs(CHttpRequest &req) const
bool x_IsShuttingDownForZEndPoints(shared_ptr< CPSGS_Reply > reply, bool verbose)
bool x_GetTimeSeries(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< pair< int, int >> &time_series)
bool x_GetId2Chunk(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &id2_chunk)
int OnIPGResolve(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnHello(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetTraceParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace)
shared_ptr< CCassConnection > m_CassConnection
bool x_GetBlobId(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobId &blob_id)
int OnAccessionVersionHistory(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnResolve(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetUseCacheParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache)
bool x_GetProtein(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &protein)
int OnBadURL(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetSendBlobIfSmallParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int &send_blob_if_small)
string x_PrepareConfigJson(void)
int OnDispatcherStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< CSplitInfoCache > m_SplitInfoCache
static unsigned int GetCpuCount(void)
Return number of active CPUs/cores (never less than 1).
static Uint8 GetTotalPhysicalMemorySize(void)
Return the amount of actual/total physical memory, in bytes.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
static const struct name_t names[]
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
CDiagContext_Extra & Print(const string &name, const string &value)
The method does not print the argument, but adds it to the string.
CDiagContext & GetDiagContext(void)
Get diag context instance.
static void SetRequestContext(CRequestContext *ctx)
Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext()
CDiagContext_Extra Extra(void) const
Create a temporary CDiagContext_Extra object.
static TPID GetPID(void)
Get cached PID (read real PID if not cached yet).
@ eDiag_Error
Error message.
@ e503_ServiceUnavailable
@ e500_InternalServerError
uint64_t Uint8
8-byte (64-bit) unsigned integer
size_t resident_peak
Peak resident set size ("high water mark")
static int GetThreadCount(void)
Get the number of threads in the current process.
size_t total_peak
Peak total memory usage.
size_t resident
Resident/working set size (RSS).
static int GetFileDescriptorsCount(int *soft_limit=NULL, int *hard_limit=NULL)
Get the number of file descriptors consumed by the current process, and optional system wide file des...
size_t total
Total memory usage.
size_t shared
Shared memory usage.
size_t text
Text (code) segment size.
static bool GetMemoryUsage(SMemoryUsage &usage)
Get current process memory usage.
size_t swap
Swap space usage.
size_t lib
Shared library code size.
size_t data
Data segment size.
static bool GetTimes(double *real, double *user, double *sys, EWhat what=eProcess)
Get current process execution times.
size_t stack
Stack size of the initial thread in the process.
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Int8.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
const char * data(void) const
Return a pointer to the array represented.
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to long.
size_type size(void) const
Return the length of the represented array.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
constexpr auto sort(_Init &&init)
Defines NCBI C++ diagnostic APIs, classes, and macros.
Multi-threading â classes, functions, and features.
const long kMaxTestIOSize
static string kBadUrlMessage
static string kHistogramNamesParam
static string kProcFDUsed
static string kConcurrentPrefix
static string kMemoryUsedSwap
static string kProcThreadCount
SShutdownData g_ShutdownData
static string kConfigurationFilePath
static string kProcFDSoftLimit
static string kMemoryUsedTotal
static string kMemoryUsedShared
static string kSeqIdsParam
static string kSystemTime
static string kPhysicalMemory
static string kUsernameParam
static string kMemoryUsedResidentPeak
static string kMemoryUsedText
static size_t s_ShutdownSize
static string kTimeoutParam
static string kDataSizeParam
static string kExcludeBlobCacheUserCount
static string kMostRecentTimeParam
static string kMemoryUsedData
static string kConfiguration
static string kMemoryUsedStack
static string kTSELastModifiedParam
static string kMemoryUsedLib
static const char * s_Shutdown
static string kShuttingDownMsg
static string kCommandLineArguments
static string kMostAncientTimeParam
static string kMemoryUsedResident
static string kExecutablePath
static string kProcFDHardLimit
static string kAlertParam
static string kResetParam
static string kClientIdParam
static string kMemoryUsedTotalPeak
static string kStartupDataState
#define PSG_ERROR(message)
#define PSG_MESSAGE(message)
#define PSG_WARNING(message)
@ ePSGS_GetSatMappingError
@ ePSGS_ConnectionsStatusError
@ ePSGS_DispatcherStatusError
@ ePSGS_MalformedParameter
@ ePSGS_InsufficientArguments
@ ePSGS_ConnectionExceedsSoftLimit
psg_clock_t::time_point psg_time_point_t
string SanitizeInputValue(const string &input_val)
long PSGToString(long signed_value, char *buf)
string GetCassStartupDataStateMessage(EPSGS_StartupDataState state)
#define PUBSEQ_GATEWAY_BUILD_DATE
#define PUBSEQ_GATEWAY_VERSION
Defines CRequestContext class for NCBI C++ diagnostic API.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Process memory usage information, in bytes.
EPSGS_AccSubstitutioOption
@ ePSGS_DefaultAccSubstitution
int TPSGS_BioseqIncludeData
int64_t m_TcpMaxConnAlertLimit
size_t m_ConnThrottleByProcess
size_t m_ConnThrottleThreshold
size_t m_ConnThrottleByUserAgent
bool IsAuthProtectedCommand(const string &cmd) const
int64_t m_TcpMaxConnSoftLimit
size_t m_ConnThrottleByHost
double m_ConnThrottleCloseIdleSec
size_t m_ConnThrottleBySite
atomic_bool m_ShutdownRequested
psg_time_point_t m_Expired
static CS_CONTEXT * context
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4