Ejemplo n.º 1
0
        internal void UpdateFromProxy(Proxy_Pool_patch 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;
            version          = proxy.version == null ? null : (string)proxy.version;
            size             = proxy.size == null ? 0 : long.Parse((string)proxy.size);
            pool_applied     = (bool)proxy.pool_applied;
            host_patches     = proxy.host_patches == null ? null : XenRef <Host_patch> .Create(proxy.host_patches);

            after_apply_guidance = proxy.after_apply_guidance == null ? null : Helper.StringArrayToEnumList <after_apply_guidance>(proxy.after_apply_guidance);
            other_config         = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
        }
Ejemplo n.º 2
0
        public Proxy_Pool_patch ToProxy()
        {
            Proxy_Pool_patch result_ = new Proxy_Pool_patch();

            result_.uuid                 = (uuid != null) ? uuid : "";
            result_.name_label           = (name_label != null) ? name_label : "";
            result_.name_description     = (name_description != null) ? name_description : "";
            result_.version              = (version != null) ? version : "";
            result_.size                 = size.ToString();
            result_.pool_applied         = pool_applied;
            result_.host_patches         = (host_patches != null) ? Helper.RefListToStringArray(host_patches) : new string[] {};
            result_.after_apply_guidance = (after_apply_guidance != null) ? Helper.ObjectListToStringArray(after_apply_guidance) : new string[] {};
            result_.other_config         = Maps.convert_to_proxy_string_string(other_config);
            return(result_);
        }
Ejemplo n.º 3
0
        public Proxy_Pool_patch ToProxy()
        {
            Proxy_Pool_patch result_ = new Proxy_Pool_patch();

            result_.uuid                 = uuid ?? "";
            result_.name_label           = name_label ?? "";
            result_.name_description     = name_description ?? "";
            result_.version              = version ?? "";
            result_.size                 = size.ToString();
            result_.pool_applied         = pool_applied;
            result_.host_patches         = host_patches == null ? new string[] {} : Helper.RefListToStringArray(host_patches);
            result_.after_apply_guidance = after_apply_guidance == null ? new string[] {} : Helper.ObjectListToStringArray(after_apply_guidance);
            result_.pool_update          = pool_update ?? "";
            result_.other_config         = Maps.convert_to_proxy_string_string(other_config);
            return(result_);
        }
Ejemplo n.º 4
0
        private void PoolPatchUpload(Dictionary <string, string> query)
        {
            string           task_ref   = query["task_id"];
            string           session_id = query["session_id"];
            Proxy_Task       task       = simProxy.proxy.GetTask(task_ref);
            Proxy_Pool_patch patch      = new Proxy_Pool_patch();

            patch.after_apply_guidance = new string[] { "unknown" };
            patch.name_label           = "fake-patch";
            patch.name_description     = "";
            patch.size    = "0";
            patch.uuid    = Guid.NewGuid().ToString();
            patch.version = "1.0";

            task.result   = new fakePool_Patch(simProxy.proxy).create(session_id, patch).Value;
            task.finished = DateTime.Now;
            task.status   = "success";
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a new Pool_patch from a Proxy_Pool_patch.
 /// </summary>
 /// <param name="proxy"></param>
 public Pool_patch(Proxy_Pool_patch proxy)
 {
     this.UpdateFromProxy(proxy);
 }
Ejemplo n.º 6
0
 public Response <string> create(string session, Proxy_Pool_patch patch)
 {
     return(createObj("pool_patch", patch));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a new Pool_patch from a Proxy_Pool_patch.
 /// </summary>
 /// <param name="proxy"></param>
 public Pool_patch(Proxy_Pool_patch proxy)
 {
     UpdateFrom(proxy);
 }