Ejemplo n.º 1
0
        internal void UpdateFromProxy(Proxy_Cluster proxy)
        {
            uuid          = proxy.uuid == null ? null : proxy.uuid;
            cluster_hosts = proxy.cluster_hosts == null ? null : XenRef <Cluster_host> .Create(proxy.cluster_hosts);

            network = proxy.network == null ? null : XenRef <Network> .Create(proxy.network);

            cluster_token             = proxy.cluster_token == null ? null : proxy.cluster_token;
            cluster_stack             = proxy.cluster_stack == null ? null : proxy.cluster_stack;
            allowed_operations        = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList <cluster_operation>(proxy.allowed_operations);
            current_operations        = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_cluster_operation(proxy.current_operations);
            pool_auto_join            = (bool)proxy.pool_auto_join;
            token_timeout             = proxy.token_timeout == null ? 0 : long.Parse(proxy.token_timeout);
            token_timeout_coefficient = proxy.token_timeout_coefficient == null ? 0 : long.Parse(proxy.token_timeout_coefficient);
            cluster_config            = proxy.cluster_config == null ? null : Maps.convert_from_proxy_string_string(proxy.cluster_config);
            other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new Network from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public Network(Hashtable table)
 {
     uuid               = Marshalling.ParseString(table, "uuid");
     name_label         = Marshalling.ParseString(table, "name_label");
     name_description   = Marshalling.ParseString(table, "name_description");
     allowed_operations = Helper.StringArrayToEnumList <network_operations>(Marshalling.ParseStringArray(table, "allowed_operations"));
     current_operations = Maps.convert_from_proxy_string_network_operations(Marshalling.ParseHashTable(table, "current_operations"));
     VIFs               = Marshalling.ParseSetRef <VIF>(table, "VIFs");
     PIFs               = Marshalling.ParseSetRef <PIF>(table, "PIFs");
     MTU                  = Marshalling.ParseLong(table, "MTU");
     other_config         = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     bridge               = Marshalling.ParseString(table, "bridge");
     managed              = Marshalling.ParseBool(table, "managed");
     blobs                = Maps.convert_from_proxy_string_XenRefBlob(Marshalling.ParseHashTable(table, "blobs"));
     tags                 = Marshalling.ParseStringArray(table, "tags");
     default_locking_mode = (network_default_locking_mode)Helper.EnumParseDefault(typeof(network_default_locking_mode), Marshalling.ParseString(table, "default_locking_mode"));
     assigned_ips         = Maps.convert_from_proxy_XenRefVIF_string(Marshalling.ParseHashTable(table, "assigned_ips"));
 }
Ejemplo n.º 3
0
        internal void UpdateFromProxy(Proxy_Network 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 <network_operations>(proxy.allowed_operations);
            current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_network_operations(proxy.current_operations);
            VIFs               = proxy.VIFs == null ? null : XenRef <VIF> .Create(proxy.VIFs);

            PIFs = proxy.PIFs == null ? null : XenRef <PIF> .Create(proxy.PIFs);

            MTU                  = proxy.MTU == null ? 0 : long.Parse((string)proxy.MTU);
            other_config         = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
            bridge               = proxy.bridge == null ? null : (string)proxy.bridge;
            blobs                = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs);
            tags                 = proxy.tags == null ? new string[] {} : (string [])proxy.tags;
            default_locking_mode = proxy.default_locking_mode == null ? (network_default_locking_mode)0 : (network_default_locking_mode)Helper.EnumParseDefault(typeof(network_default_locking_mode), (string)proxy.default_locking_mode);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this Pool_patch
 /// with the values listed in the Hashtable. Note that only the fields contained
 /// in the Hashtable will be updated and the rest will remain the same.
 /// </summary>
 /// <param name="table"></param>
 public void UpdateFrom(Hashtable table)
 {
     if (table.ContainsKey("uuid"))
     {
         uuid = Marshalling.ParseString(table, "uuid");
     }
     if (table.ContainsKey("name_label"))
     {
         name_label = Marshalling.ParseString(table, "name_label");
     }
     if (table.ContainsKey("name_description"))
     {
         name_description = Marshalling.ParseString(table, "name_description");
     }
     if (table.ContainsKey("version"))
     {
         version = Marshalling.ParseString(table, "version");
     }
     if (table.ContainsKey("size"))
     {
         size = Marshalling.ParseLong(table, "size");
     }
     if (table.ContainsKey("pool_applied"))
     {
         pool_applied = Marshalling.ParseBool(table, "pool_applied");
     }
     if (table.ContainsKey("host_patches"))
     {
         host_patches = Marshalling.ParseSetRef <Host_patch>(table, "host_patches");
     }
     if (table.ContainsKey("after_apply_guidance"))
     {
         after_apply_guidance = Helper.StringArrayToEnumList <after_apply_guidance>(Marshalling.ParseStringArray(table, "after_apply_guidance"));
     }
     if (table.ContainsKey("pool_update"))
     {
         pool_update = Marshalling.ParseRef <Pool_update>(table, "pool_update");
     }
     if (table.ContainsKey("other_config"))
     {
         other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a new Task from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public Task(Hashtable table)
 {
     uuid               = Marshalling.ParseString(table, "uuid");
     name_label         = Marshalling.ParseString(table, "name_label");
     name_description   = Marshalling.ParseString(table, "name_description");
     allowed_operations = Helper.StringArrayToEnumList <task_allowed_operations>(Marshalling.ParseStringArray(table, "allowed_operations"));
     current_operations = Maps.convert_from_proxy_string_task_allowed_operations(Marshalling.ParseHashTable(table, "current_operations"));
     created            = Marshalling.ParseDateTime(table, "created");
     finished           = Marshalling.ParseDateTime(table, "finished");
     status             = (task_status_type)Helper.EnumParseDefault(typeof(task_status_type), Marshalling.ParseString(table, "status"));
     resident_on        = Marshalling.ParseRef <Host>(table, "resident_on");
     progress           = Marshalling.ParseDouble(table, "progress");
     type               = Marshalling.ParseString(table, "type");
     result             = Marshalling.ParseString(table, "result");
     error_info         = Marshalling.ParseStringArray(table, "error_info");
     other_config       = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     subtask_of         = Marshalling.ParseRef <Task>(table, "subtask_of");
     subtasks           = Marshalling.ParseSetRef <Task>(table, "subtasks");
 }
Ejemplo n.º 6
0
        internal void UpdateFromProxy(Proxy_Task 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 <task_allowed_operations>(proxy.allowed_operations);
            current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_task_allowed_operations(proxy.current_operations);
            created            = proxy.created;
            finished           = proxy.finished;
            status             = proxy.status == null ? (task_status_type)0 : (task_status_type)Helper.EnumParseDefault(typeof(task_status_type), (string)proxy.status);
            resident_on        = proxy.resident_on == null ? null : XenRef <Host> .Create(proxy.resident_on);

            progress     = Convert.ToDouble(proxy.progress);
            type         = proxy.type == null ? null : (string)proxy.type;
            result       = proxy.result == null ? null : (string)proxy.result;
            error_info   = proxy.error_info == null ? new string[] {} : (string [])proxy.error_info;
            other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
            subtask_of   = proxy.subtask_of == null ? null : XenRef <Task> .Create(proxy.subtask_of);

            subtasks = proxy.subtasks == null ? null : XenRef <Task> .Create(proxy.subtasks);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this Cluster_host
 /// with the values listed in the Hashtable. Note that only the fields contained
 /// in the Hashtable will be updated and the rest will remain the same.
 /// </summary>
 /// <param name="table"></param>
 public void UpdateFrom(Hashtable table)
 {
     if (table.ContainsKey("uuid"))
     {
         uuid = Marshalling.ParseString(table, "uuid");
     }
     if (table.ContainsKey("cluster"))
     {
         cluster = Marshalling.ParseRef <Cluster>(table, "cluster");
     }
     if (table.ContainsKey("host"))
     {
         host = Marshalling.ParseRef <Host>(table, "host");
     }
     if (table.ContainsKey("enabled"))
     {
         enabled = Marshalling.ParseBool(table, "enabled");
     }
     if (table.ContainsKey("PIF"))
     {
         PIF = Marshalling.ParseRef <PIF>(table, "PIF");
     }
     if (table.ContainsKey("joined"))
     {
         joined = Marshalling.ParseBool(table, "joined");
     }
     if (table.ContainsKey("allowed_operations"))
     {
         allowed_operations = Helper.StringArrayToEnumList <cluster_host_operation>(Marshalling.ParseStringArray(table, "allowed_operations"));
     }
     if (table.ContainsKey("current_operations"))
     {
         current_operations = Maps.convert_from_proxy_string_cluster_host_operation(Marshalling.ParseHashTable(table, "current_operations"));
     }
     if (table.ContainsKey("other_config"))
     {
         other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a new SR from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public SR(Hashtable table)
 {
     uuid                 = Marshalling.ParseString(table, "uuid");
     name_label           = Marshalling.ParseString(table, "name_label");
     name_description     = Marshalling.ParseString(table, "name_description");
     allowed_operations   = Helper.StringArrayToEnumList <storage_operations>(Marshalling.ParseStringArray(table, "allowed_operations"));
     current_operations   = Maps.convert_from_proxy_string_storage_operations(Marshalling.ParseHashTable(table, "current_operations"));
     VDIs                 = Marshalling.ParseSetRef <VDI>(table, "VDIs");
     PBDs                 = Marshalling.ParseSetRef <PBD>(table, "PBDs");
     virtual_allocation   = Marshalling.ParseLong(table, "virtual_allocation");
     physical_utilisation = Marshalling.ParseLong(table, "physical_utilisation");
     physical_size        = Marshalling.ParseLong(table, "physical_size");
     type                 = Marshalling.ParseString(table, "type");
     content_type         = Marshalling.ParseString(table, "content_type");
     shared               = Marshalling.ParseBool(table, "shared");
     other_config         = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     tags                 = Marshalling.ParseStringArray(table, "tags");
     sm_config            = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "sm_config"));
     blobs                = Maps.convert_from_proxy_string_XenRefBlob(Marshalling.ParseHashTable(table, "blobs"));
     local_cache_enabled  = Marshalling.ParseBool(table, "local_cache_enabled");
     introduced_by        = Marshalling.ParseRef <DR_task>(table, "introduced_by");
 }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Creates a new VIF from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public VIF(Hashtable table)
 {
     uuid = Marshalling.ParseString(table, "uuid");
     allowed_operations = Helper.StringArrayToEnumList <vif_operations>(Marshalling.ParseStringArray(table, "allowed_operations"));
     current_operations = Maps.convert_from_proxy_string_vif_operations(Marshalling.ParseHashTable(table, "current_operations"));
     device             = Marshalling.ParseString(table, "device");
     network            = Marshalling.ParseRef <Network>(table, "network");
     VM                       = Marshalling.ParseRef <VM>(table, "VM");
     MAC                      = Marshalling.ParseString(table, "MAC");
     MTU                      = Marshalling.ParseLong(table, "MTU");
     other_config             = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     currently_attached       = Marshalling.ParseBool(table, "currently_attached");
     status_code              = Marshalling.ParseLong(table, "status_code");
     status_detail            = Marshalling.ParseString(table, "status_detail");
     runtime_properties       = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "runtime_properties"));
     qos_algorithm_type       = Marshalling.ParseString(table, "qos_algorithm_type");
     qos_algorithm_params     = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "qos_algorithm_params"));
     qos_supported_algorithms = Marshalling.ParseStringArray(table, "qos_supported_algorithms");
     metrics                  = Marshalling.ParseRef <VIF_metrics>(table, "metrics");
     MAC_autogenerated        = Marshalling.ParseBool(table, "MAC_autogenerated");
     locking_mode             = (vif_locking_mode)Helper.EnumParseDefault(typeof(vif_locking_mode), Marshalling.ParseString(table, "locking_mode"));
     ipv4_allowed             = Marshalling.ParseStringArray(table, "ipv4_allowed");
     ipv6_allowed             = Marshalling.ParseStringArray(table, "ipv6_allowed");
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Get the after_apply_guidance field of the given pool_update.
 /// First published in XenServer 7.1.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_pool_update">The opaque_ref of the given pool_update</param>
 public static List <update_after_apply_guidance> get_after_apply_guidance(Session session, string _pool_update)
 {
     return(Helper.StringArrayToEnumList <update_after_apply_guidance>(session.proxy.pool_update_get_after_apply_guidance(session.uuid, _pool_update ?? "").parse()));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this Task
 /// with the values listed in the Hashtable. Note that only the fields contained
 /// in the Hashtable will be updated and the rest will remain the same.
 /// </summary>
 /// <param name="table"></param>
 public void UpdateFrom(Hashtable table)
 {
     if (table.ContainsKey("uuid"))
     {
         uuid = Marshalling.ParseString(table, "uuid");
     }
     if (table.ContainsKey("name_label"))
     {
         name_label = Marshalling.ParseString(table, "name_label");
     }
     if (table.ContainsKey("name_description"))
     {
         name_description = Marshalling.ParseString(table, "name_description");
     }
     if (table.ContainsKey("allowed_operations"))
     {
         allowed_operations = Helper.StringArrayToEnumList <task_allowed_operations>(Marshalling.ParseStringArray(table, "allowed_operations"));
     }
     if (table.ContainsKey("current_operations"))
     {
         current_operations = Maps.convert_from_proxy_string_task_allowed_operations(Marshalling.ParseHashTable(table, "current_operations"));
     }
     if (table.ContainsKey("created"))
     {
         created = Marshalling.ParseDateTime(table, "created");
     }
     if (table.ContainsKey("finished"))
     {
         finished = Marshalling.ParseDateTime(table, "finished");
     }
     if (table.ContainsKey("status"))
     {
         status = (task_status_type)Helper.EnumParseDefault(typeof(task_status_type), Marshalling.ParseString(table, "status"));
     }
     if (table.ContainsKey("resident_on"))
     {
         resident_on = Marshalling.ParseRef <Host>(table, "resident_on");
     }
     if (table.ContainsKey("progress"))
     {
         progress = Marshalling.ParseDouble(table, "progress");
     }
     if (table.ContainsKey("type"))
     {
         type = Marshalling.ParseString(table, "type");
     }
     if (table.ContainsKey("result"))
     {
         result = Marshalling.ParseString(table, "result");
     }
     if (table.ContainsKey("error_info"))
     {
         error_info = Marshalling.ParseStringArray(table, "error_info");
     }
     if (table.ContainsKey("other_config"))
     {
         other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     }
     if (table.ContainsKey("subtask_of"))
     {
         subtask_of = Marshalling.ParseRef <Task>(table, "subtask_of");
     }
     if (table.ContainsKey("subtasks"))
     {
         subtasks = Marshalling.ParseSetRef <Task>(table, "subtasks");
     }
     if (table.ContainsKey("backtrace"))
     {
         backtrace = Marshalling.ParseString(table, "backtrace");
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Get the purpose field of the given network.
 /// First published in Unreleased.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_network">The opaque_ref of the given network</param>
 public static List <network_purpose> get_purpose(Session session, string _network)
 {
     return(Helper.StringArrayToEnumList <network_purpose>(session.proxy.network_get_purpose(session.uuid, _network ?? "").parse()));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Get the allowed_operations field of the given network.
 /// First published in XenServer 4.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_network">The opaque_ref of the given network</param>
 public static List <network_operations> get_allowed_operations(Session session, string _network)
 {
     return(Helper.StringArrayToEnumList <network_operations>(session.proxy.network_get_allowed_operations(session.uuid, _network ?? "").parse()));
 }
Ejemplo n.º 15
0
 public static List <storage_operations> get_allowed_operations(Session session, string _sr)
 {
     return(Helper.StringArrayToEnumList <storage_operations>(session.proxy.sr_get_allowed_operations(session.uuid, (_sr != null) ? _sr : "").parse()));
 }
Ejemplo n.º 16
0
 public static List <vif_operations> get_allowed_operations(Session session, string _vif)
 {
     return(Helper.StringArrayToEnumList <vif_operations>(session.proxy.vif_get_allowed_operations(session.uuid, (_vif != null) ? _vif : "").parse()));
 }
Ejemplo n.º 17
0
 public static List <vm_appliance_operation> get_allowed_operations(Session session, string _vm_appliance)
 {
     return(Helper.StringArrayToEnumList <vm_appliance_operation>(session.proxy.vm_appliance_get_allowed_operations(session.uuid, (_vm_appliance != null) ? _vm_appliance : "").parse()));
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Get the allowed_operations field of the given VUSB.
 /// First published in Unreleased.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_vusb">The opaque_ref of the given vusb</param>
 public static List <vusb_operations> get_allowed_operations(Session session, string _vusb)
 {
     return(Helper.StringArrayToEnumList <vusb_operations>(session.proxy.vusb_get_allowed_operations(session.uuid, _vusb ?? "").parse()));
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Get the allowed_operations field of the given task.
 /// First published in XenServer 4.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_task">The opaque_ref of the given task</param>
 public static List <task_allowed_operations> get_allowed_operations(Session session, string _task)
 {
     return(Helper.StringArrayToEnumList <task_allowed_operations>(session.proxy.task_get_allowed_operations(session.uuid, (_task != null) ? _task : "").parse()));
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Get the after_apply_guidance field of the given pool_patch.
 /// First published in XenServer 4.1.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_pool_patch">The opaque_ref of the given pool_patch</param>
 public static List <after_apply_guidance> get_after_apply_guidance(Session session, string _pool_patch)
 {
     return(Helper.StringArrayToEnumList <after_apply_guidance>(session.proxy.pool_patch_get_after_apply_guidance(session.uuid, (_pool_patch != null) ? _pool_patch : "").parse()));
 }