ATLAS Offline Software
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Crest::CrestClient Class Reference

#include <CrestApi.h>

Inheritance diagram for Crest::CrestClient:
Collaboration diagram for Crest::CrestClient:

Public Member Functions

 CrestClient (const std::string &host, const std::string &port, bool checkVersion=false)
 CrestClient constructor. More...
 
 CrestClient (std::string_view url, bool checkVersion=false)
 CrestClient constructor. More...
 
 ~CrestClient ()
 CrestClient destructor. More...
 
void checkCrestVersion ()
 This method is a CREST version test. More...
 
void createGlobalTag (GlobalTagDto &globalTag) override
 This method creates a global tag on CREST server. More...
 
GlobalTagDto findGlobalTag (const std::string &name) override
 This method finds a global tag by name on the CREST server. More...
 
GlobalTagSetDto listGlobalTags (const std::string &name, int size, int page, const std::string &sort) override
 This method finds the global tags on the CREST server. More...
 
void removeGlobalTag (const std::string &name) override
 This method removes a global tag on the CREST server. More...
 
void createTag (TagDto &tag) override
 This method creates a tag on the CREST server. More...
 
TagDto findTag (const std::string &name) override
 This method finds a tag by the name on the CREST server. More...
 
TagSetDto listTags (const std::string &name, int size, int page, const std::string &sort) override
 This method returns the tag list as TagSetDto from the CREST server. More...
 
void removeTag (const std::string &name) override
 This method removes a tag from the CREST server. More...
 
int getSize (const std::string &tagname) override
 This method gets the number of IOVs for the given tag. More...
 
void createTagMeta (TagMetaDto &tag) override
 This method creates a tag meta info on the CREST server. More...
 
void updateTagMeta (TagMetaDto &tag) override
 This method updates a tag meta info on the CREST server. More...
 
TagMetaDto findTagMeta (const std::string &name) override
 This method reads a tag meta info by the tag name from the CREST server. More...
 
void createGlobalTagMap (GlobalTagMapDto &globalTagMap) override
 This method creates a global tag map on the CREST server. More...
 
GlobalTagMapSetDto findGlobalTagMap (const std::string &name, const std::string &xCrestMapMode) override
 This method searches for tag mappings using the global tag name or tag name on the CREST server. More...
 
void removeGlobalTagMap (const std::string &name, const std::string &record, const std::string &label, const std::string &tagname) override
 This method removes a global tag map on the CREST server. More...
 
IovSetDto selectIovs (const std::string &name, uint64_t since, uint64_t until, long snapshot, int size, int page, const std::string &sort) override
 This method selects IOVs for a given tagname on the CREST server. More...
 
IovSetDto selectGroups (const std::string &name, long snapshot, int size, int page, const std::string &sort) override
 This method returns IOV groups for a given tagname on CREST server. More...
 
void storeData (const std::string &tag, const StoreSetDto &storeSetJson, const std::string &payloadFormat="JSON", const std::string &objectType="none", const std::string &compressionType="none", const std::string &version="1.0", uint64_t endTime=-1) override
 This method stores several payloads in batch mode on the CREST server. More...
 
std::string getPayload (const std::string &hash) override
 This method finds a payload resource associated to the hash on the CREST server. More...
 
PayloadDto getPayloadMeta (const std::string &hash) override
 This method finds a payload meta info for the hash on the CREST server. More...
 

Static Public Attributes

static const bool s_CREST_CLIENT_CHECK = false
 

Private Member Functions

std::string makeUrl (const std::string &address) const
 
nlohmann::json getMgmtInfo ()
 This is an auxiliary method to read the CREST Server properties. More...
 
std::string getClientVersion ()
 This method returns the full CrestApi version. More...
 
std::string getCrestVersion ()
 This method returns the full CREST Server version. More...
 
int getMajorVersion (std::string &str)
 This is an auxiliary method to extract a major version number from full version string. More...
 
nlohmann::json getJson (const std::string &str, const char *method) const
 Auxiliary method to convert string in to JSON object. More...
 
std::string parseXMLOutput (const std::string_view xmlBuffer) const
 This method removes all XML/HTML tags from a string. More...
 
std::string removeCR (const std::string &str) const
 This method removes all end of line and carriage return symbols from a string. More...
 

Private Attributes

std::string m_PATH = DEFAULT_CREST_API_VERSION
 
std::string m_host
 
std::string m_port
 
std::string m_prefix = "http://"
 
Crest::CrestRequest m_request = Crest::CrestRequest()
 

Static Private Attributes

static const std::string s_TAG_PATH = "/tags"
 
static const std::string s_ADMIN_PATH = "/admin"
 
static const std::string s_IOV_PATH = "/iovs"
 
static const std::string s_IOV_SIZE_PATH = "/size"
 
static const std::string s_GLOBALTAG_PATH = "/globaltags"
 
static const std::string s_GLOBALTAG_MAP_PATH = "/globaltagmaps"
 
static const std::string s_PAYLOAD_PATH = "/payloads"
 
static const std::string s_MONITORING_PAYLOAD_PATH = "/monitoring/payloads"
 
static const std::string s_META_PATH = "/meta"
 
static const std::string s_DATA_PATH = "/data"
 
static const std::string s_FOLDER_PATH = "/folders"
 
static const std::string s_RUNINFO_PATH = "/runinfo"
 
static const std::string s_RUNINFO_LIST_PATH = "/list"
 
static const std::string s_METHOD_IOVS = "IOVS"
 
static const std::string s_METHOD_GROUPS = "GROUPS"
 
static const std::string s_MGMT_PATH = "/mgmt"
 
static const std::string s_MGMT_INFO_PATH = "/info"
 
static const std::string s_CREST_CLIENT_VERSION = "5.0"
 
static const std::string s_MGMT_INFO_PATH_2 = "/actuator/info"
 

Detailed Description

Definition at line 32 of file CrestApi.h.

Constructor & Destructor Documentation

◆ CrestClient() [1/2]

Crest::CrestClient::CrestClient ( const std::string &  _host,
const std::string &  _port,
bool  check_version = false 
)

CrestClient constructor.

CrestClient constructor for Internet mode.

Parameters
host- host name of the CREST Server.
port- port of the CREST Server.
check_version- the parameter to switch CREST version checking, if this parameter is true, the CREST version test will be executed.

If CrestClient is created with this method the data will be sent to the CREST Server.

Parameters
_host- host name of the CREST Server.
_port- port of the CREST Server.
check_version- the parameter to switch CREST version checking, if this parameter is true, the CREST version test will be executed.

Definition at line 36 of file CrestApi.cxx.

