CAMI is an AMI C++ client. It was originally developed for the A Toroidal LHC ApparatuS (ATLAS) experiment, one of the two general-purpose detectors at the Large Hadron Collider (LHC).
- Requierments:
Make sure that GCC (or Clang) and OpenSSL are installed:
g++ --version
openssl version
- Compiling, testing and installing:
make
make test
make install
Installed files: /usr/local/include/cami.h
and /usr/local/lib/libcami.a
.
try
{
AMIClient client("ami.in2p3.fr", "/AMI/servlet/net.hep.atlas.Database.Bookkeeping.AMI.Servlet.FrontEnd", 443);
std::map<std::string, std::string> arguments;
arguments.insert(std::pair<std::string, std::string>(
"%MY_ARG1_NAME%",
"%MY_ARG1_VALUE%"
));
arguments.insert(std::pair<std::string, std::string>(
"%MY_ARG2_NAME%",
"%MY_ARG2_VALUE%"
));
arguments.insert(std::pair<std::string, std::string>(
"AMIUser",
"%MY_LOGIN%"
));
arguments.insert(std::pair<std::string, std::string>(
"AMIPass",
"%MY_PASSWORD%"
));
std::string result = client.execute(
"%MY_COMMAND%",
arguments
);
std::cout << result
<< std::endl
;
}
catch(std::exception const &e)
{
std::cerr << e.what()
<< std::endl
;
}