示例#1
0
文件: Bond.cs 项目: ryu2048/xenadmin
 /// <summary>
 /// Creates a new Bond from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public Bond(Hashtable table)
 {
     uuid          = Marshalling.ParseString(table, "uuid");
     master        = Marshalling.ParseRef <PIF>(table, "master");
     slaves        = Marshalling.ParseSetRef <PIF>(table, "slaves");
     other_config  = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     primary_slave = Marshalling.ParseRef <PIF>(table, "primary_slave");
     mode          = (bond_mode)Helper.EnumParseDefault(typeof(bond_mode), Marshalling.ParseString(table, "mode"));
     properties    = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "properties"));
     links_up      = Marshalling.ParseLong(table, "links_up");
 }
示例#2
0
 /// <summary>
 /// Get the status 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 task_status_type get_status(Session session, string _task)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.task_get_status(session.opaque_ref, _task));
     }
     else
     {
         return((task_status_type)Helper.EnumParseDefault(typeof(task_status_type), (string)session.proxy.task_get_status(session.opaque_ref, _task ?? "").parse()));
     }
 }
示例#3
0
 /// <summary>
 /// Get the protocol field of the given tunnel.
 /// First published in Unreleased.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_tunnel">The opaque_ref of the given tunnel</param>
 public static tunnel_protocol get_protocol(Session session, string _tunnel)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.tunnel_get_protocol(session.opaque_ref, _tunnel));
     }
     else
     {
         return((tunnel_protocol)Helper.EnumParseDefault(typeof(tunnel_protocol), (string)session.XmlRpcProxy.tunnel_get_protocol(session.opaque_ref, _tunnel ?? "").parse()));
     }
 }
示例#4
0
 /// <summary>
 /// Get the can_use_hotplug_vif field of the given VM_guest_metrics.
 /// First published in XenServer 7.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_vm_guest_metrics">The opaque_ref of the given vm_guest_metrics</param>
 public static tristate_type get_can_use_hotplug_vif(Session session, string _vm_guest_metrics)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.vm_guest_metrics_get_can_use_hotplug_vif(session.opaque_ref, _vm_guest_metrics));
     }
     else
     {
         return((tristate_type)Helper.EnumParseDefault(typeof(tristate_type), (string)session.XmlRpcProxy.vm_guest_metrics_get_can_use_hotplug_vif(session.opaque_ref, _vm_guest_metrics ?? "").parse()));
     }
 }
示例#5
0
 /// <summary>
 /// Get the protocol field of the given console.
 /// First published in XenServer 4.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_console">The opaque_ref of the given console</param>
 public static console_protocol get_protocol(Session session, string _console)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.console_get_protocol(session.opaque_ref, _console));
     }
     else
     {
         return((console_protocol)Helper.EnumParseDefault(typeof(console_protocol), (string)session.proxy.console_get_protocol(session.opaque_ref, _console ?? "").parse()));
     }
 }
示例#6
0
 /// <summary>
 /// Get the mode field of the given Bond.
 /// First published in XenServer 6.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_bond">The opaque_ref of the given bond</param>
 public static bond_mode get_mode(Session session, string _bond)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.bond_get_mode(session.opaque_ref, _bond));
     }
     else
     {
         return((bond_mode)Helper.EnumParseDefault(typeof(bond_mode), (string)session.proxy.bond_get_mode(session.opaque_ref, _bond ?? "").parse()));
     }
 }
示例#7
0
 /// <summary>
 /// Get the status field of the given PVS_proxy.
 /// First published in XenServer 7.1.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_pvs_proxy">The opaque_ref of the given pvs_proxy</param>
 public static pvs_proxy_status get_status(Session session, string _pvs_proxy)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.pvs_proxy_get_status(session.opaque_ref, _pvs_proxy));
     }
     else
     {
         return((pvs_proxy_status)Helper.EnumParseDefault(typeof(pvs_proxy_status), (string)session.XmlRpcProxy.pvs_proxy_get_status(session.opaque_ref, _pvs_proxy ?? "").parse()));
     }
 }
示例#8
0
 /// <summary>
 /// Execute the precheck stage of the selected update on a host
 /// 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>
 /// <param name="_host">The host to run the prechecks on.</param>
 public static livepatch_status precheck(Session session, string _pool_update, string _host)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.pool_update_precheck(session.opaque_ref, _pool_update, _host));
     }
     else
     {
         return((livepatch_status)Helper.EnumParseDefault(typeof(livepatch_status), (string)session.proxy.pool_update_precheck(session.opaque_ref, _pool_update ?? "", _host ?? "").parse()));
     }
 }