36  : m_host(_host), m_port(_port)
37  {
38  if (check_version == true)
39  {
41  }
45  }

◆ CrestClient() [2/2]

Crest::CrestClient::CrestClient ( std::string_view  url,
bool  check_version = false 
)

CrestClient constructor.

CrestClient constructor for Internet mode.

Parameters
url- URL address of the CREST Server (with port).
check_version- the parameter to switch CREST version checking, if this parameter is true, the CREST version test will be executed.

Example:

   std::string url = "http://mvg-test-pc-03.cern.ch:8090";
   CrestClient myCrestClient = CrestClient(url);

If CrestClient is created with this method the data will be sent to the CREST Server.

Parameters
url- URL address of the CREST Server (with port).
check_version- the parameter to switch CREST version checking, if this parameter is true, the CREST version test will be executed.

Example:
   std::string url = "http://mvg-test-pc-03.cern.ch:8090";
   CrestClient myCrestClient = CrestClient(url);

Definition at line 61 of file CrestApi.cxx.

62  {
63  size_t found = url.find_first_of(':');
64  size_t n = url.size();
65 
66  std::string_view url_new = url.substr(found + 3); // url_new is the url excluding the http part
67  m_prefix = url.substr(0,found + 3); // URL prefix "http://" or "https://"
68 
69  size_t found1 = url_new.find_first_of(':');
70  size_t found2 = url_new.find_first_of('/');
71 
72  std::string_view host;
73  std::string_view port;
74  std::string_view resources;
75  if (found1 != std::string::npos && found2 != std::string::npos) {
76  host = url_new.substr(0, found1);
77  port = url_new.substr(found1 + 1, found2 - found1 - 1);
78  } else if (found1 != std::string::npos) {
79  host = url_new.substr(0, found1);
80  port = url_new.substr(found1 + 1);
81  } else if (found2 != std::string::npos) {
82  if (m_prefix == "https://") {
83  port = "443";
84  }
85  else port = "80";
86  host = url_new.substr(0, found2);
87  } else {
88  if (m_prefix == "https://") {
89  port = "443";
90  }
91  else port = "80";
92  host = url_new;
93  }
94 
95  if (found2 < n - 1)
96  {
97  resources = url_new.substr(found2, n - 1);
98  m_PATH = resources;
99  }
100 
101  m_port = std::string(port);
102  m_host = std::string(host);
106 
107  if (check_version == true)
108  {
110  }
111  std::cout << "CrestClient::CrestClient: host = " << m_host << ", port = " << m_port << ", path = " << m_PATH << std::endl;
112  }

◆ ~CrestClient()

Crest::CrestClient::~CrestClient ( )

CrestClient destructor.

Definition at line 117 of file CrestApi.cxx.

117 {}

Member Function Documentation

◆ checkCrestVersion()

void Crest::CrestClient::checkCrestVersion ( )

This method is a CREST version test.

It checks if the major CREST server is equal to the major CrestApi vesrion. If the versions are different an error is thrown.

Exceptions
std::runtime_error- error, if the versions are different.

Definition at line 263 of file CrestApi.cxx.

264  {
265  std::string client = getClientVersion();
266  std::string server = getCrestVersion();
267 
268  int clientVersion = getMajorVersion(client);
269  int serverVersion = getMajorVersion(server);
270 
271  if (clientVersion != serverVersion)
272  {
273  throw CrestException("ERROR in CrestClient::checkCrestVersion: CrestApi version \"" + client + "\" does not correspond to the server version \"" + server + "\".");
274  }
275  }

◆ createGlobalTag()

void Crest::CrestClient::createGlobalTag ( GlobalTagDto globalTag)
overridevirtual

This method creates a global tag on CREST server.

Parameters
globalTag- global tag as GlobalTagDto.
Example:
 nlohmann::json js =
     {
         {"name", tagname},
         {"validity", 0},
         {"description", "test"},
         {"release", "1"},
         {"insertionTime", "2018-12-18T11:32:58.081+0000"},
         {"snapshotTime", "2018-12-18T11:32:57.952+0000"},
         {"scenario", "test"},
         {"workflow", "M"},
         {"type", "t"},
     };
 GlobalTagDto dto = GlobalTagDto();
 dto = dto.from_json(js);
 myCrestClient.createGlobalTag(dto);

Implements Crest::CrestApiBase.

Definition at line 288 of file CrestApi.cxx.

289  {
290  const char *method_name = "CrestClient::createGlobalTag";
291 
292  std::string current_path = m_PATH;
293  current_path += s_GLOBALTAG_PATH;
294  std::string retv;
295  nlohmann::json js = dto.to_json();
296  retv = m_request.performRequest(current_path, Action::POST, js, method_name);
297  }

◆ createGlobalTagMap()

void Crest::CrestClient::createGlobalTagMap ( GlobalTagMapDto globalTagMap)
overridevirtual

This method creates a global tag map on the CREST server.

Parameters
globalTagMap- the global tag map as GlobalTagMapDto.
Example:
 nlohmann::json js =
 {
   {"globalTagName", globaltag},
   {"record", "testing2"},
   {"label", "test2"},
   {"tagName", tagname}
 };
 GlobalTagMapDto globalTagMap = GlobalTagMapDto();
 globalTagMap = globalTagMap.from_json(js);
 myCrestClient.createGlobalTagMap(globalTagMap);

Implements Crest::CrestApiBase.

Definition at line 558 of file CrestApi.cxx.

559  {
560  const char *method_name = "CrestClient::createGlobalTagMap";
561 
562  std::string current_path = m_PATH;
563  current_path += s_GLOBALTAG_MAP_PATH;
564  std::string retv;
565  nlohmann::json js = dto.to_json();
566  retv = m_request.performRequest(current_path, Action::POST, js, method_name);
567  }

◆ createTag()

void Crest::CrestClient::createTag ( TagDto tag)
overridevirtual

This method creates a tag on the CREST server.

Parameters
tag- tag as TagDto.
 Example:
 nlohmann::json js =
 {
   {"name", tagname},
   {"timeType", "time"},
   {"description", "test"},
   {"synchronization", "none"},
   {"insertionTime", "2018-12-18T11:32:58.081+0000"},
   {"modificationTime", "2018-12-18T11:32:57.952+0000"},
   {"payloadSpec", "JSON"},
   {"lastValidatedTime", 0.},
   {"endOfValidity", 0.},
 };
 TagDto dto = TagDto();
 dto = dto.from_json(js);
 myCrestClient.createTag(dto);
 

Implements Crest::CrestApiBase.

Definition at line 378 of file CrestApi.cxx.

