|
virtual | ~CrestApiBase ()=default |
|
virtual void | createGlobalTag (GlobalTagDto &globalTag)=0 |
| This method creates a global tag. More...
|
|
virtual GlobalTagDto | findGlobalTag (const std::string &name)=0 |
| This method finds a global tag by name. More...
|
|
virtual GlobalTagSetDto | listGlobalTags (const std::string &name, int size, int page, const std::string &sort)=0 |
| This method finds the global tags. More...
|
|
virtual void | removeGlobalTag (const std::string &name)=0 |
| This method removes a global tag. More...
|
|
virtual void | createTag (TagDto &tag)=0 |
| This method creates a tag. More...
|
|
virtual TagDto | findTag (const std::string &name)=0 |
| This method finds a tag by the name. More...
|
|
virtual TagSetDto | listTags (const std::string &name, int size, int page, const std::string &sort)=0 |
| This method returns the tag list as TagSetDto. More...
|
|
virtual void | removeTag (const std::string &name)=0 |
| This method removes a tag. More...
|
|
virtual int | getSize (const std::string &tagname)=0 |
| This method gets the number of IOVs for the given tag. More...
|
|
virtual void | createTagMeta (TagMetaDto &tag)=0 |
| This method creates a tag meta info. More...
|
|
virtual void | updateTagMeta (TagMetaDto &tag)=0 |
| This method updates a tag meta info. More...
|
|
virtual TagMetaDto | findTagMeta (const std::string &name)=0 |
| This method gets a tag meta info by the tag name. More...
|
|
virtual IovSetDto | selectIovs (const std::string &name, uint64_t since, uint64_t until, long snapshot, int size, int page, const std::string &sort)=0 |
| This method selects IOVs for a given tagname. More...
|
|
virtual IovSetDto | selectGroups (const std::string &name, long snapshot, int size, int page, const std::string &sort)=0 |
| This method returns IOV groups for a given tagname. More...
|
|
virtual void | createGlobalTagMap (GlobalTagMapDto &globalTagMap)=0 |
| This method creates a global tag map. More...
|
|
virtual GlobalTagMapSetDto | findGlobalTagMap (const std::string &name, const std::string &xCrestMapMode)=0 |
| This method searches for tag mappings using the global tag name or tag name . More...
|
|
virtual void | removeGlobalTagMap (const std::string &name, const std::string &record, const std::string &label, const std::string &tagname)=0 |
| This method removes a global tag map. More...
|
|
virtual void | storeData (const std::string &tag, const StoreSetDto &storeSetJson, const std::string &payloadFormat, const std::string &objectType, const std::string &compressionType, const std::string &version, uint64_t endTime)=0 |
| This method stores several payloads in batch mode. More...
|
|
virtual std::string | getPayload (const std::string &hash)=0 |
| This method finds a payload resource associated to the hash. More...
|
|
virtual PayloadDto | getPayloadMeta (const std::string &hash)=0 |
| This method finds a payload meta info for the hash. More...
|
|
virtual std::string | getCrestVersion ()=0 |
| This method returns the full CREST Server version. More...
|
|
Definition at line 32 of file CrestApiBase.h.
virtual void Crest::CrestApiBase::createGlobalTag |
( |
GlobalTagDto & |
globalTag | ) |
|
|
pure virtual |
This method creates a global tag.
- Parameters
-
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);
Implemented in Crest::CrestClient, and Crest::CrestFsClient.
virtual void Crest::CrestApiBase::createGlobalTagMap |
( |
GlobalTagMapDto & |
globalTagMap | ) |
|
|
pure virtual |
This method creates a global tag map.
- Parameters
-
Example:
nlohmann::json js =
{
{"globalTagName", globaltag},
{"record", "testing2"},
{"label", "test2"},
{"tagName", tagname}
};
GlobalTagMapDto globalTagMap = GlobalTagMapDto();
globalTagMap = globalTagMap.from_json(js);
myCrestClient.createGlobalTagMap(globalTagMap);
Implemented in Crest::CrestClient, and Crest::CrestFsClient.
virtual void Crest::CrestApiBase::createTag |
( |
TagDto & |
tag | ) |
|
|
pure virtual |
This method creates a tag.
- Parameters
-
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);
Implemented in Crest::CrestClient, and Crest::CrestFsClient.
virtual void Crest::CrestApiBase::createTagMeta |
( |
TagMetaDto & |
tag | ) |
|
|
pure virtual |
This method creates a tag meta info.
- Parameters
-
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);
Implemented in Crest::CrestClient, and Crest::CrestFsClient.
virtual void Crest::CrestApiBase::storeData |
( |
const std::string & |
tag, |
|
|
const StoreSetDto & |
storeSetJson, |
|
|
const std::string & |
payloadFormat, |
|
|
const std::string & |
objectType, |
|
|
const std::string & |
compressionType, |
|
|
const std::string & |
version, |
|
|
uint64_t |
endTime |
|
) |
| |
|
pure virtual |
This method stores several payloads in batch mode.
(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);
Implemented in Crest::CrestClient, and Crest::CrestFsClient.