Exemplo n.º 1
0
 internal void UpdateFromProxy(Proxy_VMSS proxy)
 {
     uuid               = proxy.uuid == null ? null : (string)proxy.uuid;
     name_label         = proxy.name_label == null ? null : (string)proxy.name_label;
     name_description   = proxy.name_description == null ? null : (string)proxy.name_description;
     enabled            = (bool)proxy.enabled;
     type               = proxy.type == null ? (vmss_type)0 : (vmss_type)Helper.EnumParseDefault(typeof(vmss_type), (string)proxy.type);
     retained_snapshots = proxy.retained_snapshots == null ? 0 : long.Parse((string)proxy.retained_snapshots);
     frequency          = proxy.frequency == null ? (vmss_frequency)0 : (vmss_frequency)Helper.EnumParseDefault(typeof(vmss_frequency), (string)proxy.frequency);
     schedule           = proxy.schedule == null ? null : Maps.convert_from_proxy_string_string(proxy.schedule);
     last_run_time      = proxy.last_run_time;
     VMs = proxy.VMs == null ? null : XenRef <VM> .Create(proxy.VMs);
 }
Exemplo n.º 2
0
        public Proxy_VMSS ToProxy()
        {
            Proxy_VMSS result_ = new Proxy_VMSS();

            result_.uuid               = uuid ?? "";
            result_.name_label         = name_label ?? "";
            result_.name_description   = name_description ?? "";
            result_.enabled            = enabled;
            result_.type               = vmss_type_helper.ToString(type);
            result_.retained_snapshots = retained_snapshots.ToString();
            result_.frequency          = vmss_frequency_helper.ToString(frequency);
            result_.schedule           = Maps.convert_to_proxy_string_string(schedule);
            result_.last_run_time      = last_run_time;
            result_.VMs = (VMs != null) ? Helper.RefListToStringArray(VMs) : new string[] {};
            return(result_);
        }
Exemplo n.º 3
0
        public override string SaveChanges(Session session, string opaqueRef, VMSS server)
        {
            if (opaqueRef == null)
            {
                Proxy_VMSS p = this.ToProxy();
                return(session.proxy.vmss_create(session.uuid, p).parse());
            }
            else
            {
                if (!Helper.AreEqual2(_name_label, server._name_label))
                {
                    VMSS.set_name_label(session, opaqueRef, _name_label);
                }
                if (!Helper.AreEqual2(_name_description, server._name_description))
                {
                    VMSS.set_name_description(session, opaqueRef, _name_description);
                }
                if (!Helper.AreEqual2(_enabled, server._enabled))
                {
                    VMSS.set_enabled(session, opaqueRef, _enabled);
                }
                if (!Helper.AreEqual2(_type, server._type))
                {
                    VMSS.set_type(session, opaqueRef, _type);
                }
                if (!Helper.AreEqual2(_retained_snapshots, server._retained_snapshots))
                {
                    VMSS.set_retained_snapshots(session, opaqueRef, _retained_snapshots);
                }
                if (!Helper.AreEqual2(_frequency, server._frequency))
                {
                    VMSS.set_frequency(session, opaqueRef, _frequency);
                }
                if (!Helper.AreEqual2(_schedule, server._schedule))
                {
                    VMSS.set_schedule(session, opaqueRef, _schedule);
                }

                return(null);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new VMSS from a Proxy_VMSS.
 /// </summary>
 /// <param name="proxy"></param>
 public VMSS(Proxy_VMSS proxy)
 {
     this.UpdateFromProxy(proxy);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new VMSS from a Proxy_VMSS.
 /// </summary>
 /// <param name="proxy"></param>
 public VMSS(Proxy_VMSS proxy)
 {
     UpdateFrom(proxy);
 }