示例#9
0
 /// <summary>
 /// Get the protocol field of the given SDN_controller.
 /// First published in XenServer 7.2.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_sdn_controller">The opaque_ref of the given sdn_controller</param>
 public static sdn_controller_protocol get_protocol(Session session, string _sdn_controller)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.sdn_controller_get_protocol(session.opaque_ref, _sdn_controller));
     }
     else
     {
         return((sdn_controller_protocol)Helper.EnumParseDefault(typeof(sdn_controller_protocol), (string)session.XmlRpcProxy.sdn_controller_get_protocol(session.opaque_ref, _sdn_controller ?? "").parse()));
     }
 }
示例#10
0
 /// <summary>
 /// Get the current_domain_type field of the given VM_metrics.
 /// First published in XenServer 7.4.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_vm_metrics">The opaque_ref of the given vm_metrics</param>
 public static domain_type get_current_domain_type(Session session, string _vm_metrics)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.vm_metrics_get_current_domain_type(session.opaque_ref, _vm_metrics));
     }
     else
     {
         return((domain_type)Helper.EnumParseDefault(typeof(domain_type), (string)session.proxy.vm_metrics_get_current_domain_type(session.opaque_ref, _vm_metrics ?? "").parse()));
     }
 }
示例#11
0
 /// <summary>
 /// Get the allocation_algorithm field of the given GPU_group.
 /// First published in XenServer 6.2 SP1 Tech-Preview.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_gpu_group">The opaque_ref of the given gpu_group</param>
 public static allocation_algorithm get_allocation_algorithm(Session session, string _gpu_group)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.gpu_group_get_allocation_algorithm(session.opaque_ref, _gpu_group));
     }
     else
     {
         return((allocation_algorithm)Helper.EnumParseDefault(typeof(allocation_algorithm), (string)session.proxy.gpu_group_get_allocation_algorithm(session.opaque_ref, _gpu_group ?? "").parse()));
     }
 }
示例#12
0
文件: PGPU.cs 项目: ywwseu/xenadmin
 /// <summary>
 ///
 /// First published in XenServer 6.5 SP1.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_pgpu">The opaque_ref of the given pgpu</param>
 public static pgpu_dom0_access disable_dom0_access(Session session, string _pgpu)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.pgpu_disable_dom0_access(session.opaque_ref, _pgpu));
     }
     else
     {
         return((pgpu_dom0_access)Helper.EnumParseDefault(typeof(pgpu_dom0_access), (string)session.proxy.pgpu_disable_dom0_access(session.opaque_ref, _pgpu ?? "").parse()));
     }
 }
示例#13
0
 /// <summary>
 /// Get the frequency field of the given VMSS.
 /// First published in XenServer 7.2.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_vmss">The opaque_ref of the given vmss</param>
 public static vmss_frequency get_frequency(Session session, string _vmss)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.vmss_get_frequency(session.opaque_ref, _vmss));
     }
     else
     {
         return((vmss_frequency)Helper.EnumParseDefault(typeof(vmss_frequency), (string)session.proxy.vmss_get_frequency(session.opaque_ref, _vmss ?? "").parse()));
     }
 }
示例#14
0
 /// <summary>
 /// Get the implementation field of the given VGPU_type.
 /// First published in XenServer 7.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_vgpu_type">The opaque_ref of the given vgpu_type</param>
 public static vgpu_type_implementation get_implementation(Session session, string _vgpu_type)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.vgpu_type_get_implementation(session.opaque_ref, _vgpu_type));
     }
     else
     {
         return((vgpu_type_implementation)Helper.EnumParseDefault(typeof(vgpu_type_implementation), (string)session.proxy.vgpu_type_get_implementation(session.opaque_ref, _vgpu_type ?? "").parse()));
     }
 }
示例#15
0
 /// <summary>
 /// Get the configuration_mode field of the given network_sriov.
 /// First published in Unreleased.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_network_sriov">The opaque_ref of the given network_sriov</param>
 public static sriov_configuration_mode get_configuration_mode(Session session, string _network_sriov)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.network_sriov_get_configuration_mode(session.opaque_ref, _network_sriov));
     }
     else
     {
         return((sriov_configuration_mode)Helper.EnumParseDefault(typeof(sriov_configuration_mode), (string)session.proxy.network_sriov_get_configuration_mode(session.opaque_ref, _network_sriov ?? "").parse()));
     }
 }
