示例#1
0
 /// <summary>
 /// Get the current_operations field of the given Cluster.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_cluster">The opaque_ref of the given cluster</param>
 public static Dictionary <string, cluster_operation> get_current_operations(Session session, string _cluster)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.cluster_get_current_operations(session.opaque_ref, _cluster));
     }
     else
     {
         return(Maps.convert_from_proxy_string_cluster_operation(session.proxy.cluster_get_current_operations(session.opaque_ref, _cluster ?? "").parse()));
     }
 }
示例#2
0
 /// <summary>
 /// Given a Hashtable with field-value pairs, it updates the fields of this Cluster
 /// 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_hosts"))
     {
         cluster_hosts = Marshalling.ParseSetRef <Cluster_host>(table, "cluster_hosts");
     }
     if (table.ContainsKey("network"))
     {
         network = Marshalling.ParseRef <Network>(table, "network");
     }
     if (table.ContainsKey("cluster_token"))
     {
         cluster_token = Marshalling.ParseString(table, "cluster_token");
     }
     if (table.ContainsKey("cluster_stack"))
     {
         cluster_stack = Marshalling.ParseString(table, "cluster_stack");
     }
     if (table.ContainsKey("allowed_operations"))
     {
         allowed_operations = Helper.StringArrayToEnumList <cluster_operation>(Marshalling.ParseStringArray(table, "allowed_operations"));
     }
     if (table.ContainsKey("current_operations"))
     {
         current_operations = Maps.convert_from_proxy_string_cluster_operation(Marshalling.ParseHashTable(table, "current_operations"));
     }
     if (table.ContainsKey("pool_auto_join"))
     {
         pool_auto_join = Marshalling.ParseBool(table, "pool_auto_join");
     }
     if (table.ContainsKey("token_timeout"))
     {
         token_timeout = Marshalling.ParseLong(table, "token_timeout");
     }
     if (table.ContainsKey("token_timeout_coefficient"))
     {
         token_timeout_coefficient = Marshalling.ParseLong(table, "token_timeout_coefficient");
     }
     if (table.ContainsKey("cluster_config"))
     {
         cluster_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "cluster_config"));
     }
     if (table.ContainsKey("other_config"))
     {
         other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config"));
     }
 }
示例#3
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);

            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);
        }