mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-21 16:06:02 +01:00
0cd0b5f0d7
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
30 lines
1.2 KiB
C#
30 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using XenAPI;
|
|
|
|
namespace XenAdmin.Actions
|
|
{
|
|
public class SaveCallHomeSettingsAction : PureAsyncAction
|
|
{
|
|
private readonly Pool pool;
|
|
CallHomeSettings callHomeSettings;
|
|
private string authenticationToken;
|
|
|
|
public SaveCallHomeSettingsAction(Pool pool, CallHomeSettings callHomeSettings, string authenticationToken, bool suppressHistory)
|
|
: base(pool.Connection, Messages.ACTION_SAVE_CALLHOME_SETTINGS, string.Format(Messages.ACTION_SAVING_CALLHOME_SETTINGS, pool.Name), suppressHistory)
|
|
{
|
|
this.pool = pool;
|
|
this.callHomeSettings = callHomeSettings;
|
|
this.authenticationToken = authenticationToken;
|
|
}
|
|
|
|
protected override void Run()
|
|
{
|
|
Dictionary<string, string> newConfig = callHomeSettings.ToDictionary(pool.health_check_config);
|
|
if (!string.IsNullOrEmpty(authenticationToken))
|
|
CallHomeAuthenticationAction.SetUploadTokenSecret(Connection, newConfig, authenticationToken);
|
|
Pool.set_health_check_config(Connection.Session, pool.opaque_ref, newConfig);
|
|
}
|
|
}
|
|
}
|
|
|