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); 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); }
public Proxy_Cluster ToProxy() { Proxy_Cluster result_ = new Proxy_Cluster(); result_.uuid = uuid ?? ""; result_.cluster_hosts = cluster_hosts == null ? new string[] {} : Helper.RefListToStringArray(cluster_hosts); result_.cluster_token = cluster_token ?? ""; result_.cluster_stack = cluster_stack ?? ""; result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_cluster_operation(current_operations); result_.pool_auto_join = pool_auto_join; result_.token_timeout = token_timeout.ToString(); result_.token_timeout_coefficient = token_timeout_coefficient.ToString(); result_.cluster_config = Maps.convert_to_proxy_string_string(cluster_config); result_.other_config = Maps.convert_to_proxy_string_string(other_config); return(result_); }
/// <summary> /// Creates a new Cluster from a Proxy_Cluster. /// </summary> /// <param name="proxy"></param> public Cluster(Proxy_Cluster proxy) { this.UpdateFromProxy(proxy); }
/// <summary> /// Creates a new Cluster from a Proxy_Cluster. /// </summary> /// <param name="proxy"></param> public Cluster(Proxy_Cluster proxy) { UpdateFrom(proxy); }