예제 #1
0
파일: SR.cs 프로젝트: ryu2048/xenadmin
        public Proxy_SR ToProxy()
        {
            Proxy_SR result_ = new Proxy_SR();

            result_.uuid                 = (uuid != null) ? uuid : "";
            result_.name_label           = (name_label != null) ? name_label : "";
            result_.name_description     = (name_description != null) ? name_description : "";
            result_.allowed_operations   = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {};
            result_.current_operations   = Maps.convert_to_proxy_string_storage_operations(current_operations);
            result_.VDIs                 = (VDIs != null) ? Helper.RefListToStringArray(VDIs) : new string[] {};
            result_.PBDs                 = (PBDs != null) ? Helper.RefListToStringArray(PBDs) : new string[] {};
            result_.virtual_allocation   = virtual_allocation.ToString();
            result_.physical_utilisation = physical_utilisation.ToString();
            result_.physical_size        = physical_size.ToString();
            result_.type                 = (type != null) ? type : "";
            result_.content_type         = (content_type != null) ? content_type : "";
            result_.shared               = shared;
            result_.other_config         = Maps.convert_to_proxy_string_string(other_config);
            result_.tags                 = tags;
            result_.sm_config            = Maps.convert_to_proxy_string_string(sm_config);
            result_.blobs                = Maps.convert_to_proxy_string_XenRefBlob(blobs);
            result_.local_cache_enabled  = local_cache_enabled;
            result_.introduced_by        = (introduced_by != null) ? introduced_by : "";
            return(result_);
        }
예제 #2
0
파일: SR.cs 프로젝트: ryu2048/xenadmin
        internal void UpdateFromProxy(Proxy_SR 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;
            allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList <storage_operations>(proxy.allowed_operations);
            current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_storage_operations(proxy.current_operations);
            VDIs               = proxy.VDIs == null ? null : XenRef <VDI> .Create(proxy.VDIs);

            PBDs = proxy.PBDs == null ? null : XenRef <PBD> .Create(proxy.PBDs);

            virtual_allocation   = proxy.virtual_allocation == null ? 0 : long.Parse((string)proxy.virtual_allocation);
            physical_utilisation = proxy.physical_utilisation == null ? 0 : long.Parse((string)proxy.physical_utilisation);
            physical_size        = proxy.physical_size == null ? 0 : long.Parse((string)proxy.physical_size);
            type                = proxy.type == null ? null : (string)proxy.type;
            content_type        = proxy.content_type == null ? null : (string)proxy.content_type;
            shared              = (bool)proxy.shared;
            other_config        = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
            tags                = proxy.tags == null ? new string[] {} : (string [])proxy.tags;
            sm_config           = proxy.sm_config == null ? null : Maps.convert_from_proxy_string_string(proxy.sm_config);
            blobs               = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs);
            local_cache_enabled = (bool)proxy.local_cache_enabled;
            introduced_by       = proxy.introduced_by == null ? null : XenRef <DR_task> .Create(proxy.introduced_by);
        }
예제 #3
0
파일: SR.cs 프로젝트: ryu2048/xenadmin
 /// <summary>
 /// Creates a new SR from a Proxy_SR.
 /// </summary>
 /// <param name="proxy"></param>
 public SR(Proxy_SR proxy)
 {
     this.UpdateFromProxy(proxy);
 }