Exemple #1
0
        internal void UpdateFromProxy(Proxy_VMPP proxy)
        {
            this.uuid                   = (proxy.uuid == null) ? null : proxy.uuid;
            this.name_label             = (proxy.name_label == null) ? null : proxy.name_label;
            this.name_description       = (proxy.name_description == null) ? null : proxy.name_description;
            this.is_policy_enabled      = proxy.is_policy_enabled;
            this.backup_type            = (proxy.backup_type == null) ? vmpp_backup_type.snapshot : ((vmpp_backup_type)Helper.EnumParseDefault(typeof(vmpp_backup_type), proxy.backup_type));
            this.backup_retention_value = (proxy.backup_retention_value == null) ? 0L : long.Parse(proxy.backup_retention_value);
            this.backup_frequency       = (proxy.backup_frequency == null) ? vmpp_backup_frequency.hourly : ((vmpp_backup_frequency)Helper.EnumParseDefault(typeof(vmpp_backup_frequency), proxy.backup_frequency));
            this.backup_schedule        = (proxy.backup_schedule == null) ? null : Maps.convert_from_proxy_string_string(proxy.backup_schedule);
            this.is_backup_running      = proxy.is_backup_running;
            this.backup_last_run_time   = proxy.backup_last_run_time;
            this.archive_target_type    = (proxy.archive_target_type == null) ? vmpp_archive_target_type.none : ((vmpp_archive_target_type)Helper.EnumParseDefault(typeof(vmpp_archive_target_type), proxy.archive_target_type));
            this.archive_target_config  = (proxy.archive_target_config == null) ? null : Maps.convert_from_proxy_string_string(proxy.archive_target_config);
            this.archive_frequency      = (proxy.archive_frequency == null) ? vmpp_archive_frequency.never : ((vmpp_archive_frequency)Helper.EnumParseDefault(typeof(vmpp_archive_frequency), proxy.archive_frequency));
            this.archive_schedule       = (proxy.archive_schedule == null) ? null : Maps.convert_from_proxy_string_string(proxy.archive_schedule);
            this.is_archive_running     = proxy.is_archive_running;
            this.archive_last_run_time  = proxy.archive_last_run_time;
            this.VMs = (proxy.VMs == null) ? null : XenRef <VM> .Create(proxy.VMs);

            this.is_alarm_enabled = proxy.is_alarm_enabled;
            this.alarm_config     = (proxy.alarm_config == null) ? null : Maps.convert_from_proxy_string_string(proxy.alarm_config);
            this.recent_alerts    = (proxy.recent_alerts == null) ? new string[0] : proxy.recent_alerts;
        }
Exemple #2
0
 public VMPP(Proxy_VMPP proxy)
 {
     this.UpdateFromProxy(proxy);
 }
Exemple #3
0
 public override string SaveChanges(Session session, string opaqueRef, VMPP server)
 {
     if (opaqueRef == null)
     {
         Proxy_VMPP y_vmpp = this.ToProxy();
         return(session.proxy.vmpp_create(session.uuid, y_vmpp).parse());
     }
     if (!Helper.AreEqual2 <string>(this._name_label, server._name_label))
     {
         set_name_label(session, opaqueRef, this._name_label);
     }
     if (!Helper.AreEqual2 <string>(this._name_description, server._name_description))
     {
         set_name_description(session, opaqueRef, this._name_description);
     }
     if (!Helper.AreEqual2 <bool>(this._is_policy_enabled, server._is_policy_enabled))
     {
         set_is_policy_enabled(session, opaqueRef, this._is_policy_enabled);
     }
     if (!Helper.AreEqual2 <vmpp_backup_type>(this._backup_type, server._backup_type))
     {
         set_backup_type(session, opaqueRef, this._backup_type);
     }
     if (!Helper.AreEqual2 <long>(this._backup_retention_value, server._backup_retention_value))
     {
         set_backup_retention_value(session, opaqueRef, this._backup_retention_value);
     }
     if (!Helper.AreEqual2 <vmpp_backup_frequency>(this._backup_frequency, server._backup_frequency))
     {
         set_backup_frequency(session, opaqueRef, this._backup_frequency);
     }
     if (!Helper.AreEqual2 <Dictionary <string, string> >(this._backup_schedule, server._backup_schedule))
     {
         set_backup_schedule(session, opaqueRef, this._backup_schedule);
     }
     if (!Helper.AreEqual2 <vmpp_archive_target_type>(this._archive_target_type, server._archive_target_type))
     {
         set_archive_target_type(session, opaqueRef, this._archive_target_type);
     }
     if (!Helper.AreEqual2 <Dictionary <string, string> >(this._archive_target_config, server._archive_target_config))
     {
         set_archive_target_config(session, opaqueRef, this._archive_target_config);
     }
     if (!Helper.AreEqual2 <vmpp_archive_frequency>(this._archive_frequency, server._archive_frequency))
     {
         set_archive_frequency(session, opaqueRef, this._archive_frequency);
     }
     if (!Helper.AreEqual2 <Dictionary <string, string> >(this._archive_schedule, server._archive_schedule))
     {
         set_archive_schedule(session, opaqueRef, this._archive_schedule);
     }
     if (!Helper.AreEqual2 <bool>(this._is_alarm_enabled, server._is_alarm_enabled))
     {
         set_is_alarm_enabled(session, opaqueRef, this._is_alarm_enabled);
     }
     if (!Helper.AreEqual2 <Dictionary <string, string> >(this._alarm_config, server._alarm_config))
     {
         set_alarm_config(session, opaqueRef, this._alarm_config);
     }
     return(null);
 }