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); REGISTER_CLICOMMAND("ca/list", CAListCommand);
/**
* Provide a long CLI description sentence.
*
* @return text
*/
String CAListCommand::GetDescription() const String CAListCommand::GetDescription() const
{ {
return "Lists pending certificate signing requests."; return "Lists pending certificate signing requests.";
} }
/**
* Provide a short CLI description.
*
* @return text
*/
String CAListCommand::GetShortDescription() const String CAListCommand::GetShortDescription() const
{ {
return "lists pending certificate signing requests"; 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, void CAListCommand::InitParameters(boost::program_options::options_description& visibleDesc,
boost::program_options::options_description& hiddenDesc) const 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. * 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 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); REGISTER_CLICOMMAND("ca/remove", CARemoveCommand);
/**
* Provide a long CLI description sentence.
*
* @return text
*/
String CARemoveCommand::GetDescription() const String CARemoveCommand::GetDescription() const
{ {
return "Removes an outstanding certificate request."; return "Removes an outstanding certificate request.";
} }
/**
* Provide a short CLI description.
*
* @return text
*/
String CARemoveCommand::GetShortDescription() const String CARemoveCommand::GetShortDescription() const
{ {
return "removes an outstanding certificate request"; return "removes an outstanding certificate request";
} }
/**
* Define minimum arguments without key parameter.
*
* @return number of arguments
*/
int CARemoveCommand::GetMinArguments() const int CARemoveCommand::GetMinArguments() const
{ {
return 1; return 1;
} }
/**
* Impersonate as Icinga user.
*
* @return impersonate level
*/
ImpersonationLevel CARemoveCommand::GetImpersonationLevel() const ImpersonationLevel CARemoveCommand::GetImpersonationLevel() const
{ {
return ImpersonateIcinga; return ImpersonateIcinga;

View File

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

View File

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