379  {
380  const char *method_name = "CrestClient::createTag";
381 
382  std::string current_path = m_PATH;
383  current_path += s_TAG_PATH;
384  std::string retv;
385  nlohmann::json js = dto.to_json();
386  retv = m_request.performRequest(current_path, Action::POST, js, method_name);
387  }

◆ createTagMeta()

void Crest::CrestClient::createTagMeta ( TagMetaDto tag)
overridevirtual

This method creates a tag meta info on the CREST server.

Parameters
tag- tag meta info as TagMetaDto.
Example:
 nlohmann::json channel = {{"0", "ATLAS_PREFERRED"}};
 nlohmann::json chanList = nlohmann::json::array({channel});
 nlohmann::json tagInfo =
     {
         {"channel_list", chanList},
         {"node_description", "description of the node"},
         {"payload_spec", "stave:Int32, eta:Int32, mag:Float, base:Float, free:Float"}};
 nlohmann::json js =
     {
         {"tagName", tagname},
         {"description", "none"},
         {"chansize", 1},
         {"colsize", 6},
         {"tagInfo", tagInfo.dump()},
         {"insertionTime", "2020-12-04"}};
 TagMetaDto dto = TagMetaDto();
 dto = dto.from_json(js);
 myCrestClient.createTagMeta(dto);

Implements Crest::CrestApiBase.

Definition at line 468 of file CrestApi.cxx.

469  {
470  const char *method_name = "CrestClient::createTagMeta";
471 
472  std::string current_path = m_PATH;
473  current_path += s_TAG_PATH;
474  current_path += '/';
475  current_path += dto.tagName;
476  current_path += s_META_PATH;
477 
478  std::string retv;
479  nlohmann::json js = dto.to_json();
480  retv = m_request.performRequest(current_path, Action::POST, js, method_name);
481  }

◆ findGlobalTag()

GlobalTagDto Crest::CrestClient::findGlobalTag ( const std::string &  name)
overridevirtual

This method finds a global tag by name on the CREST server.

Only one global tag should be returned. (This method is an analogue of the find_global_tag method in Python)

Parameters
name- global tag name,
Returns
global tag as GlobalTagDto.

Implements Crest::CrestApiBase.

Definition at line 299 of file CrestApi.cxx.

300  {
301  const char *method_name = "CrestClient::findGlobalTag";
302 
303  std::string current_path = m_PATH;
304  current_path += s_GLOBALTAG_PATH;
305  current_path += '/';
306  current_path += name;
307  std::string retv;
308 
309  nlohmann::json js = nullptr;
310  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
311  nlohmann::json response = getJson(retv, method_name);
312 
314  std::vector<GlobalTagDto> v = dto.resources;
315  // Only one element is expected:
316  return v[0];
317  }

◆ findGlobalTagMap()

GlobalTagMapSetDto Crest::CrestClient::findGlobalTagMap ( const std::string &  name,
const std::string &  xCrestMapMode 
)
overridevirtual

This method searches for tag mappings using the global tag name or tag name on the CREST server.

(This method is an analogue of the find_global_tag_map method in Python)

Parameters
name- name of a global tag or a tag
xCrestMapMode- search mode (Trace or BackTrace). If it is set as "Trace" the global tag name will be used for searching, otherwise - the tag name.
Returns
global tag map list as GlobalTagMapSetDto.

Implements Crest::CrestApiBase.

Definition at line 569 of file CrestApi.cxx.

570  {
571  const char *method_name = "CrestClient::findGlobalTagMap";
572 
573  std::string current_path = m_PATH;
574  current_path += s_GLOBALTAG_MAP_PATH;
575  current_path += '/';
576  current_path += name;
577  std::string headers_params = "";
578 
579  if (xCrestMapMode != "")
580  {
581  headers_params += "X-Crest-MapMode: ";
582  headers_params += xCrestMapMode;
583  }
584  else
585  {
586  headers_params += "X-Crest-MapMode: ";
587  headers_params += "Trace";
588  }
589  std::string retv;
590  nlohmann::json js = nullptr;
591  retv = m_request.performRequest(current_path, Action::GET, js, method_name, headers_params);
592  nlohmann::json response = getJson(retv, method_name);
594 
595  return dto;
596  }

◆ findTag()

TagDto Crest::CrestClient::findTag ( const std::string &  name)
overridevirtual

This method finds a tag by the name on the CREST server.

(This method is an analogue of the find_tag method in Python)

Parameters
name- tag name
Returns
tag as TagDto object.

Implements Crest::CrestApiBase.

Definition at line 390 of file CrestApi.cxx.

391  {
392  const char *method_name = "CrestClient::findTag";
393 
394  std::string current_path = m_PATH;
395  current_path += s_TAG_PATH;
396  current_path += '/';
397  current_path += name;
398  std::string retv;
399  nlohmann::json js = nullptr;
400  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
401  nlohmann::json response = getJson(retv, method_name);
403 
404  std::vector<TagDto> v = dto.resources;
405  // Only one element is expected:
406  return v[0];
407  }

◆ findTagMeta()

TagMetaDto Crest::CrestClient::findTagMeta ( const std::string &  name)
overridevirtual

This method reads a tag meta info by the tag name from the CREST server.

Parameters
name- tag name
Returns
tag meta info as a TagMetaDto.

Implements Crest::CrestApiBase.

Definition at line 498 of file CrestApi.cxx.

499  {
500  const char *method_name = "CrestClient::findTagMeta";
501 
502  std::string current_path = m_PATH;
503  current_path += s_TAG_PATH;
504  current_path += '/';
505  current_path += name;
506  current_path += s_META_PATH;
507  std::string retv;
508  nlohmann::json js = nullptr;
509  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
510  nlohmann::json response = getJson(retv, method_name);
511 
513  std::vector<TagMetaDto> v = dto.resources;
514  // Only one element is expected:
515  return v[0];
516  }

◆ getClientVersion()

std::string Crest::CrestClient::getClientVersion ( )
private

This method returns the full CrestApi version.

Returns
CrestApi library version.

Definition at line 234 of file CrestApi.cxx.

235  {
236  return s_CREST_CLIENT_VERSION;
237  }

◆ getCrestVersion()

std::string Crest::CrestClient::getCrestVersion ( )
private

This method returns the full CREST Server version.

Returns
CREST server version.

Definition at line 214 of file CrestApi.cxx.