示例#16
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);
 }
示例#17
0
 /// <summary>
 /// Creates a new GPU_group from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public GPU_group(Hashtable table)
 {
     uuid                 = Marshalling.ParseString(table, "uuid");
     name_label           = Marshalling.ParseString(table, "name_label");
     name_description     = Marshalling.ParseString(table, "name_description");
     PGPUs                = Marshalling.ParseSetRef <PGPU>(table, "PGPUs");
     VGPUs                = Marshalling.ParseSetRef <VGPU>(table, "VGPUs");
     GPU_types            = Marshalling.ParseStringArray(table, "GPU_types");
     other_config         = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     allocation_algorithm = (allocation_algorithm)Helper.EnumParseDefault(typeof(allocation_algorithm), Marshalling.ParseString(table, "allocation_algorithm"));
     supported_VGPU_types = Marshalling.ParseSetRef <VGPU_type>(table, "supported_VGPU_types");
     enabled_VGPU_types   = Marshalling.ParseSetRef <VGPU_type>(table, "enabled_VGPU_types");
 }
示例#18
0
 /// <summary>
 /// Creates a new VMSS from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public VMSS(Hashtable table)
 {
     uuid               = Marshalling.ParseString(table, "uuid");
     name_label         = Marshalling.ParseString(table, "name_label");
     name_description   = Marshalling.ParseString(table, "name_description");
     enabled            = Marshalling.ParseBool(table, "enabled");
     type               = (vmss_type)Helper.EnumParseDefault(typeof(vmss_type), Marshalling.ParseString(table, "type"));
     retained_snapshots = Marshalling.ParseLong(table, "retained_snapshots");
     frequency          = (vmss_frequency)Helper.EnumParseDefault(typeof(vmss_frequency), Marshalling.ParseString(table, "frequency"));
     schedule           = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "schedule"));
     last_run_time      = Marshalling.ParseDateTime(table, "last_run_time");
     VMs = Marshalling.ParseSetRef <VM>(table, "VMs");
 }
示例#19
0
文件: PGPU.cs 项目: ywwseu/xenadmin
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this PGPU
 /// 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("PCI"))
     {
         PCI = Marshalling.ParseRef <PCI>(table, "PCI");
     }
     if (table.ContainsKey("GPU_group"))
     {
         GPU_group = Marshalling.ParseRef <GPU_group>(table, "GPU_group");
     }
     if (table.ContainsKey("host"))
     {
         host = Marshalling.ParseRef <Host>(table, "host");
     }
     if (table.ContainsKey("other_config"))
     {
         other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     }
     if (table.ContainsKey("supported_VGPU_types"))
     {
         supported_VGPU_types = Marshalling.ParseSetRef <VGPU_type>(table, "supported_VGPU_types");
     }
     if (table.ContainsKey("enabled_VGPU_types"))
     {
         enabled_VGPU_types = Marshalling.ParseSetRef <VGPU_type>(table, "enabled_VGPU_types");
     }
     if (table.ContainsKey("resident_VGPUs"))
     {
         resident_VGPUs = Marshalling.ParseSetRef <VGPU>(table, "resident_VGPUs");
     }
     if (table.ContainsKey("supported_VGPU_max_capacities"))
     {
         supported_VGPU_max_capacities = Maps.convert_from_proxy_XenRefVGPU_type_long(Marshalling.ParseHashTable(table, "supported_VGPU_max_capacities"));
     }
     if (table.ContainsKey("dom0_access"))
     {
         dom0_access = (pgpu_dom0_access)Helper.EnumParseDefault(typeof(pgpu_dom0_access), Marshalling.ParseString(table, "dom0_access"));
     }
     if (table.ContainsKey("is_system_display_device"))
     {
         is_system_display_device = Marshalling.ParseBool(table, "is_system_display_device");
     }
     if (table.ContainsKey("compatibility_metadata"))
     {
         compatibility_metadata = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "compatibility_metadata"));
     }
 }
