|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #ifndef CRESTAPI_CRESAPI_H
15 #define CRESTAPI_CRESAPI_H
22 #include "nlohmann/json.hpp"
23 #include <curl/curl.h>
121 std::string
parseXMLOutput(
const std::string_view xmlBuffer)
const;
128 std::string
removeCR(
const std::string &
str)
const;
137 void checkHash(
const std::string &
hash,
const std::string &
str,
const char* method_name);
149 CrestClient(
const std::string &host,
const std::string &port,
bool checkVersion =
false);
452 const std::string &payloadFormat=
"JSON",
454 const std::string &compressionType=
"none",
455 const std::string &
version=
"1.0",
480 #endif // CRESTAPI_CRESTCLIENT_H
static const std::string s_TAG_PATH
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.
nlohmann::json getJson(const std::string &str, const char *method) const
Auxiliary method to convert string in to JSON object.
void removeGlobalTag(const std::string &name) override
This method removes a global tag on the CREST server.
static const std::string s_MGMT_INFO_PATH
int getSize(const std::string &tagname) override
This method gets the number of IOVs for the given tag.
Header file for CREST C++ Client Library.
static const std::string s_ADMIN_PATH
std::string makeUrl(const std::string &address) const
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.
void removeTag(const std::string &name) override
This method removes a tag from the CREST server.
static const std::string s_IOV_PATH
static const std::string s_METHOD_IOVS
static const std::string s_GLOBALTAG_MAP_PATH
GlobalTagDto findGlobalTag(const std::string &name) override
This method finds a global tag by name on the CREST server.
static const std::string s_RUNINFO_PATH
~CrestClient()
CrestClient destructor.
static const std::string s_MONITORING_PAYLOAD_PATH
#define DEFAULT_CREST_API_VERSION
TagDto findTag(const std::string &name) override
This method finds a tag by the name on the CREST server.
static const bool s_CREST_CLIENT_CHECK
void createTagMeta(TagMetaDto &tag) override
This method creates a tag meta info on the CREST server.
static const std::string s_GLOBALTAG_PATH
static const std::string s_MGMT_INFO_PATH_2
static const std::string s_META_PATH
void updateTagMeta(TagMetaDto &tag) override
This method updates a tag meta info on the CREST server.
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.
static const std::string s_METHOD_GROUPS
static const std::string s_MGMT_PATH
std::string getCrestVersion() override
This method returns the full CREST Server version.
The TagDto class It contains all fields of the TagDto class from the CREST API.
void createTag(TagDto &tag) override
This method creates a tag on the CREST server.
PayloadDto getPayloadMeta(const std::string &hash) override
This method finds a payload meta info for the hash on the CREST server.
CrestClient(const std::string &host, const std::string &port, bool checkVersion=false)
CrestClient constructor.
TagMetaDto findTagMeta(const std::string &name) override
This method reads a tag meta info by the tag name from the CREST server.
static const std::string s_DATA_PATH
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.
static const std::string s_CREST_CLIENT_VERSION
void createGlobalTagMap(GlobalTagMapDto &globalTagMap) override
This method creates a global tag map on the CREST server.
static const std::string s_PAYLOAD_PATH
void checkCrestVersion()
This method is a CREST version test.
nlohmann::json getMgmtInfo()
This is an auxiliary method to read the CREST Server properties.
std::string getPayload(const std::string &hash) override
This method finds a payload resource associated to the hash on the CREST server.
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.
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.
Crest::CrestRequest m_request
std::string parseXMLOutput(const std::string_view xmlBuffer) const
This method removes all XML/HTML tags from a string.
void createGlobalTag(GlobalTagDto &globalTag) override
This method creates a global tag on CREST server.
int getMajorVersion(std::string &str)
This is an auxiliary method to extract a major version number from full version string.
void checkHash(const std::string &hash, const std::string &str, const char *method_name)
This checks the hash of payload from IOV (hash) with the hash calculated for the payload in the std::...
std::string removeCR(const std::string &str) const
This method removes all end of line and carriage return symbols from a string.
static const std::string s_FOLDER_PATH
static const std::string s_RUNINFO_LIST_PATH
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.
static const std::string s_IOV_SIZE_PATH