215  {
216 
217  std::string version = "";
218  nlohmann::json buildInfo;
220  // The CREST Server response has the following structure:
221  // { "build": { "artifact": "crestdb", "name": "crest", "version": "4.0", "group": "hep.crest"} }
222  try
223  {
224  buildInfo = info["build"];
225  version = buildInfo["version"];
226  }
227  catch (const std::exception &e)
228  {
229  throw CrestException("ERROR in CrestClient::getCrestVersion: " + to_string(info) + " does not contain version info.");
230  }
231  return version;
232  }

◆ getJson()

nlohmann::json Crest::CrestClient::getJson ( const std::string &  str,
const char *  method 
) const
private

Auxiliary method to convert string in to JSON object.

CrestClient::getJson method is used to convert the string to the json object.

Parameters
str- string (std::string)
method- method name, which calls this method. This parameter is used to throw an error exception.
Returns
- JSON object as nlohmann::json
Parameters
str- string to be converted to the json object.
method- name of the method which calls this method.
Returns
json object.

Definition at line 169 of file CrestApi.cxx.

170  {
171  nlohmann::json js = nullptr;
172  try
173  {
175  }
176  catch (nlohmann::json::parse_error &e)
177  {
178  if (method == nullptr || *method == '\0')
179  {
180  // method name is undefined
181 
182  std::string wh = e.what();
183  throw CrestException("ERROR in JSON conversion: " + wh + " | In string: " + str);
184  }
185  else
186  {
187  std::string str2 = parseXMLOutput(str); // to remove HTML tags use this function
188  std::string str3 = removeCR(str2); // to remove carridge return
189  throw CrestException("ERROR in " + std::string(method) + " | CREST Server response : " + str3);
190  }
191  }
192  catch (const std::exception &e)
193  {
194  throw CrestException("ERROR in CrestClient::" + (std::string)method + ": " + e.what());
195  }
196  return js;
197  }

◆ getMajorVersion()

int Crest::CrestClient::getMajorVersion ( std::string &  str)
private

This is an auxiliary method to extract a major version number from full version string.

Returns
major version number.

Definition at line 239 of file CrestApi.cxx.

240  {
241  int v = -1;
242  int n = str.find('.');
243 
244  if (n < 1)
245  {
246  throw CrestException("ERROR in CrestClient::getMajorVersion: string \"" + str + "\" does not contain major version.");
247  }
248 
249  std::string vers = str.substr(0, n);
250 
251  try
252  {
253  v = std::stoi(str);
254  }
255  catch (const std::exception &e)
256  {
257  throw CrestException("ERROR in CrestClient::getMajorVersion: string \"" + str + "\" does not contain major version.");
258  }
259 
260  return v;
261  }

◆ getMgmtInfo()

nlohmann::json Crest::CrestClient::getMgmtInfo ( )
private

This is an auxiliary method to read the CREST Server properties.

Returns
JSON with CREST server properties.
Example:
 {
  "build":{
    "artifact":"crestdb",
    "name":"crestdb",
    "time":"2023-12-02T15:21:57.045Z",
    "version":"4.2.1",
    "group":"hep.crest"
  }
 }

Definition at line 199 of file CrestApi.cxx.

200  {
201  const char *method_name = "getMgmtInfo";
202 
203  std::string current_path = s_MGMT_PATH + s_MGMT_INFO_PATH;
204  std::string retv;
205  nlohmann::json js = nullptr;
206 
207  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
208 
209  nlohmann::json respond = getJson(retv, method_name);
210 
211  return respond;
212  }

◆ getPayload()

std::string Crest::CrestClient::getPayload ( const std::string &  hash)
overridevirtual

This method finds a payload resource associated to the hash on the CREST server.

The payload returns as a string. (This method is an analogue of the get_payload method in Python)

Parameters
hash- hash.
Returns
payload as a std::string

Implements Crest::CrestApiBase.

Definition at line 764 of file CrestApi.cxx.

765  {
766  const char *method_name = "CrestClient::getPayload";
767 
768  std::string current_path = m_PATH;
769  current_path += s_PAYLOAD_PATH;
770  current_path += "/data?format=BLOB&hash=";
771  current_path += hash;
772  std::string retv;
773  nlohmann::json js = nullptr;
774  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
775  return retv;
776  }

◆ getPayloadMeta()

PayloadDto Crest::CrestClient::getPayloadMeta ( const std::string &  hash)
overridevirtual

This method finds a payload meta info for the hash on the CREST server.

(This method is an analogue of the get_payload_meta method in Python)

Parameters
hash- hash.
Returns
payload meta info as PayloadDto.

Implements Crest::CrestApiBase.

Definition at line 778 of file CrestApi.cxx.

779  {
780  const char *method_name = "CrestClient::getPayloadMeta";
781 
782  std::string current_path = m_PATH;
783  current_path += s_PAYLOAD_PATH;
784  current_path += '/';
785  current_path += hash;
786  current_path += "?format=META";
787  std::string retv;
788  nlohmann::json js = nullptr;
789  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
790  nlohmann::json response = getJson(retv, method_name);
791 
793  std::vector<PayloadDto> v = dto.resources;
794  // Only one element is expected:
795  return v[0];
796  }

◆ getSize()

int Crest::CrestClient::getSize ( const std::string &  tagname)
overridevirtual

This method gets the number of IOVs for the given tag.

(This method is an analogue of the get_size method in Python)

Parameters
tagname- tag name.
Returns
IOV number.

Implements Crest::CrestApiBase.

Definition at line 519 of file CrestApi.cxx.

520  {
521  const char *method_name = "CrestClient::getSize";
522 
523  std::string current_path = m_PATH;
524  current_path += s_IOV_PATH;
525  current_path += s_IOV_SIZE_PATH;
526  current_path += "?tagname=";
527  current_path += tagname;
528 
529  std::string retv;
530 
531  nlohmann::json js = nullptr;
532  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
533  nlohmann::json respond = getJson(retv, method_name);
534 
535  auto res = respond.find("resources");
537 
538  if (res != respond.end())
539  {
540  r = respond["resources"][0];
541  }
542 
543  int result = 0;
544  if (r.find("niovs") != r.end())
545  {
546  result = r["niovs"];
547  }
548  else
549  {
550  throw CrestException("ERROR in CrestClient::getSize CREST Server JSON response has no \"size\" key.");
551  }
552 
553  return result;
554  }

◆ listGlobalTags()

GlobalTagSetDto Crest::CrestClient::listGlobalTags ( const std::string &  name,
int  size,
int  page,
const std::string &  sort 
)
overridevirtual

This method finds the global tags on the CREST server.

Parameters
name- global tag name pattern, "%" can be used for any symbols,
size- page size,
page- page number,
sort- sorting order (name:ASC or name:DESC),
Returns
global tag list as GlobalTagSetDto.

