MCPcopy Create free account
hub / github.com/chrxh/alien / editResource

Method editResource

source/Network/NetworkService.cpp:620–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620bool NetworkService::editResource(std::string const& simId, std::string const& newName, std::string const& newDescription)
621{
622 log(Priority::Important, "network: edit resource with id=" + simId);
623
624 httplib::SSLClient client(_serverAddress);
625 configureClient(client);
626
627 httplib::Params params;
628 params.emplace("userName", *_loggedInUserName);
629 params.emplace("password", *_password);
630 params.emplace("simId", simId);
631 params.emplace("newName", newName);
632 params.emplace("newDescription", newDescription);
633
634 try {
635 auto result = executeRequest([&] { return client.Post("/alien-server/editsimulation.php", params); });
636 return parseBoolResult(result->body);
637 } catch (...) {
638 logNetworkError();
639 return false;
640 }
641}
642
643bool NetworkService::moveResource(std::string const& simId, WorkspaceType targetWorkspace)
644{

Callers 1

processRequestMethod · 0.80

Calls 6

logFunction · 0.85
configureClientFunction · 0.85
executeRequestFunction · 0.85
parseBoolResultFunction · 0.85
logNetworkErrorFunction · 0.85
PostMethod · 0.80

Tested by

no test coverage detected