Add function docs for CA CLI commands

This commit is contained in:
Michael Friedrich 2019-06-07 10:33:35 +02:00
parent b32d818d1b
commit 65c8d43157
4 changed files with 78 additions and 2 deletions

View File

@ -14,16 +14,32 @@ namespace po = boost::program_options;
REGISTER_CLICOMMAND("ca/list", CAListCommand);
/**
* Provide a long CLI description sentence.
*
* @return text
*/
String CAListCommand::GetDescription() const
{
return "Lists pending certificate signing requests.";
}
/**
* Provide a short CLI description.
*
* @return text
*/
String CAListCommand::GetShortDescription() const
{
return "lists pending certificate signing requests";
}
/**
* Initialize available CLI parameters.
*
* @param visibleDesc Register visible parameters.
* @param hiddenDesc Register hidden parameters.
*/
void CAListCommand::InitParameters(boost::program_options::options_description& visibleDesc,
boost::program_options::options_description& hiddenDesc) const
{
@ -36,7 +52,7 @@ void CAListCommand::InitParameters(boost::program_options::options_description&
/**
* The entry point for the "ca list" CLI command.
*
* @returns An exit status.
* @return An exit status.
*/
int CAListCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
{

View File

@ -10,21 +10,41 @@ using namespace icinga;
REGISTER_CLICOMMAND("ca/remove", CARemoveCommand);
/**
* Provide a long CLI description sentence.
*
* @return text
*/
String CARemoveCommand::GetDescription() const
{
return "Removes an outstanding certificate request.";
}
/**
* Provide a short CLI description.
*
* @return text
*/
String CARemoveCommand::GetShortDescription() const
{
return "removes an outstanding certificate request";
}
/**
* Define minimum arguments without key parameter.
*
* @return number of arguments
*/
int CARemoveCommand::GetMinArguments() const
{
return 1;
}
/**
* Impersonate as Icinga user.
*
* @return impersonate level
*/
ImpersonationLevel CARemoveCommand::GetImpersonationLevel() const
{
return ImpersonateIcinga;

View File

@ -10,21 +10,41 @@ using namespace icinga;
REGISTER_CLICOMMAND("ca/restore", CARestoreCommand);
/**
* Provide a long CLI description sentence.
*
* @return text
*/
String CARestoreCommand::GetDescription() const
{
return "Restores a previously removed certificate request.";
}
/**
* Provide a short CLI description.
*
* @return text
*/
String CARestoreCommand::GetShortDescription() const
{
return "restores a removed certificate request";
}
/**
* Define minimum arguments without key parameter.
*
* @return number of arguments
*/
int CARestoreCommand::GetMinArguments() const
{
return 1;
}
/**
* Impersonate as Icinga user.
*
* @return impersonate level
*/
ImpersonationLevel CARestoreCommand::GetImpersonationLevel() const
{
return ImpersonateIcinga;

View File

@ -10,21 +10,41 @@ using namespace icinga;
REGISTER_CLICOMMAND("ca/sign", CASignCommand);
/**
* Provide a long CLI description sentence.
*
* @return text
*/
String CASignCommand::GetDescription() const
{
return "Signs an outstanding certificate request.";
}
/**
* Provide a short CLI description.
*
* @return text
*/
String CASignCommand::GetShortDescription() const
{
return "signs an outstanding certificate request";
}
/**
* Define minimum arguments without key parameter.
*
* @return number of arguments
*/
int CASignCommand::GetMinArguments() const
{
return 1;
}
/**
* Impersonate as Icinga user.
*
* @return impersonate level
*/
ImpersonationLevel CASignCommand::GetImpersonationLevel() const
{
return ImpersonateIcinga;
@ -33,7 +53,7 @@ ImpersonationLevel CASignCommand::GetImpersonationLevel() const
/**
* The entry point for the "ca sign" CLI command.
*
* @returns An exit status.
* @return An exit status.
*/
int CASignCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
{