private void ProcessRecordFrequency(string vmss) { RunApiCall(() => { vmss_frequency obj = XenAPI.VMSS.get_frequency(session, vmss); WriteObject(obj, true); }); }
/// <summary> /// Set the value of the frequency field /// First published in XenServer 7.2. /// </summary> /// <param name="session">The session</param> /// <param name="_vmss">The opaque_ref of the given vmss</param> /// <param name="_value">the snapshot schedule frequency</param> public static void set_frequency(Session session, string _vmss, vmss_frequency _value) { if (session.JsonRpcClient != null) { session.JsonRpcClient.vmss_set_frequency(session.opaque_ref, _vmss, _value); } else { session.proxy.vmss_set_frequency(session.opaque_ref, _vmss ?? "", vmss_frequency_helper.ToString(_value)).parse(); } }
public static string StringOf(this vmss_frequency x) { switch (x) { case vmss_frequency.hourly: return("hourly"); case vmss_frequency.daily: return("daily"); case vmss_frequency.weekly: return("weekly"); default: return("unknown"); } }
internal static string FormatSchedule(Dictionary <string, string> schedule, vmss_frequency backupFrequency, DaysWeekCheckboxes.DaysMode mode) { if (backupFrequency == vmss_frequency.hourly) { return(string.Format(Messages.HOURLY_SCHEDULE_FORMAT, schedule["min"])); } else if (backupFrequency == vmss_frequency.daily) { DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); return(string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true))); } else if (backupFrequency == vmss_frequency.weekly) { DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture); return(string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode))); } return(""); }
public VMSS(string uuid, string name_label, string name_description, bool enabled, vmss_type type, long retained_snapshots, vmss_frequency frequency, Dictionary <string, string> schedule, DateTime last_run_time, List <XenRef <VM> > VMs) { this.uuid = uuid; this.name_label = name_label; this.name_description = name_description; this.enabled = enabled; this.type = type; this.retained_snapshots = retained_snapshots; this.frequency = frequency; this.schedule = schedule; this.last_run_time = last_run_time; this.VMs = VMs; }
public static string ToString(vmss_frequency x) { return(x.StringOf()); }
/// <summary> /// Set the value of the frequency field /// First published in XenServer 7.2. /// </summary> /// <param name="session">The session</param> /// <param name="_vmss">The opaque_ref of the given vmss</param> /// <param name="_value">the snapshot schedule frequency</param> public static void set_frequency(Session session, string _vmss, vmss_frequency _value) { session.proxy.vmss_set_frequency(session.uuid, _vmss ?? "", vmss_frequency_helper.ToString(_value)).parse(); }