CP-14641: Update model with the new API bindings containing new fields for CPU leveling

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2015-10-30 15:45:49 +00:00
parent 2f1e5c38bb
commit 55a0939c93
2 changed files with 44 additions and 2 deletions

View File

@ -78,7 +78,8 @@ namespace XenAPI
List<XenRef<VDI>> metadata_VDIs,
string ha_cluster_stack,
List<pool_allowed_operations> allowed_operations,
Dictionary<string, pool_allowed_operations> current_operations)
Dictionary<string, pool_allowed_operations> current_operations,
Dictionary<string, string> cpu_info)
{
this.uuid = uuid;
this.name_label = name_label;
@ -111,6 +112,7 @@ namespace XenAPI
this.ha_cluster_stack = ha_cluster_stack;
this.allowed_operations = allowed_operations;
this.current_operations = current_operations;
this.cpu_info = cpu_info;
}
/// <summary>
@ -155,6 +157,7 @@ namespace XenAPI
ha_cluster_stack = update.ha_cluster_stack;
allowed_operations = update.allowed_operations;
current_operations = update.current_operations;
cpu_info = update.cpu_info;
}
internal void UpdateFromProxy(Proxy_Pool proxy)
@ -190,6 +193,7 @@ namespace XenAPI
ha_cluster_stack = proxy.ha_cluster_stack == null ? null : (string)proxy.ha_cluster_stack;
allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList<pool_allowed_operations>(proxy.allowed_operations);
current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_pool_allowed_operations(proxy.current_operations);
cpu_info = proxy.cpu_info == null ? null : Maps.convert_from_proxy_string_string(proxy.cpu_info);
}
public Proxy_Pool ToProxy()
@ -226,6 +230,7 @@ namespace XenAPI
result_.ha_cluster_stack = (ha_cluster_stack != null) ? ha_cluster_stack : "";
result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {};
result_.current_operations = Maps.convert_to_proxy_string_pool_allowed_operations(current_operations);
result_.cpu_info = Maps.convert_to_proxy_string_string(cpu_info);
return result_;
}
@ -266,6 +271,7 @@ namespace XenAPI
ha_cluster_stack = Marshalling.ParseString(table, "ha_cluster_stack");
allowed_operations = Helper.StringArrayToEnumList<pool_allowed_operations>(Marshalling.ParseStringArray(table, "allowed_operations"));
current_operations = Maps.convert_from_proxy_string_pool_allowed_operations(Marshalling.ParseHashTable(table, "current_operations"));
cpu_info = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "cpu_info"));
}
public bool DeepEquals(Pool other, bool ignoreCurrentOperations)
@ -307,7 +313,8 @@ namespace XenAPI
Helper.AreEqual2(this._restrictions, other._restrictions) &&
Helper.AreEqual2(this._metadata_VDIs, other._metadata_VDIs) &&
Helper.AreEqual2(this._ha_cluster_stack, other._ha_cluster_stack) &&
Helper.AreEqual2(this._allowed_operations, other._allowed_operations);
Helper.AreEqual2(this._allowed_operations, other._allowed_operations) &&
Helper.AreEqual2(this._cpu_info, other._cpu_info);
}
public override string SaveChanges(Session session, string opaqueRef, Pool server)
@ -734,6 +741,17 @@ namespace XenAPI
return Maps.convert_from_proxy_string_pool_allowed_operations(session.proxy.pool_get_current_operations(session.uuid, (_pool != null) ? _pool : "").parse());
}
/// <summary>
/// Get the cpu_info field of the given pool.
/// First published in XenServer Dundee.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pool">The opaque_ref of the given pool</param>
public static Dictionary<string, string> get_cpu_info(Session session, string _pool)
{
return Maps.convert_from_proxy_string_string(session.proxy.pool_get_cpu_info(session.uuid, (_pool != null) ? _pool : "").parse());
}
/// <summary>
/// Set the name_label field of the given pool.
/// First published in XenServer 4.0.
@ -2524,5 +2542,24 @@ namespace XenAPI
}
}
private Dictionary<string, pool_allowed_operations> _current_operations;
/// <summary>
/// Details about the physical CPUs on the pool
/// First published in XenServer Dundee.
/// </summary>
public virtual Dictionary<string, string> cpu_info
{
get { return _cpu_info; }
set
{
if (!Helper.AreEqual(value, _cpu_info))
{
_cpu_info = value;
Changed = true;
NotifyPropertyChanged("cpu_info");
}
}
}
private Dictionary<string, string> _cpu_info;
}
}

View File

@ -576,6 +576,10 @@ namespace XenAPI
Response<Object>
pool_get_current_operations(string session, string _pool);
[XmlRpcMethod("pool.get_cpu_info")]
Response<Object>
pool_get_cpu_info(string session, string _pool);
[XmlRpcMethod("pool.set_name_label")]
Response<string>
pool_set_name_label(string session, string _pool, string _name_label);
@ -6836,6 +6840,7 @@ namespace XenAPI
public string ha_cluster_stack;
public string [] allowed_operations;
public Object current_operations;
public Object cpu_info;
}
[XmlRpcMissingMapping(MappingAction.Ignore)]