示例#20
0
 /// <summary>
 /// Creates a new PGPU from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public PGPU(Hashtable table)
 {
     uuid                          = Marshalling.ParseString(table, "uuid");
     PCI                           = Marshalling.ParseRef <PCI>(table, "PCI");
     GPU_group                     = Marshalling.ParseRef <GPU_group>(table, "GPU_group");
     host                          = Marshalling.ParseRef <Host>(table, "host");
     other_config                  = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     supported_VGPU_types          = Marshalling.ParseSetRef <VGPU_type>(table, "supported_VGPU_types");
     enabled_VGPU_types            = Marshalling.ParseSetRef <VGPU_type>(table, "enabled_VGPU_types");
     resident_VGPUs                = Marshalling.ParseSetRef <VGPU>(table, "resident_VGPUs");
     supported_VGPU_max_capacities = Maps.convert_from_proxy_XenRefVGPU_type_long(Marshalling.ParseHashTable(table, "supported_VGPU_max_capacities"));
     dom0_access                   = (pgpu_dom0_access)Helper.EnumParseDefault(typeof(pgpu_dom0_access), Marshalling.ParseString(table, "dom0_access"));
     is_system_display_device      = Marshalling.ParseBool(table, "is_system_display_device");
 }
示例#21
0
文件: Bond.cs 项目: ryu2048/xenadmin
        internal void UpdateFromProxy(Proxy_Bond proxy)
        {
            uuid   = proxy.uuid == null ? null : (string)proxy.uuid;
            master = proxy.master == null ? null : XenRef <PIF> .Create(proxy.master);

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

            other_config  = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
            primary_slave = proxy.primary_slave == null ? null : XenRef <PIF> .Create(proxy.primary_slave);

            mode       = proxy.mode == null ? (bond_mode)0 : (bond_mode)Helper.EnumParseDefault(typeof(bond_mode), (string)proxy.mode);
            properties = proxy.properties == null ? null : Maps.convert_from_proxy_string_string(proxy.properties);
            links_up   = proxy.links_up == null ? 0 : long.Parse((string)proxy.links_up);
        }
示例#22
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");
     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"));
 }
示例#23
0
 /// <summary>
 /// Creates a new VM_guest_metrics from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public VM_guest_metrics(Hashtable table)
 {
     uuid                  = Marshalling.ParseString(table, "uuid");
     os_version            = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "os_version"));
     PV_drivers_version    = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "PV_drivers_version"));
     PV_drivers_up_to_date = Marshalling.ParseBool(table, "PV_drivers_up_to_date");
     memory                = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "memory"));
     disks                 = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "disks"));
     networks              = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "networks"));
     other                 = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other"));
     last_updated          = Marshalling.ParseDateTime(table, "last_updated");
     other_config          = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     live                  = Marshalling.ParseBool(table, "live");
     can_use_hotplug_vbd   = (tristate_type)Helper.EnumParseDefault(typeof(tristate_type), Marshalling.ParseString(table, "can_use_hotplug_vbd"));
     can_use_hotplug_vif   = (tristate_type)Helper.EnumParseDefault(typeof(tristate_type), Marshalling.ParseString(table, "can_use_hotplug_vif"));
     PV_drivers_detected   = Marshalling.ParseBool(table, "PV_drivers_detected");
 }
示例#24
0
 /// <summary>
 /// Creates a new VGPU_type from a Hashtable.
 /// </summary>
 /// <param name="table"></param>
 public VGPU_type(Hashtable table)
 {
     uuid                    = Marshalling.ParseString(table, "uuid");
     vendor_name             = Marshalling.ParseString(table, "vendor_name");
     model_name              = Marshalling.ParseString(table, "model_name");
     framebuffer_size        = Marshalling.ParseLong(table, "framebuffer_size");
     max_heads               = Marshalling.ParseLong(table, "max_heads");
     max_resolution_x        = Marshalling.ParseLong(table, "max_resolution_x");
     max_resolution_y        = Marshalling.ParseLong(table, "max_resolution_y");
     supported_on_PGPUs      = Marshalling.ParseSetRef <PGPU>(table, "supported_on_PGPUs");
     enabled_on_PGPUs        = Marshalling.ParseSetRef <PGPU>(table, "enabled_on_PGPUs");
     VGPUs                   = Marshalling.ParseSetRef <VGPU>(table, "VGPUs");
     supported_on_GPU_groups = Marshalling.ParseSetRef <GPU_group>(table, "supported_on_GPU_groups");
     enabled_on_GPU_groups   = Marshalling.ParseSetRef <GPU_group>(table, "enabled_on_GPU_groups");
     implementation          = (vgpu_type_implementation)Helper.EnumParseDefault(typeof(vgpu_type_implementation), Marshalling.ParseString(table, "implementation"));
     identifier              = Marshalling.ParseString(table, "identifier");
     experimental            = Marshalling.ParseBool(table, "experimental");
 }