Implements Crest::CrestApiBase.

Definition at line 319 of file CrestApi.cxx.

320  {
321  const char *method_name = "CrestClient::listGlobalTags";
322 
323  std::string current_path = m_PATH;
324  current_path += s_GLOBALTAG_PATH;
325  current_path += '?';
326  if (name != "")
327  {
328  current_path += "name=";
329  current_path += name;
330  current_path += '&';
331  }
332  if (size != -1)
333  {
334  current_path += "size=";
335  current_path += std::to_string(size);
336  current_path += '&';
337  }
338  if (page != -1)
339  {
340  current_path += "page=";
341  current_path += std::to_string(page);
342  current_path += '&';
343  }
344  if (sort != "")
345  {
346  current_path += "sort=";
347  current_path += sort;
348  current_path += '&';
349  }
350  std::string retv;
351 
352  nlohmann::json js = nullptr;
353  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
354  nlohmann::json response = getJson(retv, method_name);
355 
357 
358  return dto;
359  }

◆ listTags()

TagSetDto Crest::CrestClient::listTags ( const std::string &  name,
int  size,
int  page,
const std::string &  sort 
)
overridevirtual

This method returns the tag list as TagSetDto from the CREST server.

(This method is an analogue of the list_tags method in Python)

Parameters
name- tag name pattern,
size- page size,
page- page number,
sort- sorting order (name:ASC or name:DESC).
Returns
tag list as TagSetDto object.

Implements Crest::CrestApiBase.

Definition at line 409 of file CrestApi.cxx.

410  {
411  const char *method_name = "CrestClient::listTags";
412 
413  std::string current_path = m_PATH;
414  current_path += s_TAG_PATH;
415  current_path += '?';
416  if (name != "")
417  {
418  current_path += "name=";
419  current_path += name;
420  current_path += '&';
421  }
422  if (size != -1)
423  {
424  current_path += "size=";
425  current_path += std::to_string(size);
426  current_path += '&';
427  }
428  if (page != -1)
429  {
430  current_path += "page=";
431  current_path += std::to_string(page);
432  current_path += '&';
433  }
434  if (sort != "")
435  {
436  current_path += "sort=";
437  current_path += sort;
438  current_path += '&';
439  }
440  std::string retv;
441 
442  nlohmann::json js = nullptr;
443  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
444  nlohmann::json response = getJson(retv, method_name);
445 
447 
448  return dto;
449  }

◆ makeUrl()

std::string Crest::CrestClient::makeUrl ( const std::string &  address) const
private

Definition at line 277 of file CrestApi.cxx.

278  {
279  std::string str = m_prefix;
280  str += m_host;
281  str += ':';
282  str += m_port;
283  str += address;
284  return str;
285  }

◆ parseXMLOutput()

std::string Crest::CrestClient::parseXMLOutput ( const std::string_view  xmlBuffer) const
private

This method removes all XML/HTML tags from a string.

(It is an auxiliary method to clear the CREST Server response.)

Parameters
xmlBuffer- the text (a std::string ) to be cleared.

Definition at line 121 of file CrestApi.cxx.

122  {
123  bool copy = true;
124 
125  std::string plainString = "";
126 
127  // remove all xml tags
128  for (long unsigned int i = 0; i < xmlBuffer.length(); i++)
129  {
130  char convertc = xmlBuffer[i];
131 
132  if (convertc == '<')
133  copy = false;
134  else if (convertc == '>')
135  {
136  copy = true;
137  continue;
138  }
139 
140  if (copy)
141  plainString += convertc;
142  }
143 
144  return plainString;
145  }

◆ removeCR()

std::string Crest::CrestClient::removeCR ( const std::string &  str) const
private

This method removes all end of line and carriage return symbols from a string.

(It is an auxiliary method to clear the CREST Server response.)

Parameters
str- the text (a std::string ) to be cleared.

Definition at line 149 of file CrestApi.cxx.

150  {
151  std::string str2 = str;
152  std::replace(str2.begin(), str2.end(), '\n', '|');
153  char needle = '\r';
154  size_t pos;
155  while ((pos = str2.find(needle)) != str2.npos)
156  {
157  str2.erase(pos, 1);
158  }
159  return str2;
160  }

◆ removeGlobalTag()

void Crest::CrestClient::removeGlobalTag ( const std::string &  name)
overridevirtual

This method removes a global tag on the CREST server.

(This method is an analogue of the remove_global_tag method in Python)

Parameters
name- global tag name

Implements Crest::CrestApiBase.

Definition at line 362 of file CrestApi.cxx.

363  {
364  const char *method_name = "CrestClient::removeGlobalTag";
365 
366  std::string current_path = m_PATH;
367  current_path += s_ADMIN_PATH;
368  current_path += s_GLOBALTAG_PATH;
369  current_path += '/';
370  current_path += name;
371  std::string retv;
372  nlohmann::json js = nullptr;
373  retv = m_request.performRequest(current_path, Action::DELETE, js, method_name);
374  }

◆ removeGlobalTagMap()

void Crest::CrestClient::removeGlobalTagMap ( const std::string &  name,
const std::string &  record,
const std::string &  label,
const std::string &  tagname 
)
overridevirtual

This method removes a global tag map on the CREST server.

Parameters
name- the global tag name,
label- label,
tagname- tag name.

Implements Crest::CrestApiBase.

Definition at line 598 of file CrestApi.cxx.

599  {
600  const char *method_name = "CrestClient::removeGlobalTagMap";
601 
602  std::string current_path = m_PATH;
603  current_path += s_GLOBALTAG_MAP_PATH;
604  current_path += '/';
605  current_path += name;
606  current_path += '?';
607  if (tagname != "")
608  {
609  current_path += "tagname=";
610  current_path += tagname;
611  current_path += '&';
612  }
613  if (record != "")
614  {
615  current_path += "record=";
616  current_path += record;
617  current_path += '&';
618  }
619  if (label != "")
620  {
621  current_path += "label=";
622  current_path += label;
623  current_path += '&';
624  }
625 
626  std::string retv;
627  nlohmann::json js = nullptr;
628  retv = m_request.performRequest(current_path, Action::DELETE, js, method_name);
629  }

◆ removeTag()

void Crest::CrestClient::removeTag ( const std::string &  name)
overridevirtual

This method removes a tag from the CREST server.

(This method is an analogue of the remove_tag method in Python)

Parameters
tagName- tag name

Implements Crest::CrestApiBase.

Definition at line 452 of file CrestApi.cxx.

