/// <summary> /// Given a Hashtable with field-value pairs, it updates the fields of this VM_appliance /// 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 <vm_appliance_operation>(Marshalling.ParseStringArray(table, "allowed_operations")); } if (table.ContainsKey("current_operations")) { current_operations = Maps.convert_from_proxy_string_vm_appliance_operation(Marshalling.ParseHashTable(table, "current_operations")); } if (table.ContainsKey("VMs")) { VMs = Marshalling.ParseSetRef <VM>(table, "VMs"); } }
/// <summary> /// Get the current_operations field of the given VM_appliance. /// First published in XenServer 6.0. /// </summary> /// <param name="session">The session</param> /// <param name="_vm_appliance">The opaque_ref of the given vm_appliance</param> public static Dictionary<string, vm_appliance_operation> get_current_operations(Session session, string _vm_appliance) { if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_appliance_get_current_operations(session.opaque_ref, _vm_appliance); else return Maps.convert_from_proxy_string_vm_appliance_operation(session.proxy.vm_appliance_get_current_operations(session.opaque_ref, _vm_appliance ?? "").parse()); }
internal void UpdateFromProxy(Proxy_VM_appliance 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 <vm_appliance_operation>(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vm_appliance_operation(proxy.current_operations); VMs = proxy.VMs == null ? null : XenRef <VM> .Create(proxy.VMs); }
/// <summary> /// Creates a new VM_appliance from a Hashtable. /// </summary> /// <param name="table"></param> public VM_appliance(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 <vm_appliance_operation>(Marshalling.ParseStringArray(table, "allowed_operations")); current_operations = Maps.convert_from_proxy_string_vm_appliance_operation(Marshalling.ParseHashTable(table, "current_operations")); VMs = Marshalling.ParseSetRef <VM>(table, "VMs"); }
public static Dictionary <string, vm_appliance_operation> get_current_operations(Session session, string _vm_appliance) { return(Maps.convert_from_proxy_string_vm_appliance_operation(session.proxy.vm_appliance_get_current_operations(session.uuid, (_vm_appliance != null) ? _vm_appliance : "").parse())); }