示例#25
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this SDN_controller
 /// 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("protocol"))
     {
         protocol = (sdn_controller_protocol)Helper.EnumParseDefault(typeof(sdn_controller_protocol), Marshalling.ParseString(table, "protocol"));
     }
     if (table.ContainsKey("address"))
     {
         address = Marshalling.ParseString(table, "address");
     }
     if (table.ContainsKey("port"))
     {
         port = Marshalling.ParseLong(table, "port");
     }
 }
示例#26
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this GPU_group
 /// 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("PGPUs"))
     {
         PGPUs = Marshalling.ParseSetRef <PGPU>(table, "PGPUs");
     }
     if (table.ContainsKey("VGPUs"))
     {
         VGPUs = Marshalling.ParseSetRef <VGPU>(table, "VGPUs");
     }
     if (table.ContainsKey("GPU_types"))
     {
         GPU_types = Marshalling.ParseStringArray(table, "GPU_types");
     }
     if (table.ContainsKey("other_config"))
     {
         other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     }
     if (table.ContainsKey("allocation_algorithm"))
     {
         allocation_algorithm = (allocation_algorithm)Helper.EnumParseDefault(typeof(allocation_algorithm), Marshalling.ParseString(table, "allocation_algorithm"));
     }
     if (table.ContainsKey("supported_VGPU_types"))
     {
         supported_VGPU_types = Marshalling.ParseSetRef <VGPU_type>(table, "supported_VGPU_types");
     }
     if (table.ContainsKey("enabled_VGPU_types"))
     {
         enabled_VGPU_types = Marshalling.ParseSetRef <VGPU_type>(table, "enabled_VGPU_types");
     }
 }
示例#27
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");
 }
示例#28
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this VMSS
 /// 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("enabled"))
     {
         enabled = Marshalling.ParseBool(table, "enabled");
     }
     if (table.ContainsKey("type"))
     {
         type = (vmss_type)Helper.EnumParseDefault(typeof(vmss_type), Marshalling.ParseString(table, "type"));
     }
     if (table.ContainsKey("retained_snapshots"))
     {
         retained_snapshots = Marshalling.ParseLong(table, "retained_snapshots");
     }
     if (table.ContainsKey("frequency"))
     {
         frequency = (vmss_frequency)Helper.EnumParseDefault(typeof(vmss_frequency), Marshalling.ParseString(table, "frequency"));
     }
     if (table.ContainsKey("schedule"))
     {
         schedule = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "schedule"));
     }
     if (table.ContainsKey("last_run_time"))
     {
         last_run_time = Marshalling.ParseDateTime(table, "last_run_time");
     }
     if (table.ContainsKey("VMs"))
     {
         VMs = Marshalling.ParseSetRef <VM>(table, "VMs");
     }
 }
示例#29
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this Bond
 /// 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("master"))
     {
         master = Marshalling.ParseRef <PIF>(table, "master");
     }
     if (table.ContainsKey("slaves"))
     {
         slaves = Marshalling.ParseSetRef <PIF>(table, "slaves");
     }
     if (table.ContainsKey("other_config"))
     {
         other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     }
     if (table.ContainsKey("primary_slave"))
     {
         primary_slave = Marshalling.ParseRef <PIF>(table, "primary_slave");
     }
     if (table.ContainsKey("mode"))
     {
         mode = (bond_mode)Helper.EnumParseDefault(typeof(bond_mode), Marshalling.ParseString(table, "mode"));
     }
     if (table.ContainsKey("properties"))
     {
         properties = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "properties"));
     }
     if (table.ContainsKey("links_up"))
     {
         links_up = Marshalling.ParseLong(table, "links_up");
     }
     if (table.ContainsKey("auto_update_mac"))
     {
         auto_update_mac = Marshalling.ParseBool(table, "auto_update_mac");
     }
 }
示例#30
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this Network_sriov
 /// 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("physical_PIF"))
     {
         physical_PIF = Marshalling.ParseRef <PIF>(table, "physical_PIF");
     }
     if (table.ContainsKey("logical_PIF"))
     {
         logical_PIF = Marshalling.ParseRef <PIF>(table, "logical_PIF");
     }
     if (table.ContainsKey("requires_reboot"))
     {
         requires_reboot = Marshalling.ParseBool(table, "requires_reboot");
     }
     if (table.ContainsKey("configuration_mode"))
     {
         configuration_mode = (sriov_configuration_mode)Helper.EnumParseDefault(typeof(sriov_configuration_mode), Marshalling.ParseString(table, "configuration_mode"));
     }
 }