453  {
454  const char *method_name = "CrestClient::removeTag";
455 
456  std::string current_path = m_PATH;
457  current_path += s_ADMIN_PATH;
458  current_path += s_TAG_PATH;
459  current_path += '/';
460  current_path += name;
461  std::string retv;
462  nlohmann::json js = nullptr;
463  retv = m_request.performRequest(current_path, Action::DELETE, js, method_name);
464  }

◆ selectGroups()

IovSetDto Crest::CrestClient::selectGroups ( const std::string &  name,
long  snapshot,
int  size,
int  page,
const std::string &  sort 
)
overridevirtual

This method returns IOV groups for a given tagname on CREST server.

The result is an IOV list. (This method is an analogue of the select_groups method in Python)

Parameters
name- tag name,
snapshot- snapshot,
size- page size,
page- page number,
sort- sorting order (id.since:ASC or id.since:DESC)
Returns
an IOV groups as IovSetDto.

Implements Crest::CrestApiBase.

Definition at line 678 of file CrestApi.cxx.

679  {
680  const char *method_name = "CrestClient::selectGroups";
681 
682  std::string current_path = m_PATH;
683  current_path += s_IOV_PATH;
684 
685  current_path += "?method=";
686  current_path += s_METHOD_GROUPS;
687  current_path += "&tagname=";
688 
689  current_path += name;
690  current_path += "&snapshot=";
691  current_path += std::to_string(snapshot);
692 
693  //
694  current_path += "&size=";
695  current_path += std::to_string(size);
696  current_path += "&page=";
697  current_path += std::to_string(page);
698  current_path += "&sort=";
699  current_path += sort;
700  //
701 
702  std::string retv;
703 
704  nlohmann::json js = nullptr;
705  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
706  nlohmann::json response = getJson(retv, method_name);
707 
709 
710  return dto;
711  }

◆ selectIovs()

IovSetDto Crest::CrestClient::selectIovs ( const std::string &  name,
uint64_t  since,
uint64_t  until,
long  snapshot,
int  size,
int  page,
const std::string &  sort 
)
overridevirtual

This method selects IOVs for a given tagname on the CREST server.

The result is an IOV list. (This method is an analogue of the select_iovs method in Python)

Parameters
name- tag name,
since- since time (the beginning of the time interval),
until- until time (end of the time interval),
snapshot- snapshot,
size- page size,
page- page number,
sort- sorting order (id.since:ASC or id.since:DESC)
Returns
an IOV list as IovSetDto.

Implements Crest::CrestApiBase.

Definition at line 633 of file CrestApi.cxx.

634  {
635  const char *method_name = "CrestClient::selectIovs";
636 
637  std::string current_path = m_PATH;
638  current_path += s_IOV_PATH;
639 
640  current_path += "?method=";
641  current_path += s_METHOD_IOVS;
642  current_path += "&tagname=";
643 
644  current_path += name;
645  current_path += "&since=";
646  current_path += std::to_string(since);
647  current_path += "&until=";
648  if (until == static_cast<uint64_t>(-1))
649  {
650  current_path += "INF";
651  }
652  else
653  {
654  current_path += std::to_string(until);
655  }
656  current_path += "&snapshot=";
657  current_path += std::to_string(snapshot);
658  //
659  current_path += "&size=";
660  current_path += std::to_string(size);
661  current_path += "&page=";
662  current_path += std::to_string(page);
663  current_path += "&sort=";
664  current_path += sort;
665  //
666 
667  std::string retv;
668 
669  nlohmann::json js = nullptr;
670  retv = m_request.performRequest(current_path, Action::GET, js, method_name);
671  nlohmann::json response = getJson(retv, method_name);
672 
674 
675  return dto;
676  }

◆ storeData()

void Crest::CrestClient::storeData ( const std::string &  tag,
const StoreSetDto storeSetJson,
const std::string &  payloadFormat = "JSON",
const std::string &  objectType = "none",
const std::string &  compressionType = "none",
const std::string &  version = "1.0",
uint64_t  endTime = -1 
)
overridevirtual

This method stores several payloads in batch mode on the CREST server.

(This method is an analogue of the store_data method in Python)

Parameters
tag- tag name.
storeSetJson- iov and payload data as a JSON object.
payloadFormat- payload format [FILE | JSON].
objectType- object type.
compressionType- compression type.
version- version.
endTime- end time, if endtime = 0, the server does not use this parameter in the internal check.
Example how to use these parameters:
   std::string tag = "test_MvG3a";
   uint64_t endtime = 200;
   std::string objectType = "test";
   std::string compressionType = "none";
   std::string version = "1.0";
   std::string payloadFormat = "JSON";
   std::string jsonString = R"({"size": 1, "datatype": "data", "format": "StoreSetDto", "resources": [{"since": 1000,"data": "Sample data","streamerInfo": "Info123"}]})";
   StoreSetDto storeSetJson = StoreSetDto::from_json(jsonString);

Implements Crest::CrestApiBase.

Definition at line 715 of file CrestApi.cxx.

722  {
723 
724  std::string current_path = m_PATH;
725  current_path += s_PAYLOAD_PATH;
726  std::vector<std::string> files;
727  std::string retv;
728  nlohmann::json js = storeSetJson.to_json();
729  if (payloadFormat == "JSON")
730  {
731  retv = m_request.uploadPayload(current_path, tag, endTime, js, objectType, compressionType, version, files);
732  }
733  else
734  {
735  // Assumes the data content in the JSON is just a file path.
736  nlohmann::json resources = nullptr;
737 
738  auto subjectIdIter1 = js.find("resources");
739  if (subjectIdIter1 != js.end())
740  {
741  resources = js["resources"];
742  }
743  int partN = resources.size();
744  for (int i = 0; i < partN; i++)
745  {
746  nlohmann::json element = resources[i];
747  std::string file_param;
748 
749  auto subjectIdIter1 = element.find("data");
750  if (subjectIdIter1 != element.end())
751  {
752  file_param = element["data"];
753  }
754  //
755  int found_dots = file_param.find_first_of(':');
756  int word_size = file_param.size();
757  std::string data_file = file_param.substr(found_dots + 3, word_size);
758  files.push_back(data_file);
759  }
760  retv = m_request.uploadPayload(current_path, tag, endTime, js, objectType, compressionType, version, files);
761  }
762  }

◆ updateTagMeta()

void Crest::CrestClient::updateTagMeta ( TagMetaDto tag)
overridevirtual

This method updates a tag meta info on the CREST server.

Parameters
tag- tag meta info as TagMetaDto.

Implements Crest::CrestApiBase.

Definition at line 483 of file CrestApi.cxx.

