mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +02:00
Split ApiSetupUtility::SetupMaster() into multiple functions
refs #9590
This commit is contained in:
parent
3fe6b56628
commit
f123c8218d
@ -55,6 +55,15 @@ int ApiSetupUtility::SetupMaster(const String& cn)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetupMasterCertificates(cn);
|
||||||
|
SetupMasterApiUser(cn);
|
||||||
|
SetupMasterEnableApi(cn);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ApiSetupUtility::SetupMasterCertificates(const String& cn)
|
||||||
|
{
|
||||||
Log(LogInformation, "cli")
|
Log(LogInformation, "cli")
|
||||||
<< "Generating new CA.\n";
|
<< "Generating new CA.\n";
|
||||||
|
|
||||||
@ -143,6 +152,11 @@ int ApiSetupUtility::SetupMaster(const String& cn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ApiSetupUtility::SetupMasterApiUser(const String& cn)
|
||||||
|
{
|
||||||
String api_username = "root"; //TODO make this available as cli parameter?
|
String api_username = "root"; //TODO make this available as cli parameter?
|
||||||
String api_password = RandomString(8);
|
String api_password = RandomString(8);
|
||||||
String apiuserspath = GetConfdPath() + "/api-users.conf";
|
String apiuserspath = GetConfdPath() + "/api-users.conf";
|
||||||
@ -178,7 +192,11 @@ int ApiSetupUtility::SetupMaster(const String& cn)
|
|||||||
<< boost::errinfo_file_name(apiuserspathtmp));
|
<< boost::errinfo_file_name(apiuserspathtmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ApiSetupUtility::SetupMasterEnableApi(const String& cn)
|
||||||
|
{
|
||||||
Log(LogInformation, "cli", "Enabling the ApiListener feature.\n");
|
Log(LogInformation, "cli", "Enabling the ApiListener feature.\n");
|
||||||
|
|
||||||
std::vector<std::string> enable;
|
std::vector<std::string> enable;
|
||||||
|
@ -38,6 +38,11 @@ class I2_CLI_API ApiSetupUtility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static int SetupMaster(const String& cn);
|
static int SetupMaster(const String& cn);
|
||||||
|
|
||||||
|
static int SetupMasterCertificates(const String& cn);
|
||||||
|
static int SetupMasterApiUser(const String& cn);
|
||||||
|
static int SetupMasterEnableApi(const String& cn);
|
||||||
|
|
||||||
static String GetConfdPath(void);
|
static String GetConfdPath(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user