/// <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("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")); } }
/// <summary> /// Get the current_operations field of the given Cluster_host. /// </summary> /// <param name="session">The session</param> /// <param name="_cluster_host">The opaque_ref of the given cluster_host</param> public static Dictionary <string, cluster_host_operation> get_current_operations(Session session, string _cluster_host) { if (session.JsonRpcClient != null) { return(session.JsonRpcClient.cluster_host_get_current_operations(session.opaque_ref, _cluster_host)); } else { return(Maps.convert_from_proxy_string_cluster_host_operation(session.XmlRpcProxy.cluster_host_get_current_operations(session.opaque_ref, _cluster_host ?? "").parse())); } }
internal void UpdateFromProxy(Proxy_Cluster_host proxy) { uuid = proxy.uuid == null ? null : proxy.uuid; cluster = proxy.cluster == null ? null : XenRef <Cluster> .Create(proxy.cluster); host = proxy.host == null ? null : XenRef <Host> .Create(proxy.host); enabled = (bool)proxy.enabled; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList <cluster_host_operation>(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_cluster_host_operation(proxy.current_operations); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); }