484  {
485  const char *method_name = "CrestClient::updateTagMeta";
486 
487  std::string current_path = m_PATH;
488  current_path += s_TAG_PATH;
489  current_path += '/';
490  current_path += dto.tagName;
491  current_path += s_META_PATH;
492 
493  std::string retv;
494  nlohmann::json js = dto.to_json();
495  retv = m_request.performRequest(current_path, Action::PUT, js, method_name);
496  }

Member Data Documentation

◆ m_host

std::string Crest::CrestClient::m_host
private

Definition at line 67 of file CrestApi.h.

◆ m_PATH

std::string Crest::CrestClient::m_PATH = DEFAULT_CREST_API_VERSION
private

Definition at line 37 of file CrestApi.h.

◆ m_port

std::string Crest::CrestClient::m_port
private

Definition at line 68 of file CrestApi.h.

◆ m_prefix

std::string Crest::CrestClient::m_prefix = "http://"
private

Definition at line 69 of file CrestApi.h.

◆ m_request

Crest::CrestRequest Crest::CrestClient::m_request = Crest::CrestRequest()
private

Definition at line 71 of file CrestApi.h.

◆ s_ADMIN_PATH

const std::string Crest::CrestClient::s_ADMIN_PATH = "/admin"
inlinestaticprivate

Definition at line 40 of file CrestApi.h.

◆ s_CREST_CLIENT_CHECK

const bool Crest::CrestClient::s_CREST_CLIENT_CHECK = false
inlinestatic

Definition at line 164 of file CrestApi.h.

◆ s_CREST_CLIENT_VERSION

const std::string Crest::CrestClient::s_CREST_CLIENT_VERSION = "5.0"
inlinestaticprivate

Definition at line 62 of file CrestApi.h.

◆ s_DATA_PATH

const std::string Crest::CrestClient::s_DATA_PATH = "/data"
inlinestaticprivate

Definition at line 50 of file CrestApi.h.

◆ s_FOLDER_PATH

const std::string Crest::CrestClient::s_FOLDER_PATH = "/folders"
inlinestaticprivate

Definition at line 52 of file CrestApi.h.

◆ s_GLOBALTAG_MAP_PATH

const std::string Crest::CrestClient::s_GLOBALTAG_MAP_PATH = "/globaltagmaps"
inlinestaticprivate

Definition at line 46 of file CrestApi.h.

◆ s_GLOBALTAG_PATH

const std::string Crest::CrestClient::s_GLOBALTAG_PATH = "/globaltags"
inlinestaticprivate

Definition at line 45 of file CrestApi.h.

◆ s_IOV_PATH

const std::string Crest::CrestClient::s_IOV_PATH = "/iovs"
inlinestaticprivate

Definition at line 41 of file CrestApi.h.

◆ s_IOV_SIZE_PATH

const std::string Crest::CrestClient::s_IOV_SIZE_PATH = "/size"
inlinestaticprivate

Definition at line 43 of file CrestApi.h.

◆ s_META_PATH

const std::string Crest::CrestClient::s_META_PATH = "/meta"
inlinestaticprivate

Definition at line 49 of file CrestApi.h.

◆ s_METHOD_GROUPS

const std::string Crest::CrestClient::s_METHOD_GROUPS = "GROUPS"
inlinestaticprivate

Definition at line 57 of file CrestApi.h.

◆ s_METHOD_IOVS

const std::string Crest::CrestClient::s_METHOD_IOVS = "IOVS"
inlinestaticprivate

Definition at line 56 of file CrestApi.h.

◆ s_MGMT_INFO_PATH

const std::string Crest::CrestClient::s_MGMT_INFO_PATH = "/info"
inlinestaticprivate

Definition at line 61 of file CrestApi.h.

◆ s_MGMT_INFO_PATH_2

const std::string Crest::CrestClient::s_MGMT_INFO_PATH_2 = "/actuator/info"
inlinestaticprivate

Definition at line 63 of file CrestApi.h.

◆ s_MGMT_PATH

const std::string Crest::CrestClient::s_MGMT_PATH = "/mgmt"
inlinestaticprivate

Definition at line 60 of file CrestApi.h.

◆ s_MONITORING_PAYLOAD_PATH

const std::string Crest::CrestClient::s_MONITORING_PAYLOAD_PATH = "/monitoring/payloads"
inlinestaticprivate

Definition at line 48 of file CrestApi.h.

◆ s_PAYLOAD_PATH

const std::string Crest::CrestClient::s_PAYLOAD_PATH = "/payloads"
inlinestaticprivate

Definition at line 47 of file CrestApi.h.

◆ s_RUNINFO_LIST_PATH

const std::string Crest::CrestClient::s_RUNINFO_LIST_PATH = "/list"
inlinestaticprivate

Definition at line 54 of file CrestApi.h.

◆ s_RUNINFO_PATH

const std::string Crest::CrestClient::s_RUNINFO_PATH = "/runinfo"
inlinestaticprivate

Definition at line 53 of file CrestApi.h.

◆ s_TAG_PATH

const std::string Crest::CrestClient::s_TAG_PATH = "/tags"
inlinestaticprivate

Definition at line 39 of file CrestApi.h.


The documentation for this class was generated from the following files:
RunTileTBRec.method
method
Definition: RunTileTBRec.py:73
grepfile.info
info
Definition: grepfile.py:38
GlobalTagMapSetDto::from_json
static GlobalTagMapSetDto from_json(const json &j)
Definition: CrestModel.cxx:264
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Crest::CrestClient::s_TAG_PATH
static const std::string s_TAG_PATH
Definition: CrestApi.h:39
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
beamspotman.r
def r
Definition: beamspotman.py:676
Crest::CrestClient::getJson
nlohmann::json getJson(const std::string &str, const char *method) const
Auxiliary method to convert string in to JSON object.
Definition: CrestApi.cxx:169
Crest::CrestClient::s_MGMT_INFO_PATH
static const std::string s_MGMT_INFO_PATH
Definition: CrestApi.h:61
get_generator_info.result
result
Definition: get_generator_info.py:21
Crest::Action::POST
@ POST
json
nlohmann::json json
Definition: HistogramDef.cxx:9
response
MDT_Response response
Definition: MDT_ResponseTest.cxx:28
GlobalTagSetDto::resources
std::vector< GlobalTagDto > resources
Definition: CrestModel.h:83
Crest::CrestClient::s_ADMIN_PATH
static const std::string s_ADMIN_PATH
Definition: CrestApi.h:40
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
PayloadSetDto::resources
std::vector< PayloadDto > resources
Definition: CrestModel.h:368
Crest::CrestClient::s_IOV_PATH
static const std::string s_IOV_PATH
Definition: CrestApi.h:41
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:1054
Crest::Action::DELETE
@ DELETE
Crest::CrestClient::s_METHOD_IOVS
static const std::string s_METHOD_IOVS
Definition: CrestApi.h:56
Crest::CrestRequest::performRequest
std::string performRequest(const std::string &current_path, Action action, nlohmann::json &js, const std::string &header_params="")
General auxiliary method to make request to the CREST Server.
Crest::CrestClient::s_GLOBALTAG_MAP_PATH
static const std::string s_GLOBALTAG_MAP_PATH
Definition: CrestApi.h:46
Crest::CrestRequest::uploadPayload
std::string uploadPayload(const std::string &current_path, const std::string &tag, uint64_t endtime, const nlohmann::json &js, const std::string &objectType, const std::string &compressionType, const std::string &version, const std::vector< std::string > &files)
Definition: CrestRequest.cxx:241
TagSetDto
Definition: CrestModel.h:126
Crest::CrestClient::m_host
std::string m_host
Definition: CrestApi.h:67
Crest::CrestClient::m_PATH
std::string m_PATH
Definition: CrestApi.h:37
Crest::CrestRequest::setPrefix
void setPrefix(const std::string &prefix)
Definition: CrestRequest.cxx:43
GlobalTagSetDto
Definition: CrestModel.h:81
physics_parameters.url
string url
Definition: physics_parameters.py:27
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
hotSpotInTAG.objectType
objectType
Definition: hotSpotInTAG.py:107
dq_defect_copy_defect_database.since
def since
Definition: dq_defect_copy_defect_database.py:54
rerun_display.client
client
Definition: rerun_display.py:31
Crest::Action::GET
@ GET
Crest::CrestRequest::setHost
void setHost(const std::string &host)
Definition: CrestRequest.cxx:33
dq_defect_copy_defect_database.until
def until
Definition: dq_defect_copy_defect_database.py:55
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Crest::CrestClient::s_GLOBALTAG_PATH
static const std::string s_GLOBALTAG_PATH
Definition: CrestApi.h:45
TagSetDto::resources
std::vector< TagDto > resources
Definition: CrestModel.h:128
Crest::CrestClient::s_META_PATH
static const std::string s_META_PATH
Definition: CrestApi.h:49
defineDB.tagname
string tagname
Definition: JetTagCalibration/share/defineDB.py:19
Crest::CrestClient::s_METHOD_GROUPS
static const std::string s_METHOD_GROUPS
Definition: CrestApi.h:57
lumiFormat.i
int i
Definition: lumiFormat.py:85
Crest::CrestClient::getCrestVersion
std::string getCrestVersion()
This method returns the full CREST Server version.
Definition: CrestApi.cxx:214
Crest::CrestClient::s_MGMT_PATH
static const std::string s_MGMT_PATH
Definition: CrestApi.h:60
beamspotman.n
n
Definition: beamspotman.py:731
generateReferenceFile.files
files
Definition: generateReferenceFile.py:12
TagMetaSetDto
Definition: CrestModel.h:257
calibdata.exception
exception
Definition: calibdata.py:496
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
PayloadSetDto::from_json
static PayloadSetDto from_json(const json &j)
Definition: CrestModel.cxx:658
parseDir.wh
wh
Definition: parseDir.py:46
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
GlobalTagMapSetDto
Definition: CrestModel.h:160
Crest::CrestClient::s_CREST_CLIENT_VERSION
static const std::string s_CREST_CLIENT_VERSION
Definition: CrestApi.h:62
Crest::CrestClient::getClientVersion
std::string getClientVersion()
This method returns the full CrestApi version.
Definition: CrestApi.cxx:234
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Crest::Action::PUT
@ PUT
Crest::CrestClient::s_PAYLOAD_PATH
static const std::string s_PAYLOAD_PATH
Definition: CrestApi.h:47
PayloadSetDto
Definition: CrestModel.h:366
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Crest::CrestClient::checkCrestVersion
void checkCrestVersion()
This method is a CREST version test.
Definition: CrestApi.cxx:263
Crest::CrestClient::getMgmtInfo
nlohmann::json getMgmtInfo()
This is an auxiliary method to read the CREST Server properties.
Definition: CrestApi.cxx:199
IovSetDto::from_json
static IovSetDto from_json(const json &j)
Definition: CrestModel.cxx:518
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
Crest::CrestClient::m_prefix
std::string m_prefix
Definition: CrestApi.h:69
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MyPlots.page
page
Definition: MyPlots.py:234
python.PyAthena.v
v
Definition: PyAthena.py:154
get_generator_info.version
version
Definition: get_generator_info.py:33
Crest::CrestClient::m_port
std::string m_port
Definition: CrestApi.h:68
Crest::CrestClient::m_request
Crest::CrestRequest m_request
Definition: CrestApi.h:71
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
StoreSetDto::to_json
json to_json() const
Definition: CrestModel.cxx:576
Crest::CrestClient::parseXMLOutput
std::string parseXMLOutput(const std::string_view xmlBuffer) const
This method removes all XML/HTML tags from a string.
Definition: CrestApi.cxx:121
IovSetDto
Definition: CrestModel.h:287
TagSetDto::from_json
static TagSetDto from_json(const json &j)
Definition: CrestModel.cxx:223
Crest::CrestClient::getMajorVersion
int getMajorVersion(std::string &str)
This is an auxiliary method to extract a major version number from full version string.
Definition: CrestApi.cxx:239
tagname
Definition: tagname.h:29
TagMetaSetDto::resources
std::vector< TagMetaDto > resources
Definition: CrestModel.h:259
str
Definition: BTagTrackIpAccessor.cxx:11
Crest::CrestClient::removeCR
std::string removeCR(const std::string &str) const
This method removes all end of line and carriage return symbols from a string.
Definition: CrestApi.cxx:149
calibdata.copy
bool copy
Definition: calibdata.py:27
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
python.html.AtlRunQueryDQSummary.server
server
Definition: AtlRunQueryDQSummary.py:22
GlobalTagSetDto::from_json
static GlobalTagSetDto from_json(const json &j)
Definition: CrestModel.cxx:113
TagMetaSetDto::from_json
static TagMetaSetDto from_json(const json &j)
Definition: CrestModel.cxx:432
Crest::CrestRequest::setPort
void setPort(const std::string &port)
Definition: CrestRequest.cxx:38
lumiFormat.endTime
endTime
Definition: lumiFormat.py:100
Crest::CrestClient::s_IOV_SIZE_PATH
static const std::string s_IOV_SIZE_PATH
Definition: CrestApi.h:43