Merge pull request #29 from open-amt-cloud-toolkit/feature_hostname
feat: add hostname to activation info
This commit is contained in:
@@ -77,6 +77,16 @@ web::json::value get_dns()
|
||||
return web::json::value::string(tmp);
|
||||
}
|
||||
|
||||
web::json::value get_hostname()
|
||||
{
|
||||
utility::string_t tmp;
|
||||
|
||||
std::string hostName = net_get_hostname();
|
||||
tmp = utility::conversions::convertstring(hostName);
|
||||
|
||||
return web::json::value::string(tmp);
|
||||
}
|
||||
|
||||
bool getVersion(web::json::value& value)
|
||||
{
|
||||
std::string version;
|
||||
@@ -202,6 +212,9 @@ bool get_activation_payload(web::json::value& payload)
|
||||
// get DNS Info
|
||||
activationParams[U("fqdn")] = get_dns();
|
||||
|
||||
// get hostname
|
||||
activationParams[U("hostname")] = get_hostname();
|
||||
|
||||
// get client string
|
||||
if (!get_client_string(value)) return false;
|
||||
activationParams[U("client")] = value;
|
||||
@@ -290,3 +303,4 @@ bool act_create_response(std::string payload, std::string& response)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user