From f1e1146a55aeecf258e423cdb5ebc80cc56e9dad Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 22 Mar 2018 12:30:43 +0000 Subject: [PATCH 01/18] CP-17099: Updated bindings to include new Sr.probe_ext call. Signed-off-by: Konstantina Chremmou --- XenModel/XenAPI/ApiVersion.cs | 7 +- XenModel/XenAPI/Auth.cs | 2 +- XenModel/XenAPI/Blob.cs | 20 +- XenModel/XenAPI/Bond.cs | 22 +- XenModel/XenAPI/Cluster.cs | 151 +- XenModel/XenAPI/Cluster_host.cs | 92 +- XenModel/XenAPI/Console.cs | 8 +- XenModel/XenAPI/Converters.cs | 19 +- XenModel/XenAPI/Crashdump.cs | 4 +- XenModel/XenAPI/DR_task.cs | 6 +- XenModel/XenAPI/Data_source.cs | 6 +- XenModel/XenAPI/Feature.cs | 16 +- XenModel/XenAPI/GPU_group.cs | 22 +- XenModel/XenAPI/Host.cs | 256 +- XenModel/XenAPI/Host_cpu.cs | 40 +- XenModel/XenAPI/Host_crashdump.cs | 8 +- XenModel/XenAPI/Host_metrics.cs | 12 +- XenModel/XenAPI/Host_patch.cs | 22 +- XenModel/XenAPI/JsonRpc.cs | 32 +- XenModel/XenAPI/JsonRpcClient.cs | 4135 +++++++++++---------- XenModel/XenAPI/LVHD.cs | 6 +- XenModel/XenAPI/Message.cs | 10 +- XenModel/XenAPI/Network.cs | 28 +- XenModel/XenAPI/PBD.cs | 4 +- XenModel/XenAPI/PCI.cs | 30 +- XenModel/XenAPI/PGPU.cs | 16 +- XenModel/XenAPI/PIF.cs | 48 +- XenModel/XenAPI/PIF_metrics.cs | 28 +- XenModel/XenAPI/PUSB.cs | 36 +- XenModel/XenAPI/PVS_cache_storage.cs | 8 +- XenModel/XenAPI/PVS_proxy.cs | 4 +- XenModel/XenAPI/PVS_server.cs | 12 +- XenModel/XenAPI/PVS_site.cs | 22 +- XenModel/XenAPI/Pool.cs | 54 +- XenModel/XenAPI/Pool_patch.cs | 28 +- XenModel/XenAPI/Pool_update.cs | 28 +- XenModel/XenAPI/Probe_result.cs | 240 ++ XenModel/XenAPI/Proxy.cs | 59 +- XenModel/XenAPI/Role.cs | 14 +- XenModel/XenAPI/SDN_controller.cs | 12 +- XenModel/XenAPI/SM.cs | 36 +- XenModel/XenAPI/SR.cs | 78 +- XenModel/XenAPI/Secret.cs | 8 +- XenModel/XenAPI/Sr_stat.cs | 317 ++ XenModel/XenAPI/Subject.cs | 10 +- XenModel/XenAPI/Task.cs | 28 +- XenModel/XenAPI/Tunnel.cs | 4 +- XenModel/XenAPI/USB_group.cs | 16 +- XenModel/XenAPI/User.cs | 12 +- XenModel/XenAPI/VBD.cs | 26 +- XenModel/XenAPI/VBD_metrics.cs | 4 +- XenModel/XenAPI/VDI.cs | 36 +- XenModel/XenAPI/VGPU.cs | 8 +- XenModel/XenAPI/VGPU_type.cs | 42 +- XenModel/XenAPI/VIF.cs | 38 +- XenModel/XenAPI/VIF_metrics.cs | 4 +- XenModel/XenAPI/VLAN.cs | 8 +- XenModel/XenAPI/VM.cs | 271 +- XenModel/XenAPI/VMPP.cs | 22 +- XenModel/XenAPI/VMSS.cs | 20 +- XenModel/XenAPI/VM_appliance.cs | 16 +- XenModel/XenAPI/VM_guest_metrics.cs | 4 +- XenModel/XenAPI/VM_metrics.cs | 58 +- XenModel/XenAPI/VTPM.cs | 4 +- XenModel/XenAPI/VUSB.cs | 6 +- XenModel/XenAPI/Vdi_nbd_server_info.cs | 10 +- XenModel/XenAPI/cluster_host_operation.cs | 4 +- XenModel/XenAPI/domain_type.cs | 78 + XenModel/XenAPI/sr_health.cs | 74 + XenModel/XenModel.csproj | 4 + 70 files changed, 4011 insertions(+), 2802 deletions(-) create mode 100644 XenModel/XenAPI/Probe_result.cs create mode 100644 XenModel/XenAPI/Sr_stat.cs create mode 100644 XenModel/XenAPI/domain_type.cs create mode 100644 XenModel/XenAPI/sr_health.cs diff --git a/XenModel/XenAPI/ApiVersion.cs b/XenModel/XenAPI/ApiVersion.cs index e8ffcf32b..9b181bf21 100644 --- a/XenModel/XenAPI/ApiVersion.cs +++ b/XenModel/XenAPI/ApiVersion.cs @@ -56,8 +56,9 @@ namespace XenAPI API_2_6 = 17, //XenServer 7.1 (ely) API_2_7 = 18, //XenServer 7.2 (falcon) API_2_8 = 19, //XenServer 7.3 (inverness) - API_2_10 = 20, //Unreleased (kolkata) - LATEST = 20, + API_2_9 = 20, //XenServer 7.4 (jura) + API_2_10 = 21, //Unreleased (kolkata) + LATEST = 21, UNKNOWN = 99 } @@ -105,6 +106,8 @@ namespace XenAPI return "2.7"; case API_Version.API_2_8: return "2.8"; + case API_Version.API_2_9: + return "2.9"; case API_Version.API_2_10: return "2.10"; default: diff --git a/XenModel/XenAPI/Auth.cs b/XenModel/XenAPI/Auth.cs index 2da2d80ce..fba7c5fe9 100644 --- a/XenModel/XenAPI/Auth.cs +++ b/XenModel/XenAPI/Auth.cs @@ -140,7 +140,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.auth_get_subject_identifier(session.opaque_ref, _subject_name); else - return (string)session.proxy.auth_get_subject_identifier(session.opaque_ref, _subject_name ?? "").parse(); + return session.proxy.auth_get_subject_identifier(session.opaque_ref, _subject_name ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Blob.cs b/XenModel/XenAPI/Blob.cs index 4808fdc6d..5eade3d33 100644 --- a/XenModel/XenAPI/Blob.cs +++ b/XenModel/XenAPI/Blob.cs @@ -93,13 +93,13 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Blob 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; - size = proxy.size == null ? 0 : long.Parse((string)proxy.size); + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + size = proxy.size == null ? 0 : long.Parse(proxy.size); pubblic = (bool)proxy.pubblic; last_updated = proxy.last_updated; - mime_type = proxy.mime_type == null ? null : (string)proxy.mime_type; + mime_type = proxy.mime_type == null ? null : proxy.mime_type; } public Proxy_Blob ToProxy() @@ -249,7 +249,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.blob_get_uuid(session.opaque_ref, _blob); else - return (string)session.proxy.blob_get_uuid(session.opaque_ref, _blob ?? "").parse(); + return session.proxy.blob_get_uuid(session.opaque_ref, _blob ?? "").parse(); } /// @@ -263,7 +263,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.blob_get_name_label(session.opaque_ref, _blob); else - return (string)session.proxy.blob_get_name_label(session.opaque_ref, _blob ?? "").parse(); + return session.proxy.blob_get_name_label(session.opaque_ref, _blob ?? "").parse(); } /// @@ -277,7 +277,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.blob_get_name_description(session.opaque_ref, _blob); else - return (string)session.proxy.blob_get_name_description(session.opaque_ref, _blob ?? "").parse(); + return session.proxy.blob_get_name_description(session.opaque_ref, _blob ?? "").parse(); } /// @@ -291,7 +291,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.blob_get_size(session.opaque_ref, _blob); else - return long.Parse((string)session.proxy.blob_get_size(session.opaque_ref, _blob ?? "").parse()); + return long.Parse(session.proxy.blob_get_size(session.opaque_ref, _blob ?? "").parse()); } /// @@ -333,7 +333,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.blob_get_mime_type(session.opaque_ref, _blob); else - return (string)session.proxy.blob_get_mime_type(session.opaque_ref, _blob ?? "").parse(); + return session.proxy.blob_get_mime_type(session.opaque_ref, _blob ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Bond.cs b/XenModel/XenAPI/Bond.cs index dc8e34c8c..750858500 100644 --- a/XenModel/XenAPI/Bond.cs +++ b/XenModel/XenAPI/Bond.cs @@ -96,14 +96,14 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Bond proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; master = proxy.master == null ? null : XenRef.Create(proxy.master); slaves = proxy.slaves == null ? null : XenRef.Create(proxy.slaves); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); primary_slave = proxy.primary_slave == null ? null : XenRef.Create(proxy.primary_slave); mode = proxy.mode == null ? (bond_mode) 0 : (bond_mode)Helper.EnumParseDefault(typeof(bond_mode), (string)proxy.mode); properties = proxy.properties == null ? null : Maps.convert_from_proxy_string_string(proxy.properties); - links_up = proxy.links_up == null ? 0 : long.Parse((string)proxy.links_up); + links_up = proxy.links_up == null ? 0 : long.Parse(proxy.links_up); } public Proxy_Bond ToProxy() @@ -111,7 +111,7 @@ namespace XenAPI Proxy_Bond result_ = new Proxy_Bond(); result_.uuid = uuid ?? ""; result_.master = master ?? ""; - result_.slaves = (slaves != null) ? Helper.RefListToStringArray(slaves) : new string[] {}; + result_.slaves = slaves == null ? new string[] {} : Helper.RefListToStringArray(slaves); result_.other_config = Maps.convert_to_proxy_string_string(other_config); result_.primary_slave = primary_slave ?? ""; result_.mode = bond_mode_helper.ToString(mode); @@ -239,7 +239,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.bond_get_uuid(session.opaque_ref, _bond); else - return (string)session.proxy.bond_get_uuid(session.opaque_ref, _bond ?? "").parse(); + return session.proxy.bond_get_uuid(session.opaque_ref, _bond ?? "").parse(); } /// @@ -337,7 +337,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.bond_get_links_up(session.opaque_ref, _bond); else - return long.Parse((string)session.proxy.bond_get_links_up(session.opaque_ref, _bond ?? "").parse()); + return long.Parse(session.proxy.bond_get_links_up(session.opaque_ref, _bond ?? "").parse()); } /// @@ -399,7 +399,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.bond_create(session.opaque_ref, _network, _members, _mac); else - return XenRef.Create(session.proxy.bond_create(session.opaque_ref, _network ?? "", (_members != null) ? Helper.RefListToStringArray(_members) : new string[] {}, _mac ?? "").parse()); + return XenRef.Create(session.proxy.bond_create(session.opaque_ref, _network ?? "", _members == null ? new string[] {} : Helper.RefListToStringArray(_members), _mac ?? "").parse()); } /// @@ -415,7 +415,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.async_bond_create(session.opaque_ref, _network, _members, _mac); else - return XenRef.Create(session.proxy.async_bond_create(session.opaque_ref, _network ?? "", (_members != null) ? Helper.RefListToStringArray(_members) : new string[] {}, _mac ?? "").parse()); + return XenRef.Create(session.proxy.async_bond_create(session.opaque_ref, _network ?? "", _members == null ? new string[] {} : Helper.RefListToStringArray(_members), _mac ?? "").parse()); } /// @@ -432,7 +432,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.bond_create(session.opaque_ref, _network, _members, _mac, _mode); else - return XenRef.Create(session.proxy.bond_create(session.opaque_ref, _network ?? "", (_members != null) ? Helper.RefListToStringArray(_members) : new string[] {}, _mac ?? "", bond_mode_helper.ToString(_mode)).parse()); + return XenRef.Create(session.proxy.bond_create(session.opaque_ref, _network ?? "", _members == null ? new string[] {} : Helper.RefListToStringArray(_members), _mac ?? "", bond_mode_helper.ToString(_mode)).parse()); } /// @@ -449,7 +449,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.async_bond_create(session.opaque_ref, _network, _members, _mac, _mode); else - return XenRef.Create(session.proxy.async_bond_create(session.opaque_ref, _network ?? "", (_members != null) ? Helper.RefListToStringArray(_members) : new string[] {}, _mac ?? "", bond_mode_helper.ToString(_mode)).parse()); + return XenRef.Create(session.proxy.async_bond_create(session.opaque_ref, _network ?? "", _members == null ? new string[] {} : Helper.RefListToStringArray(_members), _mac ?? "", bond_mode_helper.ToString(_mode)).parse()); } /// @@ -467,7 +467,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.bond_create(session.opaque_ref, _network, _members, _mac, _mode, _properties); else - return XenRef.Create(session.proxy.bond_create(session.opaque_ref, _network ?? "", (_members != null) ? Helper.RefListToStringArray(_members) : new string[] {}, _mac ?? "", bond_mode_helper.ToString(_mode), Maps.convert_to_proxy_string_string(_properties)).parse()); + return XenRef.Create(session.proxy.bond_create(session.opaque_ref, _network ?? "", _members == null ? new string[] {} : Helper.RefListToStringArray(_members), _mac ?? "", bond_mode_helper.ToString(_mode), Maps.convert_to_proxy_string_string(_properties)).parse()); } /// @@ -485,7 +485,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.async_bond_create(session.opaque_ref, _network, _members, _mac, _mode, _properties); else - return XenRef.Create(session.proxy.async_bond_create(session.opaque_ref, _network ?? "", (_members != null) ? Helper.RefListToStringArray(_members) : new string[] {}, _mac ?? "", bond_mode_helper.ToString(_mode), Maps.convert_to_proxy_string_string(_properties)).parse()); + return XenRef.Create(session.proxy.async_bond_create(session.opaque_ref, _network ?? "", _members == null ? new string[] {} : Helper.RefListToStringArray(_members), _mac ?? "", bond_mode_helper.ToString(_mode), Maps.convert_to_proxy_string_string(_properties)).parse()); } /// diff --git a/XenModel/XenAPI/Cluster.cs b/XenModel/XenAPI/Cluster.cs index da4abcad0..d2cfce731 100644 --- a/XenModel/XenAPI/Cluster.cs +++ b/XenModel/XenAPI/Cluster.cs @@ -42,7 +42,6 @@ namespace XenAPI { /// /// Cluster-wide Cluster metadata - /// First published in Unreleased. /// public partial class Cluster : XenObject { @@ -86,6 +85,10 @@ namespace XenAPI this.UpdateFromProxy(proxy); } + /// + /// Updates each field of this instance with the value of + /// the corresponding field of a given Cluster. + /// public override void UpdateFrom(Cluster update) { uuid = update.uuid; @@ -104,16 +107,16 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Cluster proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; cluster_hosts = proxy.cluster_hosts == null ? null : XenRef.Create(proxy.cluster_hosts); network = proxy.network == null ? null : XenRef.Create(proxy.network); - cluster_token = proxy.cluster_token == null ? null : (string)proxy.cluster_token; - cluster_stack = proxy.cluster_stack == null ? null : (string)proxy.cluster_stack; + 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(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((string)proxy.token_timeout); - token_timeout_coefficient = proxy.token_timeout_coefficient == null ? 0 : long.Parse((string)proxy.token_timeout_coefficient); + 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); } @@ -122,11 +125,11 @@ namespace XenAPI { Proxy_Cluster result_ = new Proxy_Cluster(); result_.uuid = uuid ?? ""; - result_.cluster_hosts = (cluster_hosts != null) ? Helper.RefListToStringArray(cluster_hosts) : new string[] {}; + result_.cluster_hosts = cluster_hosts == null ? new string[] {} : Helper.RefListToStringArray(cluster_hosts); result_.network = network ?? ""; result_.cluster_token = cluster_token ?? ""; result_.cluster_stack = cluster_stack ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + 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(); @@ -138,22 +141,47 @@ namespace XenAPI /// /// Creates a new Cluster from a Hashtable. + /// Note that the fields not contained in the Hashtable + /// will be created with their default values. /// /// - public Cluster(Hashtable table) + public Cluster(Hashtable table) : this() { - uuid = Marshalling.ParseString(table, "uuid"); - cluster_hosts = Marshalling.ParseSetRef(table, "cluster_hosts"); - network = Marshalling.ParseRef(table, "network"); - cluster_token = Marshalling.ParseString(table, "cluster_token"); - cluster_stack = Marshalling.ParseString(table, "cluster_stack"); - allowed_operations = Helper.StringArrayToEnumList(Marshalling.ParseStringArray(table, "allowed_operations")); - current_operations = Maps.convert_from_proxy_string_cluster_operation(Marshalling.ParseHashTable(table, "current_operations")); - pool_auto_join = Marshalling.ParseBool(table, "pool_auto_join"); - token_timeout = Marshalling.ParseLong(table, "token_timeout"); - token_timeout_coefficient = Marshalling.ParseLong(table, "token_timeout_coefficient"); - cluster_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "cluster_config")); - other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config")); + UpdateFrom(table); + } + + /// + /// 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. + /// + /// + public void UpdateFrom(Hashtable table) + { + if (table.ContainsKey("uuid")) + uuid = Marshalling.ParseString(table, "uuid"); + if (table.ContainsKey("cluster_hosts")) + cluster_hosts = Marshalling.ParseSetRef(table, "cluster_hosts"); + if (table.ContainsKey("network")) + network = Marshalling.ParseRef(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(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")); } public bool DeepEquals(Cluster other, bool ignoreCurrentOperations) @@ -207,7 +235,7 @@ namespace XenAPI } /// /// Get a record containing the current state of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -221,7 +249,7 @@ namespace XenAPI /// /// Get a reference to the Cluster instance with the specified UUID. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// UUID of object to return @@ -235,7 +263,7 @@ namespace XenAPI /// /// Get the uuid field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -244,12 +272,12 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.cluster_get_uuid(session.opaque_ref, _cluster); else - return (string)session.proxy.cluster_get_uuid(session.opaque_ref, _cluster ?? "").parse(); + return session.proxy.cluster_get_uuid(session.opaque_ref, _cluster ?? "").parse(); } /// /// Get the cluster_hosts field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -263,7 +291,7 @@ namespace XenAPI /// /// Get the network field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -277,7 +305,7 @@ namespace XenAPI /// /// Get the cluster_token field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -286,12 +314,12 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.cluster_get_cluster_token(session.opaque_ref, _cluster); else - return (string)session.proxy.cluster_get_cluster_token(session.opaque_ref, _cluster ?? "").parse(); + return session.proxy.cluster_get_cluster_token(session.opaque_ref, _cluster ?? "").parse(); } /// /// Get the cluster_stack field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -300,12 +328,11 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.cluster_get_cluster_stack(session.opaque_ref, _cluster); else - return (string)session.proxy.cluster_get_cluster_stack(session.opaque_ref, _cluster ?? "").parse(); + return session.proxy.cluster_get_cluster_stack(session.opaque_ref, _cluster ?? "").parse(); } /// /// Get the allowed_operations field of the given Cluster. - /// First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -319,7 +346,6 @@ namespace XenAPI /// /// Get the current_operations field of the given Cluster. - /// First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -333,7 +359,7 @@ namespace XenAPI /// /// Get the pool_auto_join field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -347,7 +373,7 @@ namespace XenAPI /// /// Get the token_timeout field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -356,12 +382,12 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.cluster_get_token_timeout(session.opaque_ref, _cluster); else - return long.Parse((string)session.proxy.cluster_get_token_timeout(session.opaque_ref, _cluster ?? "").parse()); + return long.Parse(session.proxy.cluster_get_token_timeout(session.opaque_ref, _cluster ?? "").parse()); } /// /// Get the token_timeout_coefficient field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -370,12 +396,12 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.cluster_get_token_timeout_coefficient(session.opaque_ref, _cluster); else - return long.Parse((string)session.proxy.cluster_get_token_timeout_coefficient(session.opaque_ref, _cluster ?? "").parse()); + return long.Parse(session.proxy.cluster_get_token_timeout_coefficient(session.opaque_ref, _cluster ?? "").parse()); } /// /// Get the cluster_config field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -389,7 +415,7 @@ namespace XenAPI /// /// Get the other_config field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -403,7 +429,7 @@ namespace XenAPI /// /// Set the other_config field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -418,7 +444,7 @@ namespace XenAPI /// /// Add the given key-value pair to the other_config field of the given Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -434,7 +460,7 @@ namespace XenAPI /// /// Remove the given key and its corresponding value from the other_config field of the given Cluster. If the key is not in that Map, then do nothing. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -449,7 +475,7 @@ namespace XenAPI /// /// Creates a Cluster object and one Cluster_host object as its first member - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// the single network on which corosync carries out its inter-host communications @@ -467,7 +493,7 @@ namespace XenAPI /// /// Creates a Cluster object and one Cluster_host object as its first member - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// the single network on which corosync carries out its inter-host communications @@ -485,7 +511,7 @@ namespace XenAPI /// /// Destroys a Cluster object and the one remaining Cluster_host member - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -499,7 +525,7 @@ namespace XenAPI /// /// Destroys a Cluster object and the one remaining Cluster_host member - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -513,7 +539,7 @@ namespace XenAPI /// /// Attempt to create a Cluster from the entire pool - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// the single network on which corosync carries out its inter-host communications @@ -530,7 +556,7 @@ namespace XenAPI /// /// Attempt to create a Cluster from the entire pool - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// the single network on which corosync carries out its inter-host communications @@ -547,7 +573,7 @@ namespace XenAPI /// /// Attempt to force destroy the Cluster_host objects, and then destroy the Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -561,7 +587,7 @@ namespace XenAPI /// /// Attempt to force destroy the Cluster_host objects, and then destroy the Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -575,7 +601,7 @@ namespace XenAPI /// /// Attempt to destroy the Cluster_host objects for all hosts in the pool and then destroy the Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -589,7 +615,7 @@ namespace XenAPI /// /// Attempt to destroy the Cluster_host objects for all hosts in the pool and then destroy the Cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -603,7 +629,7 @@ namespace XenAPI /// /// Resynchronise the cluster_host objects across the pool. Creates them where they need creating and then plugs them - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -617,7 +643,7 @@ namespace XenAPI /// /// Resynchronise the cluster_host objects across the pool. Creates them where they need creating and then plugs them - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster @@ -631,7 +657,7 @@ namespace XenAPI /// /// Return a list of all the Clusters known to the system. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session public static List> get_all(Session session) @@ -644,7 +670,6 @@ namespace XenAPI /// /// Get all the Cluster Records at once, in a single XML RPC call - /// First published in Unreleased. /// /// The session public static Dictionary, Cluster> get_all_records(Session session) @@ -657,6 +682,7 @@ namespace XenAPI /// /// Unique identifier/object reference + /// Experimental. First published in Unreleased. /// public virtual string uuid { @@ -675,6 +701,7 @@ namespace XenAPI /// /// A list of the cluster_host objects associated with the Cluster + /// Experimental. First published in Unreleased. /// [JsonConverter(typeof(XenRefListConverter))] public virtual List> cluster_hosts @@ -694,6 +721,7 @@ namespace XenAPI /// /// Reference to the single network on which corosync carries out its inter-host communications + /// Experimental. First published in Unreleased. /// [JsonConverter(typeof(XenRefConverter))] public virtual XenRef network @@ -713,6 +741,7 @@ namespace XenAPI /// /// The secret key used by xapi-clusterd when it talks to itself on other hosts + /// Experimental. First published in Unreleased. /// public virtual string cluster_token { @@ -731,6 +760,7 @@ namespace XenAPI /// /// Simply the string 'corosync'. No other cluster stacks are currently supported + /// Experimental. First published in Unreleased. /// public virtual string cluster_stack { @@ -785,6 +815,7 @@ namespace XenAPI /// /// True if xapi is automatically joining new pool members to the cluster. This will be `true` in the first release + /// Experimental. First published in Unreleased. /// public virtual bool pool_auto_join { @@ -803,6 +834,7 @@ namespace XenAPI /// /// The corosync token timeout in ms + /// Experimental. First published in Unreleased. /// public virtual long token_timeout { @@ -821,6 +853,7 @@ namespace XenAPI /// /// The corosync token timeout coefficient in ms + /// Experimental. First published in Unreleased. /// public virtual long token_timeout_coefficient { @@ -839,7 +872,9 @@ namespace XenAPI /// /// Contains read-only settings for the cluster, such as timeouts and other options. It can only be set at cluster create time + /// Experimental. First published in Unreleased. /// + [JsonConverter(typeof(StringStringMapConverter))] public virtual Dictionary cluster_config { get { return _cluster_config; } @@ -857,7 +892,9 @@ namespace XenAPI /// /// Additional configuration + /// Experimental. First published in Unreleased. /// + [JsonConverter(typeof(StringStringMapConverter))] public virtual Dictionary other_config { get { return _other_config; } diff --git a/XenModel/XenAPI/Cluster_host.cs b/XenModel/XenAPI/Cluster_host.cs index d961b561e..30bee307c 100644 --- a/XenModel/XenAPI/Cluster_host.cs +++ b/XenModel/XenAPI/Cluster_host.cs @@ -42,7 +42,6 @@ namespace XenAPI { /// /// Cluster member metadata - /// First published in Unreleased. /// public partial class Cluster_host : XenObject { @@ -76,6 +75,10 @@ namespace XenAPI this.UpdateFromProxy(proxy); } + /// + /// Updates each field of this instance with the value of + /// the corresponding field of a given Cluster_host. + /// public override void UpdateFrom(Cluster_host update) { uuid = update.uuid; @@ -89,7 +92,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Cluster_host proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; cluster = proxy.cluster == null ? null : XenRef.Create(proxy.cluster); host = proxy.host == null ? null : XenRef.Create(proxy.host); enabled = (bool)proxy.enabled; @@ -105,7 +108,7 @@ namespace XenAPI result_.cluster = cluster ?? ""; result_.host = host ?? ""; result_.enabled = enabled; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_cluster_host_operation(current_operations); result_.other_config = Maps.convert_to_proxy_string_string(other_config); return result_; @@ -113,17 +116,37 @@ namespace XenAPI /// /// Creates a new Cluster_host from a Hashtable. + /// Note that the fields not contained in the Hashtable + /// will be created with their default values. /// /// - public Cluster_host(Hashtable table) + public Cluster_host(Hashtable table) : this() { - uuid = Marshalling.ParseString(table, "uuid"); - cluster = Marshalling.ParseRef(table, "cluster"); - host = Marshalling.ParseRef(table, "host"); - enabled = Marshalling.ParseBool(table, "enabled"); - allowed_operations = Helper.StringArrayToEnumList(Marshalling.ParseStringArray(table, "allowed_operations")); - current_operations = Maps.convert_from_proxy_string_cluster_host_operation(Marshalling.ParseHashTable(table, "current_operations")); - other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config")); + UpdateFrom(table); + } + + /// + /// 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. + /// + /// + public void UpdateFrom(Hashtable table) + { + if (table.ContainsKey("uuid")) + uuid = Marshalling.ParseString(table, "uuid"); + if (table.ContainsKey("cluster")) + cluster = Marshalling.ParseRef(table, "cluster"); + if (table.ContainsKey("host")) + host = Marshalling.ParseRef(table, "host"); + if (table.ContainsKey("enabled")) + enabled = Marshalling.ParseBool(table, "enabled"); + if (table.ContainsKey("allowed_operations")) + allowed_operations = Helper.StringArrayToEnumList(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")); } public bool DeepEquals(Cluster_host other, bool ignoreCurrentOperations) @@ -167,7 +190,7 @@ namespace XenAPI } /// /// Get a record containing the current state of the given Cluster_host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -181,7 +204,7 @@ namespace XenAPI /// /// Get a reference to the Cluster_host instance with the specified UUID. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// UUID of object to return @@ -195,7 +218,7 @@ namespace XenAPI /// /// Get the uuid field of the given Cluster_host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -204,12 +227,12 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.cluster_host_get_uuid(session.opaque_ref, _cluster_host); else - return (string)session.proxy.cluster_host_get_uuid(session.opaque_ref, _cluster_host ?? "").parse(); + return session.proxy.cluster_host_get_uuid(session.opaque_ref, _cluster_host ?? "").parse(); } /// /// Get the cluster field of the given Cluster_host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -223,7 +246,7 @@ namespace XenAPI /// /// Get the host field of the given Cluster_host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -237,7 +260,7 @@ namespace XenAPI /// /// Get the enabled field of the given Cluster_host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -251,7 +274,6 @@ namespace XenAPI /// /// Get the allowed_operations field of the given Cluster_host. - /// First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -265,7 +287,6 @@ namespace XenAPI /// /// Get the current_operations field of the given Cluster_host. - /// First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -279,7 +300,7 @@ namespace XenAPI /// /// Get the other_config field of the given Cluster_host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -293,7 +314,7 @@ namespace XenAPI /// /// Add a new host to an existing cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// Cluster to join @@ -308,7 +329,7 @@ namespace XenAPI /// /// Add a new host to an existing cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// Cluster to join @@ -323,7 +344,7 @@ namespace XenAPI /// /// Remove a host from an existing cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -337,7 +358,7 @@ namespace XenAPI /// /// Remove a host from an existing cluster. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -351,7 +372,7 @@ namespace XenAPI /// /// Enable cluster membership for a disabled cluster host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -365,7 +386,7 @@ namespace XenAPI /// /// Enable cluster membership for a disabled cluster host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -379,7 +400,7 @@ namespace XenAPI /// /// Remove a host from an existing cluster forcefully. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -393,7 +414,7 @@ namespace XenAPI /// /// Remove a host from an existing cluster forcefully. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -407,7 +428,7 @@ namespace XenAPI /// /// Disable cluster membership for an enabled cluster host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -421,7 +442,7 @@ namespace XenAPI /// /// Disable cluster membership for an enabled cluster host. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session /// The opaque_ref of the given cluster_host @@ -435,7 +456,7 @@ namespace XenAPI /// /// Return a list of all the Cluster_hosts known to the system. - /// First published in Unreleased. + /// Experimental. First published in Unreleased. /// /// The session public static List> get_all(Session session) @@ -448,7 +469,6 @@ namespace XenAPI /// /// Get all the Cluster_host Records at once, in a single XML RPC call - /// First published in Unreleased. /// /// The session public static Dictionary, Cluster_host> get_all_records(Session session) @@ -461,6 +481,7 @@ namespace XenAPI /// /// Unique identifier/object reference + /// Experimental. First published in Unreleased. /// public virtual string uuid { @@ -479,6 +500,7 @@ namespace XenAPI /// /// Reference to the Cluster object + /// Experimental. First published in Unreleased. /// [JsonConverter(typeof(XenRefConverter))] public virtual XenRef cluster @@ -498,6 +520,7 @@ namespace XenAPI /// /// Reference to the Host object + /// Experimental. First published in Unreleased. /// [JsonConverter(typeof(XenRefConverter))] public virtual XenRef host @@ -517,6 +540,7 @@ namespace XenAPI /// /// Whether the cluster host believes that clustering should be enabled on this host + /// Experimental. First published in Unreleased. /// public virtual bool enabled { @@ -571,7 +595,9 @@ namespace XenAPI /// /// Additional configuration + /// Experimental. First published in Unreleased. /// + [JsonConverter(typeof(StringStringMapConverter))] public virtual Dictionary other_config { get { return _other_config; } diff --git a/XenModel/XenAPI/Console.cs b/XenModel/XenAPI/Console.cs index 806f73500..6ca0a8935 100644 --- a/XenModel/XenAPI/Console.cs +++ b/XenModel/XenAPI/Console.cs @@ -87,9 +87,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Console proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; protocol = proxy.protocol == null ? (console_protocol) 0 : (console_protocol)Helper.EnumParseDefault(typeof(console_protocol), (string)proxy.protocol); - location = proxy.location == null ? null : (string)proxy.location; + location = proxy.location == null ? null : proxy.location; VM = proxy.VM == null ? null : XenRef.Create(proxy.VM); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -271,7 +271,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.console_get_uuid(session.opaque_ref, _console); else - return (string)session.proxy.console_get_uuid(session.opaque_ref, _console ?? "").parse(); + return session.proxy.console_get_uuid(session.opaque_ref, _console ?? "").parse(); } /// @@ -299,7 +299,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.console_get_location(session.opaque_ref, _console); else - return (string)session.proxy.console_get_location(session.opaque_ref, _console ?? "").parse(); + return session.proxy.console_get_location(session.opaque_ref, _console ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Converters.cs b/XenModel/XenAPI/Converters.cs index a462ee177..65b6aeff8 100644 --- a/XenModel/XenAPI/Converters.cs +++ b/XenModel/XenAPI/Converters.cs @@ -55,7 +55,7 @@ namespace XenAPI { JToken jToken = JToken.Load(reader); var str = jToken.ToObject(); - return new XenRef(str); + return string.IsNullOrEmpty(str) ? null : new XenRef(str); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) @@ -392,7 +392,20 @@ namespace XenAPI public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JToken jToken = JToken.Load(reader); - return DateTime.ParseExact(jToken.ToString(), DateFormats, CultureInfo.InvariantCulture, DateTimeStyles.None); + var str = jToken.ToObject(); + + try + { + return DateTime.ParseExact(str, DateFormats, CultureInfo.InvariantCulture, DateTimeStyles.None); + } + catch (FormatException) + { + return DateTime.MinValue; + } + catch (ArgumentException) + { + return DateTime.MinValue; + } } } @@ -402,7 +415,7 @@ namespace XenAPI public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JToken jToken = JToken.Load(reader); - return Helper.EnumParseDefault(objectType, jToken.ToString()); + return Helper.EnumParseDefault(objectType, jToken.ToObject()); } } } diff --git a/XenModel/XenAPI/Crashdump.cs b/XenModel/XenAPI/Crashdump.cs index eee8db792..3a34504f6 100644 --- a/XenModel/XenAPI/Crashdump.cs +++ b/XenModel/XenAPI/Crashdump.cs @@ -84,7 +84,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Crashdump proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; VM = proxy.VM == null ? null : XenRef.Create(proxy.VM); VDI = proxy.VDI == null ? null : XenRef.Create(proxy.VDI); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); @@ -211,7 +211,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.crashdump_get_uuid(session.opaque_ref, _crashdump); else - return (string)session.proxy.crashdump_get_uuid(session.opaque_ref, _crashdump ?? "").parse(); + return session.proxy.crashdump_get_uuid(session.opaque_ref, _crashdump ?? "").parse(); } /// diff --git a/XenModel/XenAPI/DR_task.cs b/XenModel/XenAPI/DR_task.cs index 10b338d19..9671c4f8e 100644 --- a/XenModel/XenAPI/DR_task.cs +++ b/XenModel/XenAPI/DR_task.cs @@ -78,7 +78,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_DR_task proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; introduced_SRs = proxy.introduced_SRs == null ? null : XenRef.Create(proxy.introduced_SRs); } @@ -86,7 +86,7 @@ namespace XenAPI { Proxy_DR_task result_ = new Proxy_DR_task(); result_.uuid = uuid ?? ""; - result_.introduced_SRs = (introduced_SRs != null) ? Helper.RefListToStringArray(introduced_SRs) : new string[] {}; + result_.introduced_SRs = introduced_SRs == null ? new string[] {} : Helper.RefListToStringArray(introduced_SRs); return result_; } @@ -186,7 +186,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.dr_task_get_uuid(session.opaque_ref, _dr_task); else - return (string)session.proxy.dr_task_get_uuid(session.opaque_ref, _dr_task ?? "").parse(); + return session.proxy.dr_task_get_uuid(session.opaque_ref, _dr_task ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Data_source.cs b/XenModel/XenAPI/Data_source.cs index 6252067bd..eea9997ed 100644 --- a/XenModel/XenAPI/Data_source.cs +++ b/XenModel/XenAPI/Data_source.cs @@ -96,11 +96,11 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Data_source proxy) { - name_label = proxy.name_label == null ? null : (string)proxy.name_label; - name_description = proxy.name_description == null ? null : (string)proxy.name_description; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; enabled = (bool)proxy.enabled; standard = (bool)proxy.standard; - units = proxy.units == null ? null : (string)proxy.units; + units = proxy.units == null ? null : proxy.units; min = Convert.ToDouble(proxy.min); max = Convert.ToDouble(proxy.max); value = Convert.ToDouble(proxy.value); diff --git a/XenModel/XenAPI/Feature.cs b/XenModel/XenAPI/Feature.cs index 4a3856757..85dce3c1e 100644 --- a/XenModel/XenAPI/Feature.cs +++ b/XenModel/XenAPI/Feature.cs @@ -93,12 +93,12 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Feature 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; enabled = (bool)proxy.enabled; experimental = (bool)proxy.experimental; - version = proxy.version == null ? null : (string)proxy.version; + version = proxy.version == null ? null : proxy.version; host = proxy.host == null ? null : XenRef.Create(proxy.host); } @@ -240,7 +240,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.feature_get_uuid(session.opaque_ref, _feature); else - return (string)session.proxy.feature_get_uuid(session.opaque_ref, _feature ?? "").parse(); + return session.proxy.feature_get_uuid(session.opaque_ref, _feature ?? "").parse(); } /// @@ -254,7 +254,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.feature_get_name_label(session.opaque_ref, _feature); else - return (string)session.proxy.feature_get_name_label(session.opaque_ref, _feature ?? "").parse(); + return session.proxy.feature_get_name_label(session.opaque_ref, _feature ?? "").parse(); } /// @@ -268,7 +268,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.feature_get_name_description(session.opaque_ref, _feature); else - return (string)session.proxy.feature_get_name_description(session.opaque_ref, _feature ?? "").parse(); + return session.proxy.feature_get_name_description(session.opaque_ref, _feature ?? "").parse(); } /// @@ -310,7 +310,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.feature_get_version(session.opaque_ref, _feature); else - return (string)session.proxy.feature_get_version(session.opaque_ref, _feature ?? "").parse(); + return session.proxy.feature_get_version(session.opaque_ref, _feature ?? "").parse(); } /// diff --git a/XenModel/XenAPI/GPU_group.cs b/XenModel/XenAPI/GPU_group.cs index 0a887d728..77d264d69 100644 --- a/XenModel/XenAPI/GPU_group.cs +++ b/XenModel/XenAPI/GPU_group.cs @@ -102,9 +102,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_GPU_group 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; PGPUs = proxy.PGPUs == null ? null : XenRef.Create(proxy.PGPUs); VGPUs = proxy.VGPUs == null ? null : XenRef.Create(proxy.VGPUs); GPU_types = proxy.GPU_types == null ? new string[] {} : (string [])proxy.GPU_types; @@ -120,13 +120,13 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.PGPUs = (PGPUs != null) ? Helper.RefListToStringArray(PGPUs) : new string[] {}; - result_.VGPUs = (VGPUs != null) ? Helper.RefListToStringArray(VGPUs) : new string[] {}; + result_.PGPUs = PGPUs == null ? new string[] {} : Helper.RefListToStringArray(PGPUs); + result_.VGPUs = VGPUs == null ? new string[] {} : Helper.RefListToStringArray(VGPUs); result_.GPU_types = GPU_types; result_.other_config = Maps.convert_to_proxy_string_string(other_config); result_.allocation_algorithm = allocation_algorithm_helper.ToString(allocation_algorithm); - result_.supported_VGPU_types = (supported_VGPU_types != null) ? Helper.RefListToStringArray(supported_VGPU_types) : new string[] {}; - result_.enabled_VGPU_types = (enabled_VGPU_types != null) ? Helper.RefListToStringArray(enabled_VGPU_types) : new string[] {}; + result_.supported_VGPU_types = supported_VGPU_types == null ? new string[] {} : Helper.RefListToStringArray(supported_VGPU_types); + result_.enabled_VGPU_types = enabled_VGPU_types == null ? new string[] {} : Helper.RefListToStringArray(enabled_VGPU_types); return result_; } @@ -281,7 +281,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.gpu_group_get_uuid(session.opaque_ref, _gpu_group); else - return (string)session.proxy.gpu_group_get_uuid(session.opaque_ref, _gpu_group ?? "").parse(); + return session.proxy.gpu_group_get_uuid(session.opaque_ref, _gpu_group ?? "").parse(); } /// @@ -295,7 +295,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.gpu_group_get_name_label(session.opaque_ref, _gpu_group); else - return (string)session.proxy.gpu_group_get_name_label(session.opaque_ref, _gpu_group ?? "").parse(); + return session.proxy.gpu_group_get_name_label(session.opaque_ref, _gpu_group ?? "").parse(); } /// @@ -309,7 +309,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.gpu_group_get_name_description(session.opaque_ref, _gpu_group); else - return (string)session.proxy.gpu_group_get_name_description(session.opaque_ref, _gpu_group ?? "").parse(); + return session.proxy.gpu_group_get_name_description(session.opaque_ref, _gpu_group ?? "").parse(); } /// @@ -573,7 +573,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.gpu_group_get_remaining_capacity(session.opaque_ref, _gpu_group, _vgpu_type); else - return long.Parse((string)session.proxy.gpu_group_get_remaining_capacity(session.opaque_ref, _gpu_group ?? "", _vgpu_type ?? "").parse()); + return long.Parse(session.proxy.gpu_group_get_remaining_capacity(session.opaque_ref, _gpu_group ?? "", _vgpu_type ?? "").parse()); } /// diff --git a/XenModel/XenAPI/Host.cs b/XenModel/XenAPI/Host.cs index de524fda5..56a267e5c 100644 --- a/XenModel/XenAPI/Host.cs +++ b/XenModel/XenAPI/Host.cs @@ -105,7 +105,9 @@ namespace XenAPI long[] virtual_hardware_platform_versions, XenRef control_domain, List> updates_requiring_reboot, - List> features) + List> features, + string iscsi_iqn, + bool multipathing) { this.uuid = uuid; this.name_label = name_label; @@ -163,6 +165,8 @@ namespace XenAPI this.control_domain = control_domain; this.updates_requiring_reboot = updates_requiring_reboot; this.features = features; + this.iscsi_iqn = iscsi_iqn; + this.multipathing = multipathing; } /// @@ -236,26 +240,28 @@ namespace XenAPI control_domain = update.control_domain; updates_requiring_reboot = update.updates_requiring_reboot; features = update.features; + iscsi_iqn = update.iscsi_iqn; + multipathing = update.multipathing; } internal void UpdateFromProxy(Proxy_Host 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; - memory_overhead = proxy.memory_overhead == null ? 0 : long.Parse((string)proxy.memory_overhead); + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + memory_overhead = proxy.memory_overhead == null ? 0 : long.Parse(proxy.memory_overhead); allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_host_allowed_operations(proxy.current_operations); - API_version_major = proxy.API_version_major == null ? 0 : long.Parse((string)proxy.API_version_major); - API_version_minor = proxy.API_version_minor == null ? 0 : long.Parse((string)proxy.API_version_minor); - API_version_vendor = proxy.API_version_vendor == null ? null : (string)proxy.API_version_vendor; + API_version_major = proxy.API_version_major == null ? 0 : long.Parse(proxy.API_version_major); + API_version_minor = proxy.API_version_minor == null ? 0 : long.Parse(proxy.API_version_minor); + API_version_vendor = proxy.API_version_vendor == null ? null : proxy.API_version_vendor; API_version_vendor_implementation = proxy.API_version_vendor_implementation == null ? null : Maps.convert_from_proxy_string_string(proxy.API_version_vendor_implementation); enabled = (bool)proxy.enabled; software_version = proxy.software_version == null ? null : Maps.convert_from_proxy_string_string(proxy.software_version); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); capabilities = proxy.capabilities == null ? new string[] {} : (string [])proxy.capabilities; cpu_configuration = proxy.cpu_configuration == null ? null : Maps.convert_from_proxy_string_string(proxy.cpu_configuration); - sched_policy = proxy.sched_policy == null ? null : (string)proxy.sched_policy; + sched_policy = proxy.sched_policy == null ? null : proxy.sched_policy; supported_bootloaders = proxy.supported_bootloaders == null ? new string[] {} : (string [])proxy.supported_bootloaders; resident_VMs = proxy.resident_VMs == null ? null : XenRef.Create(proxy.resident_VMs); logging = proxy.logging == null ? null : Maps.convert_from_proxy_string_string(proxy.logging); @@ -268,21 +274,21 @@ namespace XenAPI PBDs = proxy.PBDs == null ? null : XenRef.Create(proxy.PBDs); host_CPUs = proxy.host_CPUs == null ? null : XenRef.Create(proxy.host_CPUs); cpu_info = proxy.cpu_info == null ? null : Maps.convert_from_proxy_string_string(proxy.cpu_info); - hostname = proxy.hostname == null ? null : (string)proxy.hostname; - address = proxy.address == null ? null : (string)proxy.address; + hostname = proxy.hostname == null ? null : proxy.hostname; + address = proxy.address == null ? null : proxy.address; metrics = proxy.metrics == null ? null : XenRef.Create(proxy.metrics); license_params = proxy.license_params == null ? null : Maps.convert_from_proxy_string_string(proxy.license_params); ha_statefiles = proxy.ha_statefiles == null ? new string[] {} : (string [])proxy.ha_statefiles; ha_network_peers = proxy.ha_network_peers == null ? new string[] {} : (string [])proxy.ha_network_peers; blobs = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs); tags = proxy.tags == null ? new string[] {} : (string [])proxy.tags; - external_auth_type = proxy.external_auth_type == null ? null : (string)proxy.external_auth_type; - external_auth_service_name = proxy.external_auth_service_name == null ? null : (string)proxy.external_auth_service_name; + external_auth_type = proxy.external_auth_type == null ? null : proxy.external_auth_type; + external_auth_service_name = proxy.external_auth_service_name == null ? null : proxy.external_auth_service_name; external_auth_configuration = proxy.external_auth_configuration == null ? null : Maps.convert_from_proxy_string_string(proxy.external_auth_configuration); - edition = proxy.edition == null ? null : (string)proxy.edition; + edition = proxy.edition == null ? null : proxy.edition; license_server = proxy.license_server == null ? null : Maps.convert_from_proxy_string_string(proxy.license_server); bios_strings = proxy.bios_strings == null ? null : Maps.convert_from_proxy_string_string(proxy.bios_strings); - power_on_mode = proxy.power_on_mode == null ? null : (string)proxy.power_on_mode; + power_on_mode = proxy.power_on_mode == null ? null : proxy.power_on_mode; power_on_config = proxy.power_on_config == null ? null : Maps.convert_from_proxy_string_string(proxy.power_on_config); local_cache_sr = proxy.local_cache_sr == null ? null : XenRef.Create(proxy.local_cache_sr); chipset_info = proxy.chipset_info == null ? null : Maps.convert_from_proxy_string_string(proxy.chipset_info); @@ -296,6 +302,8 @@ namespace XenAPI control_domain = proxy.control_domain == null ? null : XenRef.Create(proxy.control_domain); updates_requiring_reboot = proxy.updates_requiring_reboot == null ? null : XenRef.Create(proxy.updates_requiring_reboot); features = proxy.features == null ? null : XenRef.Create(proxy.features); + iscsi_iqn = proxy.iscsi_iqn == null ? null : proxy.iscsi_iqn; + multipathing = (bool)proxy.multipathing; } public Proxy_Host ToProxy() @@ -305,7 +313,7 @@ namespace XenAPI result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; result_.memory_overhead = memory_overhead.ToString(); - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_host_allowed_operations(current_operations); result_.API_version_major = API_version_major.ToString(); result_.API_version_minor = API_version_minor.ToString(); @@ -318,16 +326,16 @@ namespace XenAPI result_.cpu_configuration = Maps.convert_to_proxy_string_string(cpu_configuration); result_.sched_policy = sched_policy ?? ""; result_.supported_bootloaders = supported_bootloaders; - result_.resident_VMs = (resident_VMs != null) ? Helper.RefListToStringArray(resident_VMs) : new string[] {}; + result_.resident_VMs = resident_VMs == null ? new string[] {} : Helper.RefListToStringArray(resident_VMs); result_.logging = Maps.convert_to_proxy_string_string(logging); - result_.PIFs = (PIFs != null) ? Helper.RefListToStringArray(PIFs) : new string[] {}; + result_.PIFs = PIFs == null ? new string[] {} : Helper.RefListToStringArray(PIFs); result_.suspend_image_sr = suspend_image_sr ?? ""; result_.crash_dump_sr = crash_dump_sr ?? ""; - result_.crashdumps = (crashdumps != null) ? Helper.RefListToStringArray(crashdumps) : new string[] {}; - result_.patches = (patches != null) ? Helper.RefListToStringArray(patches) : new string[] {}; - result_.updates = (updates != null) ? Helper.RefListToStringArray(updates) : new string[] {}; - result_.PBDs = (PBDs != null) ? Helper.RefListToStringArray(PBDs) : new string[] {}; - result_.host_CPUs = (host_CPUs != null) ? Helper.RefListToStringArray(host_CPUs) : new string[] {}; + result_.crashdumps = crashdumps == null ? new string[] {} : Helper.RefListToStringArray(crashdumps); + result_.patches = patches == null ? new string[] {} : Helper.RefListToStringArray(patches); + result_.updates = updates == null ? new string[] {} : Helper.RefListToStringArray(updates); + result_.PBDs = PBDs == null ? new string[] {} : Helper.RefListToStringArray(PBDs); + result_.host_CPUs = host_CPUs == null ? new string[] {} : Helper.RefListToStringArray(host_CPUs); result_.cpu_info = Maps.convert_to_proxy_string_string(cpu_info); result_.hostname = hostname ?? ""; result_.address = address ?? ""; @@ -347,16 +355,18 @@ namespace XenAPI result_.power_on_config = Maps.convert_to_proxy_string_string(power_on_config); result_.local_cache_sr = local_cache_sr ?? ""; result_.chipset_info = Maps.convert_to_proxy_string_string(chipset_info); - result_.PCIs = (PCIs != null) ? Helper.RefListToStringArray(PCIs) : new string[] {}; - result_.PGPUs = (PGPUs != null) ? Helper.RefListToStringArray(PGPUs) : new string[] {}; - result_.PUSBs = (PUSBs != null) ? Helper.RefListToStringArray(PUSBs) : new string[] {}; + result_.PCIs = PCIs == null ? new string[] {} : Helper.RefListToStringArray(PCIs); + result_.PGPUs = PGPUs == null ? new string[] {} : Helper.RefListToStringArray(PGPUs); + result_.PUSBs = PUSBs == null ? new string[] {} : Helper.RefListToStringArray(PUSBs); result_.ssl_legacy = ssl_legacy; result_.guest_VCPUs_params = Maps.convert_to_proxy_string_string(guest_VCPUs_params); result_.display = host_display_helper.ToString(display); - result_.virtual_hardware_platform_versions = (virtual_hardware_platform_versions != null) ? Helper.LongArrayToStringArray(virtual_hardware_platform_versions) : new string[] {}; + result_.virtual_hardware_platform_versions = virtual_hardware_platform_versions == null ? new string[] {} : Helper.LongArrayToStringArray(virtual_hardware_platform_versions); result_.control_domain = control_domain ?? ""; - result_.updates_requiring_reboot = (updates_requiring_reboot != null) ? Helper.RefListToStringArray(updates_requiring_reboot) : new string[] {}; - result_.features = (features != null) ? Helper.RefListToStringArray(features) : new string[] {}; + result_.updates_requiring_reboot = updates_requiring_reboot == null ? new string[] {} : Helper.RefListToStringArray(updates_requiring_reboot); + result_.features = features == null ? new string[] {} : Helper.RefListToStringArray(features); + result_.iscsi_iqn = iscsi_iqn ?? ""; + result_.multipathing = multipathing; return result_; } @@ -491,6 +501,10 @@ namespace XenAPI updates_requiring_reboot = Marshalling.ParseSetRef(table, "updates_requiring_reboot"); if (table.ContainsKey("features")) features = Marshalling.ParseSetRef(table, "features"); + if (table.ContainsKey("iscsi_iqn")) + iscsi_iqn = Marshalling.ParseString(table, "iscsi_iqn"); + if (table.ContainsKey("multipathing")) + multipathing = Marshalling.ParseBool(table, "multipathing"); } public bool DeepEquals(Host other, bool ignoreCurrentOperations) @@ -557,7 +571,9 @@ namespace XenAPI Helper.AreEqual2(this._virtual_hardware_platform_versions, other._virtual_hardware_platform_versions) && Helper.AreEqual2(this._control_domain, other._control_domain) && Helper.AreEqual2(this._updates_requiring_reboot, other._updates_requiring_reboot) && - Helper.AreEqual2(this._features, other._features); + Helper.AreEqual2(this._features, other._features) && + Helper.AreEqual2(this._iscsi_iqn, other._iscsi_iqn) && + Helper.AreEqual2(this._multipathing, other._multipathing); } internal static List ProxyArrayToObjectList(Proxy_Host[] input) @@ -630,6 +646,14 @@ namespace XenAPI { Host.set_ssl_legacy(session, opaqueRef, _ssl_legacy); } + if (!Helper.AreEqual2(_iscsi_iqn, server._iscsi_iqn)) + { + Host.set_iscsi_iqn(session, opaqueRef, _iscsi_iqn); + } + if (!Helper.AreEqual2(_multipathing, server._multipathing)) + { + Host.set_multipathing(session, opaqueRef, _multipathing); + } return null; } @@ -687,7 +711,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_uuid(session.opaque_ref, _host); else - return (string)session.proxy.host_get_uuid(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_uuid(session.opaque_ref, _host ?? "").parse(); } /// @@ -701,7 +725,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_name_label(session.opaque_ref, _host); else - return (string)session.proxy.host_get_name_label(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_name_label(session.opaque_ref, _host ?? "").parse(); } /// @@ -715,7 +739,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_name_description(session.opaque_ref, _host); else - return (string)session.proxy.host_get_name_description(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_name_description(session.opaque_ref, _host ?? "").parse(); } /// @@ -729,7 +753,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_memory_overhead(session.opaque_ref, _host); else - return long.Parse((string)session.proxy.host_get_memory_overhead(session.opaque_ref, _host ?? "").parse()); + return long.Parse(session.proxy.host_get_memory_overhead(session.opaque_ref, _host ?? "").parse()); } /// @@ -771,7 +795,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_api_version_major(session.opaque_ref, _host); else - return long.Parse((string)session.proxy.host_get_api_version_major(session.opaque_ref, _host ?? "").parse()); + return long.Parse(session.proxy.host_get_api_version_major(session.opaque_ref, _host ?? "").parse()); } /// @@ -785,7 +809,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_api_version_minor(session.opaque_ref, _host); else - return long.Parse((string)session.proxy.host_get_api_version_minor(session.opaque_ref, _host ?? "").parse()); + return long.Parse(session.proxy.host_get_api_version_minor(session.opaque_ref, _host ?? "").parse()); } /// @@ -799,7 +823,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_api_version_vendor(session.opaque_ref, _host); else - return (string)session.proxy.host_get_api_version_vendor(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_api_version_vendor(session.opaque_ref, _host ?? "").parse(); } /// @@ -897,7 +921,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_sched_policy(session.opaque_ref, _host); else - return (string)session.proxy.host_get_sched_policy(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_sched_policy(session.opaque_ref, _host ?? "").parse(); } /// @@ -1081,7 +1105,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_hostname(session.opaque_ref, _host); else - return (string)session.proxy.host_get_hostname(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_hostname(session.opaque_ref, _host ?? "").parse(); } /// @@ -1095,7 +1119,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_address(session.opaque_ref, _host); else - return (string)session.proxy.host_get_address(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_address(session.opaque_ref, _host ?? "").parse(); } /// @@ -1193,7 +1217,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_external_auth_type(session.opaque_ref, _host); else - return (string)session.proxy.host_get_external_auth_type(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_external_auth_type(session.opaque_ref, _host ?? "").parse(); } /// @@ -1207,7 +1231,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_external_auth_service_name(session.opaque_ref, _host); else - return (string)session.proxy.host_get_external_auth_service_name(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_external_auth_service_name(session.opaque_ref, _host ?? "").parse(); } /// @@ -1235,7 +1259,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_edition(session.opaque_ref, _host); else - return (string)session.proxy.host_get_edition(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_edition(session.opaque_ref, _host ?? "").parse(); } /// @@ -1277,7 +1301,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_power_on_mode(session.opaque_ref, _host); else - return (string)session.proxy.host_get_power_on_mode(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_power_on_mode(session.opaque_ref, _host ?? "").parse(); } /// @@ -1462,6 +1486,34 @@ namespace XenAPI return XenRef.Create(session.proxy.host_get_features(session.opaque_ref, _host ?? "").parse()); } + /// + /// Get the iscsi_iqn field of the given host. + /// First published in Unreleased. + /// + /// The session + /// The opaque_ref of the given host + public static string get_iscsi_iqn(Session session, string _host) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.host_get_iscsi_iqn(session.opaque_ref, _host); + else + return session.proxy.host_get_iscsi_iqn(session.opaque_ref, _host ?? "").parse(); + } + + /// + /// Get the multipathing field of the given host. + /// First published in Unreleased. + /// + /// The session + /// The opaque_ref of the given host + public static bool get_multipathing(Session session, string _host) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.host_get_multipathing(session.opaque_ref, _host); + else + return (bool)session.proxy.host_get_multipathing(session.opaque_ref, _host ?? "").parse(); + } + /// /// Set the name/label field of the given host. /// First published in XenServer 4.0. @@ -1919,7 +1971,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_dmesg(session.opaque_ref, _host); else - return (string)session.proxy.host_dmesg(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_dmesg(session.opaque_ref, _host ?? "").parse(); } /// @@ -1947,7 +1999,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_dmesg_clear(session.opaque_ref, _host); else - return (string)session.proxy.host_dmesg_clear(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_dmesg_clear(session.opaque_ref, _host ?? "").parse(); } /// @@ -1975,7 +2027,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_log(session.opaque_ref, _host); else - return (string)session.proxy.host_get_log(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_log(session.opaque_ref, _host ?? "").parse(); } /// @@ -2522,7 +2574,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_system_status_capabilities(session.opaque_ref, _host); else - return (string)session.proxy.host_get_system_status_capabilities(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_system_status_capabilities(session.opaque_ref, _host ?? "").parse(); } /// @@ -2592,7 +2644,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_compute_free_memory(session.opaque_ref, _host); else - return long.Parse((string)session.proxy.host_compute_free_memory(session.opaque_ref, _host ?? "").parse()); + return long.Parse(session.proxy.host_compute_free_memory(session.opaque_ref, _host ?? "").parse()); } /// @@ -2620,7 +2672,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_compute_memory_overhead(session.opaque_ref, _host); else - return long.Parse((string)session.proxy.host_compute_memory_overhead(session.opaque_ref, _host ?? "").parse()); + return long.Parse(session.proxy.host_compute_memory_overhead(session.opaque_ref, _host ?? "").parse()); } /// @@ -2746,7 +2798,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_call_plugin(session.opaque_ref, _host, _plugin, _fn, _args); else - return (string)session.proxy.host_call_plugin(session.opaque_ref, _host ?? "", _plugin ?? "", _fn ?? "", Maps.convert_to_proxy_string_string(_args)).parse(); + return session.proxy.host_call_plugin(session.opaque_ref, _host ?? "", _plugin ?? "", _fn ?? "", Maps.convert_to_proxy_string_string(_args)).parse(); } /// @@ -2808,7 +2860,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_call_extension(session.opaque_ref, _host, _call); else - return (string)session.proxy.host_call_extension(session.opaque_ref, _host ?? "", _call ?? "").parse(); + return session.proxy.host_call_extension(session.opaque_ref, _host ?? "", _call ?? "").parse(); } /// @@ -2910,7 +2962,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_get_server_certificate(session.opaque_ref, _host); else - return (string)session.proxy.host_get_server_certificate(session.opaque_ref, _host ?? "").parse(); + return session.proxy.host_get_server_certificate(session.opaque_ref, _host ?? "").parse(); } /// @@ -3226,6 +3278,66 @@ namespace XenAPI return XenRef.Create(session.proxy.async_host_set_ssl_legacy(session.opaque_ref, _host ?? "", _value).parse()); } + /// + /// Sets the initiator IQN for the host + /// First published in Unreleased. + /// + /// The session + /// The opaque_ref of the given host + /// The value to which the IQN should be set + public static void set_iscsi_iqn(Session session, string _host, string _value) + { + if (session.JsonRpcClient != null) + session.JsonRpcClient.host_set_iscsi_iqn(session.opaque_ref, _host, _value); + else + session.proxy.host_set_iscsi_iqn(session.opaque_ref, _host ?? "", _value ?? "").parse(); + } + + /// + /// Sets the initiator IQN for the host + /// First published in Unreleased. + /// + /// The session + /// The opaque_ref of the given host + /// The value to which the IQN should be set + public static XenRef async_set_iscsi_iqn(Session session, string _host, string _value) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.async_host_set_iscsi_iqn(session.opaque_ref, _host, _value); + else + return XenRef.Create(session.proxy.async_host_set_iscsi_iqn(session.opaque_ref, _host ?? "", _value ?? "").parse()); + } + + /// + /// Specifies whether multipathing is enabled + /// First published in Unreleased. + /// + /// The session + /// The opaque_ref of the given host + /// Whether multipathing should be enabled + public static void set_multipathing(Session session, string _host, bool _value) + { + if (session.JsonRpcClient != null) + session.JsonRpcClient.host_set_multipathing(session.opaque_ref, _host, _value); + else + session.proxy.host_set_multipathing(session.opaque_ref, _host ?? "", _value).parse(); + } + + /// + /// Specifies whether multipathing is enabled + /// First published in Unreleased. + /// + /// The session + /// The opaque_ref of the given host + /// Whether multipathing should be enabled + public static XenRef async_set_multipathing(Session session, string _host, bool _value) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.async_host_set_multipathing(session.opaque_ref, _host, _value); + else + return XenRef.Create(session.proxy.async_host_set_multipathing(session.opaque_ref, _host ?? "", _value).parse()); + } + /// /// Return a list of all the hosts known to the system. /// First published in XenServer 4.0. @@ -4317,5 +4429,43 @@ namespace XenAPI } } private List> _features = new List>() {}; + + /// + /// The initiator IQN for the host + /// First published in Unreleased. + /// + public virtual string iscsi_iqn + { + get { return _iscsi_iqn; } + set + { + if (!Helper.AreEqual(value, _iscsi_iqn)) + { + _iscsi_iqn = value; + Changed = true; + NotifyPropertyChanged("iscsi_iqn"); + } + } + } + private string _iscsi_iqn = ""; + + /// + /// Specifies whether multipathing is enabled + /// First published in Unreleased. + /// + public virtual bool multipathing + { + get { return _multipathing; } + set + { + if (!Helper.AreEqual(value, _multipathing)) + { + _multipathing = value; + Changed = true; + NotifyPropertyChanged("multipathing"); + } + } + } + private bool _multipathing = false; } } diff --git a/XenModel/XenAPI/Host_cpu.cs b/XenModel/XenAPI/Host_cpu.cs index 0c94bce89..e7ff2ebf7 100644 --- a/XenModel/XenAPI/Host_cpu.cs +++ b/XenModel/XenAPI/Host_cpu.cs @@ -111,17 +111,17 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Host_cpu proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; host = proxy.host == null ? null : XenRef.Create(proxy.host); - number = proxy.number == null ? 0 : long.Parse((string)proxy.number); - vendor = proxy.vendor == null ? null : (string)proxy.vendor; - speed = proxy.speed == null ? 0 : long.Parse((string)proxy.speed); - modelname = proxy.modelname == null ? null : (string)proxy.modelname; - family = proxy.family == null ? 0 : long.Parse((string)proxy.family); - model = proxy.model == null ? 0 : long.Parse((string)proxy.model); - stepping = proxy.stepping == null ? null : (string)proxy.stepping; - flags = proxy.flags == null ? null : (string)proxy.flags; - features = proxy.features == null ? null : (string)proxy.features; + number = proxy.number == null ? 0 : long.Parse(proxy.number); + vendor = proxy.vendor == null ? null : proxy.vendor; + speed = proxy.speed == null ? 0 : long.Parse(proxy.speed); + modelname = proxy.modelname == null ? null : proxy.modelname; + family = proxy.family == null ? 0 : long.Parse(proxy.family); + model = proxy.model == null ? 0 : long.Parse(proxy.model); + stepping = proxy.stepping == null ? null : proxy.stepping; + flags = proxy.flags == null ? null : proxy.flags; + features = proxy.features == null ? null : proxy.features; utilisation = Convert.ToDouble(proxy.utilisation); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -283,7 +283,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_uuid(session.opaque_ref, _host_cpu); else - return (string)session.proxy.host_cpu_get_uuid(session.opaque_ref, _host_cpu ?? "").parse(); + return session.proxy.host_cpu_get_uuid(session.opaque_ref, _host_cpu ?? "").parse(); } /// @@ -311,7 +311,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_number(session.opaque_ref, _host_cpu); else - return long.Parse((string)session.proxy.host_cpu_get_number(session.opaque_ref, _host_cpu ?? "").parse()); + return long.Parse(session.proxy.host_cpu_get_number(session.opaque_ref, _host_cpu ?? "").parse()); } /// @@ -325,7 +325,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_vendor(session.opaque_ref, _host_cpu); else - return (string)session.proxy.host_cpu_get_vendor(session.opaque_ref, _host_cpu ?? "").parse(); + return session.proxy.host_cpu_get_vendor(session.opaque_ref, _host_cpu ?? "").parse(); } /// @@ -339,7 +339,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_speed(session.opaque_ref, _host_cpu); else - return long.Parse((string)session.proxy.host_cpu_get_speed(session.opaque_ref, _host_cpu ?? "").parse()); + return long.Parse(session.proxy.host_cpu_get_speed(session.opaque_ref, _host_cpu ?? "").parse()); } /// @@ -353,7 +353,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_modelname(session.opaque_ref, _host_cpu); else - return (string)session.proxy.host_cpu_get_modelname(session.opaque_ref, _host_cpu ?? "").parse(); + return session.proxy.host_cpu_get_modelname(session.opaque_ref, _host_cpu ?? "").parse(); } /// @@ -367,7 +367,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_family(session.opaque_ref, _host_cpu); else - return long.Parse((string)session.proxy.host_cpu_get_family(session.opaque_ref, _host_cpu ?? "").parse()); + return long.Parse(session.proxy.host_cpu_get_family(session.opaque_ref, _host_cpu ?? "").parse()); } /// @@ -381,7 +381,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_model(session.opaque_ref, _host_cpu); else - return long.Parse((string)session.proxy.host_cpu_get_model(session.opaque_ref, _host_cpu ?? "").parse()); + return long.Parse(session.proxy.host_cpu_get_model(session.opaque_ref, _host_cpu ?? "").parse()); } /// @@ -395,7 +395,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_stepping(session.opaque_ref, _host_cpu); else - return (string)session.proxy.host_cpu_get_stepping(session.opaque_ref, _host_cpu ?? "").parse(); + return session.proxy.host_cpu_get_stepping(session.opaque_ref, _host_cpu ?? "").parse(); } /// @@ -409,7 +409,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_flags(session.opaque_ref, _host_cpu); else - return (string)session.proxy.host_cpu_get_flags(session.opaque_ref, _host_cpu ?? "").parse(); + return session.proxy.host_cpu_get_flags(session.opaque_ref, _host_cpu ?? "").parse(); } /// @@ -423,7 +423,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_cpu_get_features(session.opaque_ref, _host_cpu); else - return (string)session.proxy.host_cpu_get_features(session.opaque_ref, _host_cpu ?? "").parse(); + return session.proxy.host_cpu_get_features(session.opaque_ref, _host_cpu ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Host_crashdump.cs b/XenModel/XenAPI/Host_crashdump.cs index b1c718887..80d9faa8a 100644 --- a/XenModel/XenAPI/Host_crashdump.cs +++ b/XenModel/XenAPI/Host_crashdump.cs @@ -87,10 +87,10 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Host_crashdump proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; host = proxy.host == null ? null : XenRef.Create(proxy.host); timestamp = proxy.timestamp; - size = proxy.size == null ? 0 : long.Parse((string)proxy.size); + size = proxy.size == null ? 0 : long.Parse(proxy.size); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -215,7 +215,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_crashdump_get_uuid(session.opaque_ref, _host_crashdump); else - return (string)session.proxy.host_crashdump_get_uuid(session.opaque_ref, _host_crashdump ?? "").parse(); + return session.proxy.host_crashdump_get_uuid(session.opaque_ref, _host_crashdump ?? "").parse(); } /// @@ -257,7 +257,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_crashdump_get_size(session.opaque_ref, _host_crashdump); else - return long.Parse((string)session.proxy.host_crashdump_get_size(session.opaque_ref, _host_crashdump ?? "").parse()); + return long.Parse(session.proxy.host_crashdump_get_size(session.opaque_ref, _host_crashdump ?? "").parse()); } /// diff --git a/XenModel/XenAPI/Host_metrics.cs b/XenModel/XenAPI/Host_metrics.cs index d6c5630b1..d7c69678e 100644 --- a/XenModel/XenAPI/Host_metrics.cs +++ b/XenModel/XenAPI/Host_metrics.cs @@ -90,9 +90,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Host_metrics proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - memory_total = proxy.memory_total == null ? 0 : long.Parse((string)proxy.memory_total); - memory_free = proxy.memory_free == null ? 0 : long.Parse((string)proxy.memory_free); + uuid = proxy.uuid == null ? null : proxy.uuid; + memory_total = proxy.memory_total == null ? 0 : long.Parse(proxy.memory_total); + memory_free = proxy.memory_free == null ? 0 : long.Parse(proxy.memory_free); live = (bool)proxy.live; last_updated = proxy.last_updated; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); @@ -223,7 +223,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_metrics_get_uuid(session.opaque_ref, _host_metrics); else - return (string)session.proxy.host_metrics_get_uuid(session.opaque_ref, _host_metrics ?? "").parse(); + return session.proxy.host_metrics_get_uuid(session.opaque_ref, _host_metrics ?? "").parse(); } /// @@ -237,7 +237,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_metrics_get_memory_total(session.opaque_ref, _host_metrics); else - return long.Parse((string)session.proxy.host_metrics_get_memory_total(session.opaque_ref, _host_metrics ?? "").parse()); + return long.Parse(session.proxy.host_metrics_get_memory_total(session.opaque_ref, _host_metrics ?? "").parse()); } /// @@ -253,7 +253,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_metrics_get_memory_free(session.opaque_ref, _host_metrics); else - return long.Parse((string)session.proxy.host_metrics_get_memory_free(session.opaque_ref, _host_metrics ?? "").parse()); + return long.Parse(session.proxy.host_metrics_get_memory_free(session.opaque_ref, _host_metrics ?? "").parse()); } /// diff --git a/XenModel/XenAPI/Host_patch.cs b/XenModel/XenAPI/Host_patch.cs index 69674c036..6f987b14a 100644 --- a/XenModel/XenAPI/Host_patch.cs +++ b/XenModel/XenAPI/Host_patch.cs @@ -102,14 +102,14 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Host_patch 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; - version = proxy.version == null ? null : (string)proxy.version; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + version = proxy.version == null ? null : proxy.version; host = proxy.host == null ? null : XenRef.Create(proxy.host); applied = (bool)proxy.applied; timestamp_applied = proxy.timestamp_applied; - size = proxy.size == null ? 0 : long.Parse((string)proxy.size); + size = proxy.size == null ? 0 : long.Parse(proxy.size); pool_patch = proxy.pool_patch == null ? null : XenRef.Create(proxy.pool_patch); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -275,7 +275,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_patch_get_uuid(session.opaque_ref, _host_patch); else - return (string)session.proxy.host_patch_get_uuid(session.opaque_ref, _host_patch ?? "").parse(); + return session.proxy.host_patch_get_uuid(session.opaque_ref, _host_patch ?? "").parse(); } /// @@ -289,7 +289,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_patch_get_name_label(session.opaque_ref, _host_patch); else - return (string)session.proxy.host_patch_get_name_label(session.opaque_ref, _host_patch ?? "").parse(); + return session.proxy.host_patch_get_name_label(session.opaque_ref, _host_patch ?? "").parse(); } /// @@ -303,7 +303,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_patch_get_name_description(session.opaque_ref, _host_patch); else - return (string)session.proxy.host_patch_get_name_description(session.opaque_ref, _host_patch ?? "").parse(); + return session.proxy.host_patch_get_name_description(session.opaque_ref, _host_patch ?? "").parse(); } /// @@ -317,7 +317,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_patch_get_version(session.opaque_ref, _host_patch); else - return (string)session.proxy.host_patch_get_version(session.opaque_ref, _host_patch ?? "").parse(); + return session.proxy.host_patch_get_version(session.opaque_ref, _host_patch ?? "").parse(); } /// @@ -373,7 +373,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_patch_get_size(session.opaque_ref, _host_patch); else - return long.Parse((string)session.proxy.host_patch_get_size(session.opaque_ref, _host_patch ?? "").parse()); + return long.Parse(session.proxy.host_patch_get_size(session.opaque_ref, _host_patch ?? "").parse()); } /// @@ -495,7 +495,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.host_patch_apply(session.opaque_ref, _host_patch); else - return (string)session.proxy.host_patch_apply(session.opaque_ref, _host_patch ?? "").parse(); + return session.proxy.host_patch_apply(session.opaque_ref, _host_patch ?? "").parse(); } /// diff --git a/XenModel/XenAPI/JsonRpc.cs b/XenModel/XenAPI/JsonRpc.cs index 5080ecc0a..c4852926d 100644 --- a/XenModel/XenAPI/JsonRpc.cs +++ b/XenModel/XenAPI/JsonRpc.cs @@ -114,7 +114,7 @@ namespace XenAPI internal abstract class JsonResponse { - [JsonProperty("id", Required = Required.AllowNull )] public int Id = 0; + [JsonProperty("id", Required = Required.AllowNull)] public int Id = 0; [JsonProperty("result", Required = Required.Default)] public T Result = default(T); @@ -126,7 +126,7 @@ namespace XenAPI internal class JsonResponseV1 : JsonResponse { - [JsonProperty("error", Required = Required.AllowNull)] public object Error = null; + [JsonProperty("error", Required = Required.AllowNull)] public JToken Error = null; } internal class JsonResponseV2 : JsonResponse @@ -211,8 +211,9 @@ namespace XenAPI // for performance reasons it's preferable to deserialize directly // from the Stream rather than allocating strings inbetween // therefore the latter will be done only in DEBUG mode + #if DEBUG - var settings = new JsonSerializerSettings {Formatting = Formatting.Indented, Converters = serializer.Converters}; + var settings = CreateSettings(serializer.Converters); #endif using (var str = webRequest.GetRequestStream()) @@ -267,12 +268,35 @@ namespace XenAPI var res1 = (JsonResponseV1)serializer.Deserialize(responseReader, typeof(JsonResponseV1)); #endif if (res1.Error != null) - throw new Failure(res1.Error as string[]); + { + var errorArray = res1.Error.ToObject(); + if (errorArray != null) + throw new Failure(errorArray); + } return res1.Result; } } } } } + + private JsonSerializerSettings CreateSettings(IList converters) + { + return new JsonSerializerSettings + { +#if DEBUG + Formatting = Formatting.Indented, +#endif + Converters = converters, + DateParseHandling = DateParseHandling.None, + NullValueHandling = NullValueHandling.Ignore + }; + } + + private JsonSerializer CreateSerializer(IList converters) + { + var settings = CreateSettings(converters); + return JsonSerializer.Create(settings); + } } } diff --git a/XenModel/XenAPI/JsonRpcClient.cs b/XenModel/XenAPI/JsonRpcClient.cs index 3b2ccb06f..d98c78f32 100644 --- a/XenModel/XenAPI/JsonRpcClient.cs +++ b/XenModel/XenAPI/JsonRpcClient.cs @@ -43,14231 +43,14280 @@ namespace XenAPI public Event event_get_record(string session, string _event) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings { Converters = converters }); + var serializer = CreateSerializer(converters); return Rpc("event.get_record", new JArray(session, _event ?? ""), serializer); } public string event_get_by_uuid(string session, string _uuid) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings { Converters = converters }); + var serializer = CreateSerializer(converters); return Rpc("event.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public long event_get_id(string session, string _event) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings { Converters = converters }); + var serializer = CreateSerializer(converters); return Rpc("event.get_id", new JArray(session, _event ?? ""), serializer); } public void event_set_id(string session, string _event, long _id) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings { Converters = converters }); + var serializer = CreateSerializer(converters); Rpc("event.set_id", new JArray(session, _event ?? "", _id), serializer); } public void event_register(string session, string[] _classes) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings { Converters = converters }); + var serializer = CreateSerializer(converters); Rpc("event.register", new JArray(session, JArray.FromObject(_classes ?? new string[] {})), serializer); } public void event_unregister(string session, string[] _classes) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings { Converters = converters }); + var serializer = CreateSerializer(converters); Rpc("event.unregister", new JArray(session, JArray.FromObject(_classes ?? new string[] {})), serializer); } public EventBatch event_from(string session, string[] _classes, string _token, double _timeout) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings { Converters = converters }); + var serializer = CreateSerializer(converters); return Rpc("event.from", new JArray(session, JArray.FromObject(_classes ?? new string[] {}), _token ?? "", _timeout), serializer); } public Session session_get_record(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_record", new JArray(session, _session ?? ""), serializer); } public XenRef session_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string session_get_uuid(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_uuid", new JArray(session, _session ?? ""), serializer); } public XenRef session_get_this_host(string session, string _session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.get_this_host", new JArray(session, _session ?? ""), serializer); } public XenRef session_get_this_user(string session, string _session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.get_this_user", new JArray(session, _session ?? ""), serializer); } public DateTime session_get_last_active(string session, string _session) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_last_active", new JArray(session, _session ?? ""), serializer); } public bool session_get_pool(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_pool", new JArray(session, _session ?? ""), serializer); } public Dictionary session_get_other_config(string session, string _session) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.get_other_config", new JArray(session, _session ?? ""), serializer); } public bool session_get_is_local_superuser(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_is_local_superuser", new JArray(session, _session ?? ""), serializer); } public XenRef session_get_subject(string session, string _session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.get_subject", new JArray(session, _session ?? ""), serializer); } public DateTime session_get_validation_time(string session, string _session) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_validation_time", new JArray(session, _session ?? ""), serializer); } public string session_get_auth_user_sid(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_auth_user_sid", new JArray(session, _session ?? ""), serializer); } public string session_get_auth_user_name(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_auth_user_name", new JArray(session, _session ?? ""), serializer); } public string[] session_get_rbac_permissions(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_rbac_permissions", new JArray(session, _session ?? ""), serializer); } public List> session_get_tasks(string session, string _session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("session.get_tasks", new JArray(session, _session ?? ""), serializer); } public XenRef session_get_parent(string session, string _session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.get_parent", new JArray(session, _session ?? ""), serializer); } public string session_get_originator(string session, string _session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_originator", new JArray(session, _session ?? ""), serializer); } public void session_set_other_config(string session, string _session, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("session.set_other_config", new JArray(session, _session ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void session_add_to_other_config(string session, string _session, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("session.add_to_other_config", new JArray(session, _session ?? "", _key ?? "", _value ?? ""), serializer); } public void session_remove_from_other_config(string session, string _session, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("session.remove_from_other_config", new JArray(session, _session ?? "", _key ?? ""), serializer); } public XenRef session_login_with_password(string _uname, string _pwd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.login_with_password", new JArray(_uname ?? "", _pwd ?? ""), serializer); } public XenRef session_login_with_password(string _uname, string _pwd, string _version) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.login_with_password", new JArray(_uname ?? "", _pwd ?? "", _version ?? ""), serializer); } public XenRef session_login_with_password(string _uname, string _pwd, string _version, string _originator) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.login_with_password", new JArray(_uname ?? "", _pwd ?? "", _version ?? "", _originator ?? ""), serializer); } public void session_logout(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("session.logout", new JArray(session), serializer); } public void session_change_password(string session, string _old_pwd, string _new_pwd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("session.change_password", new JArray(session, _old_pwd ?? "", _new_pwd ?? ""), serializer); } public XenRef session_slave_local_login_with_password(string _uname, string _pwd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.slave_local_login_with_password", new JArray(_uname ?? "", _pwd ?? ""), serializer); } public XenRef session_create_from_db_file(string session, string _filename) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("session.create_from_db_file", new JArray(session, _filename ?? ""), serializer); } public XenRef async_session_create_from_db_file(string session, string _filename) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.session.create_from_db_file", new JArray(session, _filename ?? ""), serializer); } public void session_local_logout(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("session.local_logout", new JArray(session), serializer); } public string[] session_get_all_subject_identifiers(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("session.get_all_subject_identifiers", new JArray(session), serializer); } public XenRef async_session_get_all_subject_identifiers(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.session.get_all_subject_identifiers", new JArray(session), serializer); } public void session_logout_subject_identifier(string session, string _subject_identifier) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("session.logout_subject_identifier", new JArray(session, _subject_identifier ?? ""), serializer); } public XenRef async_session_logout_subject_identifier(string session, string _subject_identifier) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.session.logout_subject_identifier", new JArray(session, _subject_identifier ?? ""), serializer); } public Dictionary, Session> session_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Session>>("session.get_all_records", new JArray(session), serializer); } public string auth_get_subject_identifier(string session, string _subject_name) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("auth.get_subject_identifier", new JArray(session, _subject_name ?? ""), serializer); } public Dictionary auth_get_subject_information_from_identifier(string session, string _subject_identifier) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("auth.get_subject_information_from_identifier", new JArray(session, _subject_identifier ?? ""), serializer); } public string[] auth_get_group_membership(string session, string _subject_identifier) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("auth.get_group_membership", new JArray(session, _subject_identifier ?? ""), serializer); } public Dictionary, Auth> auth_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Auth>>("auth.get_all_records", new JArray(session), serializer); } public Subject subject_get_record(string session, string _subject) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("subject.get_record", new JArray(session, _subject ?? ""), serializer); } public XenRef subject_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("subject.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef subject_create(string session, Subject _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("subject.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_subject_create(string session, Subject _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.subject.create", new JArray(session, _record.ToJObject()), serializer); } public void subject_destroy(string session, string _subject) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("subject.destroy", new JArray(session, _subject ?? ""), serializer); } public XenRef async_subject_destroy(string session, string _subject) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.subject.destroy", new JArray(session, _subject ?? ""), serializer); } public string subject_get_uuid(string session, string _subject) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("subject.get_uuid", new JArray(session, _subject ?? ""), serializer); } public string subject_get_subject_identifier(string session, string _subject) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("subject.get_subject_identifier", new JArray(session, _subject ?? ""), serializer); } public Dictionary subject_get_other_config(string session, string _subject) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("subject.get_other_config", new JArray(session, _subject ?? ""), serializer); } public List> subject_get_roles(string session, string _subject) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("subject.get_roles", new JArray(session, _subject ?? ""), serializer); } public void subject_add_to_roles(string session, string _subject, string _role) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("subject.add_to_roles", new JArray(session, _subject ?? "", _role ?? ""), serializer); } public void subject_remove_from_roles(string session, string _subject, string _role) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("subject.remove_from_roles", new JArray(session, _subject ?? "", _role ?? ""), serializer); } public string[] subject_get_permissions_name_label(string session, string _subject) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("subject.get_permissions_name_label", new JArray(session, _subject ?? ""), serializer); } public List> subject_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("subject.get_all", new JArray(session), serializer); } public Dictionary, Subject> subject_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Subject>>("subject.get_all_records", new JArray(session), serializer); } public Role role_get_record(string session, string _role) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("role.get_record", new JArray(session, _role ?? ""), serializer); } public XenRef role_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("role.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> role_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("role.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string role_get_uuid(string session, string _role) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("role.get_uuid", new JArray(session, _role ?? ""), serializer); } public string role_get_name_label(string session, string _role) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("role.get_name_label", new JArray(session, _role ?? ""), serializer); } public string role_get_name_description(string session, string _role) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("role.get_name_description", new JArray(session, _role ?? ""), serializer); } public List> role_get_subroles(string session, string _role) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("role.get_subroles", new JArray(session, _role ?? ""), serializer); } public List> role_get_permissions(string session, string _role) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("role.get_permissions", new JArray(session, _role ?? ""), serializer); } public string[] role_get_permissions_name_label(string session, string _role) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("role.get_permissions_name_label", new JArray(session, _role ?? ""), serializer); } public List> role_get_by_permission(string session, string _role) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("role.get_by_permission", new JArray(session, _role ?? ""), serializer); } public List> role_get_by_permission_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("role.get_by_permission_name_label", new JArray(session, _label ?? ""), serializer); } public List> role_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("role.get_all", new JArray(session), serializer); } public Dictionary, Role> role_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Role>>("role.get_all_records", new JArray(session), serializer); } public Task task_get_record(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_record", new JArray(session, _task ?? ""), serializer); } public XenRef task_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("task.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> task_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("task.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string task_get_uuid(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_uuid", new JArray(session, _task ?? ""), serializer); } public string task_get_name_label(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_name_label", new JArray(session, _task ?? ""), serializer); } public string task_get_name_description(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_name_description", new JArray(session, _task ?? ""), serializer); } public List task_get_allowed_operations(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("task.get_allowed_operations", new JArray(session, _task ?? ""), serializer); } public Dictionary task_get_current_operations(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("task.get_current_operations", new JArray(session, _task ?? ""), serializer); } public DateTime task_get_created(string session, string _task) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_created", new JArray(session, _task ?? ""), serializer); } public DateTime task_get_finished(string session, string _task) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_finished", new JArray(session, _task ?? ""), serializer); } public task_status_type task_get_status(string session, string _task) { var converters = new List {new task_status_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_status", new JArray(session, _task ?? ""), serializer); } public XenRef task_get_resident_on(string session, string _task) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("task.get_resident_on", new JArray(session, _task ?? ""), serializer); } public double task_get_progress(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_progress", new JArray(session, _task ?? ""), serializer); } public string task_get_type(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_type", new JArray(session, _task ?? ""), serializer); } public string task_get_result(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_result", new JArray(session, _task ?? ""), serializer); } public string[] task_get_error_info(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_error_info", new JArray(session, _task ?? ""), serializer); } public Dictionary task_get_other_config(string session, string _task) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("task.get_other_config", new JArray(session, _task ?? ""), serializer); } public XenRef task_get_subtask_of(string session, string _task) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("task.get_subtask_of", new JArray(session, _task ?? ""), serializer); } public List> task_get_subtasks(string session, string _task) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("task.get_subtasks", new JArray(session, _task ?? ""), serializer); } public string task_get_backtrace(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("task.get_backtrace", new JArray(session, _task ?? ""), serializer); } public void task_set_other_config(string session, string _task, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("task.set_other_config", new JArray(session, _task ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void task_add_to_other_config(string session, string _task, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("task.add_to_other_config", new JArray(session, _task ?? "", _key ?? "", _value ?? ""), serializer); } public void task_remove_from_other_config(string session, string _task, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("task.remove_from_other_config", new JArray(session, _task ?? "", _key ?? ""), serializer); } public XenRef task_create(string session, string _label, string _description) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("task.create", new JArray(session, _label ?? "", _description ?? ""), serializer); } public void task_destroy(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("task.destroy", new JArray(session, _task ?? ""), serializer); } public void task_cancel(string session, string _task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("task.cancel", new JArray(session, _task ?? ""), serializer); } public XenRef async_task_cancel(string session, string _task) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.task.cancel", new JArray(session, _task ?? ""), serializer); } public void task_set_status(string session, string _task, task_status_type _value) { var converters = new List {new task_status_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("task.set_status", new JArray(session, _task ?? "", _value.StringOf()), serializer); } public List> task_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("task.get_all", new JArray(session), serializer); } public Dictionary, Task> task_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Task>>("task.get_all_records", new JArray(session), serializer); } public Pool pool_get_record(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_record", new JArray(session, _pool ?? ""), serializer); } public XenRef pool_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pool_get_uuid(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_uuid", new JArray(session, _pool ?? ""), serializer); } public string pool_get_name_label(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_name_label", new JArray(session, _pool ?? ""), serializer); } public string pool_get_name_description(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_name_description", new JArray(session, _pool ?? ""), serializer); } public XenRef pool_get_master(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_master", new JArray(session, _pool ?? ""), serializer); } public XenRef pool_get_default_sr(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_default_SR", new JArray(session, _pool ?? ""), serializer); } public XenRef pool_get_suspend_image_sr(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_suspend_image_SR", new JArray(session, _pool ?? ""), serializer); } public XenRef pool_get_crash_dump_sr(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_crash_dump_SR", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_other_config(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_other_config", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_ha_enabled(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_ha_enabled", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_ha_configuration(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_ha_configuration", new JArray(session, _pool ?? ""), serializer); } public string[] pool_get_ha_statefiles(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_ha_statefiles", new JArray(session, _pool ?? ""), serializer); } public long pool_get_ha_host_failures_to_tolerate(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_ha_host_failures_to_tolerate", new JArray(session, _pool ?? ""), serializer); } public long pool_get_ha_plan_exists_for(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_ha_plan_exists_for", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_ha_allow_overcommit(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_ha_allow_overcommit", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_ha_overcommitted(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_ha_overcommitted", new JArray(session, _pool ?? ""), serializer); } public Dictionary> pool_get_blobs(string session, string _pool) { var converters = new List {new StringXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool.get_blobs", new JArray(session, _pool ?? ""), serializer); } public string[] pool_get_tags(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_tags", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_gui_config(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_gui_config", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_health_check_config(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_health_check_config", new JArray(session, _pool ?? ""), serializer); } public string pool_get_wlb_url(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_wlb_url", new JArray(session, _pool ?? ""), serializer); } public string pool_get_wlb_username(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_wlb_username", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_wlb_enabled(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_wlb_enabled", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_wlb_verify_cert(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_wlb_verify_cert", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_redo_log_enabled(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_redo_log_enabled", new JArray(session, _pool ?? ""), serializer); } public XenRef pool_get_redo_log_vdi(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_redo_log_vdi", new JArray(session, _pool ?? ""), serializer); } public string pool_get_vswitch_controller(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_vswitch_controller", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_restrictions(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_restrictions", new JArray(session, _pool ?? ""), serializer); } public List> pool_get_metadata_vdis(string session, string _pool) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool.get_metadata_VDIs", new JArray(session, _pool ?? ""), serializer); } public string pool_get_ha_cluster_stack(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_ha_cluster_stack", new JArray(session, _pool ?? ""), serializer); } public List pool_get_allowed_operations(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_allowed_operations", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_current_operations(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_current_operations", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_guest_agent_config(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_guest_agent_config", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_cpu_info(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_cpu_info", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_policy_no_vendor_device(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_policy_no_vendor_device", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_live_patching_disabled(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_live_patching_disabled", new JArray(session, _pool ?? ""), serializer); } public bool pool_get_igmp_snooping_enabled(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.get_igmp_snooping_enabled", new JArray(session, _pool ?? ""), serializer); } public void pool_set_name_label(string session, string _pool, string _name_label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_name_label", new JArray(session, _pool ?? "", _name_label ?? ""), serializer); } public void pool_set_name_description(string session, string _pool, string _name_description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_name_description", new JArray(session, _pool ?? "", _name_description ?? ""), serializer); } public void pool_set_default_sr(string session, string _pool, string _default_sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_default_SR", new JArray(session, _pool ?? "", _default_sr ?? ""), serializer); } public void pool_set_suspend_image_sr(string session, string _pool, string _suspend_image_sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_suspend_image_SR", new JArray(session, _pool ?? "", _suspend_image_sr ?? ""), serializer); } public void pool_set_crash_dump_sr(string session, string _pool, string _crash_dump_sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_crash_dump_SR", new JArray(session, _pool ?? "", _crash_dump_sr ?? ""), serializer); } public void pool_set_other_config(string session, string _pool, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_other_config", new JArray(session, _pool ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pool_add_to_other_config(string session, string _pool, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.add_to_other_config", new JArray(session, _pool ?? "", _key ?? "", _value ?? ""), serializer); } public void pool_remove_from_other_config(string session, string _pool, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.remove_from_other_config", new JArray(session, _pool ?? "", _key ?? ""), serializer); } public void pool_set_ha_allow_overcommit(string session, string _pool, bool _ha_allow_overcommit) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_ha_allow_overcommit", new JArray(session, _pool ?? "", _ha_allow_overcommit), serializer); } public void pool_set_tags(string session, string _pool, string[] _tags) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_tags", new JArray(session, _pool ?? "", _tags == null ? new JArray() : JArray.FromObject(_tags)), serializer); } public void pool_add_tags(string session, string _pool, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.add_tags", new JArray(session, _pool ?? "", _value ?? ""), serializer); } public void pool_remove_tags(string session, string _pool, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.remove_tags", new JArray(session, _pool ?? "", _value ?? ""), serializer); } public void pool_set_gui_config(string session, string _pool, Dictionary _gui_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_gui_config", new JArray(session, _pool ?? "", _gui_config == null ? new JObject() : JObject.FromObject(_gui_config, serializer)), serializer); } public void pool_add_to_gui_config(string session, string _pool, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.add_to_gui_config", new JArray(session, _pool ?? "", _key ?? "", _value ?? ""), serializer); } public void pool_remove_from_gui_config(string session, string _pool, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.remove_from_gui_config", new JArray(session, _pool ?? "", _key ?? ""), serializer); } public void pool_set_health_check_config(string session, string _pool, Dictionary _health_check_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_health_check_config", new JArray(session, _pool ?? "", _health_check_config == null ? new JObject() : JObject.FromObject(_health_check_config, serializer)), serializer); } public void pool_add_to_health_check_config(string session, string _pool, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.add_to_health_check_config", new JArray(session, _pool ?? "", _key ?? "", _value ?? ""), serializer); } public void pool_remove_from_health_check_config(string session, string _pool, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.remove_from_health_check_config", new JArray(session, _pool ?? "", _key ?? ""), serializer); } public void pool_set_wlb_enabled(string session, string _pool, bool _wlb_enabled) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_wlb_enabled", new JArray(session, _pool ?? "", _wlb_enabled), serializer); } public void pool_set_wlb_verify_cert(string session, string _pool, bool _wlb_verify_cert) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_wlb_verify_cert", new JArray(session, _pool ?? "", _wlb_verify_cert), serializer); } public void pool_set_policy_no_vendor_device(string session, string _pool, bool _policy_no_vendor_device) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_policy_no_vendor_device", new JArray(session, _pool ?? "", _policy_no_vendor_device), serializer); } public void pool_set_live_patching_disabled(string session, string _pool, bool _live_patching_disabled) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_live_patching_disabled", new JArray(session, _pool ?? "", _live_patching_disabled), serializer); } public void pool_join(string session, string _master_address, string _master_username, string _master_password) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.join", new JArray(session, _master_address ?? "", _master_username ?? "", _master_password ?? ""), serializer); } public XenRef async_pool_join(string session, string _master_address, string _master_username, string _master_password) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.join", new JArray(session, _master_address ?? "", _master_username ?? "", _master_password ?? ""), serializer); } public void pool_join_force(string session, string _master_address, string _master_username, string _master_password) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.join_force", new JArray(session, _master_address ?? "", _master_username ?? "", _master_password ?? ""), serializer); } public XenRef async_pool_join_force(string session, string _master_address, string _master_username, string _master_password) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.join_force", new JArray(session, _master_address ?? "", _master_username ?? "", _master_password ?? ""), serializer); } public void pool_eject(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.eject", new JArray(session, _host ?? ""), serializer); } public XenRef async_pool_eject(string session, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.eject", new JArray(session, _host ?? ""), serializer); } public void pool_emergency_transition_to_master(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.emergency_transition_to_master", new JArray(session), serializer); } public void pool_emergency_reset_master(string session, string _master_address) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.emergency_reset_master", new JArray(session, _master_address ?? ""), serializer); } public List> pool_recover_slaves(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool.recover_slaves", new JArray(session), serializer); } public XenRef async_pool_recover_slaves(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.recover_slaves", new JArray(session), serializer); } public List> pool_create_vlan(string session, string _device, string _network, long _vlan) { var converters = new List {new XenRefListConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool.create_VLAN", new JArray(session, _device ?? "", _network ?? "", _vlan), serializer); } public XenRef async_pool_create_vlan(string session, string _device, string _network, long _vlan) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.create_VLAN", new JArray(session, _device ?? "", _network ?? "", _vlan), serializer); } public void pool_management_reconfigure(string session, string _network) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.management_reconfigure", new JArray(session, _network ?? ""), serializer); } public XenRef async_pool_management_reconfigure(string session, string _network) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.management_reconfigure", new JArray(session, _network ?? ""), serializer); } public List> pool_create_vlan_from_pif(string session, string _pif, string _network, long _vlan) { var converters = new List {new XenRefListConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool.create_VLAN_from_PIF", new JArray(session, _pif ?? "", _network ?? "", _vlan), serializer); } public XenRef async_pool_create_vlan_from_pif(string session, string _pif, string _network, long _vlan) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.create_VLAN_from_PIF", new JArray(session, _pif ?? "", _network ?? "", _vlan), serializer); } public void pool_enable_ha(string session, List> _heartbeat_srs, Dictionary _configuration) { var converters = new List {new XenRefListConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.enable_ha", new JArray(session, _heartbeat_srs == null ? new JArray() : JArray.FromObject(_heartbeat_srs, serializer), _configuration == null ? new JObject() : JObject.FromObject(_configuration, serializer)), serializer); } public XenRef async_pool_enable_ha(string session, List> _heartbeat_srs, Dictionary _configuration) { var converters = new List {new XenRefConverter(), new XenRefListConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.enable_ha", new JArray(session, _heartbeat_srs == null ? new JArray() : JArray.FromObject(_heartbeat_srs, serializer), _configuration == null ? new JObject() : JObject.FromObject(_configuration, serializer)), serializer); } public void pool_disable_ha(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.disable_ha", new JArray(session), serializer); } public XenRef async_pool_disable_ha(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.disable_ha", new JArray(session), serializer); } public void pool_sync_database(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.sync_database", new JArray(session), serializer); } public XenRef async_pool_sync_database(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.sync_database", new JArray(session), serializer); } public void pool_designate_new_master(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.designate_new_master", new JArray(session, _host ?? ""), serializer); } public XenRef async_pool_designate_new_master(string session, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.designate_new_master", new JArray(session, _host ?? ""), serializer); } public void pool_ha_prevent_restarts_for(string session, long _seconds) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.ha_prevent_restarts_for", new JArray(session, _seconds), serializer); } public bool pool_ha_failover_plan_exists(string session, long _n) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.ha_failover_plan_exists", new JArray(session, _n), serializer); } public long pool_ha_compute_max_host_failures_to_tolerate(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.ha_compute_max_host_failures_to_tolerate", new JArray(session), serializer); } public long pool_ha_compute_hypothetical_max_host_failures_to_tolerate(string session, Dictionary, string> _configuration) { var converters = new List {new XenRefStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.ha_compute_hypothetical_max_host_failures_to_tolerate", new JArray(session, _configuration == null ? new JObject() : JObject.FromObject(_configuration, serializer)), serializer); } public Dictionary, Dictionary> pool_ha_compute_vm_failover_plan(string session, List> _failed_hosts, List> _failed_vms) { var converters = new List {new XenRefStringStringMapMapConverter(), new XenRefListConverter(), new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Dictionary>>("pool.ha_compute_vm_failover_plan", new JArray(session, _failed_hosts == null ? new JArray() : JArray.FromObject(_failed_hosts, serializer), _failed_vms == null ? new JArray() : JArray.FromObject(_failed_vms, serializer)), serializer); } public void pool_set_ha_host_failures_to_tolerate(string session, string _pool, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_ha_host_failures_to_tolerate", new JArray(session, _pool ?? "", _value), serializer); } public XenRef async_pool_set_ha_host_failures_to_tolerate(string session, string _pool, long _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.set_ha_host_failures_to_tolerate", new JArray(session, _pool ?? "", _value), serializer); } public XenRef pool_create_new_blob(string session, string _pool, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.create_new_blob", new JArray(session, _pool ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef async_pool_create_new_blob(string session, string _pool, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.create_new_blob", new JArray(session, _pool ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef pool_create_new_blob(string session, string _pool, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.create_new_blob", new JArray(session, _pool ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public XenRef async_pool_create_new_blob(string session, string _pool, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.create_new_blob", new JArray(session, _pool ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public void pool_enable_external_auth(string session, string _pool, Dictionary _config, string _service_name, string _auth_type) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.enable_external_auth", new JArray(session, _pool ?? "", _config == null ? new JObject() : JObject.FromObject(_config, serializer), _service_name ?? "", _auth_type ?? ""), serializer); } public void pool_disable_external_auth(string session, string _pool, Dictionary _config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.disable_external_auth", new JArray(session, _pool ?? "", _config == null ? new JObject() : JObject.FromObject(_config, serializer)), serializer); } public void pool_detect_nonhomogeneous_external_auth(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.detect_nonhomogeneous_external_auth", new JArray(session, _pool ?? ""), serializer); } public void pool_initialize_wlb(string session, string _wlb_url, string _wlb_username, string _wlb_password, string _xenserver_username, string _xenserver_password) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.initialize_wlb", new JArray(session, _wlb_url ?? "", _wlb_username ?? "", _wlb_password ?? "", _xenserver_username ?? "", _xenserver_password ?? ""), serializer); } public XenRef async_pool_initialize_wlb(string session, string _wlb_url, string _wlb_username, string _wlb_password, string _xenserver_username, string _xenserver_password) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.initialize_wlb", new JArray(session, _wlb_url ?? "", _wlb_username ?? "", _wlb_password ?? "", _xenserver_username ?? "", _xenserver_password ?? ""), serializer); } public void pool_deconfigure_wlb(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.deconfigure_wlb", new JArray(session), serializer); } public XenRef async_pool_deconfigure_wlb(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.deconfigure_wlb", new JArray(session), serializer); } public void pool_send_wlb_configuration(string session, Dictionary _config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.send_wlb_configuration", new JArray(session, _config == null ? new JObject() : JObject.FromObject(_config, serializer)), serializer); } public XenRef async_pool_send_wlb_configuration(string session, Dictionary _config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.send_wlb_configuration", new JArray(session, _config == null ? new JObject() : JObject.FromObject(_config, serializer)), serializer); } public Dictionary pool_retrieve_wlb_configuration(string session) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.retrieve_wlb_configuration", new JArray(session), serializer); } public XenRef async_pool_retrieve_wlb_configuration(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.retrieve_wlb_configuration", new JArray(session), serializer); } public Dictionary, string[]> pool_retrieve_wlb_recommendations(string session) { var converters = new List {new XenRefStringSetMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, string[]>>("pool.retrieve_wlb_recommendations", new JArray(session), serializer); } public XenRef async_pool_retrieve_wlb_recommendations(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.retrieve_wlb_recommendations", new JArray(session), serializer); } public string pool_send_test_post(string session, string _host, long _port, string _body) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.send_test_post", new JArray(session, _host ?? "", _port, _body ?? ""), serializer); } public XenRef async_pool_send_test_post(string session, string _host, long _port, string _body) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.send_test_post", new JArray(session, _host ?? "", _port, _body ?? ""), serializer); } public void pool_certificate_install(string session, string _name, string _cert) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.certificate_install", new JArray(session, _name ?? "", _cert ?? ""), serializer); } public XenRef async_pool_certificate_install(string session, string _name, string _cert) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.certificate_install", new JArray(session, _name ?? "", _cert ?? ""), serializer); } public void pool_certificate_uninstall(string session, string _name) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.certificate_uninstall", new JArray(session, _name ?? ""), serializer); } public XenRef async_pool_certificate_uninstall(string session, string _name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.certificate_uninstall", new JArray(session, _name ?? ""), serializer); } public string[] pool_certificate_list(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.certificate_list", new JArray(session), serializer); } public XenRef async_pool_certificate_list(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.certificate_list", new JArray(session), serializer); } public void pool_crl_install(string session, string _name, string _cert) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.crl_install", new JArray(session, _name ?? "", _cert ?? ""), serializer); } public XenRef async_pool_crl_install(string session, string _name, string _cert) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.crl_install", new JArray(session, _name ?? "", _cert ?? ""), serializer); } public void pool_crl_uninstall(string session, string _name) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.crl_uninstall", new JArray(session, _name ?? ""), serializer); } public XenRef async_pool_crl_uninstall(string session, string _name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.crl_uninstall", new JArray(session, _name ?? ""), serializer); } public string[] pool_crl_list(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.crl_list", new JArray(session), serializer); } public XenRef async_pool_crl_list(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.crl_list", new JArray(session), serializer); } public void pool_certificate_sync(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.certificate_sync", new JArray(session), serializer); } public XenRef async_pool_certificate_sync(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.certificate_sync", new JArray(session), serializer); } public void pool_enable_redo_log(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.enable_redo_log", new JArray(session, _sr ?? ""), serializer); } public XenRef async_pool_enable_redo_log(string session, string _sr) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.enable_redo_log", new JArray(session, _sr ?? ""), serializer); } public void pool_disable_redo_log(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.disable_redo_log", new JArray(session), serializer); } public XenRef async_pool_disable_redo_log(string session) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.disable_redo_log", new JArray(session), serializer); } public void pool_set_vswitch_controller(string session, string _address) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_vswitch_controller", new JArray(session, _address ?? ""), serializer); } public XenRef async_pool_set_vswitch_controller(string session, string _address) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.set_vswitch_controller", new JArray(session, _address ?? ""), serializer); } public string pool_test_archive_target(string session, string _pool, Dictionary _config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.test_archive_target", new JArray(session, _pool ?? "", _config == null ? new JObject() : JObject.FromObject(_config, serializer)), serializer); } public void pool_enable_local_storage_caching(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.enable_local_storage_caching", new JArray(session, _pool ?? ""), serializer); } public XenRef async_pool_enable_local_storage_caching(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.enable_local_storage_caching", new JArray(session, _pool ?? ""), serializer); } public void pool_disable_local_storage_caching(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.disable_local_storage_caching", new JArray(session, _pool ?? ""), serializer); } public XenRef async_pool_disable_local_storage_caching(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.disable_local_storage_caching", new JArray(session, _pool ?? ""), serializer); } public Dictionary pool_get_license_state(string session, string _pool) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool.get_license_state", new JArray(session, _pool ?? ""), serializer); } public XenRef async_pool_get_license_state(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.get_license_state", new JArray(session, _pool ?? ""), serializer); } public void pool_apply_edition(string session, string _pool, string _edition) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.apply_edition", new JArray(session, _pool ?? "", _edition ?? ""), serializer); } public XenRef async_pool_apply_edition(string session, string _pool, string _edition) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.apply_edition", new JArray(session, _pool ?? "", _edition ?? ""), serializer); } public void pool_enable_ssl_legacy(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.enable_ssl_legacy", new JArray(session, _pool ?? ""), serializer); } public XenRef async_pool_enable_ssl_legacy(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.enable_ssl_legacy", new JArray(session, _pool ?? ""), serializer); } public void pool_disable_ssl_legacy(string session, string _pool) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.disable_ssl_legacy", new JArray(session, _pool ?? ""), serializer); } public XenRef async_pool_disable_ssl_legacy(string session, string _pool) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.disable_ssl_legacy", new JArray(session, _pool ?? ""), serializer); } public void pool_set_igmp_snooping_enabled(string session, string _pool, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.set_igmp_snooping_enabled", new JArray(session, _pool ?? "", _value), serializer); } public XenRef async_pool_set_igmp_snooping_enabled(string session, string _pool, bool _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.set_igmp_snooping_enabled", new JArray(session, _pool ?? "", _value), serializer); } public bool pool_has_extension(string session, string _pool, string _name) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool.has_extension", new JArray(session, _pool ?? "", _name ?? ""), serializer); } public XenRef async_pool_has_extension(string session, string _pool, string _name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.has_extension", new JArray(session, _pool ?? "", _name ?? ""), serializer); } public void pool_add_to_guest_agent_config(string session, string _pool, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.add_to_guest_agent_config", new JArray(session, _pool ?? "", _key ?? "", _value ?? ""), serializer); } public XenRef async_pool_add_to_guest_agent_config(string session, string _pool, string _key, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.add_to_guest_agent_config", new JArray(session, _pool ?? "", _key ?? "", _value ?? ""), serializer); } public void pool_remove_from_guest_agent_config(string session, string _pool, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool.remove_from_guest_agent_config", new JArray(session, _pool ?? "", _key ?? ""), serializer); } public XenRef async_pool_remove_from_guest_agent_config(string session, string _pool, string _key) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool.remove_from_guest_agent_config", new JArray(session, _pool ?? "", _key ?? ""), serializer); } public List> pool_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool.get_all", new JArray(session), serializer); } public Dictionary, Pool> pool_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Pool>>("pool.get_all_records", new JArray(session), serializer); } public Pool_patch pool_patch_get_record(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.get_record", new JArray(session, _pool_patch ?? ""), serializer); } public XenRef pool_patch_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_patch.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> pool_patch_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool_patch.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string pool_patch_get_uuid(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.get_uuid", new JArray(session, _pool_patch ?? ""), serializer); } public string pool_patch_get_name_label(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.get_name_label", new JArray(session, _pool_patch ?? ""), serializer); } public string pool_patch_get_name_description(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.get_name_description", new JArray(session, _pool_patch ?? ""), serializer); } public string pool_patch_get_version(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.get_version", new JArray(session, _pool_patch ?? ""), serializer); } public long pool_patch_get_size(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.get_size", new JArray(session, _pool_patch ?? ""), serializer); } public bool pool_patch_get_pool_applied(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.get_pool_applied", new JArray(session, _pool_patch ?? ""), serializer); } public List> pool_patch_get_host_patches(string session, string _pool_patch) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool_patch.get_host_patches", new JArray(session, _pool_patch ?? ""), serializer); } public List pool_patch_get_after_apply_guidance(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_patch.get_after_apply_guidance", new JArray(session, _pool_patch ?? ""), serializer); } public XenRef pool_patch_get_pool_update(string session, string _pool_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_patch.get_pool_update", new JArray(session, _pool_patch ?? ""), serializer); } public Dictionary pool_patch_get_other_config(string session, string _pool_patch) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_patch.get_other_config", new JArray(session, _pool_patch ?? ""), serializer); } public void pool_patch_set_other_config(string session, string _pool_patch, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.set_other_config", new JArray(session, _pool_patch ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pool_patch_add_to_other_config(string session, string _pool_patch, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.add_to_other_config", new JArray(session, _pool_patch ?? "", _key ?? "", _value ?? ""), serializer); } public void pool_patch_remove_from_other_config(string session, string _pool_patch, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.remove_from_other_config", new JArray(session, _pool_patch ?? "", _key ?? ""), serializer); } public string pool_patch_apply(string session, string _pool_patch, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.apply", new JArray(session, _pool_patch ?? "", _host ?? ""), serializer); } public XenRef async_pool_patch_apply(string session, string _pool_patch, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_patch.apply", new JArray(session, _pool_patch ?? "", _host ?? ""), serializer); } public void pool_patch_pool_apply(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.pool_apply", new JArray(session, _pool_patch ?? ""), serializer); } public XenRef async_pool_patch_pool_apply(string session, string _pool_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_patch.pool_apply", new JArray(session, _pool_patch ?? ""), serializer); } public string pool_patch_precheck(string session, string _pool_patch, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_patch.precheck", new JArray(session, _pool_patch ?? "", _host ?? ""), serializer); } public XenRef async_pool_patch_precheck(string session, string _pool_patch, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_patch.precheck", new JArray(session, _pool_patch ?? "", _host ?? ""), serializer); } public void pool_patch_clean(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.clean", new JArray(session, _pool_patch ?? ""), serializer); } public XenRef async_pool_patch_clean(string session, string _pool_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_patch.clean", new JArray(session, _pool_patch ?? ""), serializer); } public void pool_patch_pool_clean(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.pool_clean", new JArray(session, _pool_patch ?? ""), serializer); } public XenRef async_pool_patch_pool_clean(string session, string _pool_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_patch.pool_clean", new JArray(session, _pool_patch ?? ""), serializer); } public void pool_patch_destroy(string session, string _pool_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.destroy", new JArray(session, _pool_patch ?? ""), serializer); } public XenRef async_pool_patch_destroy(string session, string _pool_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_patch.destroy", new JArray(session, _pool_patch ?? ""), serializer); } public void pool_patch_clean_on_host(string session, string _pool_patch, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_patch.clean_on_host", new JArray(session, _pool_patch ?? "", _host ?? ""), serializer); } public XenRef async_pool_patch_clean_on_host(string session, string _pool_patch, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_patch.clean_on_host", new JArray(session, _pool_patch ?? "", _host ?? ""), serializer); } public List> pool_patch_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool_patch.get_all", new JArray(session), serializer); } public Dictionary, Pool_patch> pool_patch_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Pool_patch>>("pool_patch.get_all_records", new JArray(session), serializer); } public Pool_update pool_update_get_record(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_record", new JArray(session, _pool_update ?? ""), serializer); } public XenRef pool_update_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_update.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> pool_update_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool_update.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string pool_update_get_uuid(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_uuid", new JArray(session, _pool_update ?? ""), serializer); } public string pool_update_get_name_label(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_name_label", new JArray(session, _pool_update ?? ""), serializer); } public string pool_update_get_name_description(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_name_description", new JArray(session, _pool_update ?? ""), serializer); } public string pool_update_get_version(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_version", new JArray(session, _pool_update ?? ""), serializer); } public long pool_update_get_installation_size(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_installation_size", new JArray(session, _pool_update ?? ""), serializer); } public string pool_update_get_key(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_key", new JArray(session, _pool_update ?? ""), serializer); } public List pool_update_get_after_apply_guidance(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_update.get_after_apply_guidance", new JArray(session, _pool_update ?? ""), serializer); } public XenRef pool_update_get_vdi(string session, string _pool_update) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_update.get_vdi", new JArray(session, _pool_update ?? ""), serializer); } public List> pool_update_get_hosts(string session, string _pool_update) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool_update.get_hosts", new JArray(session, _pool_update ?? ""), serializer); } public Dictionary pool_update_get_other_config(string session, string _pool_update) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_update.get_other_config", new JArray(session, _pool_update ?? ""), serializer); } public bool pool_update_get_enforce_homogeneity(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.get_enforce_homogeneity", new JArray(session, _pool_update ?? ""), serializer); } public void pool_update_set_other_config(string session, string _pool_update, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_update.set_other_config", new JArray(session, _pool_update ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pool_update_add_to_other_config(string session, string _pool_update, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_update.add_to_other_config", new JArray(session, _pool_update ?? "", _key ?? "", _value ?? ""), serializer); } public void pool_update_remove_from_other_config(string session, string _pool_update, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_update.remove_from_other_config", new JArray(session, _pool_update ?? "", _key ?? ""), serializer); } public XenRef pool_update_introduce(string session, string _vdi) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("pool_update.introduce", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_pool_update_introduce(string session, string _vdi) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_update.introduce", new JArray(session, _vdi ?? ""), serializer); } public livepatch_status pool_update_precheck(string session, string _pool_update, string _host) { var converters = new List {new livepatch_statusConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("pool_update.precheck", new JArray(session, _pool_update ?? "", _host ?? ""), serializer); } public XenRef async_pool_update_precheck(string session, string _pool_update, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_update.precheck", new JArray(session, _pool_update ?? "", _host ?? ""), serializer); } public void pool_update_apply(string session, string _pool_update, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_update.apply", new JArray(session, _pool_update ?? "", _host ?? ""), serializer); } public XenRef async_pool_update_apply(string session, string _pool_update, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_update.apply", new JArray(session, _pool_update ?? "", _host ?? ""), serializer); } public void pool_update_pool_apply(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_update.pool_apply", new JArray(session, _pool_update ?? ""), serializer); } public XenRef async_pool_update_pool_apply(string session, string _pool_update) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_update.pool_apply", new JArray(session, _pool_update ?? ""), serializer); } public void pool_update_pool_clean(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_update.pool_clean", new JArray(session, _pool_update ?? ""), serializer); } public XenRef async_pool_update_pool_clean(string session, string _pool_update) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_update.pool_clean", new JArray(session, _pool_update ?? ""), serializer); } public void pool_update_destroy(string session, string _pool_update) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("pool_update.destroy", new JArray(session, _pool_update ?? ""), serializer); } public XenRef async_pool_update_destroy(string session, string _pool_update) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.pool_update.destroy", new JArray(session, _pool_update ?? ""), serializer); } public List> pool_update_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("pool_update.get_all", new JArray(session), serializer); } public Dictionary, Pool_update> pool_update_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Pool_update>>("pool_update.get_all_records", new JArray(session), serializer); } public VM vm_get_record(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_record", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vm_create(string session, VM _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vm_create(string session, VM _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.create", new JArray(session, _record.ToJObject()), serializer); } public void vm_destroy(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.destroy", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_destroy(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.destroy", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string vm_get_uuid(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_uuid", new JArray(session, _vm ?? ""), serializer); } public List vm_get_allowed_operations(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_allowed_operations", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_current_operations(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_current_operations", new JArray(session, _vm ?? ""), serializer); } public vm_power_state vm_get_power_state(string session, string _vm) { var converters = new List {new vm_power_stateConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_power_state", new JArray(session, _vm ?? ""), serializer); } public string vm_get_name_label(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_name_label", new JArray(session, _vm ?? ""), serializer); } public string vm_get_name_description(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_name_description", new JArray(session, _vm ?? ""), serializer); } public long vm_get_user_version(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_user_version", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_is_a_template(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_is_a_template", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_is_default_template(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_is_default_template", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_suspend_vdi(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_suspend_VDI", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_resident_on(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_resident_on", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_affinity(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_affinity", new JArray(session, _vm ?? ""), serializer); } public long vm_get_memory_overhead(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_memory_overhead", new JArray(session, _vm ?? ""), serializer); } public long vm_get_memory_target(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_memory_target", new JArray(session, _vm ?? ""), serializer); } public long vm_get_memory_static_max(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_memory_static_max", new JArray(session, _vm ?? ""), serializer); } public long vm_get_memory_dynamic_max(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_memory_dynamic_max", new JArray(session, _vm ?? ""), serializer); } public long vm_get_memory_dynamic_min(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_memory_dynamic_min", new JArray(session, _vm ?? ""), serializer); } public long vm_get_memory_static_min(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_memory_static_min", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_vcpus_params(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_VCPUs_params", new JArray(session, _vm ?? ""), serializer); } public long vm_get_vcpus_max(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_VCPUs_max", new JArray(session, _vm ?? ""), serializer); } public long vm_get_vcpus_at_startup(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_VCPUs_at_startup", new JArray(session, _vm ?? ""), serializer); } public on_normal_exit vm_get_actions_after_shutdown(string session, string _vm) { var converters = new List {new on_normal_exitConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_actions_after_shutdown", new JArray(session, _vm ?? ""), serializer); } public on_normal_exit vm_get_actions_after_reboot(string session, string _vm) { var converters = new List {new on_normal_exitConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_actions_after_reboot", new JArray(session, _vm ?? ""), serializer); } public on_crash_behaviour vm_get_actions_after_crash(string session, string _vm) { var converters = new List {new on_crash_behaviourConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_actions_after_crash", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_consoles(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_consoles", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_vifs(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_VIFs", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_vbds(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_VBDs", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_vusbs(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_VUSBs", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_crash_dumps(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_crash_dumps", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_vtpms(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_VTPMs", new JArray(session, _vm ?? ""), serializer); } public string vm_get_pv_bootloader(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_PV_bootloader", new JArray(session, _vm ?? ""), serializer); } public string vm_get_pv_kernel(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_PV_kernel", new JArray(session, _vm ?? ""), serializer); } public string vm_get_pv_ramdisk(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_PV_ramdisk", new JArray(session, _vm ?? ""), serializer); } public string vm_get_pv_args(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_PV_args", new JArray(session, _vm ?? ""), serializer); } public string vm_get_pv_bootloader_args(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_PV_bootloader_args", new JArray(session, _vm ?? ""), serializer); } public string vm_get_pv_legacy_args(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_PV_legacy_args", new JArray(session, _vm ?? ""), serializer); } public string vm_get_hvm_boot_policy(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_HVM_boot_policy", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_hvm_boot_params(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_HVM_boot_params", new JArray(session, _vm ?? ""), serializer); } public double vm_get_hvm_shadow_multiplier(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_HVM_shadow_multiplier", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_platform(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_platform", new JArray(session, _vm ?? ""), serializer); } public string vm_get_pci_bus(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_PCI_bus", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_other_config(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_other_config", new JArray(session, _vm ?? ""), serializer); } public long vm_get_domid(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_domid", new JArray(session, _vm ?? ""), serializer); } public string vm_get_domarch(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_domarch", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_last_boot_cpu_flags(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_last_boot_CPU_flags", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_is_control_domain(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_is_control_domain", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_metrics(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_metrics", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_guest_metrics(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_guest_metrics", new JArray(session, _vm ?? ""), serializer); } public string vm_get_last_booted_record(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_last_booted_record", new JArray(session, _vm ?? ""), serializer); } public string vm_get_recommendations(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_recommendations", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_xenstore_data(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_xenstore_data", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_ha_always_run(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_ha_always_run", new JArray(session, _vm ?? ""), serializer); } public string vm_get_ha_restart_priority(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_ha_restart_priority", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_is_a_snapshot(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_is_a_snapshot", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_snapshot_of(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_snapshot_of", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_snapshots(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_snapshots", new JArray(session, _vm ?? ""), serializer); } public DateTime vm_get_snapshot_time(string session, string _vm) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_snapshot_time", new JArray(session, _vm ?? ""), serializer); } public string vm_get_transportable_snapshot_id(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_transportable_snapshot_id", new JArray(session, _vm ?? ""), serializer); } public Dictionary> vm_get_blobs(string session, string _vm) { var converters = new List {new StringXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_blobs", new JArray(session, _vm ?? ""), serializer); } public string[] vm_get_tags(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_tags", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_blocked_operations(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_blocked_operations", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_snapshot_info(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_snapshot_info", new JArray(session, _vm ?? ""), serializer); } public string vm_get_snapshot_metadata(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_snapshot_metadata", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_parent(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_parent", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_children(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_children", new JArray(session, _vm ?? ""), serializer); } public Dictionary vm_get_bios_strings(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_bios_strings", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_protection_policy(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_protection_policy", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_is_snapshot_from_vmpp(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_is_snapshot_from_vmpp", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_snapshot_schedule(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_snapshot_schedule", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_is_vmss_snapshot(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_is_vmss_snapshot", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_appliance(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_appliance", new JArray(session, _vm ?? ""), serializer); } public long vm_get_start_delay(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_start_delay", new JArray(session, _vm ?? ""), serializer); } public long vm_get_shutdown_delay(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_shutdown_delay", new JArray(session, _vm ?? ""), serializer); } public long vm_get_order(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_order", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_vgpus(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_VGPUs", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_attached_pcis(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_attached_PCIs", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_get_suspend_sr(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_suspend_SR", new JArray(session, _vm ?? ""), serializer); } public long vm_get_version(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_version", new JArray(session, _vm ?? ""), serializer); } public string vm_get_generation_id(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_generation_id", new JArray(session, _vm ?? ""), serializer); } public long vm_get_hardware_platform_version(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_hardware_platform_version", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_has_vendor_device(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_has_vendor_device", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_requires_reboot(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_requires_reboot", new JArray(session, _vm ?? ""), serializer); } public string vm_get_reference_label(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_reference_label", new JArray(session, _vm ?? ""), serializer); } + public domain_type vm_get_domain_type(string session, string _vm) + { + var converters = new List {new domain_typeConverter()}; + var serializer = CreateSerializer(converters); + return Rpc("VM.get_domain_type", new JArray(session, _vm ?? ""), serializer); + } + public void vm_set_name_label(string session, string _vm, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_name_label", new JArray(session, _vm ?? "", _label ?? ""), serializer); } public void vm_set_name_description(string session, string _vm, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_name_description", new JArray(session, _vm ?? "", _description ?? ""), serializer); } public void vm_set_user_version(string session, string _vm, long _user_version) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_user_version", new JArray(session, _vm ?? "", _user_version), serializer); } public void vm_set_is_a_template(string session, string _vm, bool _is_a_template) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_is_a_template", new JArray(session, _vm ?? "", _is_a_template), serializer); } public void vm_set_affinity(string session, string _vm, string _affinity) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_affinity", new JArray(session, _vm ?? "", _affinity ?? ""), serializer); } public void vm_set_vcpus_params(string session, string _vm, Dictionary _params) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_VCPUs_params", new JArray(session, _vm ?? "", _params == null ? new JObject() : JObject.FromObject(_params, serializer)), serializer); } public void vm_add_to_vcpus_params(string session, string _vm, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_to_VCPUs_params", new JArray(session, _vm ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_remove_from_vcpus_params(string session, string _vm, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.remove_from_VCPUs_params", new JArray(session, _vm ?? "", _key ?? ""), serializer); } public void vm_set_actions_after_shutdown(string session, string _vm, on_normal_exit _after_shutdown) { var converters = new List {new on_normal_exitConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_actions_after_shutdown", new JArray(session, _vm ?? "", _after_shutdown.StringOf()), serializer); } public void vm_set_actions_after_reboot(string session, string _vm, on_normal_exit _after_reboot) { var converters = new List {new on_normal_exitConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_actions_after_reboot", new JArray(session, _vm ?? "", _after_reboot.StringOf()), serializer); } public void vm_set_pv_bootloader(string session, string _vm, string _bootloader) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_PV_bootloader", new JArray(session, _vm ?? "", _bootloader ?? ""), serializer); } public void vm_set_pv_kernel(string session, string _vm, string _kernel) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_PV_kernel", new JArray(session, _vm ?? "", _kernel ?? ""), serializer); } public void vm_set_pv_ramdisk(string session, string _vm, string _ramdisk) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_PV_ramdisk", new JArray(session, _vm ?? "", _ramdisk ?? ""), serializer); } public void vm_set_pv_args(string session, string _vm, string _args) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_PV_args", new JArray(session, _vm ?? "", _args ?? ""), serializer); } public void vm_set_pv_bootloader_args(string session, string _vm, string _bootloader_args) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_PV_bootloader_args", new JArray(session, _vm ?? "", _bootloader_args ?? ""), serializer); } public void vm_set_pv_legacy_args(string session, string _vm, string _legacy_args) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_PV_legacy_args", new JArray(session, _vm ?? "", _legacy_args ?? ""), serializer); } - public void vm_set_hvm_boot_policy(string session, string _vm, string _boot_policy) - { - var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); - Rpc("VM.set_HVM_boot_policy", new JArray(session, _vm ?? "", _boot_policy ?? ""), serializer); - } - public void vm_set_hvm_boot_params(string session, string _vm, Dictionary _boot_params) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_HVM_boot_params", new JArray(session, _vm ?? "", _boot_params == null ? new JObject() : JObject.FromObject(_boot_params, serializer)), serializer); } public void vm_add_to_hvm_boot_params(string session, string _vm, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_to_HVM_boot_params", new JArray(session, _vm ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_remove_from_hvm_boot_params(string session, string _vm, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.remove_from_HVM_boot_params", new JArray(session, _vm ?? "", _key ?? ""), serializer); } public void vm_set_platform(string session, string _vm, Dictionary _platform) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_platform", new JArray(session, _vm ?? "", _platform == null ? new JObject() : JObject.FromObject(_platform, serializer)), serializer); } public void vm_add_to_platform(string session, string _vm, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_to_platform", new JArray(session, _vm ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_remove_from_platform(string session, string _vm, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.remove_from_platform", new JArray(session, _vm ?? "", _key ?? ""), serializer); } public void vm_set_pci_bus(string session, string _vm, string _pci_bus) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_PCI_bus", new JArray(session, _vm ?? "", _pci_bus ?? ""), serializer); } public void vm_set_other_config(string session, string _vm, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_other_config", new JArray(session, _vm ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vm_add_to_other_config(string session, string _vm, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_to_other_config", new JArray(session, _vm ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_remove_from_other_config(string session, string _vm, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.remove_from_other_config", new JArray(session, _vm ?? "", _key ?? ""), serializer); } public void vm_set_recommendations(string session, string _vm, string _recommendations) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_recommendations", new JArray(session, _vm ?? "", _recommendations ?? ""), serializer); } public void vm_set_xenstore_data(string session, string _vm, Dictionary _xenstore_data) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_xenstore_data", new JArray(session, _vm ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer)), serializer); } public void vm_add_to_xenstore_data(string session, string _vm, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_to_xenstore_data", new JArray(session, _vm ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_remove_from_xenstore_data(string session, string _vm, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.remove_from_xenstore_data", new JArray(session, _vm ?? "", _key ?? ""), serializer); } public void vm_set_tags(string session, string _vm, string[] _tags) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_tags", new JArray(session, _vm ?? "", _tags == null ? new JArray() : JArray.FromObject(_tags)), serializer); } public void vm_add_tags(string session, string _vm, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_tags", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public void vm_remove_tags(string session, string _vm, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.remove_tags", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public void vm_set_blocked_operations(string session, string _vm, Dictionary _blocked_operations) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_blocked_operations", new JArray(session, _vm ?? "", _blocked_operations == null ? new JObject() : JObject.FromObject(_blocked_operations, serializer)), serializer); } public void vm_add_to_blocked_operations(string session, string _vm, vm_operations _key, string _value) { var converters = new List {new vm_operationsConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_to_blocked_operations", new JArray(session, _vm ?? "", _key.StringOf(), _value ?? ""), serializer); } public void vm_remove_from_blocked_operations(string session, string _vm, vm_operations _key) { var converters = new List {new vm_operationsConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.remove_from_blocked_operations", new JArray(session, _vm ?? "", _key.StringOf()), serializer); } public void vm_set_suspend_sr(string session, string _vm, string _suspend_sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_suspend_SR", new JArray(session, _vm ?? "", _suspend_sr ?? ""), serializer); } public void vm_set_hardware_platform_version(string session, string _vm, long _hardware_platform_version) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_hardware_platform_version", new JArray(session, _vm ?? "", _hardware_platform_version), serializer); } public XenRef vm_snapshot(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.snapshot", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public XenRef async_vm_snapshot(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.snapshot", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public XenRef vm_snapshot_with_quiesce(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.snapshot_with_quiesce", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public XenRef async_vm_snapshot_with_quiesce(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.snapshot_with_quiesce", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public XenRef vm_clone(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.clone", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public XenRef async_vm_clone(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.clone", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public XenRef vm_copy(string session, string _vm, string _new_name, string _sr) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.copy", new JArray(session, _vm ?? "", _new_name ?? "", _sr ?? ""), serializer); } public XenRef async_vm_copy(string session, string _vm, string _new_name, string _sr) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.copy", new JArray(session, _vm ?? "", _new_name ?? "", _sr ?? ""), serializer); } public void vm_revert(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.revert", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_revert(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.revert", new JArray(session, _vm ?? ""), serializer); } public XenRef vm_checkpoint(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.checkpoint", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public XenRef async_vm_checkpoint(string session, string _vm, string _new_name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.checkpoint", new JArray(session, _vm ?? "", _new_name ?? ""), serializer); } public void vm_provision(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.provision", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_provision(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.provision", new JArray(session, _vm ?? ""), serializer); } public void vm_start(string session, string _vm, bool _start_paused, bool _force) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.start", new JArray(session, _vm ?? "", _start_paused, _force), serializer); } public XenRef async_vm_start(string session, string _vm, bool _start_paused, bool _force) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.start", new JArray(session, _vm ?? "", _start_paused, _force), serializer); } public void vm_start_on(string session, string _vm, string _host, bool _start_paused, bool _force) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.start_on", new JArray(session, _vm ?? "", _host ?? "", _start_paused, _force), serializer); } public XenRef async_vm_start_on(string session, string _vm, string _host, bool _start_paused, bool _force) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.start_on", new JArray(session, _vm ?? "", _host ?? "", _start_paused, _force), serializer); } public void vm_pause(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.pause", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_pause(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.pause", new JArray(session, _vm ?? ""), serializer); } public void vm_unpause(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.unpause", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_unpause(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.unpause", new JArray(session, _vm ?? ""), serializer); } public void vm_clean_shutdown(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.clean_shutdown", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_clean_shutdown(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.clean_shutdown", new JArray(session, _vm ?? ""), serializer); } public void vm_shutdown(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.shutdown", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_shutdown(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.shutdown", new JArray(session, _vm ?? ""), serializer); } public void vm_clean_reboot(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.clean_reboot", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_clean_reboot(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.clean_reboot", new JArray(session, _vm ?? ""), serializer); } public void vm_hard_shutdown(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.hard_shutdown", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_hard_shutdown(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.hard_shutdown", new JArray(session, _vm ?? ""), serializer); } public void vm_power_state_reset(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.power_state_reset", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_power_state_reset(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.power_state_reset", new JArray(session, _vm ?? ""), serializer); } public void vm_hard_reboot(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.hard_reboot", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_hard_reboot(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.hard_reboot", new JArray(session, _vm ?? ""), serializer); } public void vm_suspend(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.suspend", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_suspend(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.suspend", new JArray(session, _vm ?? ""), serializer); } public void vm_resume(string session, string _vm, bool _start_paused, bool _force) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.resume", new JArray(session, _vm ?? "", _start_paused, _force), serializer); } public XenRef async_vm_resume(string session, string _vm, bool _start_paused, bool _force) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.resume", new JArray(session, _vm ?? "", _start_paused, _force), serializer); } public void vm_resume_on(string session, string _vm, string _host, bool _start_paused, bool _force) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.resume_on", new JArray(session, _vm ?? "", _host ?? "", _start_paused, _force), serializer); } public XenRef async_vm_resume_on(string session, string _vm, string _host, bool _start_paused, bool _force) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.resume_on", new JArray(session, _vm ?? "", _host ?? "", _start_paused, _force), serializer); } public void vm_pool_migrate(string session, string _vm, string _host, Dictionary _options) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.pool_migrate", new JArray(session, _vm ?? "", _host ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef async_vm_pool_migrate(string session, string _vm, string _host, Dictionary _options) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.pool_migrate", new JArray(session, _vm ?? "", _host ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public void vm_set_vcpus_number_live(string session, string _vm, long _nvcpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_VCPUs_number_live", new JArray(session, _vm ?? "", _nvcpu), serializer); } public XenRef async_vm_set_vcpus_number_live(string session, string _vm, long _nvcpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_VCPUs_number_live", new JArray(session, _vm ?? "", _nvcpu), serializer); } public void vm_add_to_vcpus_params_live(string session, string _vm, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.add_to_VCPUs_params_live", new JArray(session, _vm ?? "", _key ?? "", _value ?? ""), serializer); } public XenRef async_vm_add_to_vcpus_params_live(string session, string _vm, string _key, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.add_to_VCPUs_params_live", new JArray(session, _vm ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_set_ha_restart_priority(string session, string _vm, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_ha_restart_priority", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public void vm_set_ha_always_run(string session, string _vm, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_ha_always_run", new JArray(session, _vm ?? "", _value), serializer); } public long vm_compute_memory_overhead(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.compute_memory_overhead", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_compute_memory_overhead(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.compute_memory_overhead", new JArray(session, _vm ?? ""), serializer); } public void vm_set_memory_dynamic_max(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_dynamic_max", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_memory_dynamic_min(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_dynamic_min", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_memory_dynamic_range(string session, string _vm, long _min, long _max) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_dynamic_range", new JArray(session, _vm ?? "", _min, _max), serializer); } public XenRef async_vm_set_memory_dynamic_range(string session, string _vm, long _min, long _max) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_memory_dynamic_range", new JArray(session, _vm ?? "", _min, _max), serializer); } public void vm_set_memory_static_max(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_static_max", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_memory_static_min(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_static_min", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_memory_static_range(string session, string _vm, long _min, long _max) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_static_range", new JArray(session, _vm ?? "", _min, _max), serializer); } public XenRef async_vm_set_memory_static_range(string session, string _vm, long _min, long _max) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_memory_static_range", new JArray(session, _vm ?? "", _min, _max), serializer); } public void vm_set_memory_limits(string session, string _vm, long _static_min, long _static_max, long _dynamic_min, long _dynamic_max) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_limits", new JArray(session, _vm ?? "", _static_min, _static_max, _dynamic_min, _dynamic_max), serializer); } public XenRef async_vm_set_memory_limits(string session, string _vm, long _static_min, long _static_max, long _dynamic_min, long _dynamic_max) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_memory_limits", new JArray(session, _vm ?? "", _static_min, _static_max, _dynamic_min, _dynamic_max), serializer); } public void vm_set_memory(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory", new JArray(session, _vm ?? "", _value), serializer); } public XenRef async_vm_set_memory(string session, string _vm, long _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_memory", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_memory_target_live(string session, string _vm, long _target) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_memory_target_live", new JArray(session, _vm ?? "", _target), serializer); } public XenRef async_vm_set_memory_target_live(string session, string _vm, long _target) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_memory_target_live", new JArray(session, _vm ?? "", _target), serializer); } public void vm_wait_memory_target_live(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.wait_memory_target_live", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_wait_memory_target_live(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.wait_memory_target_live", new JArray(session, _vm ?? ""), serializer); } public bool vm_get_cooperative(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_cooperative", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_get_cooperative(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.get_cooperative", new JArray(session, _vm ?? ""), serializer); } public void vm_set_hvm_shadow_multiplier(string session, string _vm, double _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_HVM_shadow_multiplier", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_shadow_multiplier_live(string session, string _vm, double _multiplier) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_shadow_multiplier_live", new JArray(session, _vm ?? "", _multiplier), serializer); } public XenRef async_vm_set_shadow_multiplier_live(string session, string _vm, double _multiplier) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_shadow_multiplier_live", new JArray(session, _vm ?? "", _multiplier), serializer); } public void vm_set_vcpus_max(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_VCPUs_max", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_vcpus_at_startup(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_VCPUs_at_startup", new JArray(session, _vm ?? "", _value), serializer); } public void vm_send_sysrq(string session, string _vm, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.send_sysrq", new JArray(session, _vm ?? "", _key ?? ""), serializer); } public XenRef async_vm_send_sysrq(string session, string _vm, string _key) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.send_sysrq", new JArray(session, _vm ?? "", _key ?? ""), serializer); } public void vm_send_trigger(string session, string _vm, string _trigger) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.send_trigger", new JArray(session, _vm ?? "", _trigger ?? ""), serializer); } public XenRef async_vm_send_trigger(string session, string _vm, string _trigger) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.send_trigger", new JArray(session, _vm ?? "", _trigger ?? ""), serializer); } public long vm_maximise_memory(string session, string _vm, long _total, bool _approximate) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.maximise_memory", new JArray(session, _vm ?? "", _total, _approximate), serializer); } public XenRef async_vm_maximise_memory(string session, string _vm, long _total, bool _approximate) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.maximise_memory", new JArray(session, _vm ?? "", _total, _approximate), serializer); } public XenRef vm_migrate_send(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.migrate_send", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef async_vm_migrate_send(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.migrate_send", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef vm_migrate_send(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options, Dictionary, XenRef> _vgpu_map) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.migrate_send", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer), _vgpu_map == null ? new JObject() : JObject.FromObject(_vgpu_map, serializer)), serializer); } public XenRef async_vm_migrate_send(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options, Dictionary, XenRef> _vgpu_map) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.migrate_send", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer), _vgpu_map == null ? new JObject() : JObject.FromObject(_vgpu_map, serializer)), serializer); } public void vm_assert_can_migrate(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options) { var converters = new List {new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.assert_can_migrate", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef async_vm_assert_can_migrate(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.assert_can_migrate", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public void vm_assert_can_migrate(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options, Dictionary, XenRef> _vgpu_map) { var converters = new List {new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.assert_can_migrate", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer), _vgpu_map == null ? new JObject() : JObject.FromObject(_vgpu_map, serializer)), serializer); } public XenRef async_vm_assert_can_migrate(string session, string _vm, Dictionary _dest, bool _live, Dictionary, XenRef> _vdi_map, Dictionary, XenRef> _vif_map, Dictionary _options, Dictionary, XenRef> _vgpu_map) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter(), new XenRefXenRefMapConverter(), new StringStringMapConverter(), new XenRefXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.assert_can_migrate", new JArray(session, _vm ?? "", _dest == null ? new JObject() : JObject.FromObject(_dest, serializer), _live, _vdi_map == null ? new JObject() : JObject.FromObject(_vdi_map, serializer), _vif_map == null ? new JObject() : JObject.FromObject(_vif_map, serializer), _options == null ? new JObject() : JObject.FromObject(_options, serializer), _vgpu_map == null ? new JObject() : JObject.FromObject(_vgpu_map, serializer)), serializer); } public VM vm_get_boot_record(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_boot_record", new JArray(session, _vm ?? ""), serializer); } public List vm_get_data_sources(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.get_data_sources", new JArray(session, _vm ?? ""), serializer); } public void vm_record_data_source(string session, string _vm, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.record_data_source", new JArray(session, _vm ?? "", _data_source ?? ""), serializer); } public double vm_query_data_source(string session, string _vm, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.query_data_source", new JArray(session, _vm ?? "", _data_source ?? ""), serializer); } public void vm_forget_data_source_archives(string session, string _vm, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.forget_data_source_archives", new JArray(session, _vm ?? "", _data_source ?? ""), serializer); } public void vm_assert_operation_valid(string session, string _vm, vm_operations _op) { var converters = new List {new vm_operationsConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.assert_operation_valid", new JArray(session, _vm ?? "", _op.StringOf()), serializer); } public XenRef async_vm_assert_operation_valid(string session, string _vm, vm_operations _op) { var converters = new List {new XenRefConverter(), new vm_operationsConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.assert_operation_valid", new JArray(session, _vm ?? "", _op.StringOf()), serializer); } public void vm_update_allowed_operations(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.update_allowed_operations", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_update_allowed_operations(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.update_allowed_operations", new JArray(session, _vm ?? ""), serializer); } public string[] vm_get_allowed_vbd_devices(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_allowed_VBD_devices", new JArray(session, _vm ?? ""), serializer); } public string[] vm_get_allowed_vif_devices(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.get_allowed_VIF_devices", new JArray(session, _vm ?? ""), serializer); } public List> vm_get_possible_hosts(string session, string _vm) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_possible_hosts", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_get_possible_hosts(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.get_possible_hosts", new JArray(session, _vm ?? ""), serializer); } public void vm_assert_can_boot_here(string session, string _vm, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.assert_can_boot_here", new JArray(session, _vm ?? "", _host ?? ""), serializer); } public XenRef async_vm_assert_can_boot_here(string session, string _vm, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.assert_can_boot_here", new JArray(session, _vm ?? "", _host ?? ""), serializer); } public XenRef vm_create_new_blob(string session, string _vm, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.create_new_blob", new JArray(session, _vm ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef async_vm_create_new_blob(string session, string _vm, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.create_new_blob", new JArray(session, _vm ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef vm_create_new_blob(string session, string _vm, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.create_new_blob", new JArray(session, _vm ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public XenRef async_vm_create_new_blob(string session, string _vm, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.create_new_blob", new JArray(session, _vm ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public void vm_assert_agile(string session, string _vm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.assert_agile", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_assert_agile(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.assert_agile", new JArray(session, _vm ?? ""), serializer); } public Dictionary, string[]> vm_retrieve_wlb_recommendations(string session, string _vm) { var converters = new List {new XenRefStringSetMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, string[]>>("VM.retrieve_wlb_recommendations", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_retrieve_wlb_recommendations(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.retrieve_wlb_recommendations", new JArray(session, _vm ?? ""), serializer); } public void vm_set_bios_strings(string session, string _vm, Dictionary _value) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_bios_strings", new JArray(session, _vm ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public XenRef async_vm_set_bios_strings(string session, string _vm, Dictionary _value) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_bios_strings", new JArray(session, _vm ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public void vm_copy_bios_strings(string session, string _vm, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.copy_bios_strings", new JArray(session, _vm ?? "", _host ?? ""), serializer); } public XenRef async_vm_copy_bios_strings(string session, string _vm, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.copy_bios_strings", new JArray(session, _vm ?? "", _host ?? ""), serializer); } public void vm_set_protection_policy(string session, string _vm, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_protection_policy", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public void vm_set_snapshot_schedule(string session, string _vm, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_snapshot_schedule", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public void vm_set_start_delay(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_start_delay", new JArray(session, _vm ?? "", _value), serializer); } public XenRef async_vm_set_start_delay(string session, string _vm, long _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_start_delay", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_shutdown_delay(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_shutdown_delay", new JArray(session, _vm ?? "", _value), serializer); } public XenRef async_vm_set_shutdown_delay(string session, string _vm, long _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_shutdown_delay", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_order(string session, string _vm, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_order", new JArray(session, _vm ?? "", _value), serializer); } public XenRef async_vm_set_order(string session, string _vm, long _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_order", new JArray(session, _vm ?? "", _value), serializer); } public void vm_set_suspend_vdi(string session, string _vm, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_suspend_VDI", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public XenRef async_vm_set_suspend_vdi(string session, string _vm, string _value) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_suspend_VDI", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public void vm_assert_can_be_recovered(string session, string _vm, string _session_to) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.assert_can_be_recovered", new JArray(session, _vm ?? "", _session_to ?? ""), serializer); } public XenRef async_vm_assert_can_be_recovered(string session, string _vm, string _session_to) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.assert_can_be_recovered", new JArray(session, _vm ?? "", _session_to ?? ""), serializer); } public List> vm_get_srs_required_for_recovery(string session, string _vm, string _session_to) { var converters = new List {new XenRefListConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_SRs_required_for_recovery", new JArray(session, _vm ?? "", _session_to ?? ""), serializer); } public XenRef async_vm_get_srs_required_for_recovery(string session, string _vm, string _session_to) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.get_SRs_required_for_recovery", new JArray(session, _vm ?? "", _session_to ?? ""), serializer); } public void vm_recover(string session, string _vm, string _session_to, bool _force) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.recover", new JArray(session, _vm ?? "", _session_to ?? "", _force), serializer); } public XenRef async_vm_recover(string session, string _vm, string _session_to, bool _force) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.recover", new JArray(session, _vm ?? "", _session_to ?? "", _force), serializer); } public void vm_import_convert(string session, string _type, string _username, string _password, string _sr, Dictionary _remote_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.import_convert", new JArray(session, _type ?? "", _username ?? "", _password ?? "", _sr ?? "", _remote_config == null ? new JObject() : JObject.FromObject(_remote_config, serializer)), serializer); } public XenRef async_vm_import_convert(string session, string _type, string _username, string _password, string _sr, Dictionary _remote_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.import_convert", new JArray(session, _type ?? "", _username ?? "", _password ?? "", _sr ?? "", _remote_config == null ? new JObject() : JObject.FromObject(_remote_config, serializer)), serializer); } public void vm_set_appliance(string session, string _vm, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_appliance", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public XenRef async_vm_set_appliance(string session, string _vm, string _value) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_appliance", new JArray(session, _vm ?? "", _value ?? ""), serializer); } public Dictionary vm_query_services(string session, string _vm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM.query_services", new JArray(session, _vm ?? ""), serializer); } public XenRef async_vm_query_services(string session, string _vm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.query_services", new JArray(session, _vm ?? ""), serializer); } public string vm_call_plugin(string session, string _vm, string _plugin, string _fn, Dictionary _args) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM.call_plugin", new JArray(session, _vm ?? "", _plugin ?? "", _fn ?? "", _args == null ? new JObject() : JObject.FromObject(_args, serializer)), serializer); } public XenRef async_vm_call_plugin(string session, string _vm, string _plugin, string _fn, Dictionary _args) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.call_plugin", new JArray(session, _vm ?? "", _plugin ?? "", _fn ?? "", _args == null ? new JObject() : JObject.FromObject(_args, serializer)), serializer); } public void vm_set_has_vendor_device(string session, string _vm, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_has_vendor_device", new JArray(session, _vm ?? "", _value), serializer); } public XenRef async_vm_set_has_vendor_device(string session, string _vm, bool _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_has_vendor_device", new JArray(session, _vm ?? "", _value), serializer); } public List> vm_import(string session, string _url, string _sr, bool _full_restore, bool _force) { var converters = new List {new XenRefListConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.import", new JArray(session, _url ?? "", _sr ?? "", _full_restore, _force), serializer); } public XenRef async_vm_import(string session, string _url, string _sr, bool _full_restore, bool _force) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.import", new JArray(session, _url ?? "", _sr ?? "", _full_restore, _force), serializer); } public void vm_set_actions_after_crash(string session, string _vm, on_crash_behaviour _value) { var converters = new List {new on_crash_behaviourConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM.set_actions_after_crash", new JArray(session, _vm ?? "", _value.StringOf()), serializer); } public XenRef async_vm_set_actions_after_crash(string session, string _vm, on_crash_behaviour _value) { var converters = new List {new XenRefConverter(), new on_crash_behaviourConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM.set_actions_after_crash", new JArray(session, _vm ?? "", _value.StringOf()), serializer); } + public void vm_set_domain_type(string session, string _vm, domain_type _value) + { + var converters = new List {new domain_typeConverter()}; + var serializer = CreateSerializer(converters); + Rpc("VM.set_domain_type", new JArray(session, _vm ?? "", _value.StringOf()), serializer); + } + + public void vm_set_hvm_boot_policy(string session, string _vm, string _value) + { + var converters = new List {}; + var serializer = CreateSerializer(converters); + Rpc("VM.set_HVM_boot_policy", new JArray(session, _vm ?? "", _value ?? ""), serializer); + } + public List> vm_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM.get_all", new JArray(session), serializer); } public Dictionary, VM> vm_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VM>>("VM.get_all_records", new JArray(session), serializer); } public VM_metrics vm_metrics_get_record(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_record", new JArray(session, _vm_metrics ?? ""), serializer); } public XenRef vm_metrics_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_metrics.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vm_metrics_get_uuid(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_uuid", new JArray(session, _vm_metrics ?? ""), serializer); } public long vm_metrics_get_memory_actual(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_memory_actual", new JArray(session, _vm_metrics ?? ""), serializer); } public long vm_metrics_get_vcpus_number(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_VCPUs_number", new JArray(session, _vm_metrics ?? ""), serializer); } public Dictionary vm_metrics_get_vcpus_utilisation(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_metrics.get_VCPUs_utilisation", new JArray(session, _vm_metrics ?? ""), serializer); } public Dictionary vm_metrics_get_vcpus_cpu(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_metrics.get_VCPUs_CPU", new JArray(session, _vm_metrics ?? ""), serializer); } public Dictionary vm_metrics_get_vcpus_params(string session, string _vm_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_metrics.get_VCPUs_params", new JArray(session, _vm_metrics ?? ""), serializer); } public Dictionary vm_metrics_get_vcpus_flags(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_metrics.get_VCPUs_flags", new JArray(session, _vm_metrics ?? ""), serializer); } public string[] vm_metrics_get_state(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_state", new JArray(session, _vm_metrics ?? ""), serializer); } public DateTime vm_metrics_get_start_time(string session, string _vm_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_start_time", new JArray(session, _vm_metrics ?? ""), serializer); } public DateTime vm_metrics_get_install_time(string session, string _vm_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_install_time", new JArray(session, _vm_metrics ?? ""), serializer); } public DateTime vm_metrics_get_last_updated(string session, string _vm_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_last_updated", new JArray(session, _vm_metrics ?? ""), serializer); } public Dictionary vm_metrics_get_other_config(string session, string _vm_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_metrics.get_other_config", new JArray(session, _vm_metrics ?? ""), serializer); } public bool vm_metrics_get_hvm(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_hvm", new JArray(session, _vm_metrics ?? ""), serializer); } public bool vm_metrics_get_nested_virt(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_nested_virt", new JArray(session, _vm_metrics ?? ""), serializer); } public bool vm_metrics_get_nomigrate(string session, string _vm_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_metrics.get_nomigrate", new JArray(session, _vm_metrics ?? ""), serializer); } + public domain_type vm_metrics_get_current_domain_type(string session, string _vm_metrics) + { + var converters = new List {new domain_typeConverter()}; + var serializer = CreateSerializer(converters); + return Rpc("VM_metrics.get_current_domain_type", new JArray(session, _vm_metrics ?? ""), serializer); + } + public void vm_metrics_set_other_config(string session, string _vm_metrics, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_metrics.set_other_config", new JArray(session, _vm_metrics ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vm_metrics_add_to_other_config(string session, string _vm_metrics, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_metrics.add_to_other_config", new JArray(session, _vm_metrics ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_metrics_remove_from_other_config(string session, string _vm_metrics, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_metrics.remove_from_other_config", new JArray(session, _vm_metrics ?? "", _key ?? ""), serializer); } public List> vm_metrics_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM_metrics.get_all", new JArray(session), serializer); } public Dictionary, VM_metrics> vm_metrics_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VM_metrics>>("VM_metrics.get_all_records", new JArray(session), serializer); } public VM_guest_metrics vm_guest_metrics_get_record(string session, string _vm_guest_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_record", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public XenRef vm_guest_metrics_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vm_guest_metrics_get_uuid(string session, string _vm_guest_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_uuid", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public Dictionary vm_guest_metrics_get_os_version(string session, string _vm_guest_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_os_version", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public Dictionary vm_guest_metrics_get_pv_drivers_version(string session, string _vm_guest_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_PV_drivers_version", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public bool vm_guest_metrics_get_pv_drivers_up_to_date(string session, string _vm_guest_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_PV_drivers_up_to_date", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public Dictionary vm_guest_metrics_get_memory(string session, string _vm_guest_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_memory", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public Dictionary vm_guest_metrics_get_disks(string session, string _vm_guest_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_disks", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public Dictionary vm_guest_metrics_get_networks(string session, string _vm_guest_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_networks", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public Dictionary vm_guest_metrics_get_other(string session, string _vm_guest_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_other", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public DateTime vm_guest_metrics_get_last_updated(string session, string _vm_guest_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_last_updated", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public Dictionary vm_guest_metrics_get_other_config(string session, string _vm_guest_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_guest_metrics.get_other_config", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public bool vm_guest_metrics_get_live(string session, string _vm_guest_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_live", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public tristate_type vm_guest_metrics_get_can_use_hotplug_vbd(string session, string _vm_guest_metrics) { var converters = new List {new tristate_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_can_use_hotplug_vbd", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public tristate_type vm_guest_metrics_get_can_use_hotplug_vif(string session, string _vm_guest_metrics) { var converters = new List {new tristate_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_can_use_hotplug_vif", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public bool vm_guest_metrics_get_pv_drivers_detected(string session, string _vm_guest_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_guest_metrics.get_PV_drivers_detected", new JArray(session, _vm_guest_metrics ?? ""), serializer); } public void vm_guest_metrics_set_other_config(string session, string _vm_guest_metrics, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_guest_metrics.set_other_config", new JArray(session, _vm_guest_metrics ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vm_guest_metrics_add_to_other_config(string session, string _vm_guest_metrics, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_guest_metrics.add_to_other_config", new JArray(session, _vm_guest_metrics ?? "", _key ?? "", _value ?? ""), serializer); } public void vm_guest_metrics_remove_from_other_config(string session, string _vm_guest_metrics, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_guest_metrics.remove_from_other_config", new JArray(session, _vm_guest_metrics ?? "", _key ?? ""), serializer); } public List> vm_guest_metrics_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM_guest_metrics.get_all", new JArray(session), serializer); } public Dictionary, VM_guest_metrics> vm_guest_metrics_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VM_guest_metrics>>("VM_guest_metrics.get_all_records", new JArray(session), serializer); } public VMPP vmpp_get_record(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_record", new JArray(session, _vmpp ?? ""), serializer); } public XenRef vmpp_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMPP.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vmpp_create(string session, VMPP _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMPP.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vmpp_create(string session, VMPP _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VMPP.create", new JArray(session, _record.ToJObject()), serializer); } public void vmpp_destroy(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.destroy", new JArray(session, _vmpp ?? ""), serializer); } public XenRef async_vmpp_destroy(string session, string _vmpp) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VMPP.destroy", new JArray(session, _vmpp ?? ""), serializer); } public List> vmpp_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VMPP.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string vmpp_get_uuid(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_uuid", new JArray(session, _vmpp ?? ""), serializer); } public string vmpp_get_name_label(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_name_label", new JArray(session, _vmpp ?? ""), serializer); } public string vmpp_get_name_description(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_name_description", new JArray(session, _vmpp ?? ""), serializer); } public bool vmpp_get_is_policy_enabled(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_is_policy_enabled", new JArray(session, _vmpp ?? ""), serializer); } public vmpp_backup_type vmpp_get_backup_type(string session, string _vmpp) { var converters = new List {new vmpp_backup_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_backup_type", new JArray(session, _vmpp ?? ""), serializer); } public long vmpp_get_backup_retention_value(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_backup_retention_value", new JArray(session, _vmpp ?? ""), serializer); } public vmpp_backup_frequency vmpp_get_backup_frequency(string session, string _vmpp) { var converters = new List {new vmpp_backup_frequencyConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_backup_frequency", new JArray(session, _vmpp ?? ""), serializer); } public Dictionary vmpp_get_backup_schedule(string session, string _vmpp) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMPP.get_backup_schedule", new JArray(session, _vmpp ?? ""), serializer); } public bool vmpp_get_is_backup_running(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_is_backup_running", new JArray(session, _vmpp ?? ""), serializer); } public DateTime vmpp_get_backup_last_run_time(string session, string _vmpp) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_backup_last_run_time", new JArray(session, _vmpp ?? ""), serializer); } public vmpp_archive_target_type vmpp_get_archive_target_type(string session, string _vmpp) { var converters = new List {new vmpp_archive_target_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_archive_target_type", new JArray(session, _vmpp ?? ""), serializer); } public Dictionary vmpp_get_archive_target_config(string session, string _vmpp) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMPP.get_archive_target_config", new JArray(session, _vmpp ?? ""), serializer); } public vmpp_archive_frequency vmpp_get_archive_frequency(string session, string _vmpp) { var converters = new List {new vmpp_archive_frequencyConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_archive_frequency", new JArray(session, _vmpp ?? ""), serializer); } public Dictionary vmpp_get_archive_schedule(string session, string _vmpp) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMPP.get_archive_schedule", new JArray(session, _vmpp ?? ""), serializer); } public bool vmpp_get_is_archive_running(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_is_archive_running", new JArray(session, _vmpp ?? ""), serializer); } public DateTime vmpp_get_archive_last_run_time(string session, string _vmpp) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_archive_last_run_time", new JArray(session, _vmpp ?? ""), serializer); } public List> vmpp_get_vms(string session, string _vmpp) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VMPP.get_VMs", new JArray(session, _vmpp ?? ""), serializer); } public bool vmpp_get_is_alarm_enabled(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_is_alarm_enabled", new JArray(session, _vmpp ?? ""), serializer); } public Dictionary vmpp_get_alarm_config(string session, string _vmpp) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMPP.get_alarm_config", new JArray(session, _vmpp ?? ""), serializer); } public string[] vmpp_get_recent_alerts(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_recent_alerts", new JArray(session, _vmpp ?? ""), serializer); } public void vmpp_set_name_label(string session, string _vmpp, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_name_label", new JArray(session, _vmpp ?? "", _label ?? ""), serializer); } public void vmpp_set_name_description(string session, string _vmpp, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_name_description", new JArray(session, _vmpp ?? "", _description ?? ""), serializer); } public void vmpp_set_is_policy_enabled(string session, string _vmpp, bool _is_policy_enabled) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_is_policy_enabled", new JArray(session, _vmpp ?? "", _is_policy_enabled), serializer); } public void vmpp_set_backup_type(string session, string _vmpp, vmpp_backup_type _backup_type) { var converters = new List {new vmpp_backup_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_backup_type", new JArray(session, _vmpp ?? "", _backup_type.StringOf()), serializer); } public string vmpp_protect_now(string session, string _vmpp) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.protect_now", new JArray(session, _vmpp ?? ""), serializer); } public string vmpp_archive_now(string session, string _snapshot) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.archive_now", new JArray(session, _snapshot ?? ""), serializer); } public string[] vmpp_get_alerts(string session, string _vmpp, long _hours_from_now) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMPP.get_alerts", new JArray(session, _vmpp ?? "", _hours_from_now), serializer); } public void vmpp_set_backup_retention_value(string session, string _vmpp, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_backup_retention_value", new JArray(session, _vmpp ?? "", _value), serializer); } public void vmpp_set_backup_frequency(string session, string _vmpp, vmpp_backup_frequency _value) { var converters = new List {new vmpp_backup_frequencyConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_backup_frequency", new JArray(session, _vmpp ?? "", _value.StringOf()), serializer); } public void vmpp_set_backup_schedule(string session, string _vmpp, Dictionary _value) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_backup_schedule", new JArray(session, _vmpp ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public void vmpp_set_archive_frequency(string session, string _vmpp, vmpp_archive_frequency _value) { var converters = new List {new vmpp_archive_frequencyConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_archive_frequency", new JArray(session, _vmpp ?? "", _value.StringOf()), serializer); } public void vmpp_set_archive_schedule(string session, string _vmpp, Dictionary _value) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_archive_schedule", new JArray(session, _vmpp ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public void vmpp_set_archive_target_type(string session, string _vmpp, vmpp_archive_target_type _value) { var converters = new List {new vmpp_archive_target_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_archive_target_type", new JArray(session, _vmpp ?? "", _value.StringOf()), serializer); } public void vmpp_set_archive_target_config(string session, string _vmpp, Dictionary _value) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_archive_target_config", new JArray(session, _vmpp ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public void vmpp_set_is_alarm_enabled(string session, string _vmpp, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_is_alarm_enabled", new JArray(session, _vmpp ?? "", _value), serializer); } public void vmpp_set_alarm_config(string session, string _vmpp, Dictionary _value) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_alarm_config", new JArray(session, _vmpp ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public void vmpp_add_to_backup_schedule(string session, string _vmpp, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.add_to_backup_schedule", new JArray(session, _vmpp ?? "", _key ?? "", _value ?? ""), serializer); } public void vmpp_add_to_archive_target_config(string session, string _vmpp, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.add_to_archive_target_config", new JArray(session, _vmpp ?? "", _key ?? "", _value ?? ""), serializer); } public void vmpp_add_to_archive_schedule(string session, string _vmpp, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.add_to_archive_schedule", new JArray(session, _vmpp ?? "", _key ?? "", _value ?? ""), serializer); } public void vmpp_add_to_alarm_config(string session, string _vmpp, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.add_to_alarm_config", new JArray(session, _vmpp ?? "", _key ?? "", _value ?? ""), serializer); } public void vmpp_remove_from_backup_schedule(string session, string _vmpp, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.remove_from_backup_schedule", new JArray(session, _vmpp ?? "", _key ?? ""), serializer); } public void vmpp_remove_from_archive_target_config(string session, string _vmpp, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.remove_from_archive_target_config", new JArray(session, _vmpp ?? "", _key ?? ""), serializer); } public void vmpp_remove_from_archive_schedule(string session, string _vmpp, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.remove_from_archive_schedule", new JArray(session, _vmpp ?? "", _key ?? ""), serializer); } public void vmpp_remove_from_alarm_config(string session, string _vmpp, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.remove_from_alarm_config", new JArray(session, _vmpp ?? "", _key ?? ""), serializer); } public void vmpp_set_backup_last_run_time(string session, string _vmpp, DateTime _value) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_backup_last_run_time", new JArray(session, _vmpp ?? "", _value), serializer); } public void vmpp_set_archive_last_run_time(string session, string _vmpp, DateTime _value) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMPP.set_archive_last_run_time", new JArray(session, _vmpp ?? "", _value), serializer); } public List> vmpp_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VMPP.get_all", new JArray(session), serializer); } public Dictionary, VMPP> vmpp_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VMPP>>("VMPP.get_all_records", new JArray(session), serializer); } public VMSS vmss_get_record(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_record", new JArray(session, _vmss ?? ""), serializer); } public XenRef vmss_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMSS.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vmss_create(string session, VMSS _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMSS.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vmss_create(string session, VMSS _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VMSS.create", new JArray(session, _record.ToJObject()), serializer); } public void vmss_destroy(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.destroy", new JArray(session, _vmss ?? ""), serializer); } public XenRef async_vmss_destroy(string session, string _vmss) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VMSS.destroy", new JArray(session, _vmss ?? ""), serializer); } public List> vmss_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VMSS.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string vmss_get_uuid(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_uuid", new JArray(session, _vmss ?? ""), serializer); } public string vmss_get_name_label(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_name_label", new JArray(session, _vmss ?? ""), serializer); } public string vmss_get_name_description(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_name_description", new JArray(session, _vmss ?? ""), serializer); } public bool vmss_get_enabled(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_enabled", new JArray(session, _vmss ?? ""), serializer); } public vmss_type vmss_get_type(string session, string _vmss) { var converters = new List {new vmss_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_type", new JArray(session, _vmss ?? ""), serializer); } public long vmss_get_retained_snapshots(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_retained_snapshots", new JArray(session, _vmss ?? ""), serializer); } public vmss_frequency vmss_get_frequency(string session, string _vmss) { var converters = new List {new vmss_frequencyConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_frequency", new JArray(session, _vmss ?? ""), serializer); } public Dictionary vmss_get_schedule(string session, string _vmss) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VMSS.get_schedule", new JArray(session, _vmss ?? ""), serializer); } public DateTime vmss_get_last_run_time(string session, string _vmss) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.get_last_run_time", new JArray(session, _vmss ?? ""), serializer); } public List> vmss_get_vms(string session, string _vmss) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VMSS.get_VMs", new JArray(session, _vmss ?? ""), serializer); } public void vmss_set_name_label(string session, string _vmss, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_name_label", new JArray(session, _vmss ?? "", _label ?? ""), serializer); } public void vmss_set_name_description(string session, string _vmss, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_name_description", new JArray(session, _vmss ?? "", _description ?? ""), serializer); } public void vmss_set_enabled(string session, string _vmss, bool _enabled) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_enabled", new JArray(session, _vmss ?? "", _enabled), serializer); } public string vmss_snapshot_now(string session, string _vmss) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VMSS.snapshot_now", new JArray(session, _vmss ?? ""), serializer); } public void vmss_set_retained_snapshots(string session, string _vmss, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_retained_snapshots", new JArray(session, _vmss ?? "", _value), serializer); } public void vmss_set_frequency(string session, string _vmss, vmss_frequency _value) { var converters = new List {new vmss_frequencyConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_frequency", new JArray(session, _vmss ?? "", _value.StringOf()), serializer); } public void vmss_set_schedule(string session, string _vmss, Dictionary _value) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_schedule", new JArray(session, _vmss ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public void vmss_add_to_schedule(string session, string _vmss, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.add_to_schedule", new JArray(session, _vmss ?? "", _key ?? "", _value ?? ""), serializer); } public void vmss_remove_from_schedule(string session, string _vmss, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.remove_from_schedule", new JArray(session, _vmss ?? "", _key ?? ""), serializer); } public void vmss_set_last_run_time(string session, string _vmss, DateTime _value) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_last_run_time", new JArray(session, _vmss ?? "", _value), serializer); } public void vmss_set_type(string session, string _vmss, vmss_type _value) { var converters = new List {new vmss_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VMSS.set_type", new JArray(session, _vmss ?? "", _value.StringOf()), serializer); } public List> vmss_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VMSS.get_all", new JArray(session), serializer); } public Dictionary, VMSS> vmss_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VMSS>>("VMSS.get_all_records", new JArray(session), serializer); } public VM_appliance vm_appliance_get_record(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_appliance.get_record", new JArray(session, _vm_appliance ?? ""), serializer); } public XenRef vm_appliance_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_appliance.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vm_appliance_create(string session, VM_appliance _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_appliance.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vm_appliance_create(string session, VM_appliance _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.create", new JArray(session, _record.ToJObject()), serializer); } public void vm_appliance_destroy(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.destroy", new JArray(session, _vm_appliance ?? ""), serializer); } public XenRef async_vm_appliance_destroy(string session, string _vm_appliance) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.destroy", new JArray(session, _vm_appliance ?? ""), serializer); } public List> vm_appliance_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM_appliance.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string vm_appliance_get_uuid(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_appliance.get_uuid", new JArray(session, _vm_appliance ?? ""), serializer); } public string vm_appliance_get_name_label(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_appliance.get_name_label", new JArray(session, _vm_appliance ?? ""), serializer); } public string vm_appliance_get_name_description(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VM_appliance.get_name_description", new JArray(session, _vm_appliance ?? ""), serializer); } public List vm_appliance_get_allowed_operations(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_appliance.get_allowed_operations", new JArray(session, _vm_appliance ?? ""), serializer); } public Dictionary vm_appliance_get_current_operations(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VM_appliance.get_current_operations", new JArray(session, _vm_appliance ?? ""), serializer); } public List> vm_appliance_get_vms(string session, string _vm_appliance) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM_appliance.get_VMs", new JArray(session, _vm_appliance ?? ""), serializer); } public void vm_appliance_set_name_label(string session, string _vm_appliance, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.set_name_label", new JArray(session, _vm_appliance ?? "", _label ?? ""), serializer); } public void vm_appliance_set_name_description(string session, string _vm_appliance, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.set_name_description", new JArray(session, _vm_appliance ?? "", _description ?? ""), serializer); } public void vm_appliance_start(string session, string _vm_appliance, bool _paused) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.start", new JArray(session, _vm_appliance ?? "", _paused), serializer); } public XenRef async_vm_appliance_start(string session, string _vm_appliance, bool _paused) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.start", new JArray(session, _vm_appliance ?? "", _paused), serializer); } public void vm_appliance_clean_shutdown(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.clean_shutdown", new JArray(session, _vm_appliance ?? ""), serializer); } public XenRef async_vm_appliance_clean_shutdown(string session, string _vm_appliance) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.clean_shutdown", new JArray(session, _vm_appliance ?? ""), serializer); } public void vm_appliance_hard_shutdown(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.hard_shutdown", new JArray(session, _vm_appliance ?? ""), serializer); } public XenRef async_vm_appliance_hard_shutdown(string session, string _vm_appliance) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.hard_shutdown", new JArray(session, _vm_appliance ?? ""), serializer); } public void vm_appliance_shutdown(string session, string _vm_appliance) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.shutdown", new JArray(session, _vm_appliance ?? ""), serializer); } public XenRef async_vm_appliance_shutdown(string session, string _vm_appliance) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.shutdown", new JArray(session, _vm_appliance ?? ""), serializer); } public void vm_appliance_assert_can_be_recovered(string session, string _vm_appliance, string _session_to) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.assert_can_be_recovered", new JArray(session, _vm_appliance ?? "", _session_to ?? ""), serializer); } public XenRef async_vm_appliance_assert_can_be_recovered(string session, string _vm_appliance, string _session_to) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.assert_can_be_recovered", new JArray(session, _vm_appliance ?? "", _session_to ?? ""), serializer); } public List> vm_appliance_get_srs_required_for_recovery(string session, string _vm_appliance, string _session_to) { var converters = new List {new XenRefListConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM_appliance.get_SRs_required_for_recovery", new JArray(session, _vm_appliance ?? "", _session_to ?? ""), serializer); } public XenRef async_vm_appliance_get_srs_required_for_recovery(string session, string _vm_appliance, string _session_to) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.get_SRs_required_for_recovery", new JArray(session, _vm_appliance ?? "", _session_to ?? ""), serializer); } public void vm_appliance_recover(string session, string _vm_appliance, string _session_to, bool _force) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VM_appliance.recover", new JArray(session, _vm_appliance ?? "", _session_to ?? "", _force), serializer); } public XenRef async_vm_appliance_recover(string session, string _vm_appliance, string _session_to, bool _force) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VM_appliance.recover", new JArray(session, _vm_appliance ?? "", _session_to ?? "", _force), serializer); } public List> vm_appliance_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VM_appliance.get_all", new JArray(session), serializer); } public Dictionary, VM_appliance> vm_appliance_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VM_appliance>>("VM_appliance.get_all_records", new JArray(session), serializer); } public DR_task dr_task_get_record(string session, string _dr_task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("DR_task.get_record", new JArray(session, _dr_task ?? ""), serializer); } public XenRef dr_task_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("DR_task.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string dr_task_get_uuid(string session, string _dr_task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("DR_task.get_uuid", new JArray(session, _dr_task ?? ""), serializer); } public List> dr_task_get_introduced_srs(string session, string _dr_task) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("DR_task.get_introduced_SRs", new JArray(session, _dr_task ?? ""), serializer); } public XenRef dr_task_create(string session, string _type, Dictionary _device_config, string[] _whitelist) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("DR_task.create", new JArray(session, _type ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _whitelist == null ? new JArray() : JArray.FromObject(_whitelist)), serializer); } public XenRef async_dr_task_create(string session, string _type, Dictionary _device_config, string[] _whitelist) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.DR_task.create", new JArray(session, _type ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _whitelist == null ? new JArray() : JArray.FromObject(_whitelist)), serializer); } public void dr_task_destroy(string session, string _dr_task) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("DR_task.destroy", new JArray(session, _dr_task ?? ""), serializer); } public XenRef async_dr_task_destroy(string session, string _dr_task) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.DR_task.destroy", new JArray(session, _dr_task ?? ""), serializer); } public List> dr_task_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("DR_task.get_all", new JArray(session), serializer); } public Dictionary, DR_task> dr_task_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, DR_task>>("DR_task.get_all_records", new JArray(session), serializer); } public Host host_get_record(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_record", new JArray(session, _host ?? ""), serializer); } public XenRef host_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> host_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string host_get_uuid(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_uuid", new JArray(session, _host ?? ""), serializer); } public string host_get_name_label(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_name_label", new JArray(session, _host ?? ""), serializer); } public string host_get_name_description(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_name_description", new JArray(session, _host ?? ""), serializer); } public long host_get_memory_overhead(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_memory_overhead", new JArray(session, _host ?? ""), serializer); } public List host_get_allowed_operations(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_allowed_operations", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_current_operations(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_current_operations", new JArray(session, _host ?? ""), serializer); } public long host_get_api_version_major(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_API_version_major", new JArray(session, _host ?? ""), serializer); } public long host_get_api_version_minor(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_API_version_minor", new JArray(session, _host ?? ""), serializer); } public string host_get_api_version_vendor(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_API_version_vendor", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_api_version_vendor_implementation(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_API_version_vendor_implementation", new JArray(session, _host ?? ""), serializer); } public bool host_get_enabled(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_enabled", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_software_version(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_software_version", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_other_config(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_other_config", new JArray(session, _host ?? ""), serializer); } public string[] host_get_capabilities(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_capabilities", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_cpu_configuration(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_cpu_configuration", new JArray(session, _host ?? ""), serializer); } public string host_get_sched_policy(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_sched_policy", new JArray(session, _host ?? ""), serializer); } public string[] host_get_supported_bootloaders(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_supported_bootloaders", new JArray(session, _host ?? ""), serializer); } public List> host_get_resident_vms(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_resident_VMs", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_logging(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_logging", new JArray(session, _host ?? ""), serializer); } public List> host_get_pifs(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_PIFs", new JArray(session, _host ?? ""), serializer); } public XenRef host_get_suspend_image_sr(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_suspend_image_sr", new JArray(session, _host ?? ""), serializer); } public XenRef host_get_crash_dump_sr(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_crash_dump_sr", new JArray(session, _host ?? ""), serializer); } public List> host_get_crashdumps(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_crashdumps", new JArray(session, _host ?? ""), serializer); } public List> host_get_patches(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_patches", new JArray(session, _host ?? ""), serializer); } public List> host_get_updates(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_updates", new JArray(session, _host ?? ""), serializer); } public List> host_get_pbds(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_PBDs", new JArray(session, _host ?? ""), serializer); } public List> host_get_host_cpus(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_host_CPUs", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_cpu_info(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_cpu_info", new JArray(session, _host ?? ""), serializer); } public string host_get_hostname(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_hostname", new JArray(session, _host ?? ""), serializer); } public string host_get_address(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_address", new JArray(session, _host ?? ""), serializer); } public XenRef host_get_metrics(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_metrics", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_license_params(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_license_params", new JArray(session, _host ?? ""), serializer); } public string[] host_get_ha_statefiles(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_ha_statefiles", new JArray(session, _host ?? ""), serializer); } public string[] host_get_ha_network_peers(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_ha_network_peers", new JArray(session, _host ?? ""), serializer); } public Dictionary> host_get_blobs(string session, string _host) { var converters = new List {new StringXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_blobs", new JArray(session, _host ?? ""), serializer); } public string[] host_get_tags(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_tags", new JArray(session, _host ?? ""), serializer); } public string host_get_external_auth_type(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_external_auth_type", new JArray(session, _host ?? ""), serializer); } public string host_get_external_auth_service_name(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_external_auth_service_name", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_external_auth_configuration(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_external_auth_configuration", new JArray(session, _host ?? ""), serializer); } public string host_get_edition(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_edition", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_license_server(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_license_server", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_bios_strings(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_bios_strings", new JArray(session, _host ?? ""), serializer); } public string host_get_power_on_mode(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_power_on_mode", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_power_on_config(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_power_on_config", new JArray(session, _host ?? ""), serializer); } public XenRef host_get_local_cache_sr(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_local_cache_sr", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_chipset_info(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_chipset_info", new JArray(session, _host ?? ""), serializer); } public List> host_get_pcis(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_PCIs", new JArray(session, _host ?? ""), serializer); } public List> host_get_pgpus(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_PGPUs", new JArray(session, _host ?? ""), serializer); } public List> host_get_pusbs(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_PUSBs", new JArray(session, _host ?? ""), serializer); } public bool host_get_ssl_legacy(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_ssl_legacy", new JArray(session, _host ?? ""), serializer); } public Dictionary host_get_guest_vcpus_params(string session, string _host) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_guest_VCPUs_params", new JArray(session, _host ?? ""), serializer); } public host_display host_get_display(string session, string _host) { var converters = new List {new host_displayConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_display", new JArray(session, _host ?? ""), serializer); } public long[] host_get_virtual_hardware_platform_versions(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_virtual_hardware_platform_versions", new JArray(session, _host ?? ""), serializer); } public XenRef host_get_control_domain(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_control_domain", new JArray(session, _host ?? ""), serializer); } public List> host_get_updates_requiring_reboot(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_updates_requiring_reboot", new JArray(session, _host ?? ""), serializer); } public List> host_get_features(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_features", new JArray(session, _host ?? ""), serializer); } public string host_get_iscsi_iqn(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_iscsi_iqn", new JArray(session, _host ?? ""), serializer); } public bool host_get_multipathing(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_multipathing", new JArray(session, _host ?? ""), serializer); } public void host_set_name_label(string session, string _host, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_name_label", new JArray(session, _host ?? "", _label ?? ""), serializer); } public void host_set_name_description(string session, string _host, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_name_description", new JArray(session, _host ?? "", _description ?? ""), serializer); } public void host_set_other_config(string session, string _host, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_other_config", new JArray(session, _host ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void host_add_to_other_config(string session, string _host, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.add_to_other_config", new JArray(session, _host ?? "", _key ?? "", _value ?? ""), serializer); } public void host_remove_from_other_config(string session, string _host, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.remove_from_other_config", new JArray(session, _host ?? "", _key ?? ""), serializer); } public void host_set_logging(string session, string _host, Dictionary _logging) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_logging", new JArray(session, _host ?? "", _logging == null ? new JObject() : JObject.FromObject(_logging, serializer)), serializer); } public void host_add_to_logging(string session, string _host, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.add_to_logging", new JArray(session, _host ?? "", _key ?? "", _value ?? ""), serializer); } public void host_remove_from_logging(string session, string _host, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.remove_from_logging", new JArray(session, _host ?? "", _key ?? ""), serializer); } public void host_set_suspend_image_sr(string session, string _host, string _suspend_image_sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_suspend_image_sr", new JArray(session, _host ?? "", _suspend_image_sr ?? ""), serializer); } public void host_set_crash_dump_sr(string session, string _host, string _crash_dump_sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_crash_dump_sr", new JArray(session, _host ?? "", _crash_dump_sr ?? ""), serializer); } public void host_set_hostname(string session, string _host, string _hostname) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_hostname", new JArray(session, _host ?? "", _hostname ?? ""), serializer); } public void host_set_address(string session, string _host, string _address) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_address", new JArray(session, _host ?? "", _address ?? ""), serializer); } public void host_set_tags(string session, string _host, string[] _tags) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_tags", new JArray(session, _host ?? "", _tags == null ? new JArray() : JArray.FromObject(_tags)), serializer); } public void host_add_tags(string session, string _host, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.add_tags", new JArray(session, _host ?? "", _value ?? ""), serializer); } public void host_remove_tags(string session, string _host, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.remove_tags", new JArray(session, _host ?? "", _value ?? ""), serializer); } public void host_set_license_server(string session, string _host, Dictionary _license_server) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_license_server", new JArray(session, _host ?? "", _license_server == null ? new JObject() : JObject.FromObject(_license_server, serializer)), serializer); } public void host_add_to_license_server(string session, string _host, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.add_to_license_server", new JArray(session, _host ?? "", _key ?? "", _value ?? ""), serializer); } public void host_remove_from_license_server(string session, string _host, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.remove_from_license_server", new JArray(session, _host ?? "", _key ?? ""), serializer); } public void host_set_guest_vcpus_params(string session, string _host, Dictionary _guest_vcpus_params) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_guest_VCPUs_params", new JArray(session, _host ?? "", _guest_vcpus_params == null ? new JObject() : JObject.FromObject(_guest_vcpus_params, serializer)), serializer); } public void host_add_to_guest_vcpus_params(string session, string _host, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.add_to_guest_VCPUs_params", new JArray(session, _host ?? "", _key ?? "", _value ?? ""), serializer); } public void host_remove_from_guest_vcpus_params(string session, string _host, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.remove_from_guest_VCPUs_params", new JArray(session, _host ?? "", _key ?? ""), serializer); } public void host_set_display(string session, string _host, host_display _display) { var converters = new List {new host_displayConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_display", new JArray(session, _host ?? "", _display.StringOf()), serializer); } public void host_disable(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.disable", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_disable(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.disable", new JArray(session, _host ?? ""), serializer); } public void host_enable(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.enable", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_enable(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.enable", new JArray(session, _host ?? ""), serializer); } public void host_shutdown(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.shutdown", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_shutdown(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.shutdown", new JArray(session, _host ?? ""), serializer); } public void host_reboot(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.reboot", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_reboot(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.reboot", new JArray(session, _host ?? ""), serializer); } public string host_dmesg(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.dmesg", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_dmesg(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.dmesg", new JArray(session, _host ?? ""), serializer); } public string host_dmesg_clear(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.dmesg_clear", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_dmesg_clear(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.dmesg_clear", new JArray(session, _host ?? ""), serializer); } public string host_get_log(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_log", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_get_log(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.get_log", new JArray(session, _host ?? ""), serializer); } public void host_send_debug_keys(string session, string _host, string _keys) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.send_debug_keys", new JArray(session, _host ?? "", _keys ?? ""), serializer); } public XenRef async_host_send_debug_keys(string session, string _host, string _keys) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.send_debug_keys", new JArray(session, _host ?? "", _keys ?? ""), serializer); } public void host_bugreport_upload(string session, string _host, string _url, Dictionary _options) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.bugreport_upload", new JArray(session, _host ?? "", _url ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef async_host_bugreport_upload(string session, string _host, string _url, Dictionary _options) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.bugreport_upload", new JArray(session, _host ?? "", _url ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public string[] host_list_methods(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.list_methods", new JArray(session), serializer); } public void host_license_apply(string session, string _host, string _contents) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.license_apply", new JArray(session, _host ?? "", _contents ?? ""), serializer); } public XenRef async_host_license_apply(string session, string _host, string _contents) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.license_apply", new JArray(session, _host ?? "", _contents ?? ""), serializer); } public void host_license_add(string session, string _host, string _contents) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.license_add", new JArray(session, _host ?? "", _contents ?? ""), serializer); } public XenRef async_host_license_add(string session, string _host, string _contents) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.license_add", new JArray(session, _host ?? "", _contents ?? ""), serializer); } public void host_license_remove(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.license_remove", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_license_remove(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.license_remove", new JArray(session, _host ?? ""), serializer); } public void host_destroy(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.destroy", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_destroy(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.destroy", new JArray(session, _host ?? ""), serializer); } public void host_power_on(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.power_on", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_power_on(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.power_on", new JArray(session, _host ?? ""), serializer); } public void host_emergency_ha_disable(string session, bool _soft) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.emergency_ha_disable", new JArray(session, _soft), serializer); } public List host_get_data_sources(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_data_sources", new JArray(session, _host ?? ""), serializer); } public void host_record_data_source(string session, string _host, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.record_data_source", new JArray(session, _host ?? "", _data_source ?? ""), serializer); } public double host_query_data_source(string session, string _host, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.query_data_source", new JArray(session, _host ?? "", _data_source ?? ""), serializer); } public void host_forget_data_source_archives(string session, string _host, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.forget_data_source_archives", new JArray(session, _host ?? "", _data_source ?? ""), serializer); } public void host_assert_can_evacuate(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.assert_can_evacuate", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_assert_can_evacuate(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.assert_can_evacuate", new JArray(session, _host ?? ""), serializer); } public Dictionary, string[]> host_get_vms_which_prevent_evacuation(string session, string _host) { var converters = new List {new XenRefStringSetMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, string[]>>("host.get_vms_which_prevent_evacuation", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_get_vms_which_prevent_evacuation(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.get_vms_which_prevent_evacuation", new JArray(session, _host ?? ""), serializer); } public List> host_get_uncooperative_resident_vms(string session, string _host) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_uncooperative_resident_VMs", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_get_uncooperative_resident_vms(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.get_uncooperative_resident_VMs", new JArray(session, _host ?? ""), serializer); } public void host_evacuate(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.evacuate", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_evacuate(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.evacuate", new JArray(session, _host ?? ""), serializer); } public void host_syslog_reconfigure(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.syslog_reconfigure", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_syslog_reconfigure(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.syslog_reconfigure", new JArray(session, _host ?? ""), serializer); } public void host_management_reconfigure(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.management_reconfigure", new JArray(session, _pif ?? ""), serializer); } public XenRef async_host_management_reconfigure(string session, string _pif) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.management_reconfigure", new JArray(session, _pif ?? ""), serializer); } public void host_local_management_reconfigure(string session, string _interface) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.local_management_reconfigure", new JArray(session, _interface ?? ""), serializer); } public void host_management_disable(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.management_disable", new JArray(session), serializer); } public XenRef host_get_management_interface(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.get_management_interface", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_get_management_interface(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.get_management_interface", new JArray(session, _host ?? ""), serializer); } public string host_get_system_status_capabilities(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_system_status_capabilities", new JArray(session, _host ?? ""), serializer); } public void host_restart_agent(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.restart_agent", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_restart_agent(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.restart_agent", new JArray(session, _host ?? ""), serializer); } public void host_shutdown_agent(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.shutdown_agent", new JArray(session), serializer); } public void host_set_hostname_live(string session, string _host, string _hostname) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_hostname_live", new JArray(session, _host ?? "", _hostname ?? ""), serializer); } public long host_compute_free_memory(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.compute_free_memory", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_compute_free_memory(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.compute_free_memory", new JArray(session, _host ?? ""), serializer); } public long host_compute_memory_overhead(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.compute_memory_overhead", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_compute_memory_overhead(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.compute_memory_overhead", new JArray(session, _host ?? ""), serializer); } public void host_sync_data(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.sync_data", new JArray(session, _host ?? ""), serializer); } public void host_backup_rrds(string session, string _host, double _delay) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.backup_rrds", new JArray(session, _host ?? "", _delay), serializer); } public XenRef host_create_new_blob(string session, string _host, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.create_new_blob", new JArray(session, _host ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef async_host_create_new_blob(string session, string _host, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.create_new_blob", new JArray(session, _host ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef host_create_new_blob(string session, string _host, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.create_new_blob", new JArray(session, _host ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public XenRef async_host_create_new_blob(string session, string _host, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.create_new_blob", new JArray(session, _host ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public string host_call_plugin(string session, string _host, string _plugin, string _fn, Dictionary _args) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.call_plugin", new JArray(session, _host ?? "", _plugin ?? "", _fn ?? "", _args == null ? new JObject() : JObject.FromObject(_args, serializer)), serializer); } public XenRef async_host_call_plugin(string session, string _host, string _plugin, string _fn, Dictionary _args) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.call_plugin", new JArray(session, _host ?? "", _plugin ?? "", _fn ?? "", _args == null ? new JObject() : JObject.FromObject(_args, serializer)), serializer); } public bool host_has_extension(string session, string _host, string _name) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.has_extension", new JArray(session, _host ?? "", _name ?? ""), serializer); } public XenRef async_host_has_extension(string session, string _host, string _name) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.has_extension", new JArray(session, _host ?? "", _name ?? ""), serializer); } public string host_call_extension(string session, string _host, string _call) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.call_extension", new JArray(session, _host ?? "", _call ?? ""), serializer); } public DateTime host_get_servertime(string session, string _host) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_servertime", new JArray(session, _host ?? ""), serializer); } public DateTime host_get_server_localtime(string session, string _host) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_server_localtime", new JArray(session, _host ?? ""), serializer); } public void host_enable_external_auth(string session, string _host, Dictionary _config, string _service_name, string _auth_type) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.enable_external_auth", new JArray(session, _host ?? "", _config == null ? new JObject() : JObject.FromObject(_config, serializer), _service_name ?? "", _auth_type ?? ""), serializer); } public void host_disable_external_auth(string session, string _host, Dictionary _config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.disable_external_auth", new JArray(session, _host ?? "", _config == null ? new JObject() : JObject.FromObject(_config, serializer)), serializer); } public Dictionary, string[]> host_retrieve_wlb_evacuate_recommendations(string session, string _host) { var converters = new List {new XenRefStringSetMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, string[]>>("host.retrieve_wlb_evacuate_recommendations", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_retrieve_wlb_evacuate_recommendations(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.retrieve_wlb_evacuate_recommendations", new JArray(session, _host ?? ""), serializer); } public string host_get_server_certificate(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.get_server_certificate", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_get_server_certificate(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.get_server_certificate", new JArray(session, _host ?? ""), serializer); } public void host_apply_edition(string session, string _host, string _edition) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.apply_edition", new JArray(session, _host ?? "", _edition ?? ""), serializer); } public void host_apply_edition(string session, string _host, string _edition, bool _force) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.apply_edition", new JArray(session, _host ?? "", _edition ?? "", _force), serializer); } public void host_refresh_pack_info(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.refresh_pack_info", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_refresh_pack_info(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.refresh_pack_info", new JArray(session, _host ?? ""), serializer); } public void host_set_power_on_mode(string session, string _host, string _power_on_mode, Dictionary _power_on_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_power_on_mode", new JArray(session, _host ?? "", _power_on_mode ?? "", _power_on_config == null ? new JObject() : JObject.FromObject(_power_on_config, serializer)), serializer); } public XenRef async_host_set_power_on_mode(string session, string _host, string _power_on_mode, Dictionary _power_on_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.set_power_on_mode", new JArray(session, _host ?? "", _power_on_mode ?? "", _power_on_config == null ? new JObject() : JObject.FromObject(_power_on_config, serializer)), serializer); } public void host_set_cpu_features(string session, string _host, string _features) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_cpu_features", new JArray(session, _host ?? "", _features ?? ""), serializer); } public void host_reset_cpu_features(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.reset_cpu_features", new JArray(session, _host ?? ""), serializer); } public void host_enable_local_storage_caching(string session, string _host, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.enable_local_storage_caching", new JArray(session, _host ?? "", _sr ?? ""), serializer); } public void host_disable_local_storage_caching(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.disable_local_storage_caching", new JArray(session, _host ?? ""), serializer); } public Dictionary host_migrate_receive(string session, string _host, string _network, Dictionary _options) { var converters = new List {new StringStringMapConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host.migrate_receive", new JArray(session, _host ?? "", _network ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef async_host_migrate_receive(string session, string _host, string _network, Dictionary _options) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.migrate_receive", new JArray(session, _host ?? "", _network ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public void host_declare_dead(string session, string _host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.declare_dead", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_declare_dead(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.declare_dead", new JArray(session, _host ?? ""), serializer); } public host_display host_enable_display(string session, string _host) { var converters = new List {new host_displayConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.enable_display", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_enable_display(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.enable_display", new JArray(session, _host ?? ""), serializer); } public host_display host_disable_display(string session, string _host) { var converters = new List {new host_displayConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host.disable_display", new JArray(session, _host ?? ""), serializer); } public XenRef async_host_disable_display(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.disable_display", new JArray(session, _host ?? ""), serializer); } public void host_set_ssl_legacy(string session, string _host, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_ssl_legacy", new JArray(session, _host ?? "", _value), serializer); } public XenRef async_host_set_ssl_legacy(string session, string _host, bool _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.set_ssl_legacy", new JArray(session, _host ?? "", _value), serializer); } public void host_set_iscsi_iqn(string session, string _host, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_iscsi_iqn", new JArray(session, _host ?? "", _value ?? ""), serializer); } public XenRef async_host_set_iscsi_iqn(string session, string _host, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.set_iscsi_iqn", new JArray(session, _host ?? "", _value ?? ""), serializer); } public void host_set_multipathing(string session, string _host, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host.set_multipathing", new JArray(session, _host ?? "", _value), serializer); } public XenRef async_host_set_multipathing(string session, string _host, bool _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host.set_multipathing", new JArray(session, _host ?? "", _value), serializer); } public List> host_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host.get_all", new JArray(session), serializer); } public Dictionary, Host> host_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Host>>("host.get_all_records", new JArray(session), serializer); } public Host_crashdump host_crashdump_get_record(string session, string _host_crashdump) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_crashdump.get_record", new JArray(session, _host_crashdump ?? ""), serializer); } public XenRef host_crashdump_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_crashdump.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string host_crashdump_get_uuid(string session, string _host_crashdump) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_crashdump.get_uuid", new JArray(session, _host_crashdump ?? ""), serializer); } public XenRef host_crashdump_get_host(string session, string _host_crashdump) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_crashdump.get_host", new JArray(session, _host_crashdump ?? ""), serializer); } public DateTime host_crashdump_get_timestamp(string session, string _host_crashdump) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_crashdump.get_timestamp", new JArray(session, _host_crashdump ?? ""), serializer); } public long host_crashdump_get_size(string session, string _host_crashdump) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_crashdump.get_size", new JArray(session, _host_crashdump ?? ""), serializer); } public Dictionary host_crashdump_get_other_config(string session, string _host_crashdump) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_crashdump.get_other_config", new JArray(session, _host_crashdump ?? ""), serializer); } public void host_crashdump_set_other_config(string session, string _host_crashdump, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_crashdump.set_other_config", new JArray(session, _host_crashdump ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void host_crashdump_add_to_other_config(string session, string _host_crashdump, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_crashdump.add_to_other_config", new JArray(session, _host_crashdump ?? "", _key ?? "", _value ?? ""), serializer); } public void host_crashdump_remove_from_other_config(string session, string _host_crashdump, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_crashdump.remove_from_other_config", new JArray(session, _host_crashdump ?? "", _key ?? ""), serializer); } public void host_crashdump_destroy(string session, string _host_crashdump) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_crashdump.destroy", new JArray(session, _host_crashdump ?? ""), serializer); } public XenRef async_host_crashdump_destroy(string session, string _host_crashdump) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host_crashdump.destroy", new JArray(session, _host_crashdump ?? ""), serializer); } public void host_crashdump_upload(string session, string _host_crashdump, string _url, Dictionary _options) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_crashdump.upload", new JArray(session, _host_crashdump ?? "", _url ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef async_host_crashdump_upload(string session, string _host_crashdump, string _url, Dictionary _options) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host_crashdump.upload", new JArray(session, _host_crashdump ?? "", _url ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public List> host_crashdump_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host_crashdump.get_all", new JArray(session), serializer); } public Dictionary, Host_crashdump> host_crashdump_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Host_crashdump>>("host_crashdump.get_all_records", new JArray(session), serializer); } public Host_patch host_patch_get_record(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_record", new JArray(session, _host_patch ?? ""), serializer); } public XenRef host_patch_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_patch.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> host_patch_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host_patch.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string host_patch_get_uuid(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_uuid", new JArray(session, _host_patch ?? ""), serializer); } public string host_patch_get_name_label(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_name_label", new JArray(session, _host_patch ?? ""), serializer); } public string host_patch_get_name_description(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_name_description", new JArray(session, _host_patch ?? ""), serializer); } public string host_patch_get_version(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_version", new JArray(session, _host_patch ?? ""), serializer); } public XenRef host_patch_get_host(string session, string _host_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_patch.get_host", new JArray(session, _host_patch ?? ""), serializer); } public bool host_patch_get_applied(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_applied", new JArray(session, _host_patch ?? ""), serializer); } public DateTime host_patch_get_timestamp_applied(string session, string _host_patch) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_timestamp_applied", new JArray(session, _host_patch ?? ""), serializer); } public long host_patch_get_size(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.get_size", new JArray(session, _host_patch ?? ""), serializer); } public XenRef host_patch_get_pool_patch(string session, string _host_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_patch.get_pool_patch", new JArray(session, _host_patch ?? ""), serializer); } public Dictionary host_patch_get_other_config(string session, string _host_patch) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_patch.get_other_config", new JArray(session, _host_patch ?? ""), serializer); } public void host_patch_set_other_config(string session, string _host_patch, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_patch.set_other_config", new JArray(session, _host_patch ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void host_patch_add_to_other_config(string session, string _host_patch, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_patch.add_to_other_config", new JArray(session, _host_patch ?? "", _key ?? "", _value ?? ""), serializer); } public void host_patch_remove_from_other_config(string session, string _host_patch, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_patch.remove_from_other_config", new JArray(session, _host_patch ?? "", _key ?? ""), serializer); } public void host_patch_destroy(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_patch.destroy", new JArray(session, _host_patch ?? ""), serializer); } public XenRef async_host_patch_destroy(string session, string _host_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host_patch.destroy", new JArray(session, _host_patch ?? ""), serializer); } public string host_patch_apply(string session, string _host_patch) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_patch.apply", new JArray(session, _host_patch ?? ""), serializer); } public XenRef async_host_patch_apply(string session, string _host_patch) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.host_patch.apply", new JArray(session, _host_patch ?? ""), serializer); } public List> host_patch_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host_patch.get_all", new JArray(session), serializer); } public Dictionary, Host_patch> host_patch_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Host_patch>>("host_patch.get_all_records", new JArray(session), serializer); } public Host_metrics host_metrics_get_record(string session, string _host_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_metrics.get_record", new JArray(session, _host_metrics ?? ""), serializer); } public XenRef host_metrics_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_metrics.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string host_metrics_get_uuid(string session, string _host_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_metrics.get_uuid", new JArray(session, _host_metrics ?? ""), serializer); } public long host_metrics_get_memory_total(string session, string _host_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_metrics.get_memory_total", new JArray(session, _host_metrics ?? ""), serializer); } public long host_metrics_get_memory_free(string session, string _host_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_metrics.get_memory_free", new JArray(session, _host_metrics ?? ""), serializer); } public bool host_metrics_get_live(string session, string _host_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_metrics.get_live", new JArray(session, _host_metrics ?? ""), serializer); } public DateTime host_metrics_get_last_updated(string session, string _host_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_metrics.get_last_updated", new JArray(session, _host_metrics ?? ""), serializer); } public Dictionary host_metrics_get_other_config(string session, string _host_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_metrics.get_other_config", new JArray(session, _host_metrics ?? ""), serializer); } public void host_metrics_set_other_config(string session, string _host_metrics, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_metrics.set_other_config", new JArray(session, _host_metrics ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void host_metrics_add_to_other_config(string session, string _host_metrics, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_metrics.add_to_other_config", new JArray(session, _host_metrics ?? "", _key ?? "", _value ?? ""), serializer); } public void host_metrics_remove_from_other_config(string session, string _host_metrics, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_metrics.remove_from_other_config", new JArray(session, _host_metrics ?? "", _key ?? ""), serializer); } public List> host_metrics_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host_metrics.get_all", new JArray(session), serializer); } public Dictionary, Host_metrics> host_metrics_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Host_metrics>>("host_metrics.get_all_records", new JArray(session), serializer); } public Host_cpu host_cpu_get_record(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_record", new JArray(session, _host_cpu ?? ""), serializer); } public XenRef host_cpu_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_cpu.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string host_cpu_get_uuid(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_uuid", new JArray(session, _host_cpu ?? ""), serializer); } public XenRef host_cpu_get_host(string session, string _host_cpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_cpu.get_host", new JArray(session, _host_cpu ?? ""), serializer); } public long host_cpu_get_number(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_number", new JArray(session, _host_cpu ?? ""), serializer); } public string host_cpu_get_vendor(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_vendor", new JArray(session, _host_cpu ?? ""), serializer); } public long host_cpu_get_speed(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_speed", new JArray(session, _host_cpu ?? ""), serializer); } public string host_cpu_get_modelname(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_modelname", new JArray(session, _host_cpu ?? ""), serializer); } public long host_cpu_get_family(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_family", new JArray(session, _host_cpu ?? ""), serializer); } public long host_cpu_get_model(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_model", new JArray(session, _host_cpu ?? ""), serializer); } public string host_cpu_get_stepping(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_stepping", new JArray(session, _host_cpu ?? ""), serializer); } public string host_cpu_get_flags(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_flags", new JArray(session, _host_cpu ?? ""), serializer); } public string host_cpu_get_features(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_features", new JArray(session, _host_cpu ?? ""), serializer); } public double host_cpu_get_utilisation(string session, string _host_cpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("host_cpu.get_utilisation", new JArray(session, _host_cpu ?? ""), serializer); } public Dictionary host_cpu_get_other_config(string session, string _host_cpu) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("host_cpu.get_other_config", new JArray(session, _host_cpu ?? ""), serializer); } public void host_cpu_set_other_config(string session, string _host_cpu, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_cpu.set_other_config", new JArray(session, _host_cpu ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void host_cpu_add_to_other_config(string session, string _host_cpu, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_cpu.add_to_other_config", new JArray(session, _host_cpu ?? "", _key ?? "", _value ?? ""), serializer); } public void host_cpu_remove_from_other_config(string session, string _host_cpu, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("host_cpu.remove_from_other_config", new JArray(session, _host_cpu ?? "", _key ?? ""), serializer); } public List> host_cpu_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("host_cpu.get_all", new JArray(session), serializer); } public Dictionary, Host_cpu> host_cpu_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Host_cpu>>("host_cpu.get_all_records", new JArray(session), serializer); } public Network network_get_record(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_record", new JArray(session, _network ?? ""), serializer); } public XenRef network_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef network_create(string session, Network _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_network_create(string session, Network _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.network.create", new JArray(session, _record.ToJObject()), serializer); } public void network_destroy(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.destroy", new JArray(session, _network ?? ""), serializer); } public XenRef async_network_destroy(string session, string _network) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.network.destroy", new JArray(session, _network ?? ""), serializer); } public List> network_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("network.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string network_get_uuid(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_uuid", new JArray(session, _network ?? ""), serializer); } public string network_get_name_label(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_name_label", new JArray(session, _network ?? ""), serializer); } public string network_get_name_description(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_name_description", new JArray(session, _network ?? ""), serializer); } public List network_get_allowed_operations(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.get_allowed_operations", new JArray(session, _network ?? ""), serializer); } public Dictionary network_get_current_operations(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.get_current_operations", new JArray(session, _network ?? ""), serializer); } public List> network_get_vifs(string session, string _network) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("network.get_VIFs", new JArray(session, _network ?? ""), serializer); } public List> network_get_pifs(string session, string _network) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("network.get_PIFs", new JArray(session, _network ?? ""), serializer); } public long network_get_mtu(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_MTU", new JArray(session, _network ?? ""), serializer); } public Dictionary network_get_other_config(string session, string _network) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.get_other_config", new JArray(session, _network ?? ""), serializer); } public string network_get_bridge(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_bridge", new JArray(session, _network ?? ""), serializer); } public bool network_get_managed(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_managed", new JArray(session, _network ?? ""), serializer); } public Dictionary> network_get_blobs(string session, string _network) { var converters = new List {new StringXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("network.get_blobs", new JArray(session, _network ?? ""), serializer); } public string[] network_get_tags(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_tags", new JArray(session, _network ?? ""), serializer); } public network_default_locking_mode network_get_default_locking_mode(string session, string _network) { var converters = new List {new network_default_locking_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("network.get_default_locking_mode", new JArray(session, _network ?? ""), serializer); } public Dictionary, string> network_get_assigned_ips(string session, string _network) { var converters = new List {new XenRefStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, string>>("network.get_assigned_ips", new JArray(session, _network ?? ""), serializer); } public List network_get_purpose(string session, string _network) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.get_purpose", new JArray(session, _network ?? ""), serializer); } public void network_set_name_label(string session, string _network, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.set_name_label", new JArray(session, _network ?? "", _label ?? ""), serializer); } public void network_set_name_description(string session, string _network, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.set_name_description", new JArray(session, _network ?? "", _description ?? ""), serializer); } public void network_set_mtu(string session, string _network, long _mtu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.set_MTU", new JArray(session, _network ?? "", _mtu), serializer); } public void network_set_other_config(string session, string _network, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.set_other_config", new JArray(session, _network ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void network_add_to_other_config(string session, string _network, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.add_to_other_config", new JArray(session, _network ?? "", _key ?? "", _value ?? ""), serializer); } public void network_remove_from_other_config(string session, string _network, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.remove_from_other_config", new JArray(session, _network ?? "", _key ?? ""), serializer); } public void network_set_tags(string session, string _network, string[] _tags) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.set_tags", new JArray(session, _network ?? "", _tags == null ? new JArray() : JArray.FromObject(_tags)), serializer); } public void network_add_tags(string session, string _network, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.add_tags", new JArray(session, _network ?? "", _value ?? ""), serializer); } public void network_remove_tags(string session, string _network, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.remove_tags", new JArray(session, _network ?? "", _value ?? ""), serializer); } public XenRef network_create_new_blob(string session, string _network, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.create_new_blob", new JArray(session, _network ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef async_network_create_new_blob(string session, string _network, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.network.create_new_blob", new JArray(session, _network ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef network_create_new_blob(string session, string _network, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("network.create_new_blob", new JArray(session, _network ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public XenRef async_network_create_new_blob(string session, string _network, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.network.create_new_blob", new JArray(session, _network ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public void network_set_default_locking_mode(string session, string _network, network_default_locking_mode _value) { var converters = new List {new network_default_locking_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.set_default_locking_mode", new JArray(session, _network ?? "", _value.StringOf()), serializer); } public XenRef async_network_set_default_locking_mode(string session, string _network, network_default_locking_mode _value) { var converters = new List {new XenRefConverter(), new network_default_locking_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.network.set_default_locking_mode", new JArray(session, _network ?? "", _value.StringOf()), serializer); } public void network_add_purpose(string session, string _network, network_purpose _value) { var converters = new List {new network_purposeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.add_purpose", new JArray(session, _network ?? "", _value.StringOf()), serializer); } public XenRef async_network_add_purpose(string session, string _network, network_purpose _value) { var converters = new List {new XenRefConverter(), new network_purposeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.network.add_purpose", new JArray(session, _network ?? "", _value.StringOf()), serializer); } public void network_remove_purpose(string session, string _network, network_purpose _value) { var converters = new List {new network_purposeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("network.remove_purpose", new JArray(session, _network ?? "", _value.StringOf()), serializer); } public XenRef async_network_remove_purpose(string session, string _network, network_purpose _value) { var converters = new List {new XenRefConverter(), new network_purposeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.network.remove_purpose", new JArray(session, _network ?? "", _value.StringOf()), serializer); } public List> network_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("network.get_all", new JArray(session), serializer); } public Dictionary, Network> network_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Network>>("network.get_all_records", new JArray(session), serializer); } public VIF vif_get_record(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_record", new JArray(session, _vif ?? ""), serializer); } public XenRef vif_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vif_create(string session, VIF _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vif_create(string session, VIF _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.create", new JArray(session, _record.ToJObject()), serializer); } public void vif_destroy(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.destroy", new JArray(session, _vif ?? ""), serializer); } public XenRef async_vif_destroy(string session, string _vif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.destroy", new JArray(session, _vif ?? ""), serializer); } public string vif_get_uuid(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_uuid", new JArray(session, _vif ?? ""), serializer); } public List vif_get_allowed_operations(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_allowed_operations", new JArray(session, _vif ?? ""), serializer); } public Dictionary vif_get_current_operations(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_current_operations", new JArray(session, _vif ?? ""), serializer); } public string vif_get_device(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_device", new JArray(session, _vif ?? ""), serializer); } public XenRef vif_get_network(string session, string _vif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_network", new JArray(session, _vif ?? ""), serializer); } public XenRef vif_get_vm(string session, string _vif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_VM", new JArray(session, _vif ?? ""), serializer); } public string vif_get_mac(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_MAC", new JArray(session, _vif ?? ""), serializer); } public long vif_get_mtu(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_MTU", new JArray(session, _vif ?? ""), serializer); } public Dictionary vif_get_other_config(string session, string _vif) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_other_config", new JArray(session, _vif ?? ""), serializer); } public bool vif_get_currently_attached(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_currently_attached", new JArray(session, _vif ?? ""), serializer); } public long vif_get_status_code(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_status_code", new JArray(session, _vif ?? ""), serializer); } public string vif_get_status_detail(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_status_detail", new JArray(session, _vif ?? ""), serializer); } public Dictionary vif_get_runtime_properties(string session, string _vif) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_runtime_properties", new JArray(session, _vif ?? ""), serializer); } public string vif_get_qos_algorithm_type(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_qos_algorithm_type", new JArray(session, _vif ?? ""), serializer); } public Dictionary vif_get_qos_algorithm_params(string session, string _vif) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_qos_algorithm_params", new JArray(session, _vif ?? ""), serializer); } public string[] vif_get_qos_supported_algorithms(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_qos_supported_algorithms", new JArray(session, _vif ?? ""), serializer); } public XenRef vif_get_metrics(string session, string _vif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF.get_metrics", new JArray(session, _vif ?? ""), serializer); } public bool vif_get_mac_autogenerated(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_MAC_autogenerated", new JArray(session, _vif ?? ""), serializer); } public vif_locking_mode vif_get_locking_mode(string session, string _vif) { var converters = new List {new vif_locking_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_locking_mode", new JArray(session, _vif ?? ""), serializer); } public string[] vif_get_ipv4_allowed(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv4_allowed", new JArray(session, _vif ?? ""), serializer); } public string[] vif_get_ipv6_allowed(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv6_allowed", new JArray(session, _vif ?? ""), serializer); } public vif_ipv4_configuration_mode vif_get_ipv4_configuration_mode(string session, string _vif) { var converters = new List {new vif_ipv4_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv4_configuration_mode", new JArray(session, _vif ?? ""), serializer); } public string[] vif_get_ipv4_addresses(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv4_addresses", new JArray(session, _vif ?? ""), serializer); } public string vif_get_ipv4_gateway(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv4_gateway", new JArray(session, _vif ?? ""), serializer); } public vif_ipv6_configuration_mode vif_get_ipv6_configuration_mode(string session, string _vif) { var converters = new List {new vif_ipv6_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv6_configuration_mode", new JArray(session, _vif ?? ""), serializer); } public string[] vif_get_ipv6_addresses(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv6_addresses", new JArray(session, _vif ?? ""), serializer); } public string vif_get_ipv6_gateway(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF.get_ipv6_gateway", new JArray(session, _vif ?? ""), serializer); } public void vif_set_other_config(string session, string _vif, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.set_other_config", new JArray(session, _vif ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vif_add_to_other_config(string session, string _vif, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.add_to_other_config", new JArray(session, _vif ?? "", _key ?? "", _value ?? ""), serializer); } public void vif_remove_from_other_config(string session, string _vif, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.remove_from_other_config", new JArray(session, _vif ?? "", _key ?? ""), serializer); } public void vif_set_qos_algorithm_type(string session, string _vif, string _algorithm_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.set_qos_algorithm_type", new JArray(session, _vif ?? "", _algorithm_type ?? ""), serializer); } public void vif_set_qos_algorithm_params(string session, string _vif, Dictionary _algorithm_params) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.set_qos_algorithm_params", new JArray(session, _vif ?? "", _algorithm_params == null ? new JObject() : JObject.FromObject(_algorithm_params, serializer)), serializer); } public void vif_add_to_qos_algorithm_params(string session, string _vif, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.add_to_qos_algorithm_params", new JArray(session, _vif ?? "", _key ?? "", _value ?? ""), serializer); } public void vif_remove_from_qos_algorithm_params(string session, string _vif, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.remove_from_qos_algorithm_params", new JArray(session, _vif ?? "", _key ?? ""), serializer); } public void vif_plug(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.plug", new JArray(session, _vif ?? ""), serializer); } public XenRef async_vif_plug(string session, string _vif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.plug", new JArray(session, _vif ?? ""), serializer); } public void vif_unplug(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.unplug", new JArray(session, _vif ?? ""), serializer); } public XenRef async_vif_unplug(string session, string _vif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.unplug", new JArray(session, _vif ?? ""), serializer); } public void vif_unplug_force(string session, string _vif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.unplug_force", new JArray(session, _vif ?? ""), serializer); } public XenRef async_vif_unplug_force(string session, string _vif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.unplug_force", new JArray(session, _vif ?? ""), serializer); } public void vif_move(string session, string _vif, string _network) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.move", new JArray(session, _vif ?? "", _network ?? ""), serializer); } public XenRef async_vif_move(string session, string _vif, string _network) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.move", new JArray(session, _vif ?? "", _network ?? ""), serializer); } public void vif_set_locking_mode(string session, string _vif, vif_locking_mode _value) { var converters = new List {new vif_locking_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.set_locking_mode", new JArray(session, _vif ?? "", _value.StringOf()), serializer); } public XenRef async_vif_set_locking_mode(string session, string _vif, vif_locking_mode _value) { var converters = new List {new XenRefConverter(), new vif_locking_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.set_locking_mode", new JArray(session, _vif ?? "", _value.StringOf()), serializer); } public void vif_set_ipv4_allowed(string session, string _vif, string[] _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.set_ipv4_allowed", new JArray(session, _vif ?? "", _value == null ? new JArray() : JArray.FromObject(_value)), serializer); } public XenRef async_vif_set_ipv4_allowed(string session, string _vif, string[] _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.set_ipv4_allowed", new JArray(session, _vif ?? "", _value == null ? new JArray() : JArray.FromObject(_value)), serializer); } public void vif_add_ipv4_allowed(string session, string _vif, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.add_ipv4_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public XenRef async_vif_add_ipv4_allowed(string session, string _vif, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.add_ipv4_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public void vif_remove_ipv4_allowed(string session, string _vif, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.remove_ipv4_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public XenRef async_vif_remove_ipv4_allowed(string session, string _vif, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.remove_ipv4_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public void vif_set_ipv6_allowed(string session, string _vif, string[] _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.set_ipv6_allowed", new JArray(session, _vif ?? "", _value == null ? new JArray() : JArray.FromObject(_value)), serializer); } public XenRef async_vif_set_ipv6_allowed(string session, string _vif, string[] _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.set_ipv6_allowed", new JArray(session, _vif ?? "", _value == null ? new JArray() : JArray.FromObject(_value)), serializer); } public void vif_add_ipv6_allowed(string session, string _vif, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.add_ipv6_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public XenRef async_vif_add_ipv6_allowed(string session, string _vif, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.add_ipv6_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public void vif_remove_ipv6_allowed(string session, string _vif, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.remove_ipv6_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public XenRef async_vif_remove_ipv6_allowed(string session, string _vif, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.remove_ipv6_allowed", new JArray(session, _vif ?? "", _value ?? ""), serializer); } public void vif_configure_ipv4(string session, string _vif, vif_ipv4_configuration_mode _mode, string _address, string _gateway) { var converters = new List {new vif_ipv4_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.configure_ipv4", new JArray(session, _vif ?? "", _mode.StringOf(), _address ?? "", _gateway ?? ""), serializer); } public XenRef async_vif_configure_ipv4(string session, string _vif, vif_ipv4_configuration_mode _mode, string _address, string _gateway) { var converters = new List {new XenRefConverter(), new vif_ipv4_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.configure_ipv4", new JArray(session, _vif ?? "", _mode.StringOf(), _address ?? "", _gateway ?? ""), serializer); } public void vif_configure_ipv6(string session, string _vif, vif_ipv6_configuration_mode _mode, string _address, string _gateway) { var converters = new List {new vif_ipv6_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF.configure_ipv6", new JArray(session, _vif ?? "", _mode.StringOf(), _address ?? "", _gateway ?? ""), serializer); } public XenRef async_vif_configure_ipv6(string session, string _vif, vif_ipv6_configuration_mode _mode, string _address, string _gateway) { var converters = new List {new XenRefConverter(), new vif_ipv6_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VIF.configure_ipv6", new JArray(session, _vif ?? "", _mode.StringOf(), _address ?? "", _gateway ?? ""), serializer); } public List> vif_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VIF.get_all", new JArray(session), serializer); } public Dictionary, VIF> vif_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VIF>>("VIF.get_all_records", new JArray(session), serializer); } public VIF_metrics vif_metrics_get_record(string session, string _vif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF_metrics.get_record", new JArray(session, _vif_metrics ?? ""), serializer); } public XenRef vif_metrics_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF_metrics.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vif_metrics_get_uuid(string session, string _vif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF_metrics.get_uuid", new JArray(session, _vif_metrics ?? ""), serializer); } public double vif_metrics_get_io_read_kbs(string session, string _vif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF_metrics.get_io_read_kbs", new JArray(session, _vif_metrics ?? ""), serializer); } public double vif_metrics_get_io_write_kbs(string session, string _vif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF_metrics.get_io_write_kbs", new JArray(session, _vif_metrics ?? ""), serializer); } public DateTime vif_metrics_get_last_updated(string session, string _vif_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VIF_metrics.get_last_updated", new JArray(session, _vif_metrics ?? ""), serializer); } public Dictionary vif_metrics_get_other_config(string session, string _vif_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VIF_metrics.get_other_config", new JArray(session, _vif_metrics ?? ""), serializer); } public void vif_metrics_set_other_config(string session, string _vif_metrics, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF_metrics.set_other_config", new JArray(session, _vif_metrics ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vif_metrics_add_to_other_config(string session, string _vif_metrics, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF_metrics.add_to_other_config", new JArray(session, _vif_metrics ?? "", _key ?? "", _value ?? ""), serializer); } public void vif_metrics_remove_from_other_config(string session, string _vif_metrics, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VIF_metrics.remove_from_other_config", new JArray(session, _vif_metrics ?? "", _key ?? ""), serializer); } public List> vif_metrics_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VIF_metrics.get_all", new JArray(session), serializer); } public Dictionary, VIF_metrics> vif_metrics_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VIF_metrics>>("VIF_metrics.get_all_records", new JArray(session), serializer); } public PIF pif_get_record(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_record", new JArray(session, _pif ?? ""), serializer); } public XenRef pif_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pif_get_uuid(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_uuid", new JArray(session, _pif ?? ""), serializer); } public string pif_get_device(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_device", new JArray(session, _pif ?? ""), serializer); } public XenRef pif_get_network(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_network", new JArray(session, _pif ?? ""), serializer); } public XenRef pif_get_host(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_host", new JArray(session, _pif ?? ""), serializer); } public string pif_get_mac(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_MAC", new JArray(session, _pif ?? ""), serializer); } public long pif_get_mtu(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_MTU", new JArray(session, _pif ?? ""), serializer); } public long pif_get_vlan(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_VLAN", new JArray(session, _pif ?? ""), serializer); } public XenRef pif_get_metrics(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_metrics", new JArray(session, _pif ?? ""), serializer); } public bool pif_get_physical(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_physical", new JArray(session, _pif ?? ""), serializer); } public bool pif_get_currently_attached(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_currently_attached", new JArray(session, _pif ?? ""), serializer); } public ip_configuration_mode pif_get_ip_configuration_mode(string session, string _pif) { var converters = new List {new ip_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_ip_configuration_mode", new JArray(session, _pif ?? ""), serializer); } public string pif_get_ip(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_IP", new JArray(session, _pif ?? ""), serializer); } public string pif_get_netmask(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_netmask", new JArray(session, _pif ?? ""), serializer); } public string pif_get_gateway(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_gateway", new JArray(session, _pif ?? ""), serializer); } public string pif_get_dns(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_DNS", new JArray(session, _pif ?? ""), serializer); } public XenRef pif_get_bond_slave_of(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_bond_slave_of", new JArray(session, _pif ?? ""), serializer); } public List> pif_get_bond_master_of(string session, string _pif) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PIF.get_bond_master_of", new JArray(session, _pif ?? ""), serializer); } public XenRef pif_get_vlan_master_of(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_VLAN_master_of", new JArray(session, _pif ?? ""), serializer); } public List> pif_get_vlan_slave_of(string session, string _pif) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PIF.get_VLAN_slave_of", new JArray(session, _pif ?? ""), serializer); } public bool pif_get_management(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_management", new JArray(session, _pif ?? ""), serializer); } public Dictionary pif_get_other_config(string session, string _pif) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_other_config", new JArray(session, _pif ?? ""), serializer); } public bool pif_get_disallow_unplug(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_disallow_unplug", new JArray(session, _pif ?? ""), serializer); } public List> pif_get_tunnel_access_pif_of(string session, string _pif) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PIF.get_tunnel_access_PIF_of", new JArray(session, _pif ?? ""), serializer); } public List> pif_get_tunnel_transport_pif_of(string session, string _pif) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PIF.get_tunnel_transport_PIF_of", new JArray(session, _pif ?? ""), serializer); } public ipv6_configuration_mode pif_get_ipv6_configuration_mode(string session, string _pif) { var converters = new List {new ipv6_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_ipv6_configuration_mode", new JArray(session, _pif ?? ""), serializer); } public string[] pif_get_ipv6(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_IPv6", new JArray(session, _pif ?? ""), serializer); } public string pif_get_ipv6_gateway(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_ipv6_gateway", new JArray(session, _pif ?? ""), serializer); } public primary_address_type pif_get_primary_address_type(string session, string _pif) { var converters = new List {new primary_address_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_primary_address_type", new JArray(session, _pif ?? ""), serializer); } public bool pif_get_managed(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_managed", new JArray(session, _pif ?? ""), serializer); } public Dictionary pif_get_properties(string session, string _pif) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.get_properties", new JArray(session, _pif ?? ""), serializer); } public string[] pif_get_capabilities(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_capabilities", new JArray(session, _pif ?? ""), serializer); } public pif_igmp_status pif_get_igmp_snooping_status(string session, string _pif) { var converters = new List {new pif_igmp_statusConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF.get_igmp_snooping_status", new JArray(session, _pif ?? ""), serializer); } public void pif_set_other_config(string session, string _pif, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.set_other_config", new JArray(session, _pif ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pif_add_to_other_config(string session, string _pif, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.add_to_other_config", new JArray(session, _pif ?? "", _key ?? "", _value ?? ""), serializer); } public void pif_remove_from_other_config(string session, string _pif, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.remove_from_other_config", new JArray(session, _pif ?? "", _key ?? ""), serializer); } public void pif_set_disallow_unplug(string session, string _pif, bool _disallow_unplug) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.set_disallow_unplug", new JArray(session, _pif ?? "", _disallow_unplug), serializer); } public XenRef pif_create_vlan(string session, string _device, string _network, string _host, long _vlan) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.create_VLAN", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _vlan), serializer); } public XenRef async_pif_create_vlan(string session, string _device, string _network, string _host, long _vlan) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.create_VLAN", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _vlan), serializer); } public void pif_destroy(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.destroy", new JArray(session, _pif ?? ""), serializer); } public XenRef async_pif_destroy(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.destroy", new JArray(session, _pif ?? ""), serializer); } public void pif_reconfigure_ip(string session, string _pif, ip_configuration_mode _mode, string _ip, string _netmask, string _gateway, string _dns) { var converters = new List {new ip_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.reconfigure_ip", new JArray(session, _pif ?? "", _mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? ""), serializer); } public XenRef async_pif_reconfigure_ip(string session, string _pif, ip_configuration_mode _mode, string _ip, string _netmask, string _gateway, string _dns) { var converters = new List {new XenRefConverter(), new ip_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.reconfigure_ip", new JArray(session, _pif ?? "", _mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? ""), serializer); } public void pif_reconfigure_ipv6(string session, string _pif, ipv6_configuration_mode _mode, string _ipv6, string _gateway, string _dns) { var converters = new List {new ipv6_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.reconfigure_ipv6", new JArray(session, _pif ?? "", _mode.StringOf(), _ipv6 ?? "", _gateway ?? "", _dns ?? ""), serializer); } public XenRef async_pif_reconfigure_ipv6(string session, string _pif, ipv6_configuration_mode _mode, string _ipv6, string _gateway, string _dns) { var converters = new List {new XenRefConverter(), new ipv6_configuration_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.reconfigure_ipv6", new JArray(session, _pif ?? "", _mode.StringOf(), _ipv6 ?? "", _gateway ?? "", _dns ?? ""), serializer); } public void pif_set_primary_address_type(string session, string _pif, primary_address_type _primary_address_type) { var converters = new List {new primary_address_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.set_primary_address_type", new JArray(session, _pif ?? "", _primary_address_type.StringOf()), serializer); } public XenRef async_pif_set_primary_address_type(string session, string _pif, primary_address_type _primary_address_type) { var converters = new List {new XenRefConverter(), new primary_address_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.set_primary_address_type", new JArray(session, _pif ?? "", _primary_address_type.StringOf()), serializer); } public void pif_scan(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.scan", new JArray(session, _host ?? ""), serializer); } public XenRef async_pif_scan(string session, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.scan", new JArray(session, _host ?? ""), serializer); } public XenRef pif_introduce(string session, string _host, string _mac, string _device) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.introduce", new JArray(session, _host ?? "", _mac ?? "", _device ?? ""), serializer); } public XenRef async_pif_introduce(string session, string _host, string _mac, string _device) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.introduce", new JArray(session, _host ?? "", _mac ?? "", _device ?? ""), serializer); } public XenRef pif_introduce(string session, string _host, string _mac, string _device, bool _managed) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.introduce", new JArray(session, _host ?? "", _mac ?? "", _device ?? "", _managed), serializer); } public XenRef async_pif_introduce(string session, string _host, string _mac, string _device, bool _managed) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.introduce", new JArray(session, _host ?? "", _mac ?? "", _device ?? "", _managed), serializer); } public void pif_forget(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.forget", new JArray(session, _pif ?? ""), serializer); } public XenRef async_pif_forget(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.forget", new JArray(session, _pif ?? ""), serializer); } public void pif_unplug(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.unplug", new JArray(session, _pif ?? ""), serializer); } public XenRef async_pif_unplug(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.unplug", new JArray(session, _pif ?? ""), serializer); } public void pif_plug(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.plug", new JArray(session, _pif ?? ""), serializer); } public XenRef async_pif_plug(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.plug", new JArray(session, _pif ?? ""), serializer); } public XenRef pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug), serializer); } public XenRef async_pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug), serializer); } public XenRef pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug, ipv6_configuration_mode _ipv6_configuration_mode, string[] _ipv6, string _ipv6_gateway, primary_address_type _primary_address_type) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new ipv6_configuration_modeConverter(), new primary_address_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug, _ipv6_configuration_mode.StringOf(), _ipv6 == null ? new JArray() : JArray.FromObject(_ipv6), _ipv6_gateway ?? "", _primary_address_type.StringOf()), serializer); } public XenRef async_pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug, ipv6_configuration_mode _ipv6_configuration_mode, string[] _ipv6, string _ipv6_gateway, primary_address_type _primary_address_type) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new ipv6_configuration_modeConverter(), new primary_address_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug, _ipv6_configuration_mode.StringOf(), _ipv6 == null ? new JArray() : JArray.FromObject(_ipv6), _ipv6_gateway ?? "", _primary_address_type.StringOf()), serializer); } public XenRef pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug, ipv6_configuration_mode _ipv6_configuration_mode, string[] _ipv6, string _ipv6_gateway, primary_address_type _primary_address_type, bool _managed) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new ipv6_configuration_modeConverter(), new primary_address_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug, _ipv6_configuration_mode.StringOf(), _ipv6 == null ? new JArray() : JArray.FromObject(_ipv6), _ipv6_gateway ?? "", _primary_address_type.StringOf(), _managed), serializer); } public XenRef async_pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug, ipv6_configuration_mode _ipv6_configuration_mode, string[] _ipv6, string _ipv6_gateway, primary_address_type _primary_address_type, bool _managed) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new ipv6_configuration_modeConverter(), new primary_address_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug, _ipv6_configuration_mode.StringOf(), _ipv6 == null ? new JArray() : JArray.FromObject(_ipv6), _ipv6_gateway ?? "", _primary_address_type.StringOf(), _managed), serializer); } public XenRef pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug, ipv6_configuration_mode _ipv6_configuration_mode, string[] _ipv6, string _ipv6_gateway, primary_address_type _primary_address_type, bool _managed, Dictionary _properties) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new ipv6_configuration_modeConverter(), new primary_address_typeConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug, _ipv6_configuration_mode.StringOf(), _ipv6 == null ? new JArray() : JArray.FromObject(_ipv6), _ipv6_gateway ?? "", _primary_address_type.StringOf(), _managed, _properties == null ? new JObject() : JObject.FromObject(_properties, serializer)), serializer); } public XenRef async_pif_db_introduce(string session, string _device, string _network, string _host, string _mac, long _mtu, long _vlan, bool _physical, ip_configuration_mode _ip_configuration_mode, string _ip, string _netmask, string _gateway, string _dns, string _bond_slave_of, string _vlan_master_of, bool _management, Dictionary _other_config, bool _disallow_unplug, ipv6_configuration_mode _ipv6_configuration_mode, string[] _ipv6, string _ipv6_gateway, primary_address_type _primary_address_type, bool _managed, Dictionary _properties) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new ip_configuration_modeConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new ipv6_configuration_modeConverter(), new primary_address_typeConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.db_introduce", new JArray(session, _device ?? "", _network ?? "", _host ?? "", _mac ?? "", _mtu, _vlan, _physical, _ip_configuration_mode.StringOf(), _ip ?? "", _netmask ?? "", _gateway ?? "", _dns ?? "", _bond_slave_of ?? "", _vlan_master_of ?? "", _management, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _disallow_unplug, _ipv6_configuration_mode.StringOf(), _ipv6 == null ? new JArray() : JArray.FromObject(_ipv6), _ipv6_gateway ?? "", _primary_address_type.StringOf(), _managed, _properties == null ? new JObject() : JObject.FromObject(_properties, serializer)), serializer); } public void pif_db_forget(string session, string _pif) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.db_forget", new JArray(session, _pif ?? ""), serializer); } public XenRef async_pif_db_forget(string session, string _pif) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.db_forget", new JArray(session, _pif ?? ""), serializer); } public void pif_set_property(string session, string _pif, string _name, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF.set_property", new JArray(session, _pif ?? "", _name ?? "", _value ?? ""), serializer); } public XenRef async_pif_set_property(string session, string _pif, string _name, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PIF.set_property", new JArray(session, _pif ?? "", _name ?? "", _value ?? ""), serializer); } public List> pif_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PIF.get_all", new JArray(session), serializer); } public Dictionary, PIF> pif_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PIF>>("PIF.get_all_records", new JArray(session), serializer); } public PIF_metrics pif_metrics_get_record(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_record", new JArray(session, _pif_metrics ?? ""), serializer); } public XenRef pif_metrics_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF_metrics.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pif_metrics_get_uuid(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_uuid", new JArray(session, _pif_metrics ?? ""), serializer); } public double pif_metrics_get_io_read_kbs(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_io_read_kbs", new JArray(session, _pif_metrics ?? ""), serializer); } public double pif_metrics_get_io_write_kbs(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_io_write_kbs", new JArray(session, _pif_metrics ?? ""), serializer); } public bool pif_metrics_get_carrier(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_carrier", new JArray(session, _pif_metrics ?? ""), serializer); } public string pif_metrics_get_vendor_id(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_vendor_id", new JArray(session, _pif_metrics ?? ""), serializer); } public string pif_metrics_get_vendor_name(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_vendor_name", new JArray(session, _pif_metrics ?? ""), serializer); } public string pif_metrics_get_device_id(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_device_id", new JArray(session, _pif_metrics ?? ""), serializer); } public string pif_metrics_get_device_name(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_device_name", new JArray(session, _pif_metrics ?? ""), serializer); } public long pif_metrics_get_speed(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_speed", new JArray(session, _pif_metrics ?? ""), serializer); } public bool pif_metrics_get_duplex(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_duplex", new JArray(session, _pif_metrics ?? ""), serializer); } public string pif_metrics_get_pci_bus_path(string session, string _pif_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_pci_bus_path", new JArray(session, _pif_metrics ?? ""), serializer); } public DateTime pif_metrics_get_last_updated(string session, string _pif_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PIF_metrics.get_last_updated", new JArray(session, _pif_metrics ?? ""), serializer); } public Dictionary pif_metrics_get_other_config(string session, string _pif_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PIF_metrics.get_other_config", new JArray(session, _pif_metrics ?? ""), serializer); } public void pif_metrics_set_other_config(string session, string _pif_metrics, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF_metrics.set_other_config", new JArray(session, _pif_metrics ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pif_metrics_add_to_other_config(string session, string _pif_metrics, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF_metrics.add_to_other_config", new JArray(session, _pif_metrics ?? "", _key ?? "", _value ?? ""), serializer); } public void pif_metrics_remove_from_other_config(string session, string _pif_metrics, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PIF_metrics.remove_from_other_config", new JArray(session, _pif_metrics ?? "", _key ?? ""), serializer); } public List> pif_metrics_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PIF_metrics.get_all", new JArray(session), serializer); } public Dictionary, PIF_metrics> pif_metrics_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PIF_metrics>>("PIF_metrics.get_all_records", new JArray(session), serializer); } public Bond bond_get_record(string session, string _bond) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Bond.get_record", new JArray(session, _bond ?? ""), serializer); } public XenRef bond_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string bond_get_uuid(string session, string _bond) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Bond.get_uuid", new JArray(session, _bond ?? ""), serializer); } public XenRef bond_get_master(string session, string _bond) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.get_master", new JArray(session, _bond ?? ""), serializer); } public List> bond_get_slaves(string session, string _bond) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("Bond.get_slaves", new JArray(session, _bond ?? ""), serializer); } public Dictionary bond_get_other_config(string session, string _bond) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.get_other_config", new JArray(session, _bond ?? ""), serializer); } public XenRef bond_get_primary_slave(string session, string _bond) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.get_primary_slave", new JArray(session, _bond ?? ""), serializer); } public bond_mode bond_get_mode(string session, string _bond) { var converters = new List {new bond_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Bond.get_mode", new JArray(session, _bond ?? ""), serializer); } public Dictionary bond_get_properties(string session, string _bond) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.get_properties", new JArray(session, _bond ?? ""), serializer); } public long bond_get_links_up(string session, string _bond) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Bond.get_links_up", new JArray(session, _bond ?? ""), serializer); } public void bond_set_other_config(string session, string _bond, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Bond.set_other_config", new JArray(session, _bond ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void bond_add_to_other_config(string session, string _bond, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Bond.add_to_other_config", new JArray(session, _bond ?? "", _key ?? "", _value ?? ""), serializer); } public void bond_remove_from_other_config(string session, string _bond, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Bond.remove_from_other_config", new JArray(session, _bond ?? "", _key ?? ""), serializer); } public XenRef bond_create(string session, string _network, List> _members, string _mac) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.create", new JArray(session, _network ?? "", _members == null ? new JArray() : JArray.FromObject(_members, serializer), _mac ?? ""), serializer); } public XenRef async_bond_create(string session, string _network, List> _members, string _mac) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Bond.create", new JArray(session, _network ?? "", _members == null ? new JArray() : JArray.FromObject(_members, serializer), _mac ?? ""), serializer); } public XenRef bond_create(string session, string _network, List> _members, string _mac, bond_mode _mode) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefListConverter(), new bond_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.create", new JArray(session, _network ?? "", _members == null ? new JArray() : JArray.FromObject(_members, serializer), _mac ?? "", _mode.StringOf()), serializer); } public XenRef async_bond_create(string session, string _network, List> _members, string _mac, bond_mode _mode) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefListConverter(), new bond_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Bond.create", new JArray(session, _network ?? "", _members == null ? new JArray() : JArray.FromObject(_members, serializer), _mac ?? "", _mode.StringOf()), serializer); } public XenRef bond_create(string session, string _network, List> _members, string _mac, bond_mode _mode, Dictionary _properties) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefListConverter(), new bond_modeConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Bond.create", new JArray(session, _network ?? "", _members == null ? new JArray() : JArray.FromObject(_members, serializer), _mac ?? "", _mode.StringOf(), _properties == null ? new JObject() : JObject.FromObject(_properties, serializer)), serializer); } public XenRef async_bond_create(string session, string _network, List> _members, string _mac, bond_mode _mode, Dictionary _properties) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefListConverter(), new bond_modeConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Bond.create", new JArray(session, _network ?? "", _members == null ? new JArray() : JArray.FromObject(_members, serializer), _mac ?? "", _mode.StringOf(), _properties == null ? new JObject() : JObject.FromObject(_properties, serializer)), serializer); } public void bond_destroy(string session, string _bond) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Bond.destroy", new JArray(session, _bond ?? ""), serializer); } public XenRef async_bond_destroy(string session, string _bond) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Bond.destroy", new JArray(session, _bond ?? ""), serializer); } public void bond_set_mode(string session, string _bond, bond_mode _value) { var converters = new List {new bond_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Bond.set_mode", new JArray(session, _bond ?? "", _value.StringOf()), serializer); } public XenRef async_bond_set_mode(string session, string _bond, bond_mode _value) { var converters = new List {new XenRefConverter(), new bond_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Bond.set_mode", new JArray(session, _bond ?? "", _value.StringOf()), serializer); } public void bond_set_property(string session, string _bond, string _name, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Bond.set_property", new JArray(session, _bond ?? "", _name ?? "", _value ?? ""), serializer); } public XenRef async_bond_set_property(string session, string _bond, string _name, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Bond.set_property", new JArray(session, _bond ?? "", _name ?? "", _value ?? ""), serializer); } public List> bond_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("Bond.get_all", new JArray(session), serializer); } public Dictionary, Bond> bond_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Bond>>("Bond.get_all_records", new JArray(session), serializer); } public VLAN vlan_get_record(string session, string _vlan) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VLAN.get_record", new JArray(session, _vlan ?? ""), serializer); } public XenRef vlan_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VLAN.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vlan_get_uuid(string session, string _vlan) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VLAN.get_uuid", new JArray(session, _vlan ?? ""), serializer); } public XenRef vlan_get_tagged_pif(string session, string _vlan) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VLAN.get_tagged_PIF", new JArray(session, _vlan ?? ""), serializer); } public XenRef vlan_get_untagged_pif(string session, string _vlan) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VLAN.get_untagged_PIF", new JArray(session, _vlan ?? ""), serializer); } public long vlan_get_tag(string session, string _vlan) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VLAN.get_tag", new JArray(session, _vlan ?? ""), serializer); } public Dictionary vlan_get_other_config(string session, string _vlan) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VLAN.get_other_config", new JArray(session, _vlan ?? ""), serializer); } public void vlan_set_other_config(string session, string _vlan, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VLAN.set_other_config", new JArray(session, _vlan ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vlan_add_to_other_config(string session, string _vlan, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VLAN.add_to_other_config", new JArray(session, _vlan ?? "", _key ?? "", _value ?? ""), serializer); } public void vlan_remove_from_other_config(string session, string _vlan, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VLAN.remove_from_other_config", new JArray(session, _vlan ?? "", _key ?? ""), serializer); } public XenRef vlan_create(string session, string _tagged_pif, long _tag, string _network) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VLAN.create", new JArray(session, _tagged_pif ?? "", _tag, _network ?? ""), serializer); } public XenRef async_vlan_create(string session, string _tagged_pif, long _tag, string _network) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VLAN.create", new JArray(session, _tagged_pif ?? "", _tag, _network ?? ""), serializer); } public void vlan_destroy(string session, string _vlan) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VLAN.destroy", new JArray(session, _vlan ?? ""), serializer); } public XenRef async_vlan_destroy(string session, string _vlan) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VLAN.destroy", new JArray(session, _vlan ?? ""), serializer); } public List> vlan_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VLAN.get_all", new JArray(session), serializer); } public Dictionary, VLAN> vlan_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VLAN>>("VLAN.get_all_records", new JArray(session), serializer); } public SM sm_get_record(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_record", new JArray(session, _sm ?? ""), serializer); } public XenRef sm_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SM.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> sm_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SM.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string sm_get_uuid(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_uuid", new JArray(session, _sm ?? ""), serializer); } public string sm_get_name_label(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_name_label", new JArray(session, _sm ?? ""), serializer); } public string sm_get_name_description(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_name_description", new JArray(session, _sm ?? ""), serializer); } public string sm_get_type(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_type", new JArray(session, _sm ?? ""), serializer); } public string sm_get_vendor(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_vendor", new JArray(session, _sm ?? ""), serializer); } public string sm_get_copyright(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_copyright", new JArray(session, _sm ?? ""), serializer); } public string sm_get_version(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_version", new JArray(session, _sm ?? ""), serializer); } public string sm_get_required_api_version(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_required_api_version", new JArray(session, _sm ?? ""), serializer); } public Dictionary sm_get_configuration(string session, string _sm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SM.get_configuration", new JArray(session, _sm ?? ""), serializer); } public string[] sm_get_capabilities(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_capabilities", new JArray(session, _sm ?? ""), serializer); } public Dictionary sm_get_features(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SM.get_features", new JArray(session, _sm ?? ""), serializer); } public Dictionary sm_get_other_config(string session, string _sm) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SM.get_other_config", new JArray(session, _sm ?? ""), serializer); } public string sm_get_driver_filename(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_driver_filename", new JArray(session, _sm ?? ""), serializer); } public string[] sm_get_required_cluster_stack(string session, string _sm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SM.get_required_cluster_stack", new JArray(session, _sm ?? ""), serializer); } public void sm_set_other_config(string session, string _sm, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SM.set_other_config", new JArray(session, _sm ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void sm_add_to_other_config(string session, string _sm, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SM.add_to_other_config", new JArray(session, _sm ?? "", _key ?? "", _value ?? ""), serializer); } public void sm_remove_from_other_config(string session, string _sm, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SM.remove_from_other_config", new JArray(session, _sm ?? "", _key ?? ""), serializer); } public List> sm_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SM.get_all", new JArray(session), serializer); } public Dictionary, SM> sm_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, SM>>("SM.get_all_records", new JArray(session), serializer); } public SR sr_get_record(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_record", new JArray(session, _sr ?? ""), serializer); } public XenRef sr_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> sr_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SR.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string sr_get_uuid(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_uuid", new JArray(session, _sr ?? ""), serializer); } public string sr_get_name_label(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_name_label", new JArray(session, _sr ?? ""), serializer); } public string sr_get_name_description(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_name_description", new JArray(session, _sr ?? ""), serializer); } public List sr_get_allowed_operations(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.get_allowed_operations", new JArray(session, _sr ?? ""), serializer); } public Dictionary sr_get_current_operations(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.get_current_operations", new JArray(session, _sr ?? ""), serializer); } public List> sr_get_vdis(string session, string _sr) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SR.get_VDIs", new JArray(session, _sr ?? ""), serializer); } public List> sr_get_pbds(string session, string _sr) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SR.get_PBDs", new JArray(session, _sr ?? ""), serializer); } public long sr_get_virtual_allocation(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_virtual_allocation", new JArray(session, _sr ?? ""), serializer); } public long sr_get_physical_utilisation(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_physical_utilisation", new JArray(session, _sr ?? ""), serializer); } public long sr_get_physical_size(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_physical_size", new JArray(session, _sr ?? ""), serializer); } public string sr_get_type(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_type", new JArray(session, _sr ?? ""), serializer); } public string sr_get_content_type(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_content_type", new JArray(session, _sr ?? ""), serializer); } public bool sr_get_shared(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_shared", new JArray(session, _sr ?? ""), serializer); } public Dictionary sr_get_other_config(string session, string _sr) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.get_other_config", new JArray(session, _sr ?? ""), serializer); } public string[] sr_get_tags(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_tags", new JArray(session, _sr ?? ""), serializer); } public Dictionary sr_get_sm_config(string session, string _sr) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.get_sm_config", new JArray(session, _sr ?? ""), serializer); } public Dictionary> sr_get_blobs(string session, string _sr) { var converters = new List {new StringXenRefMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SR.get_blobs", new JArray(session, _sr ?? ""), serializer); } public bool sr_get_local_cache_enabled(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_local_cache_enabled", new JArray(session, _sr ?? ""), serializer); } public XenRef sr_get_introduced_by(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.get_introduced_by", new JArray(session, _sr ?? ""), serializer); } public bool sr_get_clustered(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_clustered", new JArray(session, _sr ?? ""), serializer); } public bool sr_get_is_tools_sr(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_is_tools_sr", new JArray(session, _sr ?? ""), serializer); } public void sr_set_other_config(string session, string _sr, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_other_config", new JArray(session, _sr ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void sr_add_to_other_config(string session, string _sr, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.add_to_other_config", new JArray(session, _sr ?? "", _key ?? "", _value ?? ""), serializer); } public void sr_remove_from_other_config(string session, string _sr, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.remove_from_other_config", new JArray(session, _sr ?? "", _key ?? ""), serializer); } public void sr_set_tags(string session, string _sr, string[] _tags) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_tags", new JArray(session, _sr ?? "", _tags == null ? new JArray() : JArray.FromObject(_tags)), serializer); } public void sr_add_tags(string session, string _sr, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.add_tags", new JArray(session, _sr ?? "", _value ?? ""), serializer); } public void sr_remove_tags(string session, string _sr, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.remove_tags", new JArray(session, _sr ?? "", _value ?? ""), serializer); } public void sr_set_sm_config(string session, string _sr, Dictionary _sm_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_sm_config", new JArray(session, _sr ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public void sr_add_to_sm_config(string session, string _sr, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.add_to_sm_config", new JArray(session, _sr ?? "", _key ?? "", _value ?? ""), serializer); } public void sr_remove_from_sm_config(string session, string _sr, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.remove_from_sm_config", new JArray(session, _sr ?? "", _key ?? ""), serializer); } public XenRef sr_create(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type, bool _shared) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.create", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared), serializer); } public XenRef async_sr_create(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type, bool _shared) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.create", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared), serializer); } public XenRef sr_create(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type, bool _shared, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.create", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared, _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef async_sr_create(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type, bool _shared, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.create", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared, _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef sr_introduce(string session, string _uuid, string _name_label, string _name_description, string _type, string _content_type, bool _shared) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared), serializer); } public XenRef async_sr_introduce(string session, string _uuid, string _name_label, string _name_description, string _type, string _content_type, bool _shared) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared), serializer); } public XenRef sr_introduce(string session, string _uuid, string _name_label, string _name_description, string _type, string _content_type, bool _shared, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared, _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef async_sr_introduce(string session, string _uuid, string _name_label, string _name_description, string _type, string _content_type, bool _shared, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _shared, _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public string sr_make(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.make", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? ""), serializer); } public XenRef async_sr_make(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.make", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? ""), serializer); } public string sr_make(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.make", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef async_sr_make(string session, string _host, Dictionary _device_config, long _physical_size, string _name_label, string _name_description, string _type, string _content_type, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.make", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _physical_size, _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public void sr_destroy(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.destroy", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_destroy(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.destroy", new JArray(session, _sr ?? ""), serializer); } public void sr_forget(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.forget", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_forget(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.forget", new JArray(session, _sr ?? ""), serializer); } public void sr_update(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.update", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_update(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.update", new JArray(session, _sr ?? ""), serializer); } public string[] sr_get_supported_types(string session) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.get_supported_types", new JArray(session), serializer); } public void sr_scan(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.scan", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_scan(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.scan", new JArray(session, _sr ?? ""), serializer); } public string sr_probe(string session, string _host, Dictionary _device_config, string _type, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.probe", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _type ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef async_sr_probe(string session, string _host, Dictionary _device_config, string _type, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.probe", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _type ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } + public List sr_probe_ext(string session, string _host, Dictionary _device_config, string _type, Dictionary _sm_config) + { + var converters = new List {new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; + var serializer = CreateSerializer(converters); + return Rpc>("SR.probe_ext", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _type ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); + } + + public XenRef async_sr_probe_ext(string session, string _host, Dictionary _device_config, string _type, Dictionary _sm_config) + { + var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; + var serializer = CreateSerializer(converters); + return Rpc>("Async.SR.probe_ext", new JArray(session, _host ?? "", _device_config == null ? new JObject() : JObject.FromObject(_device_config, serializer), _type ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); + } + public void sr_set_shared(string session, string _sr, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_shared", new JArray(session, _sr ?? "", _value), serializer); } public XenRef async_sr_set_shared(string session, string _sr, bool _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.set_shared", new JArray(session, _sr ?? "", _value), serializer); } public void sr_set_name_label(string session, string _sr, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_name_label", new JArray(session, _sr ?? "", _value ?? ""), serializer); } public XenRef async_sr_set_name_label(string session, string _sr, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.set_name_label", new JArray(session, _sr ?? "", _value ?? ""), serializer); } public void sr_set_name_description(string session, string _sr, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_name_description", new JArray(session, _sr ?? "", _value ?? ""), serializer); } public XenRef async_sr_set_name_description(string session, string _sr, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.set_name_description", new JArray(session, _sr ?? "", _value ?? ""), serializer); } public XenRef sr_create_new_blob(string session, string _sr, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.create_new_blob", new JArray(session, _sr ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef async_sr_create_new_blob(string session, string _sr, string _name, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.create_new_blob", new JArray(session, _sr ?? "", _name ?? "", _mime_type ?? ""), serializer); } public XenRef sr_create_new_blob(string session, string _sr, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.create_new_blob", new JArray(session, _sr ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public XenRef async_sr_create_new_blob(string session, string _sr, string _name, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.create_new_blob", new JArray(session, _sr ?? "", _name ?? "", _mime_type ?? "", _public), serializer); } public void sr_set_physical_size(string session, string _sr, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_physical_size", new JArray(session, _sr ?? "", _value), serializer); } public void sr_set_virtual_allocation(string session, string _sr, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_virtual_allocation", new JArray(session, _sr ?? "", _value), serializer); } public void sr_set_physical_utilisation(string session, string _sr, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.set_physical_utilisation", new JArray(session, _sr ?? "", _value), serializer); } public void sr_assert_can_host_ha_statefile(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.assert_can_host_ha_statefile", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_assert_can_host_ha_statefile(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.assert_can_host_ha_statefile", new JArray(session, _sr ?? ""), serializer); } public void sr_assert_supports_database_replication(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.assert_supports_database_replication", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_assert_supports_database_replication(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.assert_supports_database_replication", new JArray(session, _sr ?? ""), serializer); } public void sr_enable_database_replication(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.enable_database_replication", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_enable_database_replication(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.enable_database_replication", new JArray(session, _sr ?? ""), serializer); } public void sr_disable_database_replication(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.disable_database_replication", new JArray(session, _sr ?? ""), serializer); } public XenRef async_sr_disable_database_replication(string session, string _sr) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SR.disable_database_replication", new JArray(session, _sr ?? ""), serializer); } public List sr_get_data_sources(string session, string _sr) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SR.get_data_sources", new JArray(session, _sr ?? ""), serializer); } public void sr_record_data_source(string session, string _sr, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.record_data_source", new JArray(session, _sr ?? "", _data_source ?? ""), serializer); } public double sr_query_data_source(string session, string _sr, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SR.query_data_source", new JArray(session, _sr ?? "", _data_source ?? ""), serializer); } public void sr_forget_data_source_archives(string session, string _sr, string _data_source) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SR.forget_data_source_archives", new JArray(session, _sr ?? "", _data_source ?? ""), serializer); } public List> sr_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SR.get_all", new JArray(session), serializer); } public Dictionary, SR> sr_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, SR>>("SR.get_all_records", new JArray(session), serializer); } + public Dictionary, Sr_stat> sr_stat_get_all_records(string session) + { + var converters = new List {new XenRefXenObjectMapConverter()}; + var serializer = CreateSerializer(converters); + return Rpc, Sr_stat>>("sr_stat.get_all_records", new JArray(session), serializer); + } + + public Dictionary, Probe_result> probe_result_get_all_records(string session) + { + var converters = new List {new XenRefXenObjectMapConverter()}; + var serializer = CreateSerializer(converters); + return Rpc, Probe_result>>("probe_result.get_all_records", new JArray(session), serializer); + } + public LVHD lvhd_get_record(string session, string _lvhd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("LVHD.get_record", new JArray(session, _lvhd ?? ""), serializer); } public XenRef lvhd_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("LVHD.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string lvhd_get_uuid(string session, string _lvhd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("LVHD.get_uuid", new JArray(session, _lvhd ?? ""), serializer); } public string lvhd_enable_thin_provisioning(string session, string _host, string _sr, long _initial_allocation, long _allocation_quantum) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("LVHD.enable_thin_provisioning", new JArray(session, _host ?? "", _sr ?? "", _initial_allocation, _allocation_quantum), serializer); } public XenRef async_lvhd_enable_thin_provisioning(string session, string _host, string _sr, long _initial_allocation, long _allocation_quantum) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.LVHD.enable_thin_provisioning", new JArray(session, _host ?? "", _sr ?? "", _initial_allocation, _allocation_quantum), serializer); } public Dictionary, LVHD> lvhd_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, LVHD>>("LVHD.get_all_records", new JArray(session), serializer); } public VDI vdi_get_record(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_record", new JArray(session, _vdi ?? ""), serializer); } public XenRef vdi_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vdi_create(string session, VDI _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vdi_create(string session, VDI _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.create", new JArray(session, _record.ToJObject()), serializer); } public void vdi_destroy(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.destroy", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_destroy(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.destroy", new JArray(session, _vdi ?? ""), serializer); } public List> vdi_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VDI.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string vdi_get_uuid(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_uuid", new JArray(session, _vdi ?? ""), serializer); } public string vdi_get_name_label(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_name_label", new JArray(session, _vdi ?? ""), serializer); } public string vdi_get_name_description(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_name_description", new JArray(session, _vdi ?? ""), serializer); } public List vdi_get_allowed_operations(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_allowed_operations", new JArray(session, _vdi ?? ""), serializer); } public Dictionary vdi_get_current_operations(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_current_operations", new JArray(session, _vdi ?? ""), serializer); } public XenRef vdi_get_sr(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_SR", new JArray(session, _vdi ?? ""), serializer); } public List> vdi_get_vbds(string session, string _vdi) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VDI.get_VBDs", new JArray(session, _vdi ?? ""), serializer); } public List> vdi_get_crash_dumps(string session, string _vdi) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VDI.get_crash_dumps", new JArray(session, _vdi ?? ""), serializer); } public long vdi_get_virtual_size(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_virtual_size", new JArray(session, _vdi ?? ""), serializer); } public long vdi_get_physical_utilisation(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_physical_utilisation", new JArray(session, _vdi ?? ""), serializer); } public vdi_type vdi_get_type(string session, string _vdi) { var converters = new List {new vdi_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_type", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_sharable(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_sharable", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_read_only(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_read_only", new JArray(session, _vdi ?? ""), serializer); } public Dictionary vdi_get_other_config(string session, string _vdi) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_other_config", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_storage_lock(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_storage_lock", new JArray(session, _vdi ?? ""), serializer); } public string vdi_get_location(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_location", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_managed(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_managed", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_missing(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_missing", new JArray(session, _vdi ?? ""), serializer); } public XenRef vdi_get_parent(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_parent", new JArray(session, _vdi ?? ""), serializer); } public Dictionary vdi_get_xenstore_data(string session, string _vdi) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_xenstore_data", new JArray(session, _vdi ?? ""), serializer); } public Dictionary vdi_get_sm_config(string session, string _vdi) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_sm_config", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_is_a_snapshot(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_is_a_snapshot", new JArray(session, _vdi ?? ""), serializer); } public XenRef vdi_get_snapshot_of(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_snapshot_of", new JArray(session, _vdi ?? ""), serializer); } public List> vdi_get_snapshots(string session, string _vdi) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VDI.get_snapshots", new JArray(session, _vdi ?? ""), serializer); } public DateTime vdi_get_snapshot_time(string session, string _vdi) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_snapshot_time", new JArray(session, _vdi ?? ""), serializer); } public string[] vdi_get_tags(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_tags", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_allow_caching(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_allow_caching", new JArray(session, _vdi ?? ""), serializer); } public on_boot vdi_get_on_boot(string session, string _vdi) { var converters = new List {new on_bootConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_on_boot", new JArray(session, _vdi ?? ""), serializer); } public XenRef vdi_get_metadata_of_pool(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_metadata_of_pool", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_metadata_latest(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_metadata_latest", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_is_tools_iso(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_is_tools_iso", new JArray(session, _vdi ?? ""), serializer); } public bool vdi_get_cbt_enabled(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.get_cbt_enabled", new JArray(session, _vdi ?? ""), serializer); } public void vdi_set_other_config(string session, string _vdi, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_other_config", new JArray(session, _vdi ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vdi_add_to_other_config(string session, string _vdi, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.add_to_other_config", new JArray(session, _vdi ?? "", _key ?? "", _value ?? ""), serializer); } public void vdi_remove_from_other_config(string session, string _vdi, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.remove_from_other_config", new JArray(session, _vdi ?? "", _key ?? ""), serializer); } public void vdi_set_xenstore_data(string session, string _vdi, Dictionary _xenstore_data) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_xenstore_data", new JArray(session, _vdi ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer)), serializer); } public void vdi_add_to_xenstore_data(string session, string _vdi, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.add_to_xenstore_data", new JArray(session, _vdi ?? "", _key ?? "", _value ?? ""), serializer); } public void vdi_remove_from_xenstore_data(string session, string _vdi, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.remove_from_xenstore_data", new JArray(session, _vdi ?? "", _key ?? ""), serializer); } public void vdi_set_sm_config(string session, string _vdi, Dictionary _sm_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_sm_config", new JArray(session, _vdi ?? "", _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public void vdi_add_to_sm_config(string session, string _vdi, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.add_to_sm_config", new JArray(session, _vdi ?? "", _key ?? "", _value ?? ""), serializer); } public void vdi_remove_from_sm_config(string session, string _vdi, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.remove_from_sm_config", new JArray(session, _vdi ?? "", _key ?? ""), serializer); } public void vdi_set_tags(string session, string _vdi, string[] _tags) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_tags", new JArray(session, _vdi ?? "", _tags == null ? new JArray() : JArray.FromObject(_tags)), serializer); } public void vdi_add_tags(string session, string _vdi, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.add_tags", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public void vdi_remove_tags(string session, string _vdi, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.remove_tags", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public XenRef vdi_snapshot(string session, string _vdi, Dictionary _driver_params) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.snapshot", new JArray(session, _vdi ?? "", _driver_params == null ? new JObject() : JObject.FromObject(_driver_params, serializer)), serializer); } public XenRef async_vdi_snapshot(string session, string _vdi, Dictionary _driver_params) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.snapshot", new JArray(session, _vdi ?? "", _driver_params == null ? new JObject() : JObject.FromObject(_driver_params, serializer)), serializer); } public XenRef vdi_clone(string session, string _vdi, Dictionary _driver_params) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.clone", new JArray(session, _vdi ?? "", _driver_params == null ? new JObject() : JObject.FromObject(_driver_params, serializer)), serializer); } public XenRef async_vdi_clone(string session, string _vdi, Dictionary _driver_params) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.clone", new JArray(session, _vdi ?? "", _driver_params == null ? new JObject() : JObject.FromObject(_driver_params, serializer)), serializer); } public void vdi_resize(string session, string _vdi, long _size) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.resize", new JArray(session, _vdi ?? "", _size), serializer); } public XenRef async_vdi_resize(string session, string _vdi, long _size) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.resize", new JArray(session, _vdi ?? "", _size), serializer); } public void vdi_resize_online(string session, string _vdi, long _size) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.resize_online", new JArray(session, _vdi ?? "", _size), serializer); } public XenRef async_vdi_resize_online(string session, string _vdi, long _size) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.resize_online", new JArray(session, _vdi ?? "", _size), serializer); } public XenRef vdi_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef async_vdi_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef vdi_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config, bool _managed, long _virtual_size, long _physical_utilisation, string _metadata_of_pool, bool _is_a_snapshot, DateTime _snapshot_time, string _snapshot_of) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new XenRefConverter(), new XenDateTimeConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer), _managed, _virtual_size, _physical_utilisation, _metadata_of_pool ?? "", _is_a_snapshot, _snapshot_time, _snapshot_of ?? ""), serializer); } public XenRef async_vdi_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config, bool _managed, long _virtual_size, long _physical_utilisation, string _metadata_of_pool, bool _is_a_snapshot, DateTime _snapshot_time, string _snapshot_of) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new XenRefConverter(), new XenDateTimeConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer), _managed, _virtual_size, _physical_utilisation, _metadata_of_pool ?? "", _is_a_snapshot, _snapshot_time, _snapshot_of ?? ""), serializer); } public XenRef vdi_db_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.db_introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef async_vdi_db_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.db_introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer)), serializer); } public XenRef vdi_db_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config, bool _managed, long _virtual_size, long _physical_utilisation, string _metadata_of_pool, bool _is_a_snapshot, DateTime _snapshot_time, string _snapshot_of) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new XenRefConverter(), new XenDateTimeConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.db_introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer), _managed, _virtual_size, _physical_utilisation, _metadata_of_pool ?? "", _is_a_snapshot, _snapshot_time, _snapshot_of ?? ""), serializer); } public XenRef async_vdi_db_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config, bool _managed, long _virtual_size, long _physical_utilisation, string _metadata_of_pool, bool _is_a_snapshot, DateTime _snapshot_time, string _snapshot_of) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new XenRefConverter(), new XenDateTimeConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.db_introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer), _managed, _virtual_size, _physical_utilisation, _metadata_of_pool ?? "", _is_a_snapshot, _snapshot_time, _snapshot_of ?? ""), serializer); } public XenRef vdi_db_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config, bool _managed, long _virtual_size, long _physical_utilisation, string _metadata_of_pool, bool _is_a_snapshot, DateTime _snapshot_time, string _snapshot_of, bool _cbt_enabled) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new XenRefConverter(), new XenDateTimeConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.db_introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer), _managed, _virtual_size, _physical_utilisation, _metadata_of_pool ?? "", _is_a_snapshot, _snapshot_time, _snapshot_of ?? "", _cbt_enabled), serializer); } public XenRef async_vdi_db_introduce(string session, string _uuid, string _name_label, string _name_description, string _sr, vdi_type _type, bool _sharable, bool _read_only, Dictionary _other_config, string _location, Dictionary _xenstore_data, Dictionary _sm_config, bool _managed, long _virtual_size, long _physical_utilisation, string _metadata_of_pool, bool _is_a_snapshot, DateTime _snapshot_time, string _snapshot_of, bool _cbt_enabled) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new vdi_typeConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new StringStringMapConverter(), new XenRefConverter(), new XenDateTimeConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.db_introduce", new JArray(session, _uuid ?? "", _name_label ?? "", _name_description ?? "", _sr ?? "", _type.StringOf(), _sharable, _read_only, _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _location ?? "", _xenstore_data == null ? new JObject() : JObject.FromObject(_xenstore_data, serializer), _sm_config == null ? new JObject() : JObject.FromObject(_sm_config, serializer), _managed, _virtual_size, _physical_utilisation, _metadata_of_pool ?? "", _is_a_snapshot, _snapshot_time, _snapshot_of ?? "", _cbt_enabled), serializer); } public void vdi_db_forget(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.db_forget", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_db_forget(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.db_forget", new JArray(session, _vdi ?? ""), serializer); } public void vdi_update(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.update", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_update(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.update", new JArray(session, _vdi ?? ""), serializer); } public XenRef vdi_copy(string session, string _vdi, string _sr) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.copy", new JArray(session, _vdi ?? "", _sr ?? ""), serializer); } public XenRef async_vdi_copy(string session, string _vdi, string _sr) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.copy", new JArray(session, _vdi ?? "", _sr ?? ""), serializer); } public XenRef vdi_copy(string session, string _vdi, string _sr, string _base_vdi, string _into_vdi) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.copy", new JArray(session, _vdi ?? "", _sr ?? "", _base_vdi ?? "", _into_vdi ?? ""), serializer); } public XenRef async_vdi_copy(string session, string _vdi, string _sr, string _base_vdi, string _into_vdi) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.copy", new JArray(session, _vdi ?? "", _sr ?? "", _base_vdi ?? "", _into_vdi ?? ""), serializer); } public void vdi_set_managed(string session, string _vdi, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_managed", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_forget(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.forget", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_forget(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.forget", new JArray(session, _vdi ?? ""), serializer); } public void vdi_set_sharable(string session, string _vdi, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_sharable", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_set_read_only(string session, string _vdi, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_read_only", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_set_missing(string session, string _vdi, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_missing", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_set_virtual_size(string session, string _vdi, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_virtual_size", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_set_physical_utilisation(string session, string _vdi, long _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_physical_utilisation", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_set_is_a_snapshot(string session, string _vdi, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_is_a_snapshot", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_set_snapshot_of(string session, string _vdi, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_snapshot_of", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public void vdi_set_snapshot_time(string session, string _vdi, DateTime _value) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_snapshot_time", new JArray(session, _vdi ?? "", _value), serializer); } public void vdi_set_metadata_of_pool(string session, string _vdi, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_metadata_of_pool", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public void vdi_set_name_label(string session, string _vdi, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_name_label", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public XenRef async_vdi_set_name_label(string session, string _vdi, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.set_name_label", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public void vdi_set_name_description(string session, string _vdi, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_name_description", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public XenRef async_vdi_set_name_description(string session, string _vdi, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.set_name_description", new JArray(session, _vdi ?? "", _value ?? ""), serializer); } public void vdi_set_on_boot(string session, string _vdi, on_boot _value) { var converters = new List {new on_bootConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_on_boot", new JArray(session, _vdi ?? "", _value.StringOf()), serializer); } public XenRef async_vdi_set_on_boot(string session, string _vdi, on_boot _value) { var converters = new List {new XenRefConverter(), new on_bootConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.set_on_boot", new JArray(session, _vdi ?? "", _value.StringOf()), serializer); } public void vdi_set_allow_caching(string session, string _vdi, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.set_allow_caching", new JArray(session, _vdi ?? "", _value), serializer); } public XenRef async_vdi_set_allow_caching(string session, string _vdi, bool _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.set_allow_caching", new JArray(session, _vdi ?? "", _value), serializer); } public XenRef vdi_open_database(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.open_database", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_open_database(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.open_database", new JArray(session, _vdi ?? ""), serializer); } public string vdi_read_database_pool_uuid(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.read_database_pool_uuid", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_read_database_pool_uuid(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.read_database_pool_uuid", new JArray(session, _vdi ?? ""), serializer); } public XenRef vdi_pool_migrate(string session, string _vdi, string _sr, Dictionary _options) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.pool_migrate", new JArray(session, _vdi ?? "", _sr ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public XenRef async_vdi_pool_migrate(string session, string _vdi, string _sr, Dictionary _options) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.pool_migrate", new JArray(session, _vdi ?? "", _sr ?? "", _options == null ? new JObject() : JObject.FromObject(_options, serializer)), serializer); } public void vdi_enable_cbt(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.enable_cbt", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_enable_cbt(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.enable_cbt", new JArray(session, _vdi ?? ""), serializer); } public void vdi_disable_cbt(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.disable_cbt", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_disable_cbt(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.disable_cbt", new JArray(session, _vdi ?? ""), serializer); } public void vdi_data_destroy(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VDI.data_destroy", new JArray(session, _vdi ?? ""), serializer); } public XenRef async_vdi_data_destroy(string session, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.data_destroy", new JArray(session, _vdi ?? ""), serializer); } public string vdi_list_changed_blocks(string session, string _vdi, string _vdi_to) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VDI.list_changed_blocks", new JArray(session, _vdi ?? "", _vdi_to ?? ""), serializer); } public XenRef async_vdi_list_changed_blocks(string session, string _vdi, string _vdi_to) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VDI.list_changed_blocks", new JArray(session, _vdi ?? "", _vdi_to ?? ""), serializer); } public List vdi_get_nbd_info(string session, string _vdi) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VDI.get_nbd_info", new JArray(session, _vdi ?? ""), serializer); } public List> vdi_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VDI.get_all", new JArray(session), serializer); } public Dictionary, VDI> vdi_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VDI>>("VDI.get_all_records", new JArray(session), serializer); } public VBD vbd_get_record(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_record", new JArray(session, _vbd ?? ""), serializer); } public XenRef vbd_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vbd_create(string session, VBD _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vbd_create(string session, VBD _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.create", new JArray(session, _record.ToJObject()), serializer); } public void vbd_destroy(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.destroy", new JArray(session, _vbd ?? ""), serializer); } public XenRef async_vbd_destroy(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.destroy", new JArray(session, _vbd ?? ""), serializer); } public string vbd_get_uuid(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_uuid", new JArray(session, _vbd ?? ""), serializer); } public List vbd_get_allowed_operations(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_allowed_operations", new JArray(session, _vbd ?? ""), serializer); } public Dictionary vbd_get_current_operations(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_current_operations", new JArray(session, _vbd ?? ""), serializer); } public XenRef vbd_get_vm(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_VM", new JArray(session, _vbd ?? ""), serializer); } public XenRef vbd_get_vdi(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_VDI", new JArray(session, _vbd ?? ""), serializer); } public string vbd_get_device(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_device", new JArray(session, _vbd ?? ""), serializer); } public string vbd_get_userdevice(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_userdevice", new JArray(session, _vbd ?? ""), serializer); } public bool vbd_get_bootable(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_bootable", new JArray(session, _vbd ?? ""), serializer); } public vbd_mode vbd_get_mode(string session, string _vbd) { var converters = new List {new vbd_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_mode", new JArray(session, _vbd ?? ""), serializer); } public vbd_type vbd_get_type(string session, string _vbd) { var converters = new List {new vbd_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_type", new JArray(session, _vbd ?? ""), serializer); } public bool vbd_get_unpluggable(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_unpluggable", new JArray(session, _vbd ?? ""), serializer); } public bool vbd_get_storage_lock(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_storage_lock", new JArray(session, _vbd ?? ""), serializer); } public bool vbd_get_empty(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_empty", new JArray(session, _vbd ?? ""), serializer); } public Dictionary vbd_get_other_config(string session, string _vbd) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_other_config", new JArray(session, _vbd ?? ""), serializer); } public bool vbd_get_currently_attached(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_currently_attached", new JArray(session, _vbd ?? ""), serializer); } public long vbd_get_status_code(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_status_code", new JArray(session, _vbd ?? ""), serializer); } public string vbd_get_status_detail(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_status_detail", new JArray(session, _vbd ?? ""), serializer); } public Dictionary vbd_get_runtime_properties(string session, string _vbd) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_runtime_properties", new JArray(session, _vbd ?? ""), serializer); } public string vbd_get_qos_algorithm_type(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_qos_algorithm_type", new JArray(session, _vbd ?? ""), serializer); } public Dictionary vbd_get_qos_algorithm_params(string session, string _vbd) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_qos_algorithm_params", new JArray(session, _vbd ?? ""), serializer); } public string[] vbd_get_qos_supported_algorithms(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD.get_qos_supported_algorithms", new JArray(session, _vbd ?? ""), serializer); } public XenRef vbd_get_metrics(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD.get_metrics", new JArray(session, _vbd ?? ""), serializer); } public void vbd_set_userdevice(string session, string _vbd, string _userdevice) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_userdevice", new JArray(session, _vbd ?? "", _userdevice ?? ""), serializer); } public void vbd_set_bootable(string session, string _vbd, bool _bootable) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_bootable", new JArray(session, _vbd ?? "", _bootable), serializer); } public void vbd_set_type(string session, string _vbd, vbd_type _type) { var converters = new List {new vbd_typeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_type", new JArray(session, _vbd ?? "", _type.StringOf()), serializer); } public void vbd_set_unpluggable(string session, string _vbd, bool _unpluggable) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_unpluggable", new JArray(session, _vbd ?? "", _unpluggable), serializer); } public void vbd_set_other_config(string session, string _vbd, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_other_config", new JArray(session, _vbd ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vbd_add_to_other_config(string session, string _vbd, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.add_to_other_config", new JArray(session, _vbd ?? "", _key ?? "", _value ?? ""), serializer); } public void vbd_remove_from_other_config(string session, string _vbd, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.remove_from_other_config", new JArray(session, _vbd ?? "", _key ?? ""), serializer); } public void vbd_set_qos_algorithm_type(string session, string _vbd, string _algorithm_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_qos_algorithm_type", new JArray(session, _vbd ?? "", _algorithm_type ?? ""), serializer); } public void vbd_set_qos_algorithm_params(string session, string _vbd, Dictionary _algorithm_params) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_qos_algorithm_params", new JArray(session, _vbd ?? "", _algorithm_params == null ? new JObject() : JObject.FromObject(_algorithm_params, serializer)), serializer); } public void vbd_add_to_qos_algorithm_params(string session, string _vbd, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.add_to_qos_algorithm_params", new JArray(session, _vbd ?? "", _key ?? "", _value ?? ""), serializer); } public void vbd_remove_from_qos_algorithm_params(string session, string _vbd, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.remove_from_qos_algorithm_params", new JArray(session, _vbd ?? "", _key ?? ""), serializer); } public void vbd_eject(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.eject", new JArray(session, _vbd ?? ""), serializer); } public XenRef async_vbd_eject(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.eject", new JArray(session, _vbd ?? ""), serializer); } public void vbd_insert(string session, string _vbd, string _vdi) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.insert", new JArray(session, _vbd ?? "", _vdi ?? ""), serializer); } public XenRef async_vbd_insert(string session, string _vbd, string _vdi) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.insert", new JArray(session, _vbd ?? "", _vdi ?? ""), serializer); } public void vbd_plug(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.plug", new JArray(session, _vbd ?? ""), serializer); } public XenRef async_vbd_plug(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.plug", new JArray(session, _vbd ?? ""), serializer); } public void vbd_unplug(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.unplug", new JArray(session, _vbd ?? ""), serializer); } public XenRef async_vbd_unplug(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.unplug", new JArray(session, _vbd ?? ""), serializer); } public void vbd_unplug_force(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.unplug_force", new JArray(session, _vbd ?? ""), serializer); } public XenRef async_vbd_unplug_force(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.unplug_force", new JArray(session, _vbd ?? ""), serializer); } public void vbd_assert_attachable(string session, string _vbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.assert_attachable", new JArray(session, _vbd ?? ""), serializer); } public XenRef async_vbd_assert_attachable(string session, string _vbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.assert_attachable", new JArray(session, _vbd ?? ""), serializer); } public void vbd_set_mode(string session, string _vbd, vbd_mode _value) { var converters = new List {new vbd_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD.set_mode", new JArray(session, _vbd ?? "", _value.StringOf()), serializer); } public XenRef async_vbd_set_mode(string session, string _vbd, vbd_mode _value) { var converters = new List {new XenRefConverter(), new vbd_modeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VBD.set_mode", new JArray(session, _vbd ?? "", _value.StringOf()), serializer); } public List> vbd_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VBD.get_all", new JArray(session), serializer); } public Dictionary, VBD> vbd_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VBD>>("VBD.get_all_records", new JArray(session), serializer); } public VBD_metrics vbd_metrics_get_record(string session, string _vbd_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD_metrics.get_record", new JArray(session, _vbd_metrics ?? ""), serializer); } public XenRef vbd_metrics_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD_metrics.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vbd_metrics_get_uuid(string session, string _vbd_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD_metrics.get_uuid", new JArray(session, _vbd_metrics ?? ""), serializer); } public double vbd_metrics_get_io_read_kbs(string session, string _vbd_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD_metrics.get_io_read_kbs", new JArray(session, _vbd_metrics ?? ""), serializer); } public double vbd_metrics_get_io_write_kbs(string session, string _vbd_metrics) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD_metrics.get_io_write_kbs", new JArray(session, _vbd_metrics ?? ""), serializer); } public DateTime vbd_metrics_get_last_updated(string session, string _vbd_metrics) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VBD_metrics.get_last_updated", new JArray(session, _vbd_metrics ?? ""), serializer); } public Dictionary vbd_metrics_get_other_config(string session, string _vbd_metrics) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VBD_metrics.get_other_config", new JArray(session, _vbd_metrics ?? ""), serializer); } public void vbd_metrics_set_other_config(string session, string _vbd_metrics, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD_metrics.set_other_config", new JArray(session, _vbd_metrics ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vbd_metrics_add_to_other_config(string session, string _vbd_metrics, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD_metrics.add_to_other_config", new JArray(session, _vbd_metrics ?? "", _key ?? "", _value ?? ""), serializer); } public void vbd_metrics_remove_from_other_config(string session, string _vbd_metrics, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VBD_metrics.remove_from_other_config", new JArray(session, _vbd_metrics ?? "", _key ?? ""), serializer); } public List> vbd_metrics_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VBD_metrics.get_all", new JArray(session), serializer); } public Dictionary, VBD_metrics> vbd_metrics_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VBD_metrics>>("VBD_metrics.get_all_records", new JArray(session), serializer); } public PBD pbd_get_record(string session, string _pbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PBD.get_record", new JArray(session, _pbd ?? ""), serializer); } public XenRef pbd_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PBD.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef pbd_create(string session, PBD _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PBD.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_pbd_create(string session, PBD _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PBD.create", new JArray(session, _record.ToJObject()), serializer); } public void pbd_destroy(string session, string _pbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PBD.destroy", new JArray(session, _pbd ?? ""), serializer); } public XenRef async_pbd_destroy(string session, string _pbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PBD.destroy", new JArray(session, _pbd ?? ""), serializer); } public string pbd_get_uuid(string session, string _pbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PBD.get_uuid", new JArray(session, _pbd ?? ""), serializer); } public XenRef pbd_get_host(string session, string _pbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PBD.get_host", new JArray(session, _pbd ?? ""), serializer); } public XenRef pbd_get_sr(string session, string _pbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PBD.get_SR", new JArray(session, _pbd ?? ""), serializer); } public Dictionary pbd_get_device_config(string session, string _pbd) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PBD.get_device_config", new JArray(session, _pbd ?? ""), serializer); } public bool pbd_get_currently_attached(string session, string _pbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PBD.get_currently_attached", new JArray(session, _pbd ?? ""), serializer); } public Dictionary pbd_get_other_config(string session, string _pbd) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PBD.get_other_config", new JArray(session, _pbd ?? ""), serializer); } public void pbd_set_other_config(string session, string _pbd, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PBD.set_other_config", new JArray(session, _pbd ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pbd_add_to_other_config(string session, string _pbd, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PBD.add_to_other_config", new JArray(session, _pbd ?? "", _key ?? "", _value ?? ""), serializer); } public void pbd_remove_from_other_config(string session, string _pbd, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PBD.remove_from_other_config", new JArray(session, _pbd ?? "", _key ?? ""), serializer); } public void pbd_plug(string session, string _pbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PBD.plug", new JArray(session, _pbd ?? ""), serializer); } public XenRef async_pbd_plug(string session, string _pbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PBD.plug", new JArray(session, _pbd ?? ""), serializer); } public void pbd_unplug(string session, string _pbd) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PBD.unplug", new JArray(session, _pbd ?? ""), serializer); } public XenRef async_pbd_unplug(string session, string _pbd) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PBD.unplug", new JArray(session, _pbd ?? ""), serializer); } public void pbd_set_device_config(string session, string _pbd, Dictionary _value) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PBD.set_device_config", new JArray(session, _pbd ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public XenRef async_pbd_set_device_config(string session, string _pbd, Dictionary _value) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PBD.set_device_config", new JArray(session, _pbd ?? "", _value == null ? new JObject() : JObject.FromObject(_value, serializer)), serializer); } public List> pbd_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PBD.get_all", new JArray(session), serializer); } public Dictionary, PBD> pbd_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PBD>>("PBD.get_all_records", new JArray(session), serializer); } public Crashdump crashdump_get_record(string session, string _crashdump) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("crashdump.get_record", new JArray(session, _crashdump ?? ""), serializer); } public XenRef crashdump_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("crashdump.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string crashdump_get_uuid(string session, string _crashdump) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("crashdump.get_uuid", new JArray(session, _crashdump ?? ""), serializer); } public XenRef crashdump_get_vm(string session, string _crashdump) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("crashdump.get_VM", new JArray(session, _crashdump ?? ""), serializer); } public XenRef crashdump_get_vdi(string session, string _crashdump) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("crashdump.get_VDI", new JArray(session, _crashdump ?? ""), serializer); } public Dictionary crashdump_get_other_config(string session, string _crashdump) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("crashdump.get_other_config", new JArray(session, _crashdump ?? ""), serializer); } public void crashdump_set_other_config(string session, string _crashdump, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("crashdump.set_other_config", new JArray(session, _crashdump ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void crashdump_add_to_other_config(string session, string _crashdump, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("crashdump.add_to_other_config", new JArray(session, _crashdump ?? "", _key ?? "", _value ?? ""), serializer); } public void crashdump_remove_from_other_config(string session, string _crashdump, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("crashdump.remove_from_other_config", new JArray(session, _crashdump ?? "", _key ?? ""), serializer); } public void crashdump_destroy(string session, string _crashdump) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("crashdump.destroy", new JArray(session, _crashdump ?? ""), serializer); } public XenRef async_crashdump_destroy(string session, string _crashdump) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.crashdump.destroy", new JArray(session, _crashdump ?? ""), serializer); } public List> crashdump_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("crashdump.get_all", new JArray(session), serializer); } public Dictionary, Crashdump> crashdump_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Crashdump>>("crashdump.get_all_records", new JArray(session), serializer); } public VTPM vtpm_get_record(string session, string _vtpm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VTPM.get_record", new JArray(session, _vtpm ?? ""), serializer); } public XenRef vtpm_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VTPM.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef vtpm_create(string session, VTPM _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VTPM.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_vtpm_create(string session, VTPM _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VTPM.create", new JArray(session, _record.ToJObject()), serializer); } public void vtpm_destroy(string session, string _vtpm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VTPM.destroy", new JArray(session, _vtpm ?? ""), serializer); } public XenRef async_vtpm_destroy(string session, string _vtpm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VTPM.destroy", new JArray(session, _vtpm ?? ""), serializer); } public string vtpm_get_uuid(string session, string _vtpm) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VTPM.get_uuid", new JArray(session, _vtpm ?? ""), serializer); } public XenRef vtpm_get_vm(string session, string _vtpm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VTPM.get_VM", new JArray(session, _vtpm ?? ""), serializer); } public XenRef vtpm_get_backend(string session, string _vtpm) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VTPM.get_backend", new JArray(session, _vtpm ?? ""), serializer); } public Dictionary, VTPM> vtpm_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VTPM>>("VTPM.get_all_records", new JArray(session), serializer); } public Console console_get_record(string session, string _console) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("console.get_record", new JArray(session, _console ?? ""), serializer); } public XenRef console_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("console.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef console_create(string session, Console _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("console.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_console_create(string session, Console _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.console.create", new JArray(session, _record.ToJObject()), serializer); } public void console_destroy(string session, string _console) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("console.destroy", new JArray(session, _console ?? ""), serializer); } public XenRef async_console_destroy(string session, string _console) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.console.destroy", new JArray(session, _console ?? ""), serializer); } public string console_get_uuid(string session, string _console) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("console.get_uuid", new JArray(session, _console ?? ""), serializer); } public console_protocol console_get_protocol(string session, string _console) { var converters = new List {new console_protocolConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("console.get_protocol", new JArray(session, _console ?? ""), serializer); } public string console_get_location(string session, string _console) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("console.get_location", new JArray(session, _console ?? ""), serializer); } public XenRef console_get_vm(string session, string _console) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("console.get_VM", new JArray(session, _console ?? ""), serializer); } public Dictionary console_get_other_config(string session, string _console) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("console.get_other_config", new JArray(session, _console ?? ""), serializer); } public void console_set_other_config(string session, string _console, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("console.set_other_config", new JArray(session, _console ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void console_add_to_other_config(string session, string _console, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("console.add_to_other_config", new JArray(session, _console ?? "", _key ?? "", _value ?? ""), serializer); } public void console_remove_from_other_config(string session, string _console, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("console.remove_from_other_config", new JArray(session, _console ?? "", _key ?? ""), serializer); } public List> console_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("console.get_all", new JArray(session), serializer); } public Dictionary, Console> console_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Console>>("console.get_all_records", new JArray(session), serializer); } public User user_get_record(string session, string _user) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("user.get_record", new JArray(session, _user ?? ""), serializer); } public XenRef user_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("user.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef user_create(string session, User _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("user.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_user_create(string session, User _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.user.create", new JArray(session, _record.ToJObject()), serializer); } public void user_destroy(string session, string _user) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("user.destroy", new JArray(session, _user ?? ""), serializer); } public XenRef async_user_destroy(string session, string _user) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.user.destroy", new JArray(session, _user ?? ""), serializer); } public string user_get_uuid(string session, string _user) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("user.get_uuid", new JArray(session, _user ?? ""), serializer); } public string user_get_short_name(string session, string _user) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("user.get_short_name", new JArray(session, _user ?? ""), serializer); } public string user_get_fullname(string session, string _user) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("user.get_fullname", new JArray(session, _user ?? ""), serializer); } public Dictionary user_get_other_config(string session, string _user) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("user.get_other_config", new JArray(session, _user ?? ""), serializer); } public void user_set_fullname(string session, string _user, string _fullname) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("user.set_fullname", new JArray(session, _user ?? "", _fullname ?? ""), serializer); } public void user_set_other_config(string session, string _user, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("user.set_other_config", new JArray(session, _user ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void user_add_to_other_config(string session, string _user, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("user.add_to_other_config", new JArray(session, _user ?? "", _key ?? "", _value ?? ""), serializer); } public void user_remove_from_other_config(string session, string _user, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("user.remove_from_other_config", new JArray(session, _user ?? "", _key ?? ""), serializer); } public Dictionary, User> user_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, User>>("user.get_all_records", new JArray(session), serializer); } public Dictionary, Data_source> data_source_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Data_source>>("data_source.get_all_records", new JArray(session), serializer); } public Blob blob_get_record(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_record", new JArray(session, _blob ?? ""), serializer); } public XenRef blob_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("blob.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> blob_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("blob.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string blob_get_uuid(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_uuid", new JArray(session, _blob ?? ""), serializer); } public string blob_get_name_label(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_name_label", new JArray(session, _blob ?? ""), serializer); } public string blob_get_name_description(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_name_description", new JArray(session, _blob ?? ""), serializer); } public long blob_get_size(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_size", new JArray(session, _blob ?? ""), serializer); } public bool blob_get_public(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_public", new JArray(session, _blob ?? ""), serializer); } public DateTime blob_get_last_updated(string session, string _blob) { var converters = new List {new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_last_updated", new JArray(session, _blob ?? ""), serializer); } public string blob_get_mime_type(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("blob.get_mime_type", new JArray(session, _blob ?? ""), serializer); } public void blob_set_name_label(string session, string _blob, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("blob.set_name_label", new JArray(session, _blob ?? "", _label ?? ""), serializer); } public void blob_set_name_description(string session, string _blob, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("blob.set_name_description", new JArray(session, _blob ?? "", _description ?? ""), serializer); } public void blob_set_public(string session, string _blob, bool _public) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("blob.set_public", new JArray(session, _blob ?? "", _public), serializer); } public XenRef blob_create(string session, string _mime_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("blob.create", new JArray(session, _mime_type ?? ""), serializer); } public XenRef blob_create(string session, string _mime_type, bool _public) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("blob.create", new JArray(session, _mime_type ?? "", _public), serializer); } public void blob_destroy(string session, string _blob) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("blob.destroy", new JArray(session, _blob ?? ""), serializer); } public List> blob_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("blob.get_all", new JArray(session), serializer); } public Dictionary, Blob> blob_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Blob>>("blob.get_all_records", new JArray(session), serializer); } public XenRef message_create(string session, string _name, long _priority, cls _cls, string _obj_uuid, string _body) { var converters = new List {new XenRefConverter(), new clsConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("message.create", new JArray(session, _name ?? "", _priority, _cls.StringOf(), _obj_uuid ?? "", _body ?? ""), serializer); } public void message_destroy(string session, string _message) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("message.destroy", new JArray(session, _message ?? ""), serializer); } public Dictionary, Message> message_get(string session, cls _cls, string _obj_uuid, DateTime _since) { var converters = new List {new XenRefXenObjectMapConverter(), new clsConverter(), new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Message>>("message.get", new JArray(session, _cls.StringOf(), _obj_uuid ?? "", _since), serializer); } public List> message_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("message.get_all", new JArray(session), serializer); } public Dictionary, Message> message_get_since(string session, DateTime _since) { var converters = new List {new XenRefXenObjectMapConverter(), new XenDateTimeConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Message>>("message.get_since", new JArray(session, _since), serializer); } public Message message_get_record(string session, string _message) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("message.get_record", new JArray(session, _message ?? ""), serializer); } public XenRef message_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("message.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public Dictionary, Message> message_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Message>>("message.get_all_records", new JArray(session), serializer); } public Dictionary, Message> message_get_all_records_where(string session, string _expr) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Message>>("message.get_all_records_where", new JArray(session, _expr ?? ""), serializer); } public Secret secret_get_record(string session, string _secret) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("secret.get_record", new JArray(session, _secret ?? ""), serializer); } public XenRef secret_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("secret.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef secret_create(string session, Secret _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("secret.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_secret_create(string session, Secret _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.secret.create", new JArray(session, _record.ToJObject()), serializer); } public void secret_destroy(string session, string _secret) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("secret.destroy", new JArray(session, _secret ?? ""), serializer); } public XenRef async_secret_destroy(string session, string _secret) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.secret.destroy", new JArray(session, _secret ?? ""), serializer); } public string secret_get_uuid(string session, string _secret) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("secret.get_uuid", new JArray(session, _secret ?? ""), serializer); } public string secret_get_value(string session, string _secret) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("secret.get_value", new JArray(session, _secret ?? ""), serializer); } public Dictionary secret_get_other_config(string session, string _secret) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("secret.get_other_config", new JArray(session, _secret ?? ""), serializer); } public void secret_set_value(string session, string _secret, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("secret.set_value", new JArray(session, _secret ?? "", _value ?? ""), serializer); } public void secret_set_other_config(string session, string _secret, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("secret.set_other_config", new JArray(session, _secret ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void secret_add_to_other_config(string session, string _secret, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("secret.add_to_other_config", new JArray(session, _secret ?? "", _key ?? "", _value ?? ""), serializer); } public void secret_remove_from_other_config(string session, string _secret, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("secret.remove_from_other_config", new JArray(session, _secret ?? "", _key ?? ""), serializer); } public List> secret_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("secret.get_all", new JArray(session), serializer); } public Dictionary, Secret> secret_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Secret>>("secret.get_all_records", new JArray(session), serializer); } public Tunnel tunnel_get_record(string session, string _tunnel) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("tunnel.get_record", new JArray(session, _tunnel ?? ""), serializer); } public XenRef tunnel_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("tunnel.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string tunnel_get_uuid(string session, string _tunnel) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("tunnel.get_uuid", new JArray(session, _tunnel ?? ""), serializer); } public XenRef tunnel_get_access_pif(string session, string _tunnel) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("tunnel.get_access_PIF", new JArray(session, _tunnel ?? ""), serializer); } public XenRef tunnel_get_transport_pif(string session, string _tunnel) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("tunnel.get_transport_PIF", new JArray(session, _tunnel ?? ""), serializer); } public Dictionary tunnel_get_status(string session, string _tunnel) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("tunnel.get_status", new JArray(session, _tunnel ?? ""), serializer); } public Dictionary tunnel_get_other_config(string session, string _tunnel) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("tunnel.get_other_config", new JArray(session, _tunnel ?? ""), serializer); } public void tunnel_set_status(string session, string _tunnel, Dictionary _status) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("tunnel.set_status", new JArray(session, _tunnel ?? "", _status == null ? new JObject() : JObject.FromObject(_status, serializer)), serializer); } public void tunnel_add_to_status(string session, string _tunnel, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("tunnel.add_to_status", new JArray(session, _tunnel ?? "", _key ?? "", _value ?? ""), serializer); } public void tunnel_remove_from_status(string session, string _tunnel, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("tunnel.remove_from_status", new JArray(session, _tunnel ?? "", _key ?? ""), serializer); } public void tunnel_set_other_config(string session, string _tunnel, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("tunnel.set_other_config", new JArray(session, _tunnel ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void tunnel_add_to_other_config(string session, string _tunnel, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("tunnel.add_to_other_config", new JArray(session, _tunnel ?? "", _key ?? "", _value ?? ""), serializer); } public void tunnel_remove_from_other_config(string session, string _tunnel, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("tunnel.remove_from_other_config", new JArray(session, _tunnel ?? "", _key ?? ""), serializer); } public XenRef tunnel_create(string session, string _transport_pif, string _network) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("tunnel.create", new JArray(session, _transport_pif ?? "", _network ?? ""), serializer); } public XenRef async_tunnel_create(string session, string _transport_pif, string _network) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.tunnel.create", new JArray(session, _transport_pif ?? "", _network ?? ""), serializer); } public void tunnel_destroy(string session, string _tunnel) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("tunnel.destroy", new JArray(session, _tunnel ?? ""), serializer); } public XenRef async_tunnel_destroy(string session, string _tunnel) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.tunnel.destroy", new JArray(session, _tunnel ?? ""), serializer); } public List> tunnel_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("tunnel.get_all", new JArray(session), serializer); } public Dictionary, Tunnel> tunnel_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Tunnel>>("tunnel.get_all_records", new JArray(session), serializer); } public PCI pci_get_record(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_record", new JArray(session, _pci ?? ""), serializer); } public XenRef pci_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PCI.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pci_get_uuid(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_uuid", new JArray(session, _pci ?? ""), serializer); } public string pci_get_class_name(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_class_name", new JArray(session, _pci ?? ""), serializer); } public string pci_get_vendor_name(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_vendor_name", new JArray(session, _pci ?? ""), serializer); } public string pci_get_device_name(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_device_name", new JArray(session, _pci ?? ""), serializer); } public XenRef pci_get_host(string session, string _pci) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PCI.get_host", new JArray(session, _pci ?? ""), serializer); } public string pci_get_pci_id(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_pci_id", new JArray(session, _pci ?? ""), serializer); } public List> pci_get_dependencies(string session, string _pci) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PCI.get_dependencies", new JArray(session, _pci ?? ""), serializer); } public Dictionary pci_get_other_config(string session, string _pci) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PCI.get_other_config", new JArray(session, _pci ?? ""), serializer); } public string pci_get_subsystem_vendor_name(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_subsystem_vendor_name", new JArray(session, _pci ?? ""), serializer); } public string pci_get_subsystem_device_name(string session, string _pci) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PCI.get_subsystem_device_name", new JArray(session, _pci ?? ""), serializer); } public void pci_set_other_config(string session, string _pci, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PCI.set_other_config", new JArray(session, _pci ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pci_add_to_other_config(string session, string _pci, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PCI.add_to_other_config", new JArray(session, _pci ?? "", _key ?? "", _value ?? ""), serializer); } public void pci_remove_from_other_config(string session, string _pci, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PCI.remove_from_other_config", new JArray(session, _pci ?? "", _key ?? ""), serializer); } public List> pci_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PCI.get_all", new JArray(session), serializer); } public Dictionary, PCI> pci_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PCI>>("PCI.get_all_records", new JArray(session), serializer); } public PGPU pgpu_get_record(string session, string _pgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PGPU.get_record", new JArray(session, _pgpu ?? ""), serializer); } public XenRef pgpu_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PGPU.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pgpu_get_uuid(string session, string _pgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PGPU.get_uuid", new JArray(session, _pgpu ?? ""), serializer); } public XenRef pgpu_get_pci(string session, string _pgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PGPU.get_PCI", new JArray(session, _pgpu ?? ""), serializer); } public XenRef pgpu_get_gpu_group(string session, string _pgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PGPU.get_GPU_group", new JArray(session, _pgpu ?? ""), serializer); } public XenRef pgpu_get_host(string session, string _pgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PGPU.get_host", new JArray(session, _pgpu ?? ""), serializer); } public Dictionary pgpu_get_other_config(string session, string _pgpu) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PGPU.get_other_config", new JArray(session, _pgpu ?? ""), serializer); } public List> pgpu_get_supported_vgpu_types(string session, string _pgpu) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PGPU.get_supported_VGPU_types", new JArray(session, _pgpu ?? ""), serializer); } public List> pgpu_get_enabled_vgpu_types(string session, string _pgpu) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PGPU.get_enabled_VGPU_types", new JArray(session, _pgpu ?? ""), serializer); } public List> pgpu_get_resident_vgpus(string session, string _pgpu) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PGPU.get_resident_VGPUs", new JArray(session, _pgpu ?? ""), serializer); } public Dictionary, long> pgpu_get_supported_vgpu_max_capacities(string session, string _pgpu) { var converters = new List {new XenRefLongMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, long>>("PGPU.get_supported_VGPU_max_capacities", new JArray(session, _pgpu ?? ""), serializer); } public pgpu_dom0_access pgpu_get_dom0_access(string session, string _pgpu) { var converters = new List {new pgpu_dom0_accessConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PGPU.get_dom0_access", new JArray(session, _pgpu ?? ""), serializer); } public bool pgpu_get_is_system_display_device(string session, string _pgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PGPU.get_is_system_display_device", new JArray(session, _pgpu ?? ""), serializer); } public Dictionary pgpu_get_compatibility_metadata(string session, string _pgpu) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PGPU.get_compatibility_metadata", new JArray(session, _pgpu ?? ""), serializer); } public void pgpu_set_other_config(string session, string _pgpu, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PGPU.set_other_config", new JArray(session, _pgpu ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pgpu_add_to_other_config(string session, string _pgpu, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PGPU.add_to_other_config", new JArray(session, _pgpu ?? "", _key ?? "", _value ?? ""), serializer); } public void pgpu_remove_from_other_config(string session, string _pgpu, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PGPU.remove_from_other_config", new JArray(session, _pgpu ?? "", _key ?? ""), serializer); } public void pgpu_add_enabled_vgpu_types(string session, string _pgpu, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PGPU.add_enabled_VGPU_types", new JArray(session, _pgpu ?? "", _value ?? ""), serializer); } public XenRef async_pgpu_add_enabled_vgpu_types(string session, string _pgpu, string _value) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PGPU.add_enabled_VGPU_types", new JArray(session, _pgpu ?? "", _value ?? ""), serializer); } public void pgpu_remove_enabled_vgpu_types(string session, string _pgpu, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PGPU.remove_enabled_VGPU_types", new JArray(session, _pgpu ?? "", _value ?? ""), serializer); } public XenRef async_pgpu_remove_enabled_vgpu_types(string session, string _pgpu, string _value) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PGPU.remove_enabled_VGPU_types", new JArray(session, _pgpu ?? "", _value ?? ""), serializer); } public void pgpu_set_enabled_vgpu_types(string session, string _pgpu, List> _value) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PGPU.set_enabled_VGPU_types", new JArray(session, _pgpu ?? "", _value == null ? new JArray() : JArray.FromObject(_value, serializer)), serializer); } public XenRef async_pgpu_set_enabled_vgpu_types(string session, string _pgpu, List> _value) { var converters = new List {new XenRefConverter(), new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PGPU.set_enabled_VGPU_types", new JArray(session, _pgpu ?? "", _value == null ? new JArray() : JArray.FromObject(_value, serializer)), serializer); } public void pgpu_set_gpu_group(string session, string _pgpu, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PGPU.set_GPU_group", new JArray(session, _pgpu ?? "", _value ?? ""), serializer); } public XenRef async_pgpu_set_gpu_group(string session, string _pgpu, string _value) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PGPU.set_GPU_group", new JArray(session, _pgpu ?? "", _value ?? ""), serializer); } public long pgpu_get_remaining_capacity(string session, string _pgpu, string _vgpu_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PGPU.get_remaining_capacity", new JArray(session, _pgpu ?? "", _vgpu_type ?? ""), serializer); } public XenRef async_pgpu_get_remaining_capacity(string session, string _pgpu, string _vgpu_type) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PGPU.get_remaining_capacity", new JArray(session, _pgpu ?? "", _vgpu_type ?? ""), serializer); } public pgpu_dom0_access pgpu_enable_dom0_access(string session, string _pgpu) { var converters = new List {new pgpu_dom0_accessConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PGPU.enable_dom0_access", new JArray(session, _pgpu ?? ""), serializer); } public XenRef async_pgpu_enable_dom0_access(string session, string _pgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PGPU.enable_dom0_access", new JArray(session, _pgpu ?? ""), serializer); } public pgpu_dom0_access pgpu_disable_dom0_access(string session, string _pgpu) { var converters = new List {new pgpu_dom0_accessConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PGPU.disable_dom0_access", new JArray(session, _pgpu ?? ""), serializer); } public XenRef async_pgpu_disable_dom0_access(string session, string _pgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PGPU.disable_dom0_access", new JArray(session, _pgpu ?? ""), serializer); } public List> pgpu_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PGPU.get_all", new JArray(session), serializer); } public Dictionary, PGPU> pgpu_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PGPU>>("PGPU.get_all_records", new JArray(session), serializer); } public GPU_group gpu_group_get_record(string session, string _gpu_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("GPU_group.get_record", new JArray(session, _gpu_group ?? ""), serializer); } public XenRef gpu_group_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("GPU_group.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> gpu_group_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("GPU_group.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string gpu_group_get_uuid(string session, string _gpu_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("GPU_group.get_uuid", new JArray(session, _gpu_group ?? ""), serializer); } public string gpu_group_get_name_label(string session, string _gpu_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("GPU_group.get_name_label", new JArray(session, _gpu_group ?? ""), serializer); } public string gpu_group_get_name_description(string session, string _gpu_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("GPU_group.get_name_description", new JArray(session, _gpu_group ?? ""), serializer); } public List> gpu_group_get_pgpus(string session, string _gpu_group) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("GPU_group.get_PGPUs", new JArray(session, _gpu_group ?? ""), serializer); } public List> gpu_group_get_vgpus(string session, string _gpu_group) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("GPU_group.get_VGPUs", new JArray(session, _gpu_group ?? ""), serializer); } public string[] gpu_group_get_gpu_types(string session, string _gpu_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("GPU_group.get_GPU_types", new JArray(session, _gpu_group ?? ""), serializer); } public Dictionary gpu_group_get_other_config(string session, string _gpu_group) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("GPU_group.get_other_config", new JArray(session, _gpu_group ?? ""), serializer); } public allocation_algorithm gpu_group_get_allocation_algorithm(string session, string _gpu_group) { var converters = new List {new allocation_algorithmConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("GPU_group.get_allocation_algorithm", new JArray(session, _gpu_group ?? ""), serializer); } public List> gpu_group_get_supported_vgpu_types(string session, string _gpu_group) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("GPU_group.get_supported_VGPU_types", new JArray(session, _gpu_group ?? ""), serializer); } public List> gpu_group_get_enabled_vgpu_types(string session, string _gpu_group) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("GPU_group.get_enabled_VGPU_types", new JArray(session, _gpu_group ?? ""), serializer); } public void gpu_group_set_name_label(string session, string _gpu_group, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("GPU_group.set_name_label", new JArray(session, _gpu_group ?? "", _label ?? ""), serializer); } public void gpu_group_set_name_description(string session, string _gpu_group, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("GPU_group.set_name_description", new JArray(session, _gpu_group ?? "", _description ?? ""), serializer); } public void gpu_group_set_other_config(string session, string _gpu_group, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("GPU_group.set_other_config", new JArray(session, _gpu_group ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void gpu_group_add_to_other_config(string session, string _gpu_group, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("GPU_group.add_to_other_config", new JArray(session, _gpu_group ?? "", _key ?? "", _value ?? ""), serializer); } public void gpu_group_remove_from_other_config(string session, string _gpu_group, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("GPU_group.remove_from_other_config", new JArray(session, _gpu_group ?? "", _key ?? ""), serializer); } public void gpu_group_set_allocation_algorithm(string session, string _gpu_group, allocation_algorithm _allocation_algorithm) { var converters = new List {new allocation_algorithmConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("GPU_group.set_allocation_algorithm", new JArray(session, _gpu_group ?? "", _allocation_algorithm.StringOf()), serializer); } public XenRef gpu_group_create(string session, string _name_label, string _name_description, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("GPU_group.create", new JArray(session, _name_label ?? "", _name_description ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public XenRef async_gpu_group_create(string session, string _name_label, string _name_description, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.GPU_group.create", new JArray(session, _name_label ?? "", _name_description ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void gpu_group_destroy(string session, string _gpu_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("GPU_group.destroy", new JArray(session, _gpu_group ?? ""), serializer); } public XenRef async_gpu_group_destroy(string session, string _gpu_group) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.GPU_group.destroy", new JArray(session, _gpu_group ?? ""), serializer); } public long gpu_group_get_remaining_capacity(string session, string _gpu_group, string _vgpu_type) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("GPU_group.get_remaining_capacity", new JArray(session, _gpu_group ?? "", _vgpu_type ?? ""), serializer); } public XenRef async_gpu_group_get_remaining_capacity(string session, string _gpu_group, string _vgpu_type) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.GPU_group.get_remaining_capacity", new JArray(session, _gpu_group ?? "", _vgpu_type ?? ""), serializer); } public List> gpu_group_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("GPU_group.get_all", new JArray(session), serializer); } public Dictionary, GPU_group> gpu_group_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, GPU_group>>("GPU_group.get_all_records", new JArray(session), serializer); } public VGPU vgpu_get_record(string session, string _vgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU.get_record", new JArray(session, _vgpu ?? ""), serializer); } public XenRef vgpu_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vgpu_get_uuid(string session, string _vgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU.get_uuid", new JArray(session, _vgpu ?? ""), serializer); } public XenRef vgpu_get_vm(string session, string _vgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_VM", new JArray(session, _vgpu ?? ""), serializer); } public XenRef vgpu_get_gpu_group(string session, string _vgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_GPU_group", new JArray(session, _vgpu ?? ""), serializer); } public string vgpu_get_device(string session, string _vgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU.get_device", new JArray(session, _vgpu ?? ""), serializer); } public bool vgpu_get_currently_attached(string session, string _vgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU.get_currently_attached", new JArray(session, _vgpu ?? ""), serializer); } public Dictionary vgpu_get_other_config(string session, string _vgpu) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_other_config", new JArray(session, _vgpu ?? ""), serializer); } public XenRef vgpu_get_type(string session, string _vgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_type", new JArray(session, _vgpu ?? ""), serializer); } public XenRef vgpu_get_resident_on(string session, string _vgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_resident_on", new JArray(session, _vgpu ?? ""), serializer); } public XenRef vgpu_get_scheduled_to_be_resident_on(string session, string _vgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_scheduled_to_be_resident_on", new JArray(session, _vgpu ?? ""), serializer); } public Dictionary vgpu_get_compatibility_metadata(string session, string _vgpu) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.get_compatibility_metadata", new JArray(session, _vgpu ?? ""), serializer); } public void vgpu_set_other_config(string session, string _vgpu, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VGPU.set_other_config", new JArray(session, _vgpu ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vgpu_add_to_other_config(string session, string _vgpu, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VGPU.add_to_other_config", new JArray(session, _vgpu ?? "", _key ?? "", _value ?? ""), serializer); } public void vgpu_remove_from_other_config(string session, string _vgpu, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VGPU.remove_from_other_config", new JArray(session, _vgpu ?? "", _key ?? ""), serializer); } public XenRef vgpu_create(string session, string _vm, string _gpu_group, string _device, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.create", new JArray(session, _vm ?? "", _gpu_group ?? "", _device ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public XenRef async_vgpu_create(string session, string _vm, string _gpu_group, string _device, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VGPU.create", new JArray(session, _vm ?? "", _gpu_group ?? "", _device ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public XenRef vgpu_create(string session, string _vm, string _gpu_group, string _device, Dictionary _other_config, string _type) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU.create", new JArray(session, _vm ?? "", _gpu_group ?? "", _device ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _type ?? ""), serializer); } public XenRef async_vgpu_create(string session, string _vm, string _gpu_group, string _device, Dictionary _other_config, string _type) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VGPU.create", new JArray(session, _vm ?? "", _gpu_group ?? "", _device ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer), _type ?? ""), serializer); } public void vgpu_destroy(string session, string _vgpu) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VGPU.destroy", new JArray(session, _vgpu ?? ""), serializer); } public XenRef async_vgpu_destroy(string session, string _vgpu) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VGPU.destroy", new JArray(session, _vgpu ?? ""), serializer); } public List> vgpu_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VGPU.get_all", new JArray(session), serializer); } public Dictionary, VGPU> vgpu_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VGPU>>("VGPU.get_all_records", new JArray(session), serializer); } public VGPU_type vgpu_type_get_record(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_record", new JArray(session, _vgpu_type ?? ""), serializer); } public XenRef vgpu_type_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VGPU_type.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vgpu_type_get_uuid(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_uuid", new JArray(session, _vgpu_type ?? ""), serializer); } public string vgpu_type_get_vendor_name(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_vendor_name", new JArray(session, _vgpu_type ?? ""), serializer); } public string vgpu_type_get_model_name(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_model_name", new JArray(session, _vgpu_type ?? ""), serializer); } public long vgpu_type_get_framebuffer_size(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_framebuffer_size", new JArray(session, _vgpu_type ?? ""), serializer); } public long vgpu_type_get_max_heads(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_max_heads", new JArray(session, _vgpu_type ?? ""), serializer); } public long vgpu_type_get_max_resolution_x(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_max_resolution_x", new JArray(session, _vgpu_type ?? ""), serializer); } public long vgpu_type_get_max_resolution_y(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_max_resolution_y", new JArray(session, _vgpu_type ?? ""), serializer); } public List> vgpu_type_get_supported_on_pgpus(string session, string _vgpu_type) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VGPU_type.get_supported_on_PGPUs", new JArray(session, _vgpu_type ?? ""), serializer); } public List> vgpu_type_get_enabled_on_pgpus(string session, string _vgpu_type) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VGPU_type.get_enabled_on_PGPUs", new JArray(session, _vgpu_type ?? ""), serializer); } public List> vgpu_type_get_vgpus(string session, string _vgpu_type) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VGPU_type.get_VGPUs", new JArray(session, _vgpu_type ?? ""), serializer); } public List> vgpu_type_get_supported_on_gpu_groups(string session, string _vgpu_type) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VGPU_type.get_supported_on_GPU_groups", new JArray(session, _vgpu_type ?? ""), serializer); } public List> vgpu_type_get_enabled_on_gpu_groups(string session, string _vgpu_type) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VGPU_type.get_enabled_on_GPU_groups", new JArray(session, _vgpu_type ?? ""), serializer); } public vgpu_type_implementation vgpu_type_get_implementation(string session, string _vgpu_type) { var converters = new List {new vgpu_type_implementationConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_implementation", new JArray(session, _vgpu_type ?? ""), serializer); } public string vgpu_type_get_identifier(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_identifier", new JArray(session, _vgpu_type ?? ""), serializer); } public bool vgpu_type_get_experimental(string session, string _vgpu_type) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VGPU_type.get_experimental", new JArray(session, _vgpu_type ?? ""), serializer); } public List> vgpu_type_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VGPU_type.get_all", new JArray(session), serializer); } public Dictionary, VGPU_type> vgpu_type_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VGPU_type>>("VGPU_type.get_all_records", new JArray(session), serializer); } public PVS_site pvs_site_get_record(string session, string _pvs_site) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_site.get_record", new JArray(session, _pvs_site ?? ""), serializer); } public XenRef pvs_site_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_site.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> pvs_site_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_site.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string pvs_site_get_uuid(string session, string _pvs_site) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_site.get_uuid", new JArray(session, _pvs_site ?? ""), serializer); } public string pvs_site_get_name_label(string session, string _pvs_site) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_site.get_name_label", new JArray(session, _pvs_site ?? ""), serializer); } public string pvs_site_get_name_description(string session, string _pvs_site) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_site.get_name_description", new JArray(session, _pvs_site ?? ""), serializer); } public string pvs_site_get_pvs_uuid(string session, string _pvs_site) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_site.get_PVS_uuid", new JArray(session, _pvs_site ?? ""), serializer); } public List> pvs_site_get_cache_storage(string session, string _pvs_site) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_site.get_cache_storage", new JArray(session, _pvs_site ?? ""), serializer); } public List> pvs_site_get_servers(string session, string _pvs_site) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_site.get_servers", new JArray(session, _pvs_site ?? ""), serializer); } public List> pvs_site_get_proxies(string session, string _pvs_site) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_site.get_proxies", new JArray(session, _pvs_site ?? ""), serializer); } public void pvs_site_set_name_label(string session, string _pvs_site, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PVS_site.set_name_label", new JArray(session, _pvs_site ?? "", _label ?? ""), serializer); } public void pvs_site_set_name_description(string session, string _pvs_site, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PVS_site.set_name_description", new JArray(session, _pvs_site ?? "", _description ?? ""), serializer); } public XenRef pvs_site_introduce(string session, string _name_label, string _name_description, string _pvs_uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_site.introduce", new JArray(session, _name_label ?? "", _name_description ?? "", _pvs_uuid ?? ""), serializer); } public XenRef async_pvs_site_introduce(string session, string _name_label, string _name_description, string _pvs_uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_site.introduce", new JArray(session, _name_label ?? "", _name_description ?? "", _pvs_uuid ?? ""), serializer); } public void pvs_site_forget(string session, string _pvs_site) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PVS_site.forget", new JArray(session, _pvs_site ?? ""), serializer); } public XenRef async_pvs_site_forget(string session, string _pvs_site) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_site.forget", new JArray(session, _pvs_site ?? ""), serializer); } public void pvs_site_set_pvs_uuid(string session, string _pvs_site, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PVS_site.set_PVS_uuid", new JArray(session, _pvs_site ?? "", _value ?? ""), serializer); } public XenRef async_pvs_site_set_pvs_uuid(string session, string _pvs_site, string _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_site.set_PVS_uuid", new JArray(session, _pvs_site ?? "", _value ?? ""), serializer); } public List> pvs_site_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_site.get_all", new JArray(session), serializer); } public Dictionary, PVS_site> pvs_site_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PVS_site>>("PVS_site.get_all_records", new JArray(session), serializer); } public PVS_server pvs_server_get_record(string session, string _pvs_server) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_server.get_record", new JArray(session, _pvs_server ?? ""), serializer); } public XenRef pvs_server_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_server.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pvs_server_get_uuid(string session, string _pvs_server) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_server.get_uuid", new JArray(session, _pvs_server ?? ""), serializer); } public string[] pvs_server_get_addresses(string session, string _pvs_server) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_server.get_addresses", new JArray(session, _pvs_server ?? ""), serializer); } public long pvs_server_get_first_port(string session, string _pvs_server) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_server.get_first_port", new JArray(session, _pvs_server ?? ""), serializer); } public long pvs_server_get_last_port(string session, string _pvs_server) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_server.get_last_port", new JArray(session, _pvs_server ?? ""), serializer); } public XenRef pvs_server_get_site(string session, string _pvs_server) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_server.get_site", new JArray(session, _pvs_server ?? ""), serializer); } public XenRef pvs_server_introduce(string session, string[] _addresses, long _first_port, long _last_port, string _site) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_server.introduce", new JArray(session, _addresses == null ? new JArray() : JArray.FromObject(_addresses), _first_port, _last_port, _site ?? ""), serializer); } public XenRef async_pvs_server_introduce(string session, string[] _addresses, long _first_port, long _last_port, string _site) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_server.introduce", new JArray(session, _addresses == null ? new JArray() : JArray.FromObject(_addresses), _first_port, _last_port, _site ?? ""), serializer); } public void pvs_server_forget(string session, string _pvs_server) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PVS_server.forget", new JArray(session, _pvs_server ?? ""), serializer); } public XenRef async_pvs_server_forget(string session, string _pvs_server) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_server.forget", new JArray(session, _pvs_server ?? ""), serializer); } public List> pvs_server_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_server.get_all", new JArray(session), serializer); } public Dictionary, PVS_server> pvs_server_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PVS_server>>("PVS_server.get_all_records", new JArray(session), serializer); } public PVS_proxy pvs_proxy_get_record(string session, string _pvs_proxy) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_proxy.get_record", new JArray(session, _pvs_proxy ?? ""), serializer); } public XenRef pvs_proxy_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_proxy.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pvs_proxy_get_uuid(string session, string _pvs_proxy) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_proxy.get_uuid", new JArray(session, _pvs_proxy ?? ""), serializer); } public XenRef pvs_proxy_get_site(string session, string _pvs_proxy) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_proxy.get_site", new JArray(session, _pvs_proxy ?? ""), serializer); } public XenRef pvs_proxy_get_vif(string session, string _pvs_proxy) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_proxy.get_VIF", new JArray(session, _pvs_proxy ?? ""), serializer); } public bool pvs_proxy_get_currently_attached(string session, string _pvs_proxy) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_proxy.get_currently_attached", new JArray(session, _pvs_proxy ?? ""), serializer); } public pvs_proxy_status pvs_proxy_get_status(string session, string _pvs_proxy) { var converters = new List {new pvs_proxy_statusConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_proxy.get_status", new JArray(session, _pvs_proxy ?? ""), serializer); } public XenRef pvs_proxy_create(string session, string _site, string _vif) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_proxy.create", new JArray(session, _site ?? "", _vif ?? ""), serializer); } public XenRef async_pvs_proxy_create(string session, string _site, string _vif) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_proxy.create", new JArray(session, _site ?? "", _vif ?? ""), serializer); } public void pvs_proxy_destroy(string session, string _pvs_proxy) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PVS_proxy.destroy", new JArray(session, _pvs_proxy ?? ""), serializer); } public XenRef async_pvs_proxy_destroy(string session, string _pvs_proxy) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_proxy.destroy", new JArray(session, _pvs_proxy ?? ""), serializer); } public List> pvs_proxy_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_proxy.get_all", new JArray(session), serializer); } public Dictionary, PVS_proxy> pvs_proxy_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PVS_proxy>>("PVS_proxy.get_all_records", new JArray(session), serializer); } public PVS_cache_storage pvs_cache_storage_get_record(string session, string _pvs_cache_storage) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_cache_storage.get_record", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public XenRef pvs_cache_storage_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_cache_storage.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public XenRef pvs_cache_storage_create(string session, PVS_cache_storage _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_cache_storage.create", new JArray(session, _record.ToJObject()), serializer); } public XenRef async_pvs_cache_storage_create(string session, PVS_cache_storage _record) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_cache_storage.create", new JArray(session, _record.ToJObject()), serializer); } public void pvs_cache_storage_destroy(string session, string _pvs_cache_storage) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PVS_cache_storage.destroy", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public XenRef async_pvs_cache_storage_destroy(string session, string _pvs_cache_storage) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PVS_cache_storage.destroy", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public string pvs_cache_storage_get_uuid(string session, string _pvs_cache_storage) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_cache_storage.get_uuid", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public XenRef pvs_cache_storage_get_host(string session, string _pvs_cache_storage) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_cache_storage.get_host", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public XenRef pvs_cache_storage_get_sr(string session, string _pvs_cache_storage) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_cache_storage.get_SR", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public XenRef pvs_cache_storage_get_site(string session, string _pvs_cache_storage) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_cache_storage.get_site", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public long pvs_cache_storage_get_size(string session, string _pvs_cache_storage) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PVS_cache_storage.get_size", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public XenRef pvs_cache_storage_get_vdi(string session, string _pvs_cache_storage) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PVS_cache_storage.get_VDI", new JArray(session, _pvs_cache_storage ?? ""), serializer); } public List> pvs_cache_storage_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PVS_cache_storage.get_all", new JArray(session), serializer); } public Dictionary, PVS_cache_storage> pvs_cache_storage_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PVS_cache_storage>>("PVS_cache_storage.get_all_records", new JArray(session), serializer); } public Feature feature_get_record(string session, string _feature) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Feature.get_record", new JArray(session, _feature ?? ""), serializer); } public XenRef feature_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Feature.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> feature_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("Feature.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string feature_get_uuid(string session, string _feature) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Feature.get_uuid", new JArray(session, _feature ?? ""), serializer); } public string feature_get_name_label(string session, string _feature) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Feature.get_name_label", new JArray(session, _feature ?? ""), serializer); } public string feature_get_name_description(string session, string _feature) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Feature.get_name_description", new JArray(session, _feature ?? ""), serializer); } public bool feature_get_enabled(string session, string _feature) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Feature.get_enabled", new JArray(session, _feature ?? ""), serializer); } public bool feature_get_experimental(string session, string _feature) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Feature.get_experimental", new JArray(session, _feature ?? ""), serializer); } public string feature_get_version(string session, string _feature) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Feature.get_version", new JArray(session, _feature ?? ""), serializer); } public XenRef feature_get_host(string session, string _feature) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Feature.get_host", new JArray(session, _feature ?? ""), serializer); } public List> feature_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("Feature.get_all", new JArray(session), serializer); } public Dictionary, Feature> feature_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Feature>>("Feature.get_all_records", new JArray(session), serializer); } public SDN_controller sdn_controller_get_record(string session, string _sdn_controller) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SDN_controller.get_record", new JArray(session, _sdn_controller ?? ""), serializer); } public XenRef sdn_controller_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SDN_controller.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string sdn_controller_get_uuid(string session, string _sdn_controller) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SDN_controller.get_uuid", new JArray(session, _sdn_controller ?? ""), serializer); } public sdn_controller_protocol sdn_controller_get_protocol(string session, string _sdn_controller) { var converters = new List {new sdn_controller_protocolConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SDN_controller.get_protocol", new JArray(session, _sdn_controller ?? ""), serializer); } public string sdn_controller_get_address(string session, string _sdn_controller) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SDN_controller.get_address", new JArray(session, _sdn_controller ?? ""), serializer); } public long sdn_controller_get_port(string session, string _sdn_controller) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("SDN_controller.get_port", new JArray(session, _sdn_controller ?? ""), serializer); } public XenRef sdn_controller_introduce(string session, sdn_controller_protocol _protocol, string _address, long _port) { var converters = new List {new XenRefConverter(), new sdn_controller_protocolConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("SDN_controller.introduce", new JArray(session, _protocol.StringOf(), _address ?? "", _port), serializer); } public XenRef async_sdn_controller_introduce(string session, sdn_controller_protocol _protocol, string _address, long _port) { var converters = new List {new XenRefConverter(), new sdn_controller_protocolConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SDN_controller.introduce", new JArray(session, _protocol.StringOf(), _address ?? "", _port), serializer); } public void sdn_controller_forget(string session, string _sdn_controller) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("SDN_controller.forget", new JArray(session, _sdn_controller ?? ""), serializer); } public XenRef async_sdn_controller_forget(string session, string _sdn_controller) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.SDN_controller.forget", new JArray(session, _sdn_controller ?? ""), serializer); } public List> sdn_controller_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("SDN_controller.get_all", new JArray(session), serializer); } public Dictionary, SDN_controller> sdn_controller_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, SDN_controller>>("SDN_controller.get_all_records", new JArray(session), serializer); } public Dictionary, Vdi_nbd_server_info> vdi_nbd_server_info_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Vdi_nbd_server_info>>("vdi_nbd_server_info.get_all_records", new JArray(session), serializer); } public PUSB pusb_get_record(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_record", new JArray(session, _pusb ?? ""), serializer); } public XenRef pusb_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PUSB.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string pusb_get_uuid(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_uuid", new JArray(session, _pusb ?? ""), serializer); } public XenRef pusb_get_usb_group(string session, string _pusb) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PUSB.get_USB_group", new JArray(session, _pusb ?? ""), serializer); } public XenRef pusb_get_host(string session, string _pusb) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PUSB.get_host", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_path(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_path", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_vendor_id(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_vendor_id", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_vendor_desc(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_vendor_desc", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_product_id(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_product_id", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_product_desc(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_product_desc", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_serial(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_serial", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_version(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_version", new JArray(session, _pusb ?? ""), serializer); } public string pusb_get_description(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_description", new JArray(session, _pusb ?? ""), serializer); } public bool pusb_get_passthrough_enabled(string session, string _pusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("PUSB.get_passthrough_enabled", new JArray(session, _pusb ?? ""), serializer); } public Dictionary pusb_get_other_config(string session, string _pusb) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("PUSB.get_other_config", new JArray(session, _pusb ?? ""), serializer); } public void pusb_set_other_config(string session, string _pusb, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PUSB.set_other_config", new JArray(session, _pusb ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void pusb_add_to_other_config(string session, string _pusb, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PUSB.add_to_other_config", new JArray(session, _pusb ?? "", _key ?? "", _value ?? ""), serializer); } public void pusb_remove_from_other_config(string session, string _pusb, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PUSB.remove_from_other_config", new JArray(session, _pusb ?? "", _key ?? ""), serializer); } public void pusb_scan(string session, string _host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PUSB.scan", new JArray(session, _host ?? ""), serializer); } public XenRef async_pusb_scan(string session, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PUSB.scan", new JArray(session, _host ?? ""), serializer); } public void pusb_set_passthrough_enabled(string session, string _pusb, bool _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("PUSB.set_passthrough_enabled", new JArray(session, _pusb ?? "", _value), serializer); } public XenRef async_pusb_set_passthrough_enabled(string session, string _pusb, bool _value) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.PUSB.set_passthrough_enabled", new JArray(session, _pusb ?? "", _value), serializer); } public List> pusb_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("PUSB.get_all", new JArray(session), serializer); } public Dictionary, PUSB> pusb_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, PUSB>>("PUSB.get_all_records", new JArray(session), serializer); } public USB_group usb_group_get_record(string session, string _usb_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("USB_group.get_record", new JArray(session, _usb_group ?? ""), serializer); } public XenRef usb_group_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("USB_group.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public List> usb_group_get_by_name_label(string session, string _label) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("USB_group.get_by_name_label", new JArray(session, _label ?? ""), serializer); } public string usb_group_get_uuid(string session, string _usb_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("USB_group.get_uuid", new JArray(session, _usb_group ?? ""), serializer); } public string usb_group_get_name_label(string session, string _usb_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("USB_group.get_name_label", new JArray(session, _usb_group ?? ""), serializer); } public string usb_group_get_name_description(string session, string _usb_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("USB_group.get_name_description", new JArray(session, _usb_group ?? ""), serializer); } public List> usb_group_get_pusbs(string session, string _usb_group) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("USB_group.get_PUSBs", new JArray(session, _usb_group ?? ""), serializer); } public List> usb_group_get_vusbs(string session, string _usb_group) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("USB_group.get_VUSBs", new JArray(session, _usb_group ?? ""), serializer); } public Dictionary usb_group_get_other_config(string session, string _usb_group) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("USB_group.get_other_config", new JArray(session, _usb_group ?? ""), serializer); } public void usb_group_set_name_label(string session, string _usb_group, string _label) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("USB_group.set_name_label", new JArray(session, _usb_group ?? "", _label ?? ""), serializer); } public void usb_group_set_name_description(string session, string _usb_group, string _description) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("USB_group.set_name_description", new JArray(session, _usb_group ?? "", _description ?? ""), serializer); } public void usb_group_set_other_config(string session, string _usb_group, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("USB_group.set_other_config", new JArray(session, _usb_group ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void usb_group_add_to_other_config(string session, string _usb_group, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("USB_group.add_to_other_config", new JArray(session, _usb_group ?? "", _key ?? "", _value ?? ""), serializer); } public void usb_group_remove_from_other_config(string session, string _usb_group, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("USB_group.remove_from_other_config", new JArray(session, _usb_group ?? "", _key ?? ""), serializer); } public XenRef usb_group_create(string session, string _name_label, string _name_description, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("USB_group.create", new JArray(session, _name_label ?? "", _name_description ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public XenRef async_usb_group_create(string session, string _name_label, string _name_description, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.USB_group.create", new JArray(session, _name_label ?? "", _name_description ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void usb_group_destroy(string session, string _usb_group) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("USB_group.destroy", new JArray(session, _usb_group ?? ""), serializer); } public XenRef async_usb_group_destroy(string session, string _usb_group) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.USB_group.destroy", new JArray(session, _usb_group ?? ""), serializer); } public List> usb_group_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("USB_group.get_all", new JArray(session), serializer); } public Dictionary, USB_group> usb_group_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, USB_group>>("USB_group.get_all_records", new JArray(session), serializer); } public VUSB vusb_get_record(string session, string _vusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VUSB.get_record", new JArray(session, _vusb ?? ""), serializer); } public XenRef vusb_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VUSB.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string vusb_get_uuid(string session, string _vusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VUSB.get_uuid", new JArray(session, _vusb ?? ""), serializer); } public List vusb_get_allowed_operations(string session, string _vusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VUSB.get_allowed_operations", new JArray(session, _vusb ?? ""), serializer); } public Dictionary vusb_get_current_operations(string session, string _vusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VUSB.get_current_operations", new JArray(session, _vusb ?? ""), serializer); } public XenRef vusb_get_vm(string session, string _vusb) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VUSB.get_VM", new JArray(session, _vusb ?? ""), serializer); } public XenRef vusb_get_usb_group(string session, string _vusb) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VUSB.get_USB_group", new JArray(session, _vusb ?? ""), serializer); } public Dictionary vusb_get_other_config(string session, string _vusb) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VUSB.get_other_config", new JArray(session, _vusb ?? ""), serializer); } public bool vusb_get_currently_attached(string session, string _vusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("VUSB.get_currently_attached", new JArray(session, _vusb ?? ""), serializer); } public void vusb_set_other_config(string session, string _vusb, Dictionary _other_config) { var converters = new List {new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VUSB.set_other_config", new JArray(session, _vusb ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vusb_add_to_other_config(string session, string _vusb, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VUSB.add_to_other_config", new JArray(session, _vusb ?? "", _key ?? "", _value ?? ""), serializer); } public void vusb_remove_from_other_config(string session, string _vusb, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VUSB.remove_from_other_config", new JArray(session, _vusb ?? "", _key ?? ""), serializer); } public XenRef vusb_create(string session, string _vm, string _usb_group, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("VUSB.create", new JArray(session, _vm ?? "", _usb_group ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public XenRef async_vusb_create(string session, string _vm, string _usb_group, Dictionary _other_config) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter(), new StringStringMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VUSB.create", new JArray(session, _vm ?? "", _usb_group ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void vusb_unplug(string session, string _vusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VUSB.unplug", new JArray(session, _vusb ?? ""), serializer); } public XenRef async_vusb_unplug(string session, string _vusb) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VUSB.unplug", new JArray(session, _vusb ?? ""), serializer); } public void vusb_destroy(string session, string _vusb) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("VUSB.destroy", new JArray(session, _vusb ?? ""), serializer); } public XenRef async_vusb_destroy(string session, string _vusb) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.VUSB.destroy", new JArray(session, _vusb ?? ""), serializer); } public List> vusb_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("VUSB.get_all", new JArray(session), serializer); } public Dictionary, VUSB> vusb_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, VUSB>>("VUSB.get_all_records", new JArray(session), serializer); } public Cluster cluster_get_record(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster.get_record", new JArray(session, _cluster ?? ""), serializer); } public XenRef cluster_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string cluster_get_uuid(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster.get_uuid", new JArray(session, _cluster ?? ""), serializer); } public List> cluster_get_cluster_hosts(string session, string _cluster) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("Cluster.get_cluster_hosts", new JArray(session, _cluster ?? ""), serializer); } public XenRef cluster_get_network(string session, string _cluster) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster.get_network", new JArray(session, _cluster ?? ""), serializer); } public string cluster_get_cluster_token(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster.get_cluster_token", new JArray(session, _cluster ?? ""), serializer); } public string cluster_get_cluster_stack(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster.get_cluster_stack", new JArray(session, _cluster ?? ""), serializer); } public List cluster_get_allowed_operations(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster.get_allowed_operations", new JArray(session, _cluster ?? ""), serializer); } public Dictionary cluster_get_current_operations(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster.get_current_operations", new JArray(session, _cluster ?? ""), serializer); } public bool cluster_get_pool_auto_join(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster.get_pool_auto_join", new JArray(session, _cluster ?? ""), serializer); } public long cluster_get_token_timeout(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster.get_token_timeout", new JArray(session, _cluster ?? ""), serializer); } public long cluster_get_token_timeout_coefficient(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster.get_token_timeout_coefficient", new JArray(session, _cluster ?? ""), serializer); } public Dictionary cluster_get_cluster_config(string session, string _cluster) { - var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var converters = new List {new StringStringMapConverter()}; + var serializer = CreateSerializer(converters); return Rpc>("Cluster.get_cluster_config", new JArray(session, _cluster ?? ""), serializer); } public Dictionary cluster_get_other_config(string session, string _cluster) { - var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var converters = new List {new StringStringMapConverter()}; + var serializer = CreateSerializer(converters); return Rpc>("Cluster.get_other_config", new JArray(session, _cluster ?? ""), serializer); } public void cluster_set_other_config(string session, string _cluster, Dictionary _other_config) { - var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var converters = new List {new StringStringMapConverter()}; + var serializer = CreateSerializer(converters); Rpc("Cluster.set_other_config", new JArray(session, _cluster ?? "", _other_config == null ? new JObject() : JObject.FromObject(_other_config, serializer)), serializer); } public void cluster_add_to_other_config(string session, string _cluster, string _key, string _value) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster.add_to_other_config", new JArray(session, _cluster ?? "", _key ?? "", _value ?? ""), serializer); } public void cluster_remove_from_other_config(string session, string _cluster, string _key) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster.remove_from_other_config", new JArray(session, _cluster ?? "", _key ?? ""), serializer); } public XenRef cluster_create(string session, string _network, string _cluster_stack, bool _pool_auto_join, double _token_timeout, double _token_timeout_coefficient) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster.create", new JArray(session, _network ?? "", _cluster_stack ?? "", _pool_auto_join, _token_timeout, _token_timeout_coefficient), serializer); } public XenRef async_cluster_create(string session, string _network, string _cluster_stack, bool _pool_auto_join, double _token_timeout, double _token_timeout_coefficient) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster.create", new JArray(session, _network ?? "", _cluster_stack ?? "", _pool_auto_join, _token_timeout, _token_timeout_coefficient), serializer); } public void cluster_destroy(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster.destroy", new JArray(session, _cluster ?? ""), serializer); } public XenRef async_cluster_destroy(string session, string _cluster) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster.destroy", new JArray(session, _cluster ?? ""), serializer); } public XenRef cluster_pool_create(string session, string _network, string _cluster_stack, double _token_timeout, double _token_timeout_coefficient) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster.pool_create", new JArray(session, _network ?? "", _cluster_stack ?? "", _token_timeout, _token_timeout_coefficient), serializer); } public XenRef async_cluster_pool_create(string session, string _network, string _cluster_stack, double _token_timeout, double _token_timeout_coefficient) { var converters = new List {new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster.pool_create", new JArray(session, _network ?? "", _cluster_stack ?? "", _token_timeout, _token_timeout_coefficient), serializer); } public void cluster_pool_force_destroy(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster.pool_force_destroy", new JArray(session, _cluster ?? ""), serializer); } public XenRef async_cluster_pool_force_destroy(string session, string _cluster) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster.pool_force_destroy", new JArray(session, _cluster ?? ""), serializer); } public void cluster_pool_destroy(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster.pool_destroy", new JArray(session, _cluster ?? ""), serializer); } public XenRef async_cluster_pool_destroy(string session, string _cluster) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster.pool_destroy", new JArray(session, _cluster ?? ""), serializer); } public void cluster_pool_resync(string session, string _cluster) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster.pool_resync", new JArray(session, _cluster ?? ""), serializer); } public XenRef async_cluster_pool_resync(string session, string _cluster) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster.pool_resync", new JArray(session, _cluster ?? ""), serializer); } public List> cluster_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("Cluster.get_all", new JArray(session), serializer); } public Dictionary, Cluster> cluster_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Cluster>>("Cluster.get_all_records", new JArray(session), serializer); } public Cluster_host cluster_host_get_record(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster_host.get_record", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef cluster_host_get_by_uuid(string session, string _uuid) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster_host.get_by_uuid", new JArray(session, _uuid ?? ""), serializer); } public string cluster_host_get_uuid(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster_host.get_uuid", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef cluster_host_get_cluster(string session, string _cluster_host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster_host.get_cluster", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef cluster_host_get_host(string session, string _cluster_host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster_host.get_host", new JArray(session, _cluster_host ?? ""), serializer); } public bool cluster_host_get_enabled(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc("Cluster_host.get_enabled", new JArray(session, _cluster_host ?? ""), serializer); } public List cluster_host_get_allowed_operations(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster_host.get_allowed_operations", new JArray(session, _cluster_host ?? ""), serializer); } public Dictionary cluster_host_get_current_operations(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster_host.get_current_operations", new JArray(session, _cluster_host ?? ""), serializer); } public Dictionary cluster_host_get_other_config(string session, string _cluster_host) { - var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var converters = new List {new StringStringMapConverter()}; + var serializer = CreateSerializer(converters); return Rpc>("Cluster_host.get_other_config", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef cluster_host_create(string session, string _cluster, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Cluster_host.create", new JArray(session, _cluster ?? "", _host ?? ""), serializer); } public XenRef async_cluster_host_create(string session, string _cluster, string _host) { var converters = new List {new XenRefConverter(), new XenRefConverter(), new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster_host.create", new JArray(session, _cluster ?? "", _host ?? ""), serializer); } public void cluster_host_destroy(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster_host.destroy", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef async_cluster_host_destroy(string session, string _cluster_host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster_host.destroy", new JArray(session, _cluster_host ?? ""), serializer); } public void cluster_host_enable(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster_host.enable", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef async_cluster_host_enable(string session, string _cluster_host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster_host.enable", new JArray(session, _cluster_host ?? ""), serializer); } public void cluster_host_force_destroy(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster_host.force_destroy", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef async_cluster_host_force_destroy(string session, string _cluster_host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster_host.force_destroy", new JArray(session, _cluster_host ?? ""), serializer); } public void cluster_host_disable(string session, string _cluster_host) { var converters = new List {}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); Rpc("Cluster_host.disable", new JArray(session, _cluster_host ?? ""), serializer); } public XenRef async_cluster_host_disable(string session, string _cluster_host) { var converters = new List {new XenRefConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>("Async.Cluster_host.disable", new JArray(session, _cluster_host ?? ""), serializer); } public List> cluster_host_get_all(string session) { var converters = new List {new XenRefListConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc>>("Cluster_host.get_all", new JArray(session), serializer); } public Dictionary, Cluster_host> cluster_host_get_all_records(string session) { var converters = new List {new XenRefXenObjectMapConverter()}; - var serializer = JsonSerializer.Create(new JsonSerializerSettings {Converters = converters}); + var serializer = CreateSerializer(converters); return Rpc, Cluster_host>>("Cluster_host.get_all_records", new JArray(session), serializer); } diff --git a/XenModel/XenAPI/LVHD.cs b/XenModel/XenAPI/LVHD.cs index 2e5922ebd..e7e1b2ddc 100644 --- a/XenModel/XenAPI/LVHD.cs +++ b/XenModel/XenAPI/LVHD.cs @@ -75,7 +75,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_LVHD proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; } public Proxy_LVHD ToProxy() @@ -178,7 +178,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.lvhd_get_uuid(session.opaque_ref, _lvhd); else - return (string)session.proxy.lvhd_get_uuid(session.opaque_ref, _lvhd ?? "").parse(); + return session.proxy.lvhd_get_uuid(session.opaque_ref, _lvhd ?? "").parse(); } /// @@ -195,7 +195,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.lvhd_enable_thin_provisioning(session.opaque_ref, _host, _sr, _initial_allocation, _allocation_quantum); else - return (string)session.proxy.lvhd_enable_thin_provisioning(session.opaque_ref, _host ?? "", _sr ?? "", _initial_allocation.ToString(), _allocation_quantum.ToString()).parse(); + return session.proxy.lvhd_enable_thin_provisioning(session.opaque_ref, _host ?? "", _sr ?? "", _initial_allocation.ToString(), _allocation_quantum.ToString()).parse(); } /// diff --git a/XenModel/XenAPI/Message.cs b/XenModel/XenAPI/Message.cs index eb0d3371c..467306ae7 100644 --- a/XenModel/XenAPI/Message.cs +++ b/XenModel/XenAPI/Message.cs @@ -255,13 +255,13 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Message proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - name = proxy.name == null ? null : (string)proxy.name; - priority = proxy.priority == null ? 0 : long.Parse((string)proxy.priority); + uuid = proxy.uuid == null ? null : proxy.uuid; + name = proxy.name == null ? null : proxy.name; + priority = proxy.priority == null ? 0 : long.Parse(proxy.priority); cls = proxy.cls == null ? (cls) 0 : (cls)Helper.EnumParseDefault(typeof(cls), (string)proxy.cls); - obj_uuid = proxy.obj_uuid == null ? null : (string)proxy.obj_uuid; + obj_uuid = proxy.obj_uuid == null ? null : proxy.obj_uuid; timestamp = proxy.timestamp; - body = proxy.body == null ? null : (string)proxy.body; + body = proxy.body == null ? null : proxy.body; } public Proxy_Message ToProxy() diff --git a/XenModel/XenAPI/Network.cs b/XenModel/XenAPI/Network.cs index 60bd2f210..739ff2ba2 100644 --- a/XenModel/XenAPI/Network.cs +++ b/XenModel/XenAPI/Network.cs @@ -120,16 +120,16 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Network 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_network_operations(proxy.current_operations); VIFs = proxy.VIFs == null ? null : XenRef.Create(proxy.VIFs); PIFs = proxy.PIFs == null ? null : XenRef.Create(proxy.PIFs); - MTU = proxy.MTU == null ? 0 : long.Parse((string)proxy.MTU); + MTU = proxy.MTU == null ? 0 : long.Parse(proxy.MTU); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); - bridge = proxy.bridge == null ? null : (string)proxy.bridge; + bridge = proxy.bridge == null ? null : proxy.bridge; managed = (bool)proxy.managed; blobs = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs); tags = proxy.tags == null ? new string[] {} : (string [])proxy.tags; @@ -144,10 +144,10 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_network_operations(current_operations); - result_.VIFs = (VIFs != null) ? Helper.RefListToStringArray(VIFs) : new string[] {}; - result_.PIFs = (PIFs != null) ? Helper.RefListToStringArray(PIFs) : new string[] {}; + result_.VIFs = VIFs == null ? new string[] {} : Helper.RefListToStringArray(VIFs); + result_.PIFs = PIFs == null ? new string[] {} : Helper.RefListToStringArray(PIFs); result_.MTU = MTU.ToString(); result_.other_config = Maps.convert_to_proxy_string_string(other_config); result_.bridge = bridge ?? ""; @@ -156,7 +156,7 @@ namespace XenAPI result_.tags = tags; result_.default_locking_mode = network_default_locking_mode_helper.ToString(default_locking_mode); result_.assigned_ips = Maps.convert_to_proxy_XenRefVIF_string(assigned_ips); - result_.purpose = (purpose != null) ? Helper.ObjectListToStringArray(purpose) : new string[] {}; + result_.purpose = purpose == null ? new string[] {} : Helper.ObjectListToStringArray(purpose); return result_; } @@ -391,7 +391,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.network_get_uuid(session.opaque_ref, _network); else - return (string)session.proxy.network_get_uuid(session.opaque_ref, _network ?? "").parse(); + return session.proxy.network_get_uuid(session.opaque_ref, _network ?? "").parse(); } /// @@ -405,7 +405,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.network_get_name_label(session.opaque_ref, _network); else - return (string)session.proxy.network_get_name_label(session.opaque_ref, _network ?? "").parse(); + return session.proxy.network_get_name_label(session.opaque_ref, _network ?? "").parse(); } /// @@ -419,7 +419,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.network_get_name_description(session.opaque_ref, _network); else - return (string)session.proxy.network_get_name_description(session.opaque_ref, _network ?? "").parse(); + return session.proxy.network_get_name_description(session.opaque_ref, _network ?? "").parse(); } /// @@ -489,7 +489,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.network_get_mtu(session.opaque_ref, _network); else - return long.Parse((string)session.proxy.network_get_mtu(session.opaque_ref, _network ?? "").parse()); + return long.Parse(session.proxy.network_get_mtu(session.opaque_ref, _network ?? "").parse()); } /// @@ -517,7 +517,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.network_get_bridge(session.opaque_ref, _network); else - return (string)session.proxy.network_get_bridge(session.opaque_ref, _network ?? "").parse(); + return session.proxy.network_get_bridge(session.opaque_ref, _network ?? "").parse(); } /// diff --git a/XenModel/XenAPI/PBD.cs b/XenModel/XenAPI/PBD.cs index e2bd4e9b8..e35d3a0eb 100644 --- a/XenModel/XenAPI/PBD.cs +++ b/XenModel/XenAPI/PBD.cs @@ -90,7 +90,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PBD proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; host = proxy.host == null ? null : XenRef.Create(proxy.host); SR = proxy.SR == null ? null : XenRef.Create(proxy.SR); device_config = proxy.device_config == null ? null : Maps.convert_from_proxy_string_string(proxy.device_config); @@ -283,7 +283,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pbd_get_uuid(session.opaque_ref, _pbd); else - return (string)session.proxy.pbd_get_uuid(session.opaque_ref, _pbd ?? "").parse(); + return session.proxy.pbd_get_uuid(session.opaque_ref, _pbd ?? "").parse(); } /// diff --git a/XenModel/XenAPI/PCI.cs b/XenModel/XenAPI/PCI.cs index aed0e2006..577ca9ca5 100644 --- a/XenModel/XenAPI/PCI.cs +++ b/XenModel/XenAPI/PCI.cs @@ -102,16 +102,16 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PCI proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - class_name = proxy.class_name == null ? null : (string)proxy.class_name; - vendor_name = proxy.vendor_name == null ? null : (string)proxy.vendor_name; - device_name = proxy.device_name == null ? null : (string)proxy.device_name; + uuid = proxy.uuid == null ? null : proxy.uuid; + class_name = proxy.class_name == null ? null : proxy.class_name; + vendor_name = proxy.vendor_name == null ? null : proxy.vendor_name; + device_name = proxy.device_name == null ? null : proxy.device_name; host = proxy.host == null ? null : XenRef.Create(proxy.host); - pci_id = proxy.pci_id == null ? null : (string)proxy.pci_id; + pci_id = proxy.pci_id == null ? null : proxy.pci_id; dependencies = proxy.dependencies == null ? null : XenRef.Create(proxy.dependencies); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); - subsystem_vendor_name = proxy.subsystem_vendor_name == null ? null : (string)proxy.subsystem_vendor_name; - subsystem_device_name = proxy.subsystem_device_name == null ? null : (string)proxy.subsystem_device_name; + subsystem_vendor_name = proxy.subsystem_vendor_name == null ? null : proxy.subsystem_vendor_name; + subsystem_device_name = proxy.subsystem_device_name == null ? null : proxy.subsystem_device_name; } public Proxy_PCI ToProxy() @@ -123,7 +123,7 @@ namespace XenAPI result_.device_name = device_name ?? ""; result_.host = host ?? ""; result_.pci_id = pci_id ?? ""; - result_.dependencies = (dependencies != null) ? Helper.RefListToStringArray(dependencies) : new string[] {}; + result_.dependencies = dependencies == null ? new string[] {} : Helper.RefListToStringArray(dependencies); result_.other_config = Maps.convert_to_proxy_string_string(other_config); result_.subsystem_vendor_name = subsystem_vendor_name ?? ""; result_.subsystem_device_name = subsystem_device_name ?? ""; @@ -255,7 +255,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pci_get_uuid(session.opaque_ref, _pci); else - return (string)session.proxy.pci_get_uuid(session.opaque_ref, _pci ?? "").parse(); + return session.proxy.pci_get_uuid(session.opaque_ref, _pci ?? "").parse(); } /// @@ -269,7 +269,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pci_get_class_name(session.opaque_ref, _pci); else - return (string)session.proxy.pci_get_class_name(session.opaque_ref, _pci ?? "").parse(); + return session.proxy.pci_get_class_name(session.opaque_ref, _pci ?? "").parse(); } /// @@ -283,7 +283,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pci_get_vendor_name(session.opaque_ref, _pci); else - return (string)session.proxy.pci_get_vendor_name(session.opaque_ref, _pci ?? "").parse(); + return session.proxy.pci_get_vendor_name(session.opaque_ref, _pci ?? "").parse(); } /// @@ -297,7 +297,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pci_get_device_name(session.opaque_ref, _pci); else - return (string)session.proxy.pci_get_device_name(session.opaque_ref, _pci ?? "").parse(); + return session.proxy.pci_get_device_name(session.opaque_ref, _pci ?? "").parse(); } /// @@ -325,7 +325,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pci_get_pci_id(session.opaque_ref, _pci); else - return (string)session.proxy.pci_get_pci_id(session.opaque_ref, _pci ?? "").parse(); + return session.proxy.pci_get_pci_id(session.opaque_ref, _pci ?? "").parse(); } /// @@ -367,7 +367,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pci_get_subsystem_vendor_name(session.opaque_ref, _pci); else - return (string)session.proxy.pci_get_subsystem_vendor_name(session.opaque_ref, _pci ?? "").parse(); + return session.proxy.pci_get_subsystem_vendor_name(session.opaque_ref, _pci ?? "").parse(); } /// @@ -381,7 +381,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pci_get_subsystem_device_name(session.opaque_ref, _pci); else - return (string)session.proxy.pci_get_subsystem_device_name(session.opaque_ref, _pci ?? "").parse(); + return session.proxy.pci_get_subsystem_device_name(session.opaque_ref, _pci ?? "").parse(); } /// diff --git a/XenModel/XenAPI/PGPU.cs b/XenModel/XenAPI/PGPU.cs index e539fc647..a577a0a01 100644 --- a/XenModel/XenAPI/PGPU.cs +++ b/XenModel/XenAPI/PGPU.cs @@ -108,7 +108,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PGPU proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; PCI = proxy.PCI == null ? null : XenRef.Create(proxy.PCI); GPU_group = proxy.GPU_group == null ? null : XenRef.Create(proxy.GPU_group); host = proxy.host == null ? null : XenRef.Create(proxy.host); @@ -130,9 +130,9 @@ namespace XenAPI result_.GPU_group = GPU_group ?? ""; result_.host = host ?? ""; result_.other_config = Maps.convert_to_proxy_string_string(other_config); - result_.supported_VGPU_types = (supported_VGPU_types != null) ? Helper.RefListToStringArray(supported_VGPU_types) : new string[] {}; - result_.enabled_VGPU_types = (enabled_VGPU_types != null) ? Helper.RefListToStringArray(enabled_VGPU_types) : new string[] {}; - result_.resident_VGPUs = (resident_VGPUs != null) ? Helper.RefListToStringArray(resident_VGPUs) : new string[] {}; + result_.supported_VGPU_types = supported_VGPU_types == null ? new string[] {} : Helper.RefListToStringArray(supported_VGPU_types); + result_.enabled_VGPU_types = enabled_VGPU_types == null ? new string[] {} : Helper.RefListToStringArray(enabled_VGPU_types); + result_.resident_VGPUs = resident_VGPUs == null ? new string[] {} : Helper.RefListToStringArray(resident_VGPUs); result_.supported_VGPU_max_capacities = Maps.convert_to_proxy_XenRefVGPU_type_long(supported_VGPU_max_capacities); result_.dom0_access = pgpu_dom0_access_helper.ToString(dom0_access); result_.is_system_display_device = is_system_display_device; @@ -275,7 +275,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pgpu_get_uuid(session.opaque_ref, _pgpu); else - return (string)session.proxy.pgpu_get_uuid(session.opaque_ref, _pgpu ?? "").parse(); + return session.proxy.pgpu_get_uuid(session.opaque_ref, _pgpu ?? "").parse(); } /// @@ -550,7 +550,7 @@ namespace XenAPI if (session.JsonRpcClient != null) session.JsonRpcClient.pgpu_set_enabled_vgpu_types(session.opaque_ref, _pgpu, _value); else - session.proxy.pgpu_set_enabled_vgpu_types(session.opaque_ref, _pgpu ?? "", (_value != null) ? Helper.RefListToStringArray(_value) : new string[] {}).parse(); + session.proxy.pgpu_set_enabled_vgpu_types(session.opaque_ref, _pgpu ?? "", _value == null ? new string[] {} : Helper.RefListToStringArray(_value)).parse(); } /// @@ -565,7 +565,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.async_pgpu_set_enabled_vgpu_types(session.opaque_ref, _pgpu, _value); else - return XenRef.Create(session.proxy.async_pgpu_set_enabled_vgpu_types(session.opaque_ref, _pgpu ?? "", (_value != null) ? Helper.RefListToStringArray(_value) : new string[] {}).parse()); + return XenRef.Create(session.proxy.async_pgpu_set_enabled_vgpu_types(session.opaque_ref, _pgpu ?? "", _value == null ? new string[] {} : Helper.RefListToStringArray(_value)).parse()); } /// @@ -610,7 +610,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pgpu_get_remaining_capacity(session.opaque_ref, _pgpu, _vgpu_type); else - return long.Parse((string)session.proxy.pgpu_get_remaining_capacity(session.opaque_ref, _pgpu ?? "", _vgpu_type ?? "").parse()); + return long.Parse(session.proxy.pgpu_get_remaining_capacity(session.opaque_ref, _pgpu ?? "", _vgpu_type ?? "").parse()); } /// diff --git a/XenModel/XenAPI/PIF.cs b/XenModel/XenAPI/PIF.cs index bb2c5d299..3b790449a 100644 --- a/XenModel/XenAPI/PIF.cs +++ b/XenModel/XenAPI/PIF.cs @@ -168,21 +168,21 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PIF proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - device = proxy.device == null ? null : (string)proxy.device; + uuid = proxy.uuid == null ? null : proxy.uuid; + device = proxy.device == null ? null : proxy.device; network = proxy.network == null ? null : XenRef.Create(proxy.network); host = proxy.host == null ? null : XenRef.Create(proxy.host); - MAC = proxy.MAC == null ? null : (string)proxy.MAC; - MTU = proxy.MTU == null ? 0 : long.Parse((string)proxy.MTU); - VLAN = proxy.VLAN == null ? 0 : long.Parse((string)proxy.VLAN); + MAC = proxy.MAC == null ? null : proxy.MAC; + MTU = proxy.MTU == null ? 0 : long.Parse(proxy.MTU); + VLAN = proxy.VLAN == null ? 0 : long.Parse(proxy.VLAN); metrics = proxy.metrics == null ? null : XenRef.Create(proxy.metrics); physical = (bool)proxy.physical; currently_attached = (bool)proxy.currently_attached; ip_configuration_mode = proxy.ip_configuration_mode == null ? (ip_configuration_mode) 0 : (ip_configuration_mode)Helper.EnumParseDefault(typeof(ip_configuration_mode), (string)proxy.ip_configuration_mode); - IP = proxy.IP == null ? null : (string)proxy.IP; - netmask = proxy.netmask == null ? null : (string)proxy.netmask; - gateway = proxy.gateway == null ? null : (string)proxy.gateway; - DNS = proxy.DNS == null ? null : (string)proxy.DNS; + IP = proxy.IP == null ? null : proxy.IP; + netmask = proxy.netmask == null ? null : proxy.netmask; + gateway = proxy.gateway == null ? null : proxy.gateway; + DNS = proxy.DNS == null ? null : proxy.DNS; bond_slave_of = proxy.bond_slave_of == null ? null : XenRef.Create(proxy.bond_slave_of); bond_master_of = proxy.bond_master_of == null ? null : XenRef.Create(proxy.bond_master_of); VLAN_master_of = proxy.VLAN_master_of == null ? null : XenRef.Create(proxy.VLAN_master_of); @@ -194,7 +194,7 @@ namespace XenAPI tunnel_transport_PIF_of = proxy.tunnel_transport_PIF_of == null ? null : XenRef.Create(proxy.tunnel_transport_PIF_of); ipv6_configuration_mode = proxy.ipv6_configuration_mode == null ? (ipv6_configuration_mode) 0 : (ipv6_configuration_mode)Helper.EnumParseDefault(typeof(ipv6_configuration_mode), (string)proxy.ipv6_configuration_mode); IPv6 = proxy.IPv6 == null ? new string[] {} : (string [])proxy.IPv6; - ipv6_gateway = proxy.ipv6_gateway == null ? null : (string)proxy.ipv6_gateway; + ipv6_gateway = proxy.ipv6_gateway == null ? null : proxy.ipv6_gateway; primary_address_type = proxy.primary_address_type == null ? (primary_address_type) 0 : (primary_address_type)Helper.EnumParseDefault(typeof(primary_address_type), (string)proxy.primary_address_type); managed = (bool)proxy.managed; properties = proxy.properties == null ? null : Maps.convert_from_proxy_string_string(proxy.properties); @@ -221,14 +221,14 @@ namespace XenAPI result_.gateway = gateway ?? ""; result_.DNS = DNS ?? ""; result_.bond_slave_of = bond_slave_of ?? ""; - result_.bond_master_of = (bond_master_of != null) ? Helper.RefListToStringArray(bond_master_of) : new string[] {}; + result_.bond_master_of = bond_master_of == null ? new string[] {} : Helper.RefListToStringArray(bond_master_of); result_.VLAN_master_of = VLAN_master_of ?? ""; - result_.VLAN_slave_of = (VLAN_slave_of != null) ? Helper.RefListToStringArray(VLAN_slave_of) : new string[] {}; + result_.VLAN_slave_of = VLAN_slave_of == null ? new string[] {} : Helper.RefListToStringArray(VLAN_slave_of); result_.management = management; result_.other_config = Maps.convert_to_proxy_string_string(other_config); result_.disallow_unplug = disallow_unplug; - result_.tunnel_access_PIF_of = (tunnel_access_PIF_of != null) ? Helper.RefListToStringArray(tunnel_access_PIF_of) : new string[] {}; - result_.tunnel_transport_PIF_of = (tunnel_transport_PIF_of != null) ? Helper.RefListToStringArray(tunnel_transport_PIF_of) : new string[] {}; + result_.tunnel_access_PIF_of = tunnel_access_PIF_of == null ? new string[] {} : Helper.RefListToStringArray(tunnel_access_PIF_of); + result_.tunnel_transport_PIF_of = tunnel_transport_PIF_of == null ? new string[] {} : Helper.RefListToStringArray(tunnel_transport_PIF_of); result_.ipv6_configuration_mode = ipv6_configuration_mode_helper.ToString(ipv6_configuration_mode); result_.IPv6 = IPv6; result_.ipv6_gateway = ipv6_gateway ?? ""; @@ -435,7 +435,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_uuid(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_uuid(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_uuid(session.opaque_ref, _pif ?? "").parse(); } /// @@ -449,7 +449,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_device(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_device(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_device(session.opaque_ref, _pif ?? "").parse(); } /// @@ -491,7 +491,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_mac(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_mac(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_mac(session.opaque_ref, _pif ?? "").parse(); } /// @@ -505,7 +505,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_mtu(session.opaque_ref, _pif); else - return long.Parse((string)session.proxy.pif_get_mtu(session.opaque_ref, _pif ?? "").parse()); + return long.Parse(session.proxy.pif_get_mtu(session.opaque_ref, _pif ?? "").parse()); } /// @@ -519,7 +519,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_vlan(session.opaque_ref, _pif); else - return long.Parse((string)session.proxy.pif_get_vlan(session.opaque_ref, _pif ?? "").parse()); + return long.Parse(session.proxy.pif_get_vlan(session.opaque_ref, _pif ?? "").parse()); } /// @@ -589,7 +589,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_ip(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_ip(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_ip(session.opaque_ref, _pif ?? "").parse(); } /// @@ -603,7 +603,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_netmask(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_netmask(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_netmask(session.opaque_ref, _pif ?? "").parse(); } /// @@ -617,7 +617,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_gateway(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_gateway(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_gateway(session.opaque_ref, _pif ?? "").parse(); } /// @@ -631,7 +631,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_dns(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_dns(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_dns(session.opaque_ref, _pif ?? "").parse(); } /// @@ -799,7 +799,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_get_ipv6_gateway(session.opaque_ref, _pif); else - return (string)session.proxy.pif_get_ipv6_gateway(session.opaque_ref, _pif ?? "").parse(); + return session.proxy.pif_get_ipv6_gateway(session.opaque_ref, _pif ?? "").parse(); } /// diff --git a/XenModel/XenAPI/PIF_metrics.cs b/XenModel/XenAPI/PIF_metrics.cs index 04431021d..7c64bc9b9 100644 --- a/XenModel/XenAPI/PIF_metrics.cs +++ b/XenModel/XenAPI/PIF_metrics.cs @@ -111,17 +111,17 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PIF_metrics proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; io_read_kbs = Convert.ToDouble(proxy.io_read_kbs); io_write_kbs = Convert.ToDouble(proxy.io_write_kbs); carrier = (bool)proxy.carrier; - vendor_id = proxy.vendor_id == null ? null : (string)proxy.vendor_id; - vendor_name = proxy.vendor_name == null ? null : (string)proxy.vendor_name; - device_id = proxy.device_id == null ? null : (string)proxy.device_id; - device_name = proxy.device_name == null ? null : (string)proxy.device_name; - speed = proxy.speed == null ? 0 : long.Parse((string)proxy.speed); + vendor_id = proxy.vendor_id == null ? null : proxy.vendor_id; + vendor_name = proxy.vendor_name == null ? null : proxy.vendor_name; + device_id = proxy.device_id == null ? null : proxy.device_id; + device_name = proxy.device_name == null ? null : proxy.device_name; + speed = proxy.speed == null ? 0 : long.Parse(proxy.speed); duplex = (bool)proxy.duplex; - pci_bus_path = proxy.pci_bus_path == null ? null : (string)proxy.pci_bus_path; + pci_bus_path = proxy.pci_bus_path == null ? null : proxy.pci_bus_path; last_updated = proxy.last_updated; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -279,7 +279,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_metrics_get_uuid(session.opaque_ref, _pif_metrics); else - return (string)session.proxy.pif_metrics_get_uuid(session.opaque_ref, _pif_metrics ?? "").parse(); + return session.proxy.pif_metrics_get_uuid(session.opaque_ref, _pif_metrics ?? "").parse(); } /// @@ -335,7 +335,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_metrics_get_vendor_id(session.opaque_ref, _pif_metrics); else - return (string)session.proxy.pif_metrics_get_vendor_id(session.opaque_ref, _pif_metrics ?? "").parse(); + return session.proxy.pif_metrics_get_vendor_id(session.opaque_ref, _pif_metrics ?? "").parse(); } /// @@ -349,7 +349,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_metrics_get_vendor_name(session.opaque_ref, _pif_metrics); else - return (string)session.proxy.pif_metrics_get_vendor_name(session.opaque_ref, _pif_metrics ?? "").parse(); + return session.proxy.pif_metrics_get_vendor_name(session.opaque_ref, _pif_metrics ?? "").parse(); } /// @@ -363,7 +363,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_metrics_get_device_id(session.opaque_ref, _pif_metrics); else - return (string)session.proxy.pif_metrics_get_device_id(session.opaque_ref, _pif_metrics ?? "").parse(); + return session.proxy.pif_metrics_get_device_id(session.opaque_ref, _pif_metrics ?? "").parse(); } /// @@ -377,7 +377,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_metrics_get_device_name(session.opaque_ref, _pif_metrics); else - return (string)session.proxy.pif_metrics_get_device_name(session.opaque_ref, _pif_metrics ?? "").parse(); + return session.proxy.pif_metrics_get_device_name(session.opaque_ref, _pif_metrics ?? "").parse(); } /// @@ -391,7 +391,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_metrics_get_speed(session.opaque_ref, _pif_metrics); else - return long.Parse((string)session.proxy.pif_metrics_get_speed(session.opaque_ref, _pif_metrics ?? "").parse()); + return long.Parse(session.proxy.pif_metrics_get_speed(session.opaque_ref, _pif_metrics ?? "").parse()); } /// @@ -419,7 +419,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pif_metrics_get_pci_bus_path(session.opaque_ref, _pif_metrics); else - return (string)session.proxy.pif_metrics_get_pci_bus_path(session.opaque_ref, _pif_metrics ?? "").parse(); + return session.proxy.pif_metrics_get_pci_bus_path(session.opaque_ref, _pif_metrics ?? "").parse(); } /// diff --git a/XenModel/XenAPI/PUSB.cs b/XenModel/XenAPI/PUSB.cs index 0e9518de2..4012f4997 100644 --- a/XenModel/XenAPI/PUSB.cs +++ b/XenModel/XenAPI/PUSB.cs @@ -111,17 +111,17 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PUSB proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; USB_group = proxy.USB_group == null ? null : XenRef.Create(proxy.USB_group); host = proxy.host == null ? null : XenRef.Create(proxy.host); - path = proxy.path == null ? null : (string)proxy.path; - vendor_id = proxy.vendor_id == null ? null : (string)proxy.vendor_id; - vendor_desc = proxy.vendor_desc == null ? null : (string)proxy.vendor_desc; - product_id = proxy.product_id == null ? null : (string)proxy.product_id; - product_desc = proxy.product_desc == null ? null : (string)proxy.product_desc; - serial = proxy.serial == null ? null : (string)proxy.serial; - version = proxy.version == null ? null : (string)proxy.version; - description = proxy.description == null ? null : (string)proxy.description; + path = proxy.path == null ? null : proxy.path; + vendor_id = proxy.vendor_id == null ? null : proxy.vendor_id; + vendor_desc = proxy.vendor_desc == null ? null : proxy.vendor_desc; + product_id = proxy.product_id == null ? null : proxy.product_id; + product_desc = proxy.product_desc == null ? null : proxy.product_desc; + serial = proxy.serial == null ? null : proxy.serial; + version = proxy.version == null ? null : proxy.version; + description = proxy.description == null ? null : proxy.description; passthrough_enabled = (bool)proxy.passthrough_enabled; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -279,7 +279,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_uuid(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_uuid(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_uuid(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -321,7 +321,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_path(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_path(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_path(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -335,7 +335,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_vendor_id(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_vendor_id(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_vendor_id(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -349,7 +349,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_vendor_desc(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_vendor_desc(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_vendor_desc(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -363,7 +363,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_product_id(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_product_id(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_product_id(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -377,7 +377,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_product_desc(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_product_desc(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_product_desc(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -391,7 +391,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_serial(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_serial(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_serial(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -405,7 +405,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_version(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_version(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_version(session.opaque_ref, _pusb ?? "").parse(); } /// @@ -419,7 +419,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pusb_get_description(session.opaque_ref, _pusb); else - return (string)session.proxy.pusb_get_description(session.opaque_ref, _pusb ?? "").parse(); + return session.proxy.pusb_get_description(session.opaque_ref, _pusb ?? "").parse(); } /// diff --git a/XenModel/XenAPI/PVS_cache_storage.cs b/XenModel/XenAPI/PVS_cache_storage.cs index bf2195ae6..b4c450b13 100644 --- a/XenModel/XenAPI/PVS_cache_storage.cs +++ b/XenModel/XenAPI/PVS_cache_storage.cs @@ -90,11 +90,11 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PVS_cache_storage proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; host = proxy.host == null ? null : XenRef.Create(proxy.host); SR = proxy.SR == null ? null : XenRef.Create(proxy.SR); site = proxy.site == null ? null : XenRef.Create(proxy.site); - size = proxy.size == null ? 0 : long.Parse((string)proxy.size); + size = proxy.size == null ? 0 : long.Parse(proxy.size); VDI = proxy.VDI == null ? null : XenRef.Create(proxy.VDI); } @@ -274,7 +274,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_cache_storage_get_uuid(session.opaque_ref, _pvs_cache_storage); else - return (string)session.proxy.pvs_cache_storage_get_uuid(session.opaque_ref, _pvs_cache_storage ?? "").parse(); + return session.proxy.pvs_cache_storage_get_uuid(session.opaque_ref, _pvs_cache_storage ?? "").parse(); } /// @@ -330,7 +330,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_cache_storage_get_size(session.opaque_ref, _pvs_cache_storage); else - return long.Parse((string)session.proxy.pvs_cache_storage_get_size(session.opaque_ref, _pvs_cache_storage ?? "").parse()); + return long.Parse(session.proxy.pvs_cache_storage_get_size(session.opaque_ref, _pvs_cache_storage ?? "").parse()); } /// diff --git a/XenModel/XenAPI/PVS_proxy.cs b/XenModel/XenAPI/PVS_proxy.cs index 1f7a9946c..9af2ad253 100644 --- a/XenModel/XenAPI/PVS_proxy.cs +++ b/XenModel/XenAPI/PVS_proxy.cs @@ -87,7 +87,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PVS_proxy proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; site = proxy.site == null ? null : XenRef.Create(proxy.site); VIF = proxy.VIF == null ? null : XenRef.Create(proxy.VIF); currently_attached = (bool)proxy.currently_attached; @@ -210,7 +210,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_proxy_get_uuid(session.opaque_ref, _pvs_proxy); else - return (string)session.proxy.pvs_proxy_get_uuid(session.opaque_ref, _pvs_proxy ?? "").parse(); + return session.proxy.pvs_proxy_get_uuid(session.opaque_ref, _pvs_proxy ?? "").parse(); } /// diff --git a/XenModel/XenAPI/PVS_server.cs b/XenModel/XenAPI/PVS_server.cs index 58ad9b331..3d47db12d 100644 --- a/XenModel/XenAPI/PVS_server.cs +++ b/XenModel/XenAPI/PVS_server.cs @@ -87,10 +87,10 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PVS_server proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; addresses = proxy.addresses == null ? new string[] {} : (string [])proxy.addresses; - first_port = proxy.first_port == null ? 0 : long.Parse((string)proxy.first_port); - last_port = proxy.last_port == null ? 0 : long.Parse((string)proxy.last_port); + first_port = proxy.first_port == null ? 0 : long.Parse(proxy.first_port); + last_port = proxy.last_port == null ? 0 : long.Parse(proxy.last_port); site = proxy.site == null ? null : XenRef.Create(proxy.site); } @@ -210,7 +210,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_server_get_uuid(session.opaque_ref, _pvs_server); else - return (string)session.proxy.pvs_server_get_uuid(session.opaque_ref, _pvs_server ?? "").parse(); + return session.proxy.pvs_server_get_uuid(session.opaque_ref, _pvs_server ?? "").parse(); } /// @@ -238,7 +238,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_server_get_first_port(session.opaque_ref, _pvs_server); else - return long.Parse((string)session.proxy.pvs_server_get_first_port(session.opaque_ref, _pvs_server ?? "").parse()); + return long.Parse(session.proxy.pvs_server_get_first_port(session.opaque_ref, _pvs_server ?? "").parse()); } /// @@ -252,7 +252,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_server_get_last_port(session.opaque_ref, _pvs_server); else - return long.Parse((string)session.proxy.pvs_server_get_last_port(session.opaque_ref, _pvs_server ?? "").parse()); + return long.Parse(session.proxy.pvs_server_get_last_port(session.opaque_ref, _pvs_server ?? "").parse()); } /// diff --git a/XenModel/XenAPI/PVS_site.cs b/XenModel/XenAPI/PVS_site.cs index 9cdb82291..7e6042caf 100644 --- a/XenModel/XenAPI/PVS_site.cs +++ b/XenModel/XenAPI/PVS_site.cs @@ -93,10 +93,10 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_PVS_site 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; - PVS_uuid = proxy.PVS_uuid == null ? null : (string)proxy.PVS_uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + PVS_uuid = proxy.PVS_uuid == null ? null : proxy.PVS_uuid; cache_storage = proxy.cache_storage == null ? null : XenRef.Create(proxy.cache_storage); servers = proxy.servers == null ? null : XenRef.Create(proxy.servers); proxies = proxy.proxies == null ? null : XenRef.Create(proxy.proxies); @@ -109,9 +109,9 @@ namespace XenAPI result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; result_.PVS_uuid = PVS_uuid ?? ""; - result_.cache_storage = (cache_storage != null) ? Helper.RefListToStringArray(cache_storage) : new string[] {}; - result_.servers = (servers != null) ? Helper.RefListToStringArray(servers) : new string[] {}; - result_.proxies = (proxies != null) ? Helper.RefListToStringArray(proxies) : new string[] {}; + result_.cache_storage = cache_storage == null ? new string[] {} : Helper.RefListToStringArray(cache_storage); + result_.servers = servers == null ? new string[] {} : Helper.RefListToStringArray(servers); + result_.proxies = proxies == null ? new string[] {} : Helper.RefListToStringArray(proxies); return result_; } @@ -253,7 +253,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_site_get_uuid(session.opaque_ref, _pvs_site); else - return (string)session.proxy.pvs_site_get_uuid(session.opaque_ref, _pvs_site ?? "").parse(); + return session.proxy.pvs_site_get_uuid(session.opaque_ref, _pvs_site ?? "").parse(); } /// @@ -267,7 +267,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_site_get_name_label(session.opaque_ref, _pvs_site); else - return (string)session.proxy.pvs_site_get_name_label(session.opaque_ref, _pvs_site ?? "").parse(); + return session.proxy.pvs_site_get_name_label(session.opaque_ref, _pvs_site ?? "").parse(); } /// @@ -281,7 +281,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_site_get_name_description(session.opaque_ref, _pvs_site); else - return (string)session.proxy.pvs_site_get_name_description(session.opaque_ref, _pvs_site ?? "").parse(); + return session.proxy.pvs_site_get_name_description(session.opaque_ref, _pvs_site ?? "").parse(); } /// @@ -295,7 +295,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pvs_site_get_pvs_uuid(session.opaque_ref, _pvs_site); else - return (string)session.proxy.pvs_site_get_pvs_uuid(session.opaque_ref, _pvs_site ?? "").parse(); + return session.proxy.pvs_site_get_pvs_uuid(session.opaque_ref, _pvs_site ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Pool.cs b/XenModel/XenAPI/Pool.cs index aa866f586..8a4424ee0 100644 --- a/XenModel/XenAPI/Pool.cs +++ b/XenModel/XenAPI/Pool.cs @@ -180,9 +180,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Pool 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; master = proxy.master == null ? null : XenRef.Create(proxy.master); default_SR = proxy.default_SR == null ? null : XenRef.Create(proxy.default_SR); suspend_image_SR = proxy.suspend_image_SR == null ? null : XenRef.Create(proxy.suspend_image_SR); @@ -191,24 +191,24 @@ namespace XenAPI ha_enabled = (bool)proxy.ha_enabled; ha_configuration = proxy.ha_configuration == null ? null : Maps.convert_from_proxy_string_string(proxy.ha_configuration); ha_statefiles = proxy.ha_statefiles == null ? new string[] {} : (string [])proxy.ha_statefiles; - ha_host_failures_to_tolerate = proxy.ha_host_failures_to_tolerate == null ? 0 : long.Parse((string)proxy.ha_host_failures_to_tolerate); - ha_plan_exists_for = proxy.ha_plan_exists_for == null ? 0 : long.Parse((string)proxy.ha_plan_exists_for); + ha_host_failures_to_tolerate = proxy.ha_host_failures_to_tolerate == null ? 0 : long.Parse(proxy.ha_host_failures_to_tolerate); + ha_plan_exists_for = proxy.ha_plan_exists_for == null ? 0 : long.Parse(proxy.ha_plan_exists_for); ha_allow_overcommit = (bool)proxy.ha_allow_overcommit; ha_overcommitted = (bool)proxy.ha_overcommitted; blobs = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs); tags = proxy.tags == null ? new string[] {} : (string [])proxy.tags; gui_config = proxy.gui_config == null ? null : Maps.convert_from_proxy_string_string(proxy.gui_config); health_check_config = proxy.health_check_config == null ? null : Maps.convert_from_proxy_string_string(proxy.health_check_config); - wlb_url = proxy.wlb_url == null ? null : (string)proxy.wlb_url; - wlb_username = proxy.wlb_username == null ? null : (string)proxy.wlb_username; + wlb_url = proxy.wlb_url == null ? null : proxy.wlb_url; + wlb_username = proxy.wlb_username == null ? null : proxy.wlb_username; wlb_enabled = (bool)proxy.wlb_enabled; wlb_verify_cert = (bool)proxy.wlb_verify_cert; redo_log_enabled = (bool)proxy.redo_log_enabled; redo_log_vdi = proxy.redo_log_vdi == null ? null : XenRef.Create(proxy.redo_log_vdi); - vswitch_controller = proxy.vswitch_controller == null ? null : (string)proxy.vswitch_controller; + vswitch_controller = proxy.vswitch_controller == null ? null : proxy.vswitch_controller; restrictions = proxy.restrictions == null ? null : Maps.convert_from_proxy_string_string(proxy.restrictions); metadata_VDIs = proxy.metadata_VDIs == null ? null : XenRef.Create(proxy.metadata_VDIs); - ha_cluster_stack = proxy.ha_cluster_stack == null ? null : (string)proxy.ha_cluster_stack; + ha_cluster_stack = proxy.ha_cluster_stack == null ? null : proxy.ha_cluster_stack; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_pool_allowed_operations(proxy.current_operations); guest_agent_config = proxy.guest_agent_config == null ? null : Maps.convert_from_proxy_string_string(proxy.guest_agent_config); @@ -248,9 +248,9 @@ namespace XenAPI result_.redo_log_vdi = redo_log_vdi ?? ""; result_.vswitch_controller = vswitch_controller ?? ""; result_.restrictions = Maps.convert_to_proxy_string_string(restrictions); - result_.metadata_VDIs = (metadata_VDIs != null) ? Helper.RefListToStringArray(metadata_VDIs) : new string[] {}; + result_.metadata_VDIs = metadata_VDIs == null ? new string[] {} : Helper.RefListToStringArray(metadata_VDIs); result_.ha_cluster_stack = ha_cluster_stack ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_pool_allowed_operations(current_operations); result_.guest_agent_config = Maps.convert_to_proxy_string_string(guest_agent_config); result_.cpu_info = Maps.convert_to_proxy_string_string(cpu_info); @@ -517,7 +517,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_uuid(session.opaque_ref, _pool); else - return (string)session.proxy.pool_get_uuid(session.opaque_ref, _pool ?? "").parse(); + return session.proxy.pool_get_uuid(session.opaque_ref, _pool ?? "").parse(); } /// @@ -531,7 +531,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_name_label(session.opaque_ref, _pool); else - return (string)session.proxy.pool_get_name_label(session.opaque_ref, _pool ?? "").parse(); + return session.proxy.pool_get_name_label(session.opaque_ref, _pool ?? "").parse(); } /// @@ -545,7 +545,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_name_description(session.opaque_ref, _pool); else - return (string)session.proxy.pool_get_name_description(session.opaque_ref, _pool ?? "").parse(); + return session.proxy.pool_get_name_description(session.opaque_ref, _pool ?? "").parse(); } /// @@ -671,7 +671,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_ha_host_failures_to_tolerate(session.opaque_ref, _pool); else - return long.Parse((string)session.proxy.pool_get_ha_host_failures_to_tolerate(session.opaque_ref, _pool ?? "").parse()); + return long.Parse(session.proxy.pool_get_ha_host_failures_to_tolerate(session.opaque_ref, _pool ?? "").parse()); } /// @@ -685,7 +685,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_ha_plan_exists_for(session.opaque_ref, _pool); else - return long.Parse((string)session.proxy.pool_get_ha_plan_exists_for(session.opaque_ref, _pool ?? "").parse()); + return long.Parse(session.proxy.pool_get_ha_plan_exists_for(session.opaque_ref, _pool ?? "").parse()); } /// @@ -783,7 +783,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_wlb_url(session.opaque_ref, _pool); else - return (string)session.proxy.pool_get_wlb_url(session.opaque_ref, _pool ?? "").parse(); + return session.proxy.pool_get_wlb_url(session.opaque_ref, _pool ?? "").parse(); } /// @@ -797,7 +797,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_wlb_username(session.opaque_ref, _pool); else - return (string)session.proxy.pool_get_wlb_username(session.opaque_ref, _pool ?? "").parse(); + return session.proxy.pool_get_wlb_username(session.opaque_ref, _pool ?? "").parse(); } /// @@ -869,7 +869,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_vswitch_controller(session.opaque_ref, _pool); else - return (string)session.proxy.pool_get_vswitch_controller(session.opaque_ref, _pool ?? "").parse(); + return session.proxy.pool_get_vswitch_controller(session.opaque_ref, _pool ?? "").parse(); } /// @@ -911,7 +911,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_get_ha_cluster_stack(session.opaque_ref, _pool); else - return (string)session.proxy.pool_get_ha_cluster_stack(session.opaque_ref, _pool ?? "").parse(); + return session.proxy.pool_get_ha_cluster_stack(session.opaque_ref, _pool ?? "").parse(); } /// @@ -1594,7 +1594,7 @@ namespace XenAPI if (session.JsonRpcClient != null) session.JsonRpcClient.pool_enable_ha(session.opaque_ref, _heartbeat_srs, _configuration); else - session.proxy.pool_enable_ha(session.opaque_ref, (_heartbeat_srs != null) ? Helper.RefListToStringArray(_heartbeat_srs) : new string[] {}, Maps.convert_to_proxy_string_string(_configuration)).parse(); + session.proxy.pool_enable_ha(session.opaque_ref, _heartbeat_srs == null ? new string[] {} : Helper.RefListToStringArray(_heartbeat_srs), Maps.convert_to_proxy_string_string(_configuration)).parse(); } /// @@ -1609,7 +1609,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.async_pool_enable_ha(session.opaque_ref, _heartbeat_srs, _configuration); else - return XenRef.Create(session.proxy.async_pool_enable_ha(session.opaque_ref, (_heartbeat_srs != null) ? Helper.RefListToStringArray(_heartbeat_srs) : new string[] {}, Maps.convert_to_proxy_string_string(_configuration)).parse()); + return XenRef.Create(session.proxy.async_pool_enable_ha(session.opaque_ref, _heartbeat_srs == null ? new string[] {} : Helper.RefListToStringArray(_heartbeat_srs), Maps.convert_to_proxy_string_string(_configuration)).parse()); } /// @@ -1730,7 +1730,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_ha_compute_max_host_failures_to_tolerate(session.opaque_ref); else - return long.Parse((string)session.proxy.pool_ha_compute_max_host_failures_to_tolerate(session.opaque_ref).parse()); + return long.Parse(session.proxy.pool_ha_compute_max_host_failures_to_tolerate(session.opaque_ref).parse()); } /// @@ -1744,7 +1744,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_ha_compute_hypothetical_max_host_failures_to_tolerate(session.opaque_ref, _configuration); else - return long.Parse((string)session.proxy.pool_ha_compute_hypothetical_max_host_failures_to_tolerate(session.opaque_ref, Maps.convert_to_proxy_XenRefVM_string(_configuration)).parse()); + return long.Parse(session.proxy.pool_ha_compute_hypothetical_max_host_failures_to_tolerate(session.opaque_ref, Maps.convert_to_proxy_XenRefVM_string(_configuration)).parse()); } /// @@ -1759,7 +1759,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_ha_compute_vm_failover_plan(session.opaque_ref, _failed_hosts, _failed_vms); else - return Maps.convert_from_proxy_XenRefVM_Dictionary_string_string(session.proxy.pool_ha_compute_vm_failover_plan(session.opaque_ref, (_failed_hosts != null) ? Helper.RefListToStringArray(_failed_hosts) : new string[] {}, (_failed_vms != null) ? Helper.RefListToStringArray(_failed_vms) : new string[] {}).parse()); + return Maps.convert_from_proxy_XenRefVM_Dictionary_string_string(session.proxy.pool_ha_compute_vm_failover_plan(session.opaque_ref, _failed_hosts == null ? new string[] {} : Helper.RefListToStringArray(_failed_hosts), _failed_vms == null ? new string[] {} : Helper.RefListToStringArray(_failed_vms)).parse()); } /// @@ -2059,7 +2059,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_send_test_post(session.opaque_ref, _host, _port, _body); else - return (string)session.proxy.pool_send_test_post(session.opaque_ref, _host ?? "", _port.ToString(), _body ?? "").parse(); + return session.proxy.pool_send_test_post(session.opaque_ref, _host ?? "", _port.ToString(), _body ?? "").parse(); } /// @@ -2370,7 +2370,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_test_archive_target(session.opaque_ref, _pool, _config); else - return (string)session.proxy.pool_test_archive_target(session.opaque_ref, _pool ?? "", Maps.convert_to_proxy_string_string(_config)).parse(); + return session.proxy.pool_test_archive_target(session.opaque_ref, _pool ?? "", Maps.convert_to_proxy_string_string(_config)).parse(); } /// diff --git a/XenModel/XenAPI/Pool_patch.cs b/XenModel/XenAPI/Pool_patch.cs index a8cbe47f2..27d77876e 100644 --- a/XenModel/XenAPI/Pool_patch.cs +++ b/XenModel/XenAPI/Pool_patch.cs @@ -102,11 +102,11 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Pool_patch 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; - version = proxy.version == null ? null : (string)proxy.version; - size = proxy.size == null ? 0 : long.Parse((string)proxy.size); + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + version = proxy.version == null ? null : proxy.version; + size = proxy.size == null ? 0 : long.Parse(proxy.size); pool_applied = (bool)proxy.pool_applied; host_patches = proxy.host_patches == null ? null : XenRef.Create(proxy.host_patches); after_apply_guidance = proxy.after_apply_guidance == null ? null : Helper.StringArrayToEnumList(proxy.after_apply_guidance); @@ -123,8 +123,8 @@ namespace XenAPI result_.version = version ?? ""; result_.size = size.ToString(); result_.pool_applied = pool_applied; - result_.host_patches = (host_patches != null) ? Helper.RefListToStringArray(host_patches) : new string[] {}; - result_.after_apply_guidance = (after_apply_guidance != null) ? Helper.ObjectListToStringArray(after_apply_guidance) : new string[] {}; + result_.host_patches = host_patches == null ? new string[] {} : Helper.RefListToStringArray(host_patches); + result_.after_apply_guidance = after_apply_guidance == null ? new string[] {} : Helper.ObjectListToStringArray(after_apply_guidance); result_.pool_update = pool_update ?? ""; result_.other_config = Maps.convert_to_proxy_string_string(other_config); return result_; @@ -275,7 +275,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_patch_get_uuid(session.opaque_ref, _pool_patch); else - return (string)session.proxy.pool_patch_get_uuid(session.opaque_ref, _pool_patch ?? "").parse(); + return session.proxy.pool_patch_get_uuid(session.opaque_ref, _pool_patch ?? "").parse(); } /// @@ -289,7 +289,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_patch_get_name_label(session.opaque_ref, _pool_patch); else - return (string)session.proxy.pool_patch_get_name_label(session.opaque_ref, _pool_patch ?? "").parse(); + return session.proxy.pool_patch_get_name_label(session.opaque_ref, _pool_patch ?? "").parse(); } /// @@ -303,7 +303,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_patch_get_name_description(session.opaque_ref, _pool_patch); else - return (string)session.proxy.pool_patch_get_name_description(session.opaque_ref, _pool_patch ?? "").parse(); + return session.proxy.pool_patch_get_name_description(session.opaque_ref, _pool_patch ?? "").parse(); } /// @@ -317,7 +317,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_patch_get_version(session.opaque_ref, _pool_patch); else - return (string)session.proxy.pool_patch_get_version(session.opaque_ref, _pool_patch ?? "").parse(); + return session.proxy.pool_patch_get_version(session.opaque_ref, _pool_patch ?? "").parse(); } /// @@ -331,7 +331,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_patch_get_size(session.opaque_ref, _pool_patch); else - return long.Parse((string)session.proxy.pool_patch_get_size(session.opaque_ref, _pool_patch ?? "").parse()); + return long.Parse(session.proxy.pool_patch_get_size(session.opaque_ref, _pool_patch ?? "").parse()); } /// @@ -464,7 +464,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_patch_apply(session.opaque_ref, _pool_patch, _host); else - return (string)session.proxy.pool_patch_apply(session.opaque_ref, _pool_patch ?? "", _host ?? "").parse(); + return session.proxy.pool_patch_apply(session.opaque_ref, _pool_patch ?? "", _host ?? "").parse(); } /// @@ -530,7 +530,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_patch_precheck(session.opaque_ref, _pool_patch, _host); else - return (string)session.proxy.pool_patch_precheck(session.opaque_ref, _pool_patch ?? "", _host ?? "").parse(); + return session.proxy.pool_patch_precheck(session.opaque_ref, _pool_patch ?? "", _host ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Pool_update.cs b/XenModel/XenAPI/Pool_update.cs index 2e03bb229..ce831a445 100644 --- a/XenModel/XenAPI/Pool_update.cs +++ b/XenModel/XenAPI/Pool_update.cs @@ -105,12 +105,12 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Pool_update 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; - version = proxy.version == null ? null : (string)proxy.version; - installation_size = proxy.installation_size == null ? 0 : long.Parse((string)proxy.installation_size); - key = proxy.key == null ? null : (string)proxy.key; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + version = proxy.version == null ? null : proxy.version; + installation_size = proxy.installation_size == null ? 0 : long.Parse(proxy.installation_size); + key = proxy.key == null ? null : proxy.key; after_apply_guidance = proxy.after_apply_guidance == null ? null : Helper.StringArrayToEnumList(proxy.after_apply_guidance); vdi = proxy.vdi == null ? null : XenRef.Create(proxy.vdi); hosts = proxy.hosts == null ? null : XenRef.Create(proxy.hosts); @@ -127,9 +127,9 @@ namespace XenAPI result_.version = version ?? ""; result_.installation_size = installation_size.ToString(); result_.key = key ?? ""; - result_.after_apply_guidance = (after_apply_guidance != null) ? Helper.ObjectListToStringArray(after_apply_guidance) : new string[] {}; + result_.after_apply_guidance = after_apply_guidance == null ? new string[] {} : Helper.ObjectListToStringArray(after_apply_guidance); result_.vdi = vdi ?? ""; - result_.hosts = (hosts != null) ? Helper.RefListToStringArray(hosts) : new string[] {}; + result_.hosts = hosts == null ? new string[] {} : Helper.RefListToStringArray(hosts); result_.other_config = Maps.convert_to_proxy_string_string(other_config); result_.enforce_homogeneity = enforce_homogeneity; return result_; @@ -277,7 +277,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_update_get_uuid(session.opaque_ref, _pool_update); else - return (string)session.proxy.pool_update_get_uuid(session.opaque_ref, _pool_update ?? "").parse(); + return session.proxy.pool_update_get_uuid(session.opaque_ref, _pool_update ?? "").parse(); } /// @@ -291,7 +291,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_update_get_name_label(session.opaque_ref, _pool_update); else - return (string)session.proxy.pool_update_get_name_label(session.opaque_ref, _pool_update ?? "").parse(); + return session.proxy.pool_update_get_name_label(session.opaque_ref, _pool_update ?? "").parse(); } /// @@ -305,7 +305,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_update_get_name_description(session.opaque_ref, _pool_update); else - return (string)session.proxy.pool_update_get_name_description(session.opaque_ref, _pool_update ?? "").parse(); + return session.proxy.pool_update_get_name_description(session.opaque_ref, _pool_update ?? "").parse(); } /// @@ -319,7 +319,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_update_get_version(session.opaque_ref, _pool_update); else - return (string)session.proxy.pool_update_get_version(session.opaque_ref, _pool_update ?? "").parse(); + return session.proxy.pool_update_get_version(session.opaque_ref, _pool_update ?? "").parse(); } /// @@ -333,7 +333,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_update_get_installation_size(session.opaque_ref, _pool_update); else - return long.Parse((string)session.proxy.pool_update_get_installation_size(session.opaque_ref, _pool_update ?? "").parse()); + return long.Parse(session.proxy.pool_update_get_installation_size(session.opaque_ref, _pool_update ?? "").parse()); } /// @@ -347,7 +347,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.pool_update_get_key(session.opaque_ref, _pool_update); else - return (string)session.proxy.pool_update_get_key(session.opaque_ref, _pool_update ?? "").parse(); + return session.proxy.pool_update_get_key(session.opaque_ref, _pool_update ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Probe_result.cs b/XenModel/XenAPI/Probe_result.cs new file mode 100644 index 000000000..879740ed0 --- /dev/null +++ b/XenModel/XenAPI/Probe_result.cs @@ -0,0 +1,240 @@ +/* + * Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + + +namespace XenAPI +{ + /// + /// A set of properties that describe one result element of SR.probe. Result elements and properties can change dynamically based on changes to the the SR.probe input-parameters or the target. + /// First published in Unreleased. + /// + public partial class Probe_result : XenObject + { + public Probe_result() + { + } + + public Probe_result(Dictionary configuration, + bool complete, + Sr_stat sr, + Dictionary extra_info) + { + this.configuration = configuration; + this.complete = complete; + this.sr = sr; + this.extra_info = extra_info; + } + + /// + /// Creates a new Probe_result from a Proxy_Probe_result. + /// + /// + public Probe_result(Proxy_Probe_result proxy) + { + this.UpdateFromProxy(proxy); + } + + /// + /// Updates each field of this instance with the value of + /// the corresponding field of a given Probe_result. + /// + public override void UpdateFrom(Probe_result update) + { + configuration = update.configuration; + complete = update.complete; + sr = update.sr; + extra_info = update.extra_info; + } + + internal void UpdateFromProxy(Proxy_Probe_result proxy) + { + configuration = proxy.configuration == null ? null : Maps.convert_from_proxy_string_string(proxy.configuration); + complete = (bool)proxy.complete; + sr = proxy.sr == null ? null : new Sr_stat((Proxy_Sr_stat)proxy.sr); + extra_info = proxy.extra_info == null ? null : Maps.convert_from_proxy_string_string(proxy.extra_info); + } + + public Proxy_Probe_result ToProxy() + { + Proxy_Probe_result result_ = new Proxy_Probe_result(); + result_.configuration = Maps.convert_to_proxy_string_string(configuration); + result_.complete = complete; + result_.sr = sr == null ? null : sr.ToProxy(); + result_.extra_info = Maps.convert_to_proxy_string_string(extra_info); + return result_; + } + + /// + /// Creates a new Probe_result from a Hashtable. + /// Note that the fields not contained in the Hashtable + /// will be created with their default values. + /// + /// + public Probe_result(Hashtable table) : this() + { + UpdateFrom(table); + } + + /// + /// Given a Hashtable with field-value pairs, it updates the fields of this Probe_result + /// 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. + /// + /// + public void UpdateFrom(Hashtable table) + { + if (table.ContainsKey("configuration")) + configuration = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "configuration")); + if (table.ContainsKey("complete")) + complete = Marshalling.ParseBool(table, "complete"); + if (table.ContainsKey("sr")) + sr = (Sr_stat)Marshalling.convertStruct(typeof(Sr_stat), Marshalling.ParseHashTable(table, "sr"));; + if (table.ContainsKey("extra_info")) + extra_info = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "extra_info")); + } + + public bool DeepEquals(Probe_result other) + { + if (ReferenceEquals(null, other)) + return false; + if (ReferenceEquals(this, other)) + return true; + + return Helper.AreEqual2(this._configuration, other._configuration) && + Helper.AreEqual2(this._complete, other._complete) && + Helper.AreEqual2(this._sr, other._sr) && + Helper.AreEqual2(this._extra_info, other._extra_info); + } + + internal static List ProxyArrayToObjectList(Proxy_Probe_result[] input) + { + var result = new List(); + foreach (var item in input) + result.Add(new Probe_result(item)); + + return result; + } + + public override string SaveChanges(Session session, string opaqueRef, Probe_result server) + { + if (opaqueRef == null) + { + System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); + return ""; + } + else + { + throw new InvalidOperationException("This type has no read/write properties"); + } + } + /// + /// Plugin-specific configuration which describes where and how to locate the storage repository. This may include the physical block device name, a remote NFS server and path or an RBD storage pool. + /// + [JsonConverter(typeof(StringStringMapConverter))] + public virtual Dictionary configuration + { + get { return _configuration; } + set + { + if (!Helper.AreEqual(value, _configuration)) + { + _configuration = value; + Changed = true; + NotifyPropertyChanged("configuration"); + } + } + } + private Dictionary _configuration = new Dictionary() {}; + + /// + /// True if this configuration is complete and can be used to call SR.create. False if it requires further iterative calls to SR.probe, to potentially narrow down on a configuration that can be used. + /// + public virtual bool complete + { + get { return _complete; } + set + { + if (!Helper.AreEqual(value, _complete)) + { + _complete = value; + Changed = true; + NotifyPropertyChanged("complete"); + } + } + } + private bool _complete; + + /// + /// Existing SR found for this configuration + /// + public virtual Sr_stat sr + { + get { return _sr; } + set + { + if (!Helper.AreEqual(value, _sr)) + { + _sr = value; + Changed = true; + NotifyPropertyChanged("sr"); + } + } + } + private Sr_stat _sr; + + /// + /// Additional plugin-specific information about this configuration, that might be of use for an API user. This can for example include the LUN or the WWPN. + /// + [JsonConverter(typeof(StringStringMapConverter))] + public virtual Dictionary extra_info + { + get { return _extra_info; } + set + { + if (!Helper.AreEqual(value, _extra_info)) + { + _extra_info = value; + Changed = true; + NotifyPropertyChanged("extra_info"); + } + } + } + private Dictionary _extra_info = new Dictionary() {}; + } +} diff --git a/XenModel/XenAPI/Proxy.cs b/XenModel/XenAPI/Proxy.cs index bd9d1760b..f82e1d348 100644 --- a/XenModel/XenAPI/Proxy.cs +++ b/XenModel/XenAPI/Proxy.cs @@ -1680,6 +1680,10 @@ namespace XenAPI Response vm_get_reference_label(string session, string _vm); + [XmlRpcMethod("VM.get_domain_type")] + Response + vm_get_domain_type(string session, string _vm); + [XmlRpcMethod("VM.set_name_label")] Response vm_set_name_label(string session, string _vm, string _label); @@ -1744,10 +1748,6 @@ namespace XenAPI Response vm_set_pv_legacy_args(string session, string _vm, string _legacy_args); - [XmlRpcMethod("VM.set_HVM_boot_policy")] - Response - vm_set_hvm_boot_policy(string session, string _vm, string _boot_policy); - [XmlRpcMethod("VM.set_HVM_boot_params")] Response vm_set_hvm_boot_params(string session, string _vm, Object _boot_params); @@ -2412,6 +2412,14 @@ namespace XenAPI Response async_vm_set_actions_after_crash(string session, string _vm, string _value); + [XmlRpcMethod("VM.set_domain_type")] + Response + vm_set_domain_type(string session, string _vm, string _value); + + [XmlRpcMethod("VM.set_HVM_boot_policy")] + Response + vm_set_hvm_boot_policy(string session, string _vm, string _value); + [XmlRpcMethod("VM.get_all")] Response vm_get_all(string session); @@ -2488,6 +2496,10 @@ namespace XenAPI Response vm_metrics_get_nomigrate(string session, string _vm_metrics); + [XmlRpcMethod("VM_metrics.get_current_domain_type")] + Response + vm_metrics_get_current_domain_type(string session, string _vm_metrics); + [XmlRpcMethod("VM_metrics.set_other_config")] Response vm_metrics_set_other_config(string session, string _vm_metrics, Object _other_config); @@ -5484,6 +5496,14 @@ namespace XenAPI Response async_sr_probe(string session, string _host, Object _device_config, string _type, Object _sm_config); + [XmlRpcMethod("SR.probe_ext")] + Response + sr_probe_ext(string session, string _host, Object _device_config, string _type, Object _sm_config); + + [XmlRpcMethod("Async.SR.probe_ext")] + Response + async_sr_probe_ext(string session, string _host, Object _device_config, string _type, Object _sm_config); + [XmlRpcMethod("SR.set_shared")] Response sr_set_shared(string session, string _sr, bool _value); @@ -5592,6 +5612,14 @@ namespace XenAPI Response sr_get_all_records(string session); + [XmlRpcMethod("sr_stat.get_all_records")] + Response + sr_stat_get_all_records(string session); + + [XmlRpcMethod("probe_result.get_all_records")] + Response + probe_result_get_all_records(string session); + [XmlRpcMethod("LVHD.get_record")] Response lvhd_get_record(string session, string _lvhd); @@ -8400,6 +8428,7 @@ namespace XenAPI public bool has_vendor_device; public bool requires_reboot; public string reference_label; + public string domain_type; } [XmlRpcMissingMapping(MappingAction.Ignore)] @@ -8420,6 +8449,7 @@ namespace XenAPI public bool hvm; public bool nested_virt; public bool nomigrate; + public string current_domain_type; } [XmlRpcMissingMapping(MappingAction.Ignore)] @@ -8802,6 +8832,27 @@ namespace XenAPI public bool is_tools_sr; } + [XmlRpcMissingMapping(MappingAction.Ignore)] + public class Proxy_Sr_stat + { + public string uuid; + public string name_label; + public string name_description; + public string free_space; + public string total_space; + public bool clustered; + public string health; + } + + [XmlRpcMissingMapping(MappingAction.Ignore)] + public class Proxy_Probe_result + { + public Object configuration; + public bool complete; + public Proxy_Sr_stat sr; + public Object extra_info; + } + [XmlRpcMissingMapping(MappingAction.Ignore)] public class Proxy_LVHD { diff --git a/XenModel/XenAPI/Role.cs b/XenModel/XenAPI/Role.cs index 718dcecbd..719de5d2a 100644 --- a/XenModel/XenAPI/Role.cs +++ b/XenModel/XenAPI/Role.cs @@ -84,9 +84,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Role 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; subroles = proxy.subroles == null ? null : XenRef.Create(proxy.subroles); } @@ -96,7 +96,7 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.subroles = (subroles != null) ? Helper.RefListToStringArray(subroles) : new string[] {}; + result_.subroles = subroles == null ? new string[] {} : Helper.RefListToStringArray(subroles); return result_; } @@ -216,7 +216,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.role_get_uuid(session.opaque_ref, _role); else - return (string)session.proxy.role_get_uuid(session.opaque_ref, _role ?? "").parse(); + return session.proxy.role_get_uuid(session.opaque_ref, _role ?? "").parse(); } /// @@ -230,7 +230,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.role_get_name_label(session.opaque_ref, _role); else - return (string)session.proxy.role_get_name_label(session.opaque_ref, _role ?? "").parse(); + return session.proxy.role_get_name_label(session.opaque_ref, _role ?? "").parse(); } /// @@ -244,7 +244,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.role_get_name_description(session.opaque_ref, _role); else - return (string)session.proxy.role_get_name_description(session.opaque_ref, _role ?? "").parse(); + return session.proxy.role_get_name_description(session.opaque_ref, _role ?? "").parse(); } /// diff --git a/XenModel/XenAPI/SDN_controller.cs b/XenModel/XenAPI/SDN_controller.cs index 53d96b4a0..b9d18c5e2 100644 --- a/XenModel/XenAPI/SDN_controller.cs +++ b/XenModel/XenAPI/SDN_controller.cs @@ -84,10 +84,10 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_SDN_controller proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; protocol = proxy.protocol == null ? (sdn_controller_protocol) 0 : (sdn_controller_protocol)Helper.EnumParseDefault(typeof(sdn_controller_protocol), (string)proxy.protocol); - address = proxy.address == null ? null : (string)proxy.address; - port = proxy.port == null ? 0 : long.Parse((string)proxy.port); + address = proxy.address == null ? null : proxy.address; + port = proxy.port == null ? 0 : long.Parse(proxy.port); } public Proxy_SDN_controller ToProxy() @@ -202,7 +202,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sdn_controller_get_uuid(session.opaque_ref, _sdn_controller); else - return (string)session.proxy.sdn_controller_get_uuid(session.opaque_ref, _sdn_controller ?? "").parse(); + return session.proxy.sdn_controller_get_uuid(session.opaque_ref, _sdn_controller ?? "").parse(); } /// @@ -230,7 +230,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sdn_controller_get_address(session.opaque_ref, _sdn_controller); else - return (string)session.proxy.sdn_controller_get_address(session.opaque_ref, _sdn_controller ?? "").parse(); + return session.proxy.sdn_controller_get_address(session.opaque_ref, _sdn_controller ?? "").parse(); } /// @@ -244,7 +244,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sdn_controller_get_port(session.opaque_ref, _sdn_controller); else - return long.Parse((string)session.proxy.sdn_controller_get_port(session.opaque_ref, _sdn_controller ?? "").parse()); + return long.Parse(session.proxy.sdn_controller_get_port(session.opaque_ref, _sdn_controller ?? "").parse()); } /// diff --git a/XenModel/XenAPI/SM.cs b/XenModel/XenAPI/SM.cs index d13007da7..55eb1da8d 100644 --- a/XenModel/XenAPI/SM.cs +++ b/XenModel/XenAPI/SM.cs @@ -114,19 +114,19 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_SM 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; - type = proxy.type == null ? null : (string)proxy.type; - vendor = proxy.vendor == null ? null : (string)proxy.vendor; - copyright = proxy.copyright == null ? null : (string)proxy.copyright; - version = proxy.version == null ? null : (string)proxy.version; - required_api_version = proxy.required_api_version == null ? null : (string)proxy.required_api_version; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + type = proxy.type == null ? null : proxy.type; + vendor = proxy.vendor == null ? null : proxy.vendor; + copyright = proxy.copyright == null ? null : proxy.copyright; + version = proxy.version == null ? null : proxy.version; + required_api_version = proxy.required_api_version == null ? null : proxy.required_api_version; configuration = proxy.configuration == null ? null : Maps.convert_from_proxy_string_string(proxy.configuration); capabilities = proxy.capabilities == null ? new string[] {} : (string [])proxy.capabilities; features = proxy.features == null ? null : Maps.convert_from_proxy_string_long(proxy.features); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); - driver_filename = proxy.driver_filename == null ? null : (string)proxy.driver_filename; + driver_filename = proxy.driver_filename == null ? null : proxy.driver_filename; required_cluster_stack = proxy.required_cluster_stack == null ? new string[] {} : (string [])proxy.required_cluster_stack; } @@ -301,7 +301,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_uuid(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_uuid(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_uuid(session.opaque_ref, _sm ?? "").parse(); } /// @@ -315,7 +315,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_name_label(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_name_label(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_name_label(session.opaque_ref, _sm ?? "").parse(); } /// @@ -329,7 +329,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_name_description(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_name_description(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_name_description(session.opaque_ref, _sm ?? "").parse(); } /// @@ -343,7 +343,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_type(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_type(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_type(session.opaque_ref, _sm ?? "").parse(); } /// @@ -357,7 +357,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_vendor(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_vendor(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_vendor(session.opaque_ref, _sm ?? "").parse(); } /// @@ -371,7 +371,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_copyright(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_copyright(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_copyright(session.opaque_ref, _sm ?? "").parse(); } /// @@ -385,7 +385,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_version(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_version(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_version(session.opaque_ref, _sm ?? "").parse(); } /// @@ -399,7 +399,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_required_api_version(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_required_api_version(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_required_api_version(session.opaque_ref, _sm ?? "").parse(); } /// @@ -471,7 +471,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sm_get_driver_filename(session.opaque_ref, _sm); else - return (string)session.proxy.sm_get_driver_filename(session.opaque_ref, _sm ?? "").parse(); + return session.proxy.sm_get_driver_filename(session.opaque_ref, _sm ?? "").parse(); } /// diff --git a/XenModel/XenAPI/SR.cs b/XenModel/XenAPI/SR.cs index 5df05243e..f24f73399 100644 --- a/XenModel/XenAPI/SR.cs +++ b/XenModel/XenAPI/SR.cs @@ -135,18 +135,18 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_SR 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_storage_operations(proxy.current_operations); VDIs = proxy.VDIs == null ? null : XenRef.Create(proxy.VDIs); PBDs = proxy.PBDs == null ? null : XenRef.Create(proxy.PBDs); - virtual_allocation = proxy.virtual_allocation == null ? 0 : long.Parse((string)proxy.virtual_allocation); - physical_utilisation = proxy.physical_utilisation == null ? 0 : long.Parse((string)proxy.physical_utilisation); - physical_size = proxy.physical_size == null ? 0 : long.Parse((string)proxy.physical_size); - type = proxy.type == null ? null : (string)proxy.type; - content_type = proxy.content_type == null ? null : (string)proxy.content_type; + virtual_allocation = proxy.virtual_allocation == null ? 0 : long.Parse(proxy.virtual_allocation); + physical_utilisation = proxy.physical_utilisation == null ? 0 : long.Parse(proxy.physical_utilisation); + physical_size = proxy.physical_size == null ? 0 : long.Parse(proxy.physical_size); + type = proxy.type == null ? null : proxy.type; + content_type = proxy.content_type == null ? null : proxy.content_type; shared = (bool)proxy.shared; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); tags = proxy.tags == null ? new string[] {} : (string [])proxy.tags; @@ -164,10 +164,10 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_storage_operations(current_operations); - result_.VDIs = (VDIs != null) ? Helper.RefListToStringArray(VDIs) : new string[] {}; - result_.PBDs = (PBDs != null) ? Helper.RefListToStringArray(PBDs) : new string[] {}; + result_.VDIs = VDIs == null ? new string[] {} : Helper.RefListToStringArray(VDIs); + result_.PBDs = PBDs == null ? new string[] {} : Helper.RefListToStringArray(PBDs); result_.virtual_allocation = virtual_allocation.ToString(); result_.physical_utilisation = physical_utilisation.ToString(); result_.physical_size = physical_size.ToString(); @@ -379,7 +379,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_uuid(session.opaque_ref, _sr); else - return (string)session.proxy.sr_get_uuid(session.opaque_ref, _sr ?? "").parse(); + return session.proxy.sr_get_uuid(session.opaque_ref, _sr ?? "").parse(); } /// @@ -393,7 +393,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_name_label(session.opaque_ref, _sr); else - return (string)session.proxy.sr_get_name_label(session.opaque_ref, _sr ?? "").parse(); + return session.proxy.sr_get_name_label(session.opaque_ref, _sr ?? "").parse(); } /// @@ -407,7 +407,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_name_description(session.opaque_ref, _sr); else - return (string)session.proxy.sr_get_name_description(session.opaque_ref, _sr ?? "").parse(); + return session.proxy.sr_get_name_description(session.opaque_ref, _sr ?? "").parse(); } /// @@ -477,7 +477,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_virtual_allocation(session.opaque_ref, _sr); else - return long.Parse((string)session.proxy.sr_get_virtual_allocation(session.opaque_ref, _sr ?? "").parse()); + return long.Parse(session.proxy.sr_get_virtual_allocation(session.opaque_ref, _sr ?? "").parse()); } /// @@ -491,7 +491,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_physical_utilisation(session.opaque_ref, _sr); else - return long.Parse((string)session.proxy.sr_get_physical_utilisation(session.opaque_ref, _sr ?? "").parse()); + return long.Parse(session.proxy.sr_get_physical_utilisation(session.opaque_ref, _sr ?? "").parse()); } /// @@ -505,7 +505,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_physical_size(session.opaque_ref, _sr); else - return long.Parse((string)session.proxy.sr_get_physical_size(session.opaque_ref, _sr ?? "").parse()); + return long.Parse(session.proxy.sr_get_physical_size(session.opaque_ref, _sr ?? "").parse()); } /// @@ -519,7 +519,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_type(session.opaque_ref, _sr); else - return (string)session.proxy.sr_get_type(session.opaque_ref, _sr ?? "").parse(); + return session.proxy.sr_get_type(session.opaque_ref, _sr ?? "").parse(); } /// @@ -533,7 +533,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_get_content_type(session.opaque_ref, _sr); else - return (string)session.proxy.sr_get_content_type(session.opaque_ref, _sr ?? "").parse(); + return session.proxy.sr_get_content_type(session.opaque_ref, _sr ?? "").parse(); } /// @@ -982,7 +982,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_make(session.opaque_ref, _host, _device_config, _physical_size, _name_label, _name_description, _type, _content_type); else - return (string)session.proxy.sr_make(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _physical_size.ToString(), _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "").parse(); + return session.proxy.sr_make(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _physical_size.ToString(), _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "").parse(); } /// @@ -1027,7 +1027,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_make(session.opaque_ref, _host, _device_config, _physical_size, _name_label, _name_description, _type, _content_type, _sm_config); else - return (string)session.proxy.sr_make(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _physical_size.ToString(), _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", Maps.convert_to_proxy_string_string(_sm_config)).parse(); + return session.proxy.sr_make(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _physical_size.ToString(), _name_label ?? "", _name_description ?? "", _type ?? "", _content_type ?? "", Maps.convert_to_proxy_string_string(_sm_config)).parse(); } /// @@ -1192,7 +1192,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.sr_probe(session.opaque_ref, _host, _device_config, _type, _sm_config); else - return (string)session.proxy.sr_probe(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _type ?? "", Maps.convert_to_proxy_string_string(_sm_config)).parse(); + return session.proxy.sr_probe(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _type ?? "", Maps.convert_to_proxy_string_string(_sm_config)).parse(); } /// @@ -1212,6 +1212,40 @@ namespace XenAPI return XenRef.Create(session.proxy.async_sr_probe(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _type ?? "", Maps.convert_to_proxy_string_string(_sm_config)).parse()); } + /// + /// Perform a backend-specific scan, using the given device_config. If the device_config is complete, then this will return a list of the SRs present of this type on the device, if any. If the device_config is partial, then a backend-specific scan will be performed, returning results that will guide the user in improving the device_config. + /// First published in Unreleased. + /// + /// The session + /// The host to create/make the SR on + /// The device config string that will be passed to backend SR driver + /// The type of the SR; used to specify the SR backend driver to use + /// Storage backend specific configuration options + public static List probe_ext(Session session, string _host, Dictionary _device_config, string _type, Dictionary _sm_config) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.sr_probe_ext(session.opaque_ref, _host, _device_config, _type, _sm_config); + else + return Probe_result.ProxyArrayToObjectList(session.proxy.sr_probe_ext(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _type ?? "", Maps.convert_to_proxy_string_string(_sm_config)).parse()); + } + + /// + /// Perform a backend-specific scan, using the given device_config. If the device_config is complete, then this will return a list of the SRs present of this type on the device, if any. If the device_config is partial, then a backend-specific scan will be performed, returning results that will guide the user in improving the device_config. + /// First published in Unreleased. + /// + /// The session + /// The host to create/make the SR on + /// The device config string that will be passed to backend SR driver + /// The type of the SR; used to specify the SR backend driver to use + /// Storage backend specific configuration options + public static XenRef async_probe_ext(Session session, string _host, Dictionary _device_config, string _type, Dictionary _sm_config) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.async_sr_probe_ext(session.opaque_ref, _host, _device_config, _type, _sm_config); + else + return XenRef.Create(session.proxy.async_sr_probe_ext(session.opaque_ref, _host ?? "", Maps.convert_to_proxy_string_string(_device_config), _type ?? "", Maps.convert_to_proxy_string_string(_sm_config)).parse()); + } + /// /// Sets the shared flag on the SR /// First published in XenServer 4.0. diff --git a/XenModel/XenAPI/Secret.cs b/XenModel/XenAPI/Secret.cs index 2447fd9a8..b9c380316 100644 --- a/XenModel/XenAPI/Secret.cs +++ b/XenModel/XenAPI/Secret.cs @@ -81,8 +81,8 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Secret proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - value = proxy.value == null ? null : (string)proxy.value; + uuid = proxy.uuid == null ? null : proxy.uuid; + value = proxy.value == null ? null : proxy.value; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -259,7 +259,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.secret_get_uuid(session.opaque_ref, _secret); else - return (string)session.proxy.secret_get_uuid(session.opaque_ref, _secret ?? "").parse(); + return session.proxy.secret_get_uuid(session.opaque_ref, _secret ?? "").parse(); } /// @@ -273,7 +273,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.secret_get_value(session.opaque_ref, _secret); else - return (string)session.proxy.secret_get_value(session.opaque_ref, _secret ?? "").parse(); + return session.proxy.secret_get_value(session.opaque_ref, _secret ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Sr_stat.cs b/XenModel/XenAPI/Sr_stat.cs new file mode 100644 index 000000000..e8dbe282e --- /dev/null +++ b/XenModel/XenAPI/Sr_stat.cs @@ -0,0 +1,317 @@ +/* + * Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + + +namespace XenAPI +{ + /// + /// A set of high-level properties associated with an SR. + /// First published in Unreleased. + /// + public partial class Sr_stat : XenObject + { + public Sr_stat() + { + } + + public Sr_stat(string uuid, + string name_label, + string name_description, + long free_space, + long total_space, + bool clustered, + sr_health health) + { + this.uuid = uuid; + this.name_label = name_label; + this.name_description = name_description; + this.free_space = free_space; + this.total_space = total_space; + this.clustered = clustered; + this.health = health; + } + + /// + /// Creates a new Sr_stat from a Proxy_Sr_stat. + /// + /// + public Sr_stat(Proxy_Sr_stat proxy) + { + this.UpdateFromProxy(proxy); + } + + /// + /// Updates each field of this instance with the value of + /// the corresponding field of a given Sr_stat. + /// + public override void UpdateFrom(Sr_stat update) + { + uuid = update.uuid; + name_label = update.name_label; + name_description = update.name_description; + free_space = update.free_space; + total_space = update.total_space; + clustered = update.clustered; + health = update.health; + } + + internal void UpdateFromProxy(Proxy_Sr_stat proxy) + { + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + free_space = proxy.free_space == null ? 0 : long.Parse(proxy.free_space); + total_space = proxy.total_space == null ? 0 : long.Parse(proxy.total_space); + clustered = (bool)proxy.clustered; + health = proxy.health == null ? (sr_health) 0 : (sr_health)Helper.EnumParseDefault(typeof(sr_health), (string)proxy.health); + } + + public Proxy_Sr_stat ToProxy() + { + Proxy_Sr_stat result_ = new Proxy_Sr_stat(); + result_.uuid = uuid; + result_.name_label = name_label ?? ""; + result_.name_description = name_description ?? ""; + result_.free_space = free_space.ToString(); + result_.total_space = total_space.ToString(); + result_.clustered = clustered; + result_.health = sr_health_helper.ToString(health); + return result_; + } + + /// + /// Creates a new Sr_stat from a Hashtable. + /// Note that the fields not contained in the Hashtable + /// will be created with their default values. + /// + /// + public Sr_stat(Hashtable table) : this() + { + UpdateFrom(table); + } + + /// + /// Given a Hashtable with field-value pairs, it updates the fields of this Sr_stat + /// 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. + /// + /// + 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("free_space")) + free_space = Marshalling.ParseLong(table, "free_space"); + if (table.ContainsKey("total_space")) + total_space = Marshalling.ParseLong(table, "total_space"); + if (table.ContainsKey("clustered")) + clustered = Marshalling.ParseBool(table, "clustered"); + if (table.ContainsKey("health")) + health = (sr_health)Helper.EnumParseDefault(typeof(sr_health), Marshalling.ParseString(table, "health")); + } + + public bool DeepEquals(Sr_stat other) + { + if (ReferenceEquals(null, other)) + return false; + if (ReferenceEquals(this, other)) + return true; + + return Helper.AreEqual2(this._uuid, other._uuid) && + Helper.AreEqual2(this._name_label, other._name_label) && + Helper.AreEqual2(this._name_description, other._name_description) && + Helper.AreEqual2(this._free_space, other._free_space) && + Helper.AreEqual2(this._total_space, other._total_space) && + Helper.AreEqual2(this._clustered, other._clustered) && + Helper.AreEqual2(this._health, other._health); + } + + internal static List ProxyArrayToObjectList(Proxy_Sr_stat[] input) + { + var result = new List(); + foreach (var item in input) + result.Add(new Sr_stat(item)); + + return result; + } + + public override string SaveChanges(Session session, string opaqueRef, Sr_stat server) + { + if (opaqueRef == null) + { + System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); + return ""; + } + else + { + throw new InvalidOperationException("This type has no read/write properties"); + } + } + /// + /// Uuid that uniquely identifies this SR, if one is available. + /// + public virtual string uuid + { + get { return _uuid; } + set + { + if (!Helper.AreEqual(value, _uuid)) + { + _uuid = value; + Changed = true; + NotifyPropertyChanged("uuid"); + } + } + } + private string _uuid; + + /// + /// Short, human-readable label for the SR. + /// + public virtual string name_label + { + get { return _name_label; } + set + { + if (!Helper.AreEqual(value, _name_label)) + { + _name_label = value; + Changed = true; + NotifyPropertyChanged("name_label"); + } + } + } + private string _name_label = ""; + + /// + /// Longer, human-readable description of the SR. Descriptions are generally only displayed by clients when the user is examining SRs in detail. + /// + public virtual string name_description + { + get { return _name_description; } + set + { + if (!Helper.AreEqual(value, _name_description)) + { + _name_description = value; + Changed = true; + NotifyPropertyChanged("name_description"); + } + } + } + private string _name_description = ""; + + /// + /// Number of bytes free on the backing storage (in bytes) + /// + public virtual long free_space + { + get { return _free_space; } + set + { + if (!Helper.AreEqual(value, _free_space)) + { + _free_space = value; + Changed = true; + NotifyPropertyChanged("free_space"); + } + } + } + private long _free_space; + + /// + /// Total physical size of the backing storage (in bytes) + /// + public virtual long total_space + { + get { return _total_space; } + set + { + if (!Helper.AreEqual(value, _total_space)) + { + _total_space = value; + Changed = true; + NotifyPropertyChanged("total_space"); + } + } + } + private long _total_space; + + /// + /// Indicates whether the SR uses clustered local storage. + /// + public virtual bool clustered + { + get { return _clustered; } + set + { + if (!Helper.AreEqual(value, _clustered)) + { + _clustered = value; + Changed = true; + NotifyPropertyChanged("clustered"); + } + } + } + private bool _clustered; + + /// + /// The health status of the SR. + /// + [JsonConverter(typeof(sr_healthConverter))] + public virtual sr_health health + { + get { return _health; } + set + { + if (!Helper.AreEqual(value, _health)) + { + _health = value; + Changed = true; + NotifyPropertyChanged("health"); + } + } + } + private sr_health _health; + } +} diff --git a/XenModel/XenAPI/Subject.cs b/XenModel/XenAPI/Subject.cs index a4a57d877..b90535bdc 100644 --- a/XenModel/XenAPI/Subject.cs +++ b/XenModel/XenAPI/Subject.cs @@ -84,8 +84,8 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Subject proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - subject_identifier = proxy.subject_identifier == null ? null : (string)proxy.subject_identifier; + uuid = proxy.uuid == null ? null : proxy.uuid; + subject_identifier = proxy.subject_identifier == null ? null : proxy.subject_identifier; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); roles = proxy.roles == null ? null : XenRef.Create(proxy.roles); } @@ -96,7 +96,7 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.subject_identifier = subject_identifier ?? ""; result_.other_config = Maps.convert_to_proxy_string_string(other_config); - result_.roles = (roles != null) ? Helper.RefListToStringArray(roles) : new string[] {}; + result_.roles = roles == null ? new string[] {} : Helper.RefListToStringArray(roles); return result_; } @@ -258,7 +258,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.subject_get_uuid(session.opaque_ref, _subject); else - return (string)session.proxy.subject_get_uuid(session.opaque_ref, _subject ?? "").parse(); + return session.proxy.subject_get_uuid(session.opaque_ref, _subject ?? "").parse(); } /// @@ -272,7 +272,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.subject_get_subject_identifier(session.opaque_ref, _subject); else - return (string)session.proxy.subject_get_subject_identifier(session.opaque_ref, _subject ?? "").parse(); + return session.proxy.subject_get_subject_identifier(session.opaque_ref, _subject ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Task.cs b/XenModel/XenAPI/Task.cs index 0d2797c5f..1375b5601 100644 --- a/XenModel/XenAPI/Task.cs +++ b/XenModel/XenAPI/Task.cs @@ -123,9 +123,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Task 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_task_allowed_operations(proxy.current_operations); created = proxy.created; @@ -133,13 +133,13 @@ namespace XenAPI status = proxy.status == null ? (task_status_type) 0 : (task_status_type)Helper.EnumParseDefault(typeof(task_status_type), (string)proxy.status); resident_on = proxy.resident_on == null ? null : XenRef.Create(proxy.resident_on); progress = Convert.ToDouble(proxy.progress); - type = proxy.type == null ? null : (string)proxy.type; - result = proxy.result == null ? null : (string)proxy.result; + type = proxy.type == null ? null : proxy.type; + result = proxy.result == null ? null : proxy.result; error_info = proxy.error_info == null ? new string[] {} : (string [])proxy.error_info; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); subtask_of = proxy.subtask_of == null ? null : XenRef.Create(proxy.subtask_of); subtasks = proxy.subtasks == null ? null : XenRef.Create(proxy.subtasks); - backtrace = proxy.backtrace == null ? null : (string)proxy.backtrace; + backtrace = proxy.backtrace == null ? null : proxy.backtrace; } public Proxy_Task ToProxy() @@ -148,7 +148,7 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_task_allowed_operations(current_operations); result_.created = created; result_.finished = finished; @@ -160,7 +160,7 @@ namespace XenAPI result_.error_info = error_info; result_.other_config = Maps.convert_to_proxy_string_string(other_config); result_.subtask_of = subtask_of ?? ""; - result_.subtasks = (subtasks != null) ? Helper.RefListToStringArray(subtasks) : new string[] {}; + result_.subtasks = subtasks == null ? new string[] {} : Helper.RefListToStringArray(subtasks); result_.backtrace = backtrace ?? ""; return result_; } @@ -327,7 +327,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.task_get_uuid(session.opaque_ref, _task); else - return (string)session.proxy.task_get_uuid(session.opaque_ref, _task ?? "").parse(); + return session.proxy.task_get_uuid(session.opaque_ref, _task ?? "").parse(); } /// @@ -341,7 +341,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.task_get_name_label(session.opaque_ref, _task); else - return (string)session.proxy.task_get_name_label(session.opaque_ref, _task ?? "").parse(); + return session.proxy.task_get_name_label(session.opaque_ref, _task ?? "").parse(); } /// @@ -355,7 +355,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.task_get_name_description(session.opaque_ref, _task); else - return (string)session.proxy.task_get_name_description(session.opaque_ref, _task ?? "").parse(); + return session.proxy.task_get_name_description(session.opaque_ref, _task ?? "").parse(); } /// @@ -467,7 +467,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.task_get_type(session.opaque_ref, _task); else - return (string)session.proxy.task_get_type(session.opaque_ref, _task ?? "").parse(); + return session.proxy.task_get_type(session.opaque_ref, _task ?? "").parse(); } /// @@ -481,7 +481,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.task_get_result(session.opaque_ref, _task); else - return (string)session.proxy.task_get_result(session.opaque_ref, _task ?? "").parse(); + return session.proxy.task_get_result(session.opaque_ref, _task ?? "").parse(); } /// @@ -551,7 +551,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.task_get_backtrace(session.opaque_ref, _task); else - return (string)session.proxy.task_get_backtrace(session.opaque_ref, _task ?? "").parse(); + return session.proxy.task_get_backtrace(session.opaque_ref, _task ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Tunnel.cs b/XenModel/XenAPI/Tunnel.cs index ac8213f56..bc1d03ccd 100644 --- a/XenModel/XenAPI/Tunnel.cs +++ b/XenModel/XenAPI/Tunnel.cs @@ -87,7 +87,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Tunnel proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; access_PIF = proxy.access_PIF == null ? null : XenRef.Create(proxy.access_PIF); transport_PIF = proxy.transport_PIF == null ? null : XenRef.Create(proxy.transport_PIF); status = proxy.status == null ? null : Maps.convert_from_proxy_string_string(proxy.status); @@ -219,7 +219,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.tunnel_get_uuid(session.opaque_ref, _tunnel); else - return (string)session.proxy.tunnel_get_uuid(session.opaque_ref, _tunnel ?? "").parse(); + return session.proxy.tunnel_get_uuid(session.opaque_ref, _tunnel ?? "").parse(); } /// diff --git a/XenModel/XenAPI/USB_group.cs b/XenModel/XenAPI/USB_group.cs index b7fb324a3..df1d567ab 100644 --- a/XenModel/XenAPI/USB_group.cs +++ b/XenModel/XenAPI/USB_group.cs @@ -90,9 +90,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_USB_group 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; PUSBs = proxy.PUSBs == null ? null : XenRef.Create(proxy.PUSBs); VUSBs = proxy.VUSBs == null ? null : XenRef.Create(proxy.VUSBs); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); @@ -104,8 +104,8 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.PUSBs = (PUSBs != null) ? Helper.RefListToStringArray(PUSBs) : new string[] {}; - result_.VUSBs = (VUSBs != null) ? Helper.RefListToStringArray(VUSBs) : new string[] {}; + result_.PUSBs = PUSBs == null ? new string[] {} : Helper.RefListToStringArray(PUSBs); + result_.VUSBs = VUSBs == null ? new string[] {} : Helper.RefListToStringArray(VUSBs); result_.other_config = Maps.convert_to_proxy_string_string(other_config); return result_; } @@ -245,7 +245,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.usb_group_get_uuid(session.opaque_ref, _usb_group); else - return (string)session.proxy.usb_group_get_uuid(session.opaque_ref, _usb_group ?? "").parse(); + return session.proxy.usb_group_get_uuid(session.opaque_ref, _usb_group ?? "").parse(); } /// @@ -259,7 +259,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.usb_group_get_name_label(session.opaque_ref, _usb_group); else - return (string)session.proxy.usb_group_get_name_label(session.opaque_ref, _usb_group ?? "").parse(); + return session.proxy.usb_group_get_name_label(session.opaque_ref, _usb_group ?? "").parse(); } /// @@ -273,7 +273,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.usb_group_get_name_description(session.opaque_ref, _usb_group); else - return (string)session.proxy.usb_group_get_name_description(session.opaque_ref, _usb_group ?? "").parse(); + return session.proxy.usb_group_get_name_description(session.opaque_ref, _usb_group ?? "").parse(); } /// diff --git a/XenModel/XenAPI/User.cs b/XenModel/XenAPI/User.cs index 1c5ff66ed..ef77dd950 100644 --- a/XenModel/XenAPI/User.cs +++ b/XenModel/XenAPI/User.cs @@ -84,9 +84,9 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_User proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - short_name = proxy.short_name == null ? null : (string)proxy.short_name; - fullname = proxy.fullname == null ? null : (string)proxy.fullname; + uuid = proxy.uuid == null ? null : proxy.uuid; + short_name = proxy.short_name == null ? null : proxy.short_name; + fullname = proxy.fullname == null ? null : proxy.fullname; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -279,7 +279,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.user_get_uuid(session.opaque_ref, _user); else - return (string)session.proxy.user_get_uuid(session.opaque_ref, _user ?? "").parse(); + return session.proxy.user_get_uuid(session.opaque_ref, _user ?? "").parse(); } /// @@ -293,7 +293,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.user_get_short_name(session.opaque_ref, _user); else - return (string)session.proxy.user_get_short_name(session.opaque_ref, _user ?? "").parse(); + return session.proxy.user_get_short_name(session.opaque_ref, _user ?? "").parse(); } /// @@ -307,7 +307,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.user_get_fullname(session.opaque_ref, _user); else - return (string)session.proxy.user_get_fullname(session.opaque_ref, _user ?? "").parse(); + return session.proxy.user_get_fullname(session.opaque_ref, _user ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VBD.cs b/XenModel/XenAPI/VBD.cs index 9bb20d18e..05272ec82 100644 --- a/XenModel/XenAPI/VBD.cs +++ b/XenModel/XenAPI/VBD.cs @@ -138,13 +138,13 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VBD proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vbd_operations(proxy.current_operations); VM = proxy.VM == null ? null : XenRef.Create(proxy.VM); VDI = proxy.VDI == null ? null : XenRef.Create(proxy.VDI); - device = proxy.device == null ? null : (string)proxy.device; - userdevice = proxy.userdevice == null ? null : (string)proxy.userdevice; + device = proxy.device == null ? null : proxy.device; + userdevice = proxy.userdevice == null ? null : proxy.userdevice; bootable = (bool)proxy.bootable; mode = proxy.mode == null ? (vbd_mode) 0 : (vbd_mode)Helper.EnumParseDefault(typeof(vbd_mode), (string)proxy.mode); type = proxy.type == null ? (vbd_type) 0 : (vbd_type)Helper.EnumParseDefault(typeof(vbd_type), (string)proxy.type); @@ -153,10 +153,10 @@ namespace XenAPI empty = (bool)proxy.empty; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); currently_attached = (bool)proxy.currently_attached; - status_code = proxy.status_code == null ? 0 : long.Parse((string)proxy.status_code); - status_detail = proxy.status_detail == null ? null : (string)proxy.status_detail; + status_code = proxy.status_code == null ? 0 : long.Parse(proxy.status_code); + status_detail = proxy.status_detail == null ? null : proxy.status_detail; runtime_properties = proxy.runtime_properties == null ? null : Maps.convert_from_proxy_string_string(proxy.runtime_properties); - qos_algorithm_type = proxy.qos_algorithm_type == null ? null : (string)proxy.qos_algorithm_type; + qos_algorithm_type = proxy.qos_algorithm_type == null ? null : proxy.qos_algorithm_type; qos_algorithm_params = proxy.qos_algorithm_params == null ? null : Maps.convert_from_proxy_string_string(proxy.qos_algorithm_params); qos_supported_algorithms = proxy.qos_supported_algorithms == null ? new string[] {} : (string [])proxy.qos_supported_algorithms; metrics = proxy.metrics == null ? null : XenRef.Create(proxy.metrics); @@ -166,7 +166,7 @@ namespace XenAPI { Proxy_VBD result_ = new Proxy_VBD(); result_.uuid = uuid ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_vbd_operations(current_operations); result_.VM = VM ?? ""; result_.VDI = VDI ?? ""; @@ -437,7 +437,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vbd_get_uuid(session.opaque_ref, _vbd); else - return (string)session.proxy.vbd_get_uuid(session.opaque_ref, _vbd ?? "").parse(); + return session.proxy.vbd_get_uuid(session.opaque_ref, _vbd ?? "").parse(); } /// @@ -507,7 +507,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vbd_get_device(session.opaque_ref, _vbd); else - return (string)session.proxy.vbd_get_device(session.opaque_ref, _vbd ?? "").parse(); + return session.proxy.vbd_get_device(session.opaque_ref, _vbd ?? "").parse(); } /// @@ -521,7 +521,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vbd_get_userdevice(session.opaque_ref, _vbd); else - return (string)session.proxy.vbd_get_userdevice(session.opaque_ref, _vbd ?? "").parse(); + return session.proxy.vbd_get_userdevice(session.opaque_ref, _vbd ?? "").parse(); } /// @@ -647,7 +647,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vbd_get_status_code(session.opaque_ref, _vbd); else - return long.Parse((string)session.proxy.vbd_get_status_code(session.opaque_ref, _vbd ?? "").parse()); + return long.Parse(session.proxy.vbd_get_status_code(session.opaque_ref, _vbd ?? "").parse()); } /// @@ -661,7 +661,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vbd_get_status_detail(session.opaque_ref, _vbd); else - return (string)session.proxy.vbd_get_status_detail(session.opaque_ref, _vbd ?? "").parse(); + return session.proxy.vbd_get_status_detail(session.opaque_ref, _vbd ?? "").parse(); } /// @@ -689,7 +689,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vbd_get_qos_algorithm_type(session.opaque_ref, _vbd); else - return (string)session.proxy.vbd_get_qos_algorithm_type(session.opaque_ref, _vbd ?? "").parse(); + return session.proxy.vbd_get_qos_algorithm_type(session.opaque_ref, _vbd ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VBD_metrics.cs b/XenModel/XenAPI/VBD_metrics.cs index bf027060a..c8033cd2f 100644 --- a/XenModel/XenAPI/VBD_metrics.cs +++ b/XenModel/XenAPI/VBD_metrics.cs @@ -87,7 +87,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VBD_metrics proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; io_read_kbs = Convert.ToDouble(proxy.io_read_kbs); io_write_kbs = Convert.ToDouble(proxy.io_write_kbs); last_updated = proxy.last_updated; @@ -215,7 +215,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vbd_metrics_get_uuid(session.opaque_ref, _vbd_metrics); else - return (string)session.proxy.vbd_metrics_get_uuid(session.opaque_ref, _vbd_metrics ?? "").parse(); + return session.proxy.vbd_metrics_get_uuid(session.opaque_ref, _vbd_metrics ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VDI.cs b/XenModel/XenAPI/VDI.cs index f4aaa32bb..e91acca4d 100644 --- a/XenModel/XenAPI/VDI.cs +++ b/XenModel/XenAPI/VDI.cs @@ -168,22 +168,22 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VDI 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vdi_operations(proxy.current_operations); SR = proxy.SR == null ? null : XenRef.Create(proxy.SR); VBDs = proxy.VBDs == null ? null : XenRef.Create(proxy.VBDs); crash_dumps = proxy.crash_dumps == null ? null : XenRef.Create(proxy.crash_dumps); - virtual_size = proxy.virtual_size == null ? 0 : long.Parse((string)proxy.virtual_size); - physical_utilisation = proxy.physical_utilisation == null ? 0 : long.Parse((string)proxy.physical_utilisation); + virtual_size = proxy.virtual_size == null ? 0 : long.Parse(proxy.virtual_size); + physical_utilisation = proxy.physical_utilisation == null ? 0 : long.Parse(proxy.physical_utilisation); type = proxy.type == null ? (vdi_type) 0 : (vdi_type)Helper.EnumParseDefault(typeof(vdi_type), (string)proxy.type); sharable = (bool)proxy.sharable; read_only = (bool)proxy.read_only; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); storage_lock = (bool)proxy.storage_lock; - location = proxy.location == null ? null : (string)proxy.location; + location = proxy.location == null ? null : proxy.location; managed = (bool)proxy.managed; missing = (bool)proxy.missing; parent = proxy.parent == null ? null : XenRef.Create(proxy.parent); @@ -208,11 +208,11 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_vdi_operations(current_operations); result_.SR = SR ?? ""; - result_.VBDs = (VBDs != null) ? Helper.RefListToStringArray(VBDs) : new string[] {}; - result_.crash_dumps = (crash_dumps != null) ? Helper.RefListToStringArray(crash_dumps) : new string[] {}; + result_.VBDs = VBDs == null ? new string[] {} : Helper.RefListToStringArray(VBDs); + result_.crash_dumps = crash_dumps == null ? new string[] {} : Helper.RefListToStringArray(crash_dumps); result_.virtual_size = virtual_size.ToString(); result_.physical_utilisation = physical_utilisation.ToString(); result_.type = vdi_type_helper.ToString(type); @@ -228,7 +228,7 @@ namespace XenAPI result_.sm_config = Maps.convert_to_proxy_string_string(sm_config); result_.is_a_snapshot = is_a_snapshot; result_.snapshot_of = snapshot_of ?? ""; - result_.snapshots = (snapshots != null) ? Helper.RefListToStringArray(snapshots) : new string[] {}; + result_.snapshots = snapshots == null ? new string[] {} : Helper.RefListToStringArray(snapshots); result_.snapshot_time = snapshot_time; result_.tags = tags; result_.allow_caching = allow_caching; @@ -535,7 +535,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_get_uuid(session.opaque_ref, _vdi); else - return (string)session.proxy.vdi_get_uuid(session.opaque_ref, _vdi ?? "").parse(); + return session.proxy.vdi_get_uuid(session.opaque_ref, _vdi ?? "").parse(); } /// @@ -549,7 +549,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_get_name_label(session.opaque_ref, _vdi); else - return (string)session.proxy.vdi_get_name_label(session.opaque_ref, _vdi ?? "").parse(); + return session.proxy.vdi_get_name_label(session.opaque_ref, _vdi ?? "").parse(); } /// @@ -563,7 +563,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_get_name_description(session.opaque_ref, _vdi); else - return (string)session.proxy.vdi_get_name_description(session.opaque_ref, _vdi ?? "").parse(); + return session.proxy.vdi_get_name_description(session.opaque_ref, _vdi ?? "").parse(); } /// @@ -647,7 +647,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_get_virtual_size(session.opaque_ref, _vdi); else - return long.Parse((string)session.proxy.vdi_get_virtual_size(session.opaque_ref, _vdi ?? "").parse()); + return long.Parse(session.proxy.vdi_get_virtual_size(session.opaque_ref, _vdi ?? "").parse()); } /// @@ -661,7 +661,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_get_physical_utilisation(session.opaque_ref, _vdi); else - return long.Parse((string)session.proxy.vdi_get_physical_utilisation(session.opaque_ref, _vdi ?? "").parse()); + return long.Parse(session.proxy.vdi_get_physical_utilisation(session.opaque_ref, _vdi ?? "").parse()); } /// @@ -745,7 +745,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_get_location(session.opaque_ref, _vdi); else - return (string)session.proxy.vdi_get_location(session.opaque_ref, _vdi ?? "").parse(); + return session.proxy.vdi_get_location(session.opaque_ref, _vdi ?? "").parse(); } /// @@ -2018,7 +2018,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_read_database_pool_uuid(session.opaque_ref, _vdi); else - return (string)session.proxy.vdi_read_database_pool_uuid(session.opaque_ref, _vdi ?? "").parse(); + return session.proxy.vdi_read_database_pool_uuid(session.opaque_ref, _vdi ?? "").parse(); } /// @@ -2163,7 +2163,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vdi_list_changed_blocks(session.opaque_ref, _vdi, _vdi_to); else - return (string)session.proxy.vdi_list_changed_blocks(session.opaque_ref, _vdi ?? "", _vdi_to ?? "").parse(); + return session.proxy.vdi_list_changed_blocks(session.opaque_ref, _vdi ?? "", _vdi_to ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VGPU.cs b/XenModel/XenAPI/VGPU.cs index 844584aee..3585cd62b 100644 --- a/XenModel/XenAPI/VGPU.cs +++ b/XenModel/XenAPI/VGPU.cs @@ -102,10 +102,10 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VGPU proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; VM = proxy.VM == null ? null : XenRef.Create(proxy.VM); GPU_group = proxy.GPU_group == null ? null : XenRef.Create(proxy.GPU_group); - device = proxy.device == null ? null : (string)proxy.device; + device = proxy.device == null ? null : proxy.device; currently_attached = (bool)proxy.currently_attached; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); type = proxy.type == null ? null : XenRef.Create(proxy.type); @@ -255,7 +255,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_get_uuid(session.opaque_ref, _vgpu); else - return (string)session.proxy.vgpu_get_uuid(session.opaque_ref, _vgpu ?? "").parse(); + return session.proxy.vgpu_get_uuid(session.opaque_ref, _vgpu ?? "").parse(); } /// @@ -297,7 +297,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_get_device(session.opaque_ref, _vgpu); else - return (string)session.proxy.vgpu_get_device(session.opaque_ref, _vgpu ?? "").parse(); + return session.proxy.vgpu_get_device(session.opaque_ref, _vgpu ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VGPU_type.cs b/XenModel/XenAPI/VGPU_type.cs index 029b6e938..315765697 100644 --- a/XenModel/XenAPI/VGPU_type.cs +++ b/XenModel/XenAPI/VGPU_type.cs @@ -117,20 +117,20 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VGPU_type proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - vendor_name = proxy.vendor_name == null ? null : (string)proxy.vendor_name; - model_name = proxy.model_name == null ? null : (string)proxy.model_name; - framebuffer_size = proxy.framebuffer_size == null ? 0 : long.Parse((string)proxy.framebuffer_size); - max_heads = proxy.max_heads == null ? 0 : long.Parse((string)proxy.max_heads); - max_resolution_x = proxy.max_resolution_x == null ? 0 : long.Parse((string)proxy.max_resolution_x); - max_resolution_y = proxy.max_resolution_y == null ? 0 : long.Parse((string)proxy.max_resolution_y); + uuid = proxy.uuid == null ? null : proxy.uuid; + vendor_name = proxy.vendor_name == null ? null : proxy.vendor_name; + model_name = proxy.model_name == null ? null : proxy.model_name; + framebuffer_size = proxy.framebuffer_size == null ? 0 : long.Parse(proxy.framebuffer_size); + max_heads = proxy.max_heads == null ? 0 : long.Parse(proxy.max_heads); + max_resolution_x = proxy.max_resolution_x == null ? 0 : long.Parse(proxy.max_resolution_x); + max_resolution_y = proxy.max_resolution_y == null ? 0 : long.Parse(proxy.max_resolution_y); supported_on_PGPUs = proxy.supported_on_PGPUs == null ? null : XenRef.Create(proxy.supported_on_PGPUs); enabled_on_PGPUs = proxy.enabled_on_PGPUs == null ? null : XenRef.Create(proxy.enabled_on_PGPUs); VGPUs = proxy.VGPUs == null ? null : XenRef.Create(proxy.VGPUs); supported_on_GPU_groups = proxy.supported_on_GPU_groups == null ? null : XenRef.Create(proxy.supported_on_GPU_groups); enabled_on_GPU_groups = proxy.enabled_on_GPU_groups == null ? null : XenRef.Create(proxy.enabled_on_GPU_groups); implementation = proxy.implementation == null ? (vgpu_type_implementation) 0 : (vgpu_type_implementation)Helper.EnumParseDefault(typeof(vgpu_type_implementation), (string)proxy.implementation); - identifier = proxy.identifier == null ? null : (string)proxy.identifier; + identifier = proxy.identifier == null ? null : proxy.identifier; experimental = (bool)proxy.experimental; } @@ -144,11 +144,11 @@ namespace XenAPI result_.max_heads = max_heads.ToString(); result_.max_resolution_x = max_resolution_x.ToString(); result_.max_resolution_y = max_resolution_y.ToString(); - result_.supported_on_PGPUs = (supported_on_PGPUs != null) ? Helper.RefListToStringArray(supported_on_PGPUs) : new string[] {}; - result_.enabled_on_PGPUs = (enabled_on_PGPUs != null) ? Helper.RefListToStringArray(enabled_on_PGPUs) : new string[] {}; - result_.VGPUs = (VGPUs != null) ? Helper.RefListToStringArray(VGPUs) : new string[] {}; - result_.supported_on_GPU_groups = (supported_on_GPU_groups != null) ? Helper.RefListToStringArray(supported_on_GPU_groups) : new string[] {}; - result_.enabled_on_GPU_groups = (enabled_on_GPU_groups != null) ? Helper.RefListToStringArray(enabled_on_GPU_groups) : new string[] {}; + result_.supported_on_PGPUs = supported_on_PGPUs == null ? new string[] {} : Helper.RefListToStringArray(supported_on_PGPUs); + result_.enabled_on_PGPUs = enabled_on_PGPUs == null ? new string[] {} : Helper.RefListToStringArray(enabled_on_PGPUs); + result_.VGPUs = VGPUs == null ? new string[] {} : Helper.RefListToStringArray(VGPUs); + result_.supported_on_GPU_groups = supported_on_GPU_groups == null ? new string[] {} : Helper.RefListToStringArray(supported_on_GPU_groups); + result_.enabled_on_GPU_groups = enabled_on_GPU_groups == null ? new string[] {} : Helper.RefListToStringArray(enabled_on_GPU_groups); result_.implementation = vgpu_type_implementation_helper.ToString(implementation); result_.identifier = identifier ?? ""; result_.experimental = experimental; @@ -290,7 +290,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_uuid(session.opaque_ref, _vgpu_type); else - return (string)session.proxy.vgpu_type_get_uuid(session.opaque_ref, _vgpu_type ?? "").parse(); + return session.proxy.vgpu_type_get_uuid(session.opaque_ref, _vgpu_type ?? "").parse(); } /// @@ -304,7 +304,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_vendor_name(session.opaque_ref, _vgpu_type); else - return (string)session.proxy.vgpu_type_get_vendor_name(session.opaque_ref, _vgpu_type ?? "").parse(); + return session.proxy.vgpu_type_get_vendor_name(session.opaque_ref, _vgpu_type ?? "").parse(); } /// @@ -318,7 +318,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_model_name(session.opaque_ref, _vgpu_type); else - return (string)session.proxy.vgpu_type_get_model_name(session.opaque_ref, _vgpu_type ?? "").parse(); + return session.proxy.vgpu_type_get_model_name(session.opaque_ref, _vgpu_type ?? "").parse(); } /// @@ -332,7 +332,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_framebuffer_size(session.opaque_ref, _vgpu_type); else - return long.Parse((string)session.proxy.vgpu_type_get_framebuffer_size(session.opaque_ref, _vgpu_type ?? "").parse()); + return long.Parse(session.proxy.vgpu_type_get_framebuffer_size(session.opaque_ref, _vgpu_type ?? "").parse()); } /// @@ -346,7 +346,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_max_heads(session.opaque_ref, _vgpu_type); else - return long.Parse((string)session.proxy.vgpu_type_get_max_heads(session.opaque_ref, _vgpu_type ?? "").parse()); + return long.Parse(session.proxy.vgpu_type_get_max_heads(session.opaque_ref, _vgpu_type ?? "").parse()); } /// @@ -360,7 +360,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_max_resolution_x(session.opaque_ref, _vgpu_type); else - return long.Parse((string)session.proxy.vgpu_type_get_max_resolution_x(session.opaque_ref, _vgpu_type ?? "").parse()); + return long.Parse(session.proxy.vgpu_type_get_max_resolution_x(session.opaque_ref, _vgpu_type ?? "").parse()); } /// @@ -374,7 +374,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_max_resolution_y(session.opaque_ref, _vgpu_type); else - return long.Parse((string)session.proxy.vgpu_type_get_max_resolution_y(session.opaque_ref, _vgpu_type ?? "").parse()); + return long.Parse(session.proxy.vgpu_type_get_max_resolution_y(session.opaque_ref, _vgpu_type ?? "").parse()); } /// @@ -472,7 +472,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vgpu_type_get_identifier(session.opaque_ref, _vgpu_type); else - return (string)session.proxy.vgpu_type_get_identifier(session.opaque_ref, _vgpu_type ?? "").parse(); + return session.proxy.vgpu_type_get_identifier(session.opaque_ref, _vgpu_type ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VIF.cs b/XenModel/XenAPI/VIF.cs index 92ea6f6dd..7618e17d1 100644 --- a/XenModel/XenAPI/VIF.cs +++ b/XenModel/XenAPI/VIF.cs @@ -153,20 +153,20 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VIF proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vif_operations(proxy.current_operations); - device = proxy.device == null ? null : (string)proxy.device; + device = proxy.device == null ? null : proxy.device; network = proxy.network == null ? null : XenRef.Create(proxy.network); VM = proxy.VM == null ? null : XenRef.Create(proxy.VM); - MAC = proxy.MAC == null ? null : (string)proxy.MAC; - MTU = proxy.MTU == null ? 0 : long.Parse((string)proxy.MTU); + MAC = proxy.MAC == null ? null : proxy.MAC; + MTU = proxy.MTU == null ? 0 : long.Parse(proxy.MTU); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); currently_attached = (bool)proxy.currently_attached; - status_code = proxy.status_code == null ? 0 : long.Parse((string)proxy.status_code); - status_detail = proxy.status_detail == null ? null : (string)proxy.status_detail; + status_code = proxy.status_code == null ? 0 : long.Parse(proxy.status_code); + status_detail = proxy.status_detail == null ? null : proxy.status_detail; runtime_properties = proxy.runtime_properties == null ? null : Maps.convert_from_proxy_string_string(proxy.runtime_properties); - qos_algorithm_type = proxy.qos_algorithm_type == null ? null : (string)proxy.qos_algorithm_type; + qos_algorithm_type = proxy.qos_algorithm_type == null ? null : proxy.qos_algorithm_type; qos_algorithm_params = proxy.qos_algorithm_params == null ? null : Maps.convert_from_proxy_string_string(proxy.qos_algorithm_params); qos_supported_algorithms = proxy.qos_supported_algorithms == null ? new string[] {} : (string [])proxy.qos_supported_algorithms; metrics = proxy.metrics == null ? null : XenRef.Create(proxy.metrics); @@ -176,17 +176,17 @@ namespace XenAPI ipv6_allowed = proxy.ipv6_allowed == null ? new string[] {} : (string [])proxy.ipv6_allowed; ipv4_configuration_mode = proxy.ipv4_configuration_mode == null ? (vif_ipv4_configuration_mode) 0 : (vif_ipv4_configuration_mode)Helper.EnumParseDefault(typeof(vif_ipv4_configuration_mode), (string)proxy.ipv4_configuration_mode); ipv4_addresses = proxy.ipv4_addresses == null ? new string[] {} : (string [])proxy.ipv4_addresses; - ipv4_gateway = proxy.ipv4_gateway == null ? null : (string)proxy.ipv4_gateway; + ipv4_gateway = proxy.ipv4_gateway == null ? null : proxy.ipv4_gateway; ipv6_configuration_mode = proxy.ipv6_configuration_mode == null ? (vif_ipv6_configuration_mode) 0 : (vif_ipv6_configuration_mode)Helper.EnumParseDefault(typeof(vif_ipv6_configuration_mode), (string)proxy.ipv6_configuration_mode); ipv6_addresses = proxy.ipv6_addresses == null ? new string[] {} : (string [])proxy.ipv6_addresses; - ipv6_gateway = proxy.ipv6_gateway == null ? null : (string)proxy.ipv6_gateway; + ipv6_gateway = proxy.ipv6_gateway == null ? null : proxy.ipv6_gateway; } public Proxy_VIF ToProxy() { Proxy_VIF result_ = new Proxy_VIF(); result_.uuid = uuid ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_vif_operations(current_operations); result_.device = device ?? ""; result_.network = network ?? ""; @@ -469,7 +469,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_uuid(session.opaque_ref, _vif); else - return (string)session.proxy.vif_get_uuid(session.opaque_ref, _vif ?? "").parse(); + return session.proxy.vif_get_uuid(session.opaque_ref, _vif ?? "").parse(); } /// @@ -511,7 +511,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_device(session.opaque_ref, _vif); else - return (string)session.proxy.vif_get_device(session.opaque_ref, _vif ?? "").parse(); + return session.proxy.vif_get_device(session.opaque_ref, _vif ?? "").parse(); } /// @@ -553,7 +553,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_mac(session.opaque_ref, _vif); else - return (string)session.proxy.vif_get_mac(session.opaque_ref, _vif ?? "").parse(); + return session.proxy.vif_get_mac(session.opaque_ref, _vif ?? "").parse(); } /// @@ -567,7 +567,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_mtu(session.opaque_ref, _vif); else - return long.Parse((string)session.proxy.vif_get_mtu(session.opaque_ref, _vif ?? "").parse()); + return long.Parse(session.proxy.vif_get_mtu(session.opaque_ref, _vif ?? "").parse()); } /// @@ -609,7 +609,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_status_code(session.opaque_ref, _vif); else - return long.Parse((string)session.proxy.vif_get_status_code(session.opaque_ref, _vif ?? "").parse()); + return long.Parse(session.proxy.vif_get_status_code(session.opaque_ref, _vif ?? "").parse()); } /// @@ -623,7 +623,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_status_detail(session.opaque_ref, _vif); else - return (string)session.proxy.vif_get_status_detail(session.opaque_ref, _vif ?? "").parse(); + return session.proxy.vif_get_status_detail(session.opaque_ref, _vif ?? "").parse(); } /// @@ -651,7 +651,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_qos_algorithm_type(session.opaque_ref, _vif); else - return (string)session.proxy.vif_get_qos_algorithm_type(session.opaque_ref, _vif ?? "").parse(); + return session.proxy.vif_get_qos_algorithm_type(session.opaque_ref, _vif ?? "").parse(); } /// @@ -791,7 +791,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_ipv4_gateway(session.opaque_ref, _vif); else - return (string)session.proxy.vif_get_ipv4_gateway(session.opaque_ref, _vif ?? "").parse(); + return session.proxy.vif_get_ipv4_gateway(session.opaque_ref, _vif ?? "").parse(); } /// @@ -833,7 +833,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_get_ipv6_gateway(session.opaque_ref, _vif); else - return (string)session.proxy.vif_get_ipv6_gateway(session.opaque_ref, _vif ?? "").parse(); + return session.proxy.vif_get_ipv6_gateway(session.opaque_ref, _vif ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VIF_metrics.cs b/XenModel/XenAPI/VIF_metrics.cs index daa8bb02d..c36178fec 100644 --- a/XenModel/XenAPI/VIF_metrics.cs +++ b/XenModel/XenAPI/VIF_metrics.cs @@ -87,7 +87,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VIF_metrics proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; io_read_kbs = Convert.ToDouble(proxy.io_read_kbs); io_write_kbs = Convert.ToDouble(proxy.io_write_kbs); last_updated = proxy.last_updated; @@ -215,7 +215,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vif_metrics_get_uuid(session.opaque_ref, _vif_metrics); else - return (string)session.proxy.vif_metrics_get_uuid(session.opaque_ref, _vif_metrics ?? "").parse(); + return session.proxy.vif_metrics_get_uuid(session.opaque_ref, _vif_metrics ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VLAN.cs b/XenModel/XenAPI/VLAN.cs index e4924457f..f4b6abf8c 100644 --- a/XenModel/XenAPI/VLAN.cs +++ b/XenModel/XenAPI/VLAN.cs @@ -87,10 +87,10 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VLAN proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; tagged_PIF = proxy.tagged_PIF == null ? null : XenRef.Create(proxy.tagged_PIF); untagged_PIF = proxy.untagged_PIF == null ? null : XenRef.Create(proxy.untagged_PIF); - tag = proxy.tag == null ? 0 : long.Parse((string)proxy.tag); + tag = proxy.tag == null ? 0 : long.Parse(proxy.tag); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); } @@ -215,7 +215,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vlan_get_uuid(session.opaque_ref, _vlan); else - return (string)session.proxy.vlan_get_uuid(session.opaque_ref, _vlan ?? "").parse(); + return session.proxy.vlan_get_uuid(session.opaque_ref, _vlan ?? "").parse(); } /// @@ -257,7 +257,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vlan_get_tag(session.opaque_ref, _vlan); else - return long.Parse((string)session.proxy.vlan_get_tag(session.opaque_ref, _vlan ?? "").parse()); + return long.Parse(session.proxy.vlan_get_tag(session.opaque_ref, _vlan ?? "").parse()); } /// diff --git a/XenModel/XenAPI/VM.cs b/XenModel/XenAPI/VM.cs index ebda7e0a4..b25a4dd72 100644 --- a/XenModel/XenAPI/VM.cs +++ b/XenModel/XenAPI/VM.cs @@ -132,7 +132,8 @@ namespace XenAPI long hardware_platform_version, bool has_vendor_device, bool requires_reboot, - string reference_label) + string reference_label, + domain_type domain_type) { this.uuid = uuid; this.allowed_operations = allowed_operations; @@ -217,6 +218,7 @@ namespace XenAPI this.has_vendor_device = has_vendor_device; this.requires_reboot = requires_reboot; this.reference_label = reference_label; + this.domain_type = domain_type; } /// @@ -317,31 +319,32 @@ namespace XenAPI has_vendor_device = update.has_vendor_device; requires_reboot = update.requires_reboot; reference_label = update.reference_label; + domain_type = update.domain_type; } internal void UpdateFromProxy(Proxy_VM proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vm_operations(proxy.current_operations); power_state = proxy.power_state == null ? (vm_power_state) 0 : (vm_power_state)Helper.EnumParseDefault(typeof(vm_power_state), (string)proxy.power_state); - name_label = proxy.name_label == null ? null : (string)proxy.name_label; - name_description = proxy.name_description == null ? null : (string)proxy.name_description; - user_version = proxy.user_version == null ? 0 : long.Parse((string)proxy.user_version); + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; + user_version = proxy.user_version == null ? 0 : long.Parse(proxy.user_version); is_a_template = (bool)proxy.is_a_template; is_default_template = (bool)proxy.is_default_template; suspend_VDI = proxy.suspend_VDI == null ? null : XenRef.Create(proxy.suspend_VDI); resident_on = proxy.resident_on == null ? null : XenRef.Create(proxy.resident_on); affinity = proxy.affinity == null ? null : XenRef.Create(proxy.affinity); - memory_overhead = proxy.memory_overhead == null ? 0 : long.Parse((string)proxy.memory_overhead); - memory_target = proxy.memory_target == null ? 0 : long.Parse((string)proxy.memory_target); - memory_static_max = proxy.memory_static_max == null ? 0 : long.Parse((string)proxy.memory_static_max); - memory_dynamic_max = proxy.memory_dynamic_max == null ? 0 : long.Parse((string)proxy.memory_dynamic_max); - memory_dynamic_min = proxy.memory_dynamic_min == null ? 0 : long.Parse((string)proxy.memory_dynamic_min); - memory_static_min = proxy.memory_static_min == null ? 0 : long.Parse((string)proxy.memory_static_min); + memory_overhead = proxy.memory_overhead == null ? 0 : long.Parse(proxy.memory_overhead); + memory_target = proxy.memory_target == null ? 0 : long.Parse(proxy.memory_target); + memory_static_max = proxy.memory_static_max == null ? 0 : long.Parse(proxy.memory_static_max); + memory_dynamic_max = proxy.memory_dynamic_max == null ? 0 : long.Parse(proxy.memory_dynamic_max); + memory_dynamic_min = proxy.memory_dynamic_min == null ? 0 : long.Parse(proxy.memory_dynamic_min); + memory_static_min = proxy.memory_static_min == null ? 0 : long.Parse(proxy.memory_static_min); VCPUs_params = proxy.VCPUs_params == null ? null : Maps.convert_from_proxy_string_string(proxy.VCPUs_params); - VCPUs_max = proxy.VCPUs_max == null ? 0 : long.Parse((string)proxy.VCPUs_max); - VCPUs_at_startup = proxy.VCPUs_at_startup == null ? 0 : long.Parse((string)proxy.VCPUs_at_startup); + VCPUs_max = proxy.VCPUs_max == null ? 0 : long.Parse(proxy.VCPUs_max); + VCPUs_at_startup = proxy.VCPUs_at_startup == null ? 0 : long.Parse(proxy.VCPUs_at_startup); actions_after_shutdown = proxy.actions_after_shutdown == null ? (on_normal_exit) 0 : (on_normal_exit)Helper.EnumParseDefault(typeof(on_normal_exit), (string)proxy.actions_after_shutdown); actions_after_reboot = proxy.actions_after_reboot == null ? (on_normal_exit) 0 : (on_normal_exit)Helper.EnumParseDefault(typeof(on_normal_exit), (string)proxy.actions_after_reboot); actions_after_crash = proxy.actions_after_crash == null ? (on_crash_behaviour) 0 : (on_crash_behaviour)Helper.EnumParseDefault(typeof(on_crash_behaviour), (string)proxy.actions_after_crash); @@ -351,39 +354,39 @@ namespace XenAPI VUSBs = proxy.VUSBs == null ? null : XenRef.Create(proxy.VUSBs); crash_dumps = proxy.crash_dumps == null ? null : XenRef.Create(proxy.crash_dumps); VTPMs = proxy.VTPMs == null ? null : XenRef.Create(proxy.VTPMs); - PV_bootloader = proxy.PV_bootloader == null ? null : (string)proxy.PV_bootloader; - PV_kernel = proxy.PV_kernel == null ? null : (string)proxy.PV_kernel; - PV_ramdisk = proxy.PV_ramdisk == null ? null : (string)proxy.PV_ramdisk; - PV_args = proxy.PV_args == null ? null : (string)proxy.PV_args; - PV_bootloader_args = proxy.PV_bootloader_args == null ? null : (string)proxy.PV_bootloader_args; - PV_legacy_args = proxy.PV_legacy_args == null ? null : (string)proxy.PV_legacy_args; - HVM_boot_policy = proxy.HVM_boot_policy == null ? null : (string)proxy.HVM_boot_policy; + PV_bootloader = proxy.PV_bootloader == null ? null : proxy.PV_bootloader; + PV_kernel = proxy.PV_kernel == null ? null : proxy.PV_kernel; + PV_ramdisk = proxy.PV_ramdisk == null ? null : proxy.PV_ramdisk; + PV_args = proxy.PV_args == null ? null : proxy.PV_args; + PV_bootloader_args = proxy.PV_bootloader_args == null ? null : proxy.PV_bootloader_args; + PV_legacy_args = proxy.PV_legacy_args == null ? null : proxy.PV_legacy_args; + HVM_boot_policy = proxy.HVM_boot_policy == null ? null : proxy.HVM_boot_policy; HVM_boot_params = proxy.HVM_boot_params == null ? null : Maps.convert_from_proxy_string_string(proxy.HVM_boot_params); HVM_shadow_multiplier = Convert.ToDouble(proxy.HVM_shadow_multiplier); platform = proxy.platform == null ? null : Maps.convert_from_proxy_string_string(proxy.platform); - PCI_bus = proxy.PCI_bus == null ? null : (string)proxy.PCI_bus; + PCI_bus = proxy.PCI_bus == null ? null : proxy.PCI_bus; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); - domid = proxy.domid == null ? 0 : long.Parse((string)proxy.domid); - domarch = proxy.domarch == null ? null : (string)proxy.domarch; + domid = proxy.domid == null ? 0 : long.Parse(proxy.domid); + domarch = proxy.domarch == null ? null : proxy.domarch; last_boot_CPU_flags = proxy.last_boot_CPU_flags == null ? null : Maps.convert_from_proxy_string_string(proxy.last_boot_CPU_flags); is_control_domain = (bool)proxy.is_control_domain; metrics = proxy.metrics == null ? null : XenRef.Create(proxy.metrics); guest_metrics = proxy.guest_metrics == null ? null : XenRef.Create(proxy.guest_metrics); - last_booted_record = proxy.last_booted_record == null ? null : (string)proxy.last_booted_record; - recommendations = proxy.recommendations == null ? null : (string)proxy.recommendations; + last_booted_record = proxy.last_booted_record == null ? null : proxy.last_booted_record; + recommendations = proxy.recommendations == null ? null : proxy.recommendations; xenstore_data = proxy.xenstore_data == null ? null : Maps.convert_from_proxy_string_string(proxy.xenstore_data); ha_always_run = (bool)proxy.ha_always_run; - ha_restart_priority = proxy.ha_restart_priority == null ? null : (string)proxy.ha_restart_priority; + ha_restart_priority = proxy.ha_restart_priority == null ? null : proxy.ha_restart_priority; is_a_snapshot = (bool)proxy.is_a_snapshot; snapshot_of = proxy.snapshot_of == null ? null : XenRef.Create(proxy.snapshot_of); snapshots = proxy.snapshots == null ? null : XenRef.Create(proxy.snapshots); snapshot_time = proxy.snapshot_time; - transportable_snapshot_id = proxy.transportable_snapshot_id == null ? null : (string)proxy.transportable_snapshot_id; + transportable_snapshot_id = proxy.transportable_snapshot_id == null ? null : proxy.transportable_snapshot_id; blobs = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs); tags = proxy.tags == null ? new string[] {} : (string [])proxy.tags; blocked_operations = proxy.blocked_operations == null ? null : Maps.convert_from_proxy_vm_operations_string(proxy.blocked_operations); snapshot_info = proxy.snapshot_info == null ? null : Maps.convert_from_proxy_string_string(proxy.snapshot_info); - snapshot_metadata = proxy.snapshot_metadata == null ? null : (string)proxy.snapshot_metadata; + snapshot_metadata = proxy.snapshot_metadata == null ? null : proxy.snapshot_metadata; parent = proxy.parent == null ? null : XenRef.Create(proxy.parent); children = proxy.children == null ? null : XenRef.Create(proxy.children); bios_strings = proxy.bios_strings == null ? null : Maps.convert_from_proxy_string_string(proxy.bios_strings); @@ -392,25 +395,26 @@ namespace XenAPI snapshot_schedule = proxy.snapshot_schedule == null ? null : XenRef.Create(proxy.snapshot_schedule); is_vmss_snapshot = (bool)proxy.is_vmss_snapshot; appliance = proxy.appliance == null ? null : XenRef.Create(proxy.appliance); - start_delay = proxy.start_delay == null ? 0 : long.Parse((string)proxy.start_delay); - shutdown_delay = proxy.shutdown_delay == null ? 0 : long.Parse((string)proxy.shutdown_delay); - order = proxy.order == null ? 0 : long.Parse((string)proxy.order); + start_delay = proxy.start_delay == null ? 0 : long.Parse(proxy.start_delay); + shutdown_delay = proxy.shutdown_delay == null ? 0 : long.Parse(proxy.shutdown_delay); + order = proxy.order == null ? 0 : long.Parse(proxy.order); VGPUs = proxy.VGPUs == null ? null : XenRef.Create(proxy.VGPUs); attached_PCIs = proxy.attached_PCIs == null ? null : XenRef.Create(proxy.attached_PCIs); suspend_SR = proxy.suspend_SR == null ? null : XenRef.Create(proxy.suspend_SR); - version = proxy.version == null ? 0 : long.Parse((string)proxy.version); - generation_id = proxy.generation_id == null ? null : (string)proxy.generation_id; - hardware_platform_version = proxy.hardware_platform_version == null ? 0 : long.Parse((string)proxy.hardware_platform_version); + version = proxy.version == null ? 0 : long.Parse(proxy.version); + generation_id = proxy.generation_id == null ? null : proxy.generation_id; + hardware_platform_version = proxy.hardware_platform_version == null ? 0 : long.Parse(proxy.hardware_platform_version); has_vendor_device = (bool)proxy.has_vendor_device; requires_reboot = (bool)proxy.requires_reboot; - reference_label = proxy.reference_label == null ? null : (string)proxy.reference_label; + reference_label = proxy.reference_label == null ? null : proxy.reference_label; + domain_type = proxy.domain_type == null ? (domain_type) 0 : (domain_type)Helper.EnumParseDefault(typeof(domain_type), (string)proxy.domain_type); } public Proxy_VM ToProxy() { Proxy_VM result_ = new Proxy_VM(); result_.uuid = uuid ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_vm_operations(current_operations); result_.power_state = vm_power_state_helper.ToString(power_state); result_.name_label = name_label ?? ""; @@ -433,12 +437,12 @@ namespace XenAPI result_.actions_after_shutdown = on_normal_exit_helper.ToString(actions_after_shutdown); result_.actions_after_reboot = on_normal_exit_helper.ToString(actions_after_reboot); result_.actions_after_crash = on_crash_behaviour_helper.ToString(actions_after_crash); - result_.consoles = (consoles != null) ? Helper.RefListToStringArray(consoles) : new string[] {}; - result_.VIFs = (VIFs != null) ? Helper.RefListToStringArray(VIFs) : new string[] {}; - result_.VBDs = (VBDs != null) ? Helper.RefListToStringArray(VBDs) : new string[] {}; - result_.VUSBs = (VUSBs != null) ? Helper.RefListToStringArray(VUSBs) : new string[] {}; - result_.crash_dumps = (crash_dumps != null) ? Helper.RefListToStringArray(crash_dumps) : new string[] {}; - result_.VTPMs = (VTPMs != null) ? Helper.RefListToStringArray(VTPMs) : new string[] {}; + result_.consoles = consoles == null ? new string[] {} : Helper.RefListToStringArray(consoles); + result_.VIFs = VIFs == null ? new string[] {} : Helper.RefListToStringArray(VIFs); + result_.VBDs = VBDs == null ? new string[] {} : Helper.RefListToStringArray(VBDs); + result_.VUSBs = VUSBs == null ? new string[] {} : Helper.RefListToStringArray(VUSBs); + result_.crash_dumps = crash_dumps == null ? new string[] {} : Helper.RefListToStringArray(crash_dumps); + result_.VTPMs = VTPMs == null ? new string[] {} : Helper.RefListToStringArray(VTPMs); result_.PV_bootloader = PV_bootloader ?? ""; result_.PV_kernel = PV_kernel ?? ""; result_.PV_ramdisk = PV_ramdisk ?? ""; @@ -464,7 +468,7 @@ namespace XenAPI result_.ha_restart_priority = ha_restart_priority ?? ""; result_.is_a_snapshot = is_a_snapshot; result_.snapshot_of = snapshot_of ?? ""; - result_.snapshots = (snapshots != null) ? Helper.RefListToStringArray(snapshots) : new string[] {}; + result_.snapshots = snapshots == null ? new string[] {} : Helper.RefListToStringArray(snapshots); result_.snapshot_time = snapshot_time; result_.transportable_snapshot_id = transportable_snapshot_id ?? ""; result_.blobs = Maps.convert_to_proxy_string_XenRefBlob(blobs); @@ -473,7 +477,7 @@ namespace XenAPI result_.snapshot_info = Maps.convert_to_proxy_string_string(snapshot_info); result_.snapshot_metadata = snapshot_metadata ?? ""; result_.parent = parent ?? ""; - result_.children = (children != null) ? Helper.RefListToStringArray(children) : new string[] {}; + result_.children = children == null ? new string[] {} : Helper.RefListToStringArray(children); result_.bios_strings = Maps.convert_to_proxy_string_string(bios_strings); result_.protection_policy = protection_policy ?? ""; result_.is_snapshot_from_vmpp = is_snapshot_from_vmpp; @@ -483,8 +487,8 @@ namespace XenAPI result_.start_delay = start_delay.ToString(); result_.shutdown_delay = shutdown_delay.ToString(); result_.order = order.ToString(); - result_.VGPUs = (VGPUs != null) ? Helper.RefListToStringArray(VGPUs) : new string[] {}; - result_.attached_PCIs = (attached_PCIs != null) ? Helper.RefListToStringArray(attached_PCIs) : new string[] {}; + result_.VGPUs = VGPUs == null ? new string[] {} : Helper.RefListToStringArray(VGPUs); + result_.attached_PCIs = attached_PCIs == null ? new string[] {} : Helper.RefListToStringArray(attached_PCIs); result_.suspend_SR = suspend_SR ?? ""; result_.version = version.ToString(); result_.generation_id = generation_id ?? ""; @@ -492,6 +496,7 @@ namespace XenAPI result_.has_vendor_device = has_vendor_device; result_.requires_reboot = requires_reboot; result_.reference_label = reference_label ?? ""; + result_.domain_type = domain_type_helper.ToString(domain_type); return result_; } @@ -680,6 +685,8 @@ namespace XenAPI requires_reboot = Marshalling.ParseBool(table, "requires_reboot"); if (table.ContainsKey("reference_label")) reference_label = Marshalling.ParseString(table, "reference_label"); + if (table.ContainsKey("domain_type")) + domain_type = (domain_type)Helper.EnumParseDefault(typeof(domain_type), Marshalling.ParseString(table, "domain_type")); } public bool DeepEquals(VM other, bool ignoreCurrentOperations) @@ -773,7 +780,8 @@ namespace XenAPI Helper.AreEqual2(this._hardware_platform_version, other._hardware_platform_version) && Helper.AreEqual2(this._has_vendor_device, other._has_vendor_device) && Helper.AreEqual2(this._requires_reboot, other._requires_reboot) && - Helper.AreEqual2(this._reference_label, other._reference_label); + Helper.AreEqual2(this._reference_label, other._reference_label) && + Helper.AreEqual2(this._domain_type, other._domain_type); } internal static List ProxyArrayToObjectList(Proxy_VM[] input) @@ -850,10 +858,6 @@ namespace XenAPI { VM.set_PV_legacy_args(session, opaqueRef, _PV_legacy_args); } - if (!Helper.AreEqual2(_HVM_boot_policy, server._HVM_boot_policy)) - { - VM.set_HVM_boot_policy(session, opaqueRef, _HVM_boot_policy); - } if (!Helper.AreEqual2(_HVM_boot_params, server._HVM_boot_params)) { VM.set_HVM_boot_params(session, opaqueRef, _HVM_boot_params); @@ -922,6 +926,10 @@ namespace XenAPI { VM.set_actions_after_crash(session, opaqueRef, _actions_after_crash); } + if (!Helper.AreEqual2(_HVM_boot_policy, server._HVM_boot_policy)) + { + VM.set_HVM_boot_policy(session, opaqueRef, _HVM_boot_policy); + } if (!Helper.AreEqual2(_HVM_shadow_multiplier, server._HVM_shadow_multiplier)) { VM.set_HVM_shadow_multiplier(session, opaqueRef, _HVM_shadow_multiplier); @@ -962,6 +970,10 @@ namespace XenAPI { VM.set_has_vendor_device(session, opaqueRef, _has_vendor_device); } + if (!Helper.AreEqual2(_domain_type, server._domain_type)) + { + VM.set_domain_type(session, opaqueRef, _domain_type); + } return null; } @@ -1075,7 +1087,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_uuid(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_uuid(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_uuid(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1131,7 +1143,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_name_label(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_name_label(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_name_label(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1145,7 +1157,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_name_description(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_name_description(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_name_description(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1159,7 +1171,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_user_version(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_user_version(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_user_version(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1243,7 +1255,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_memory_overhead(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_memory_overhead(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_memory_overhead(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1259,7 +1271,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_memory_target(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_memory_target(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_memory_target(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1273,7 +1285,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_memory_static_max(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_memory_static_max(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_memory_static_max(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1287,7 +1299,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_memory_dynamic_max(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_memory_dynamic_max(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_memory_dynamic_max(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1301,7 +1313,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_memory_dynamic_min(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_memory_dynamic_min(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_memory_dynamic_min(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1315,7 +1327,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_memory_static_min(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_memory_static_min(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_memory_static_min(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1343,7 +1355,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_vcpus_max(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_vcpus_max(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_vcpus_max(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1357,7 +1369,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_vcpus_at_startup(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_vcpus_at_startup(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_vcpus_at_startup(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1497,7 +1509,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_pv_bootloader(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_pv_bootloader(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_pv_bootloader(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1511,7 +1523,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_pv_kernel(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_pv_kernel(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_pv_kernel(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1525,7 +1537,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_pv_ramdisk(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_pv_ramdisk(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_pv_ramdisk(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1539,7 +1551,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_pv_args(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_pv_args(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_pv_args(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1553,7 +1565,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_pv_bootloader_args(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_pv_bootloader_args(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_pv_bootloader_args(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1567,21 +1579,23 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_pv_legacy_args(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_pv_legacy_args(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_pv_legacy_args(session.opaque_ref, _vm ?? "").parse(); } /// /// Get the HVM/boot_policy field of the given VM. /// First published in XenServer 4.0. + /// Deprecated since Unreleased. /// /// The session /// The opaque_ref of the given vm + [Deprecated("Unreleased")] public static string get_HVM_boot_policy(Session session, string _vm) { if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_hvm_boot_policy(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_hvm_boot_policy(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_hvm_boot_policy(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1639,7 +1653,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_pci_bus(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_pci_bus(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_pci_bus(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1667,7 +1681,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_domid(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_domid(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_domid(session.opaque_ref, _vm ?? "").parse()); } /// @@ -1681,7 +1695,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_domarch(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_domarch(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_domarch(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1751,7 +1765,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_last_booted_record(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_last_booted_record(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_last_booted_record(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1765,7 +1779,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_recommendations(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_recommendations(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_recommendations(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1809,7 +1823,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_ha_restart_priority(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_ha_restart_priority(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_ha_restart_priority(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1879,7 +1893,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_transportable_snapshot_id(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_transportable_snapshot_id(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_transportable_snapshot_id(session.opaque_ref, _vm ?? "").parse(); } /// @@ -1949,7 +1963,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_snapshot_metadata(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_snapshot_metadata(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_snapshot_metadata(session.opaque_ref, _vm ?? "").parse(); } /// @@ -2079,7 +2093,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_start_delay(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_start_delay(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_start_delay(session.opaque_ref, _vm ?? "").parse()); } /// @@ -2093,7 +2107,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_shutdown_delay(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_shutdown_delay(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_shutdown_delay(session.opaque_ref, _vm ?? "").parse()); } /// @@ -2107,7 +2121,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_order(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_order(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_order(session.opaque_ref, _vm ?? "").parse()); } /// @@ -2163,7 +2177,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_version(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_version(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_version(session.opaque_ref, _vm ?? "").parse()); } /// @@ -2177,7 +2191,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_generation_id(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_generation_id(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_generation_id(session.opaque_ref, _vm ?? "").parse(); } /// @@ -2191,7 +2205,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_hardware_platform_version(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_get_hardware_platform_version(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_get_hardware_platform_version(session.opaque_ref, _vm ?? "").parse()); } /// @@ -2233,7 +2247,21 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_get_reference_label(session.opaque_ref, _vm); else - return (string)session.proxy.vm_get_reference_label(session.opaque_ref, _vm ?? "").parse(); + return session.proxy.vm_get_reference_label(session.opaque_ref, _vm ?? "").parse(); + } + + /// + /// Get the domain_type field of the given VM. + /// First published in XenServer 7.4. + /// + /// The session + /// The opaque_ref of the given vm + public static domain_type get_domain_type(Session session, string _vm) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.vm_get_domain_type(session.opaque_ref, _vm); + else + return (domain_type)Helper.EnumParseDefault(typeof(domain_type), (string)session.proxy.vm_get_domain_type(session.opaque_ref, _vm ?? "").parse()); } /// @@ -2477,21 +2505,6 @@ namespace XenAPI session.proxy.vm_set_pv_legacy_args(session.opaque_ref, _vm ?? "", _legacy_args ?? "").parse(); } - /// - /// Set the HVM/boot_policy field of the given VM. - /// First published in XenServer 4.0. - /// - /// The session - /// The opaque_ref of the given vm - /// New value to set - public static void set_HVM_boot_policy(Session session, string _vm, string _boot_policy) - { - if (session.JsonRpcClient != null) - session.JsonRpcClient.vm_set_hvm_boot_policy(session.opaque_ref, _vm, _boot_policy); - else - session.proxy.vm_set_hvm_boot_policy(session.opaque_ref, _vm ?? "", _boot_policy ?? "").parse(); - } - /// /// Set the HVM/boot_params field of the given VM. /// First published in XenServer 4.0. @@ -3558,7 +3571,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_compute_memory_overhead(session.opaque_ref, _vm); else - return long.Parse((string)session.proxy.vm_compute_memory_overhead(session.opaque_ref, _vm ?? "").parse()); + return long.Parse(session.proxy.vm_compute_memory_overhead(session.opaque_ref, _vm ?? "").parse()); } /// @@ -4011,7 +4024,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_maximise_memory(session.opaque_ref, _vm, _total, _approximate); else - return long.Parse((string)session.proxy.vm_maximise_memory(session.opaque_ref, _vm ?? "", _total.ToString(), _approximate).parse()); + return long.Parse(session.proxy.vm_maximise_memory(session.opaque_ref, _vm ?? "", _total.ToString(), _approximate).parse()); } /// @@ -4937,7 +4950,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_call_plugin(session.opaque_ref, _vm, _plugin, _fn, _args); else - return (string)session.proxy.vm_call_plugin(session.opaque_ref, _vm ?? "", _plugin ?? "", _fn ?? "", Maps.convert_to_proxy_string_string(_args)).parse(); + return session.proxy.vm_call_plugin(session.opaque_ref, _vm ?? "", _plugin ?? "", _fn ?? "", Maps.convert_to_proxy_string_string(_args)).parse(); } /// @@ -5051,6 +5064,38 @@ namespace XenAPI return XenRef.Create(session.proxy.async_vm_set_actions_after_crash(session.opaque_ref, _vm ?? "", on_crash_behaviour_helper.ToString(_value)).parse()); } + /// + /// Set the VM.domain_type field of the given VM, which will take effect when it is next started + /// First published in Unreleased. + /// + /// The session + /// The opaque_ref of the given vm + /// The new domain type + public static void set_domain_type(Session session, string _vm, domain_type _value) + { + if (session.JsonRpcClient != null) + session.JsonRpcClient.vm_set_domain_type(session.opaque_ref, _vm, _value); + else + session.proxy.vm_set_domain_type(session.opaque_ref, _vm ?? "", domain_type_helper.ToString(_value)).parse(); + } + + /// + /// Set the VM.HVM_boot_policy field of the given VM, which will take effect when it is next started + /// First published in XenServer 4.0. + /// Deprecated since Unreleased. + /// + /// The session + /// The opaque_ref of the given vm + /// The new HVM boot policy + [Deprecated("Unreleased")] + public static void set_HVM_boot_policy(Session session, string _vm, string _value) + { + if (session.JsonRpcClient != null) + session.JsonRpcClient.vm_set_hvm_boot_policy(session.opaque_ref, _vm, _value); + else + session.proxy.vm_set_hvm_boot_policy(session.opaque_ref, _vm ?? "", _value ?? "").parse(); + } + /// /// Return a list of all the VMs known to the system. /// First published in XenServer 4.0. @@ -6640,5 +6685,25 @@ namespace XenAPI } } private string _reference_label = ""; + + /// + /// The type of domain that will be created when the VM is started + /// First published in XenServer 7.4. + /// + [JsonConverter(typeof(domain_typeConverter))] + public virtual domain_type domain_type + { + get { return _domain_type; } + set + { + if (!Helper.AreEqual(value, _domain_type)) + { + _domain_type = value; + Changed = true; + NotifyPropertyChanged("domain_type"); + } + } + } + private domain_type _domain_type = domain_type.unspecified; } } diff --git a/XenModel/XenAPI/VMPP.cs b/XenModel/XenAPI/VMPP.cs index a1bfc86b7..316ca3431 100644 --- a/XenModel/XenAPI/VMPP.cs +++ b/XenModel/XenAPI/VMPP.cs @@ -132,12 +132,12 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VMPP 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; is_policy_enabled = (bool)proxy.is_policy_enabled; backup_type = proxy.backup_type == null ? (vmpp_backup_type) 0 : (vmpp_backup_type)Helper.EnumParseDefault(typeof(vmpp_backup_type), (string)proxy.backup_type); - backup_retention_value = proxy.backup_retention_value == null ? 0 : long.Parse((string)proxy.backup_retention_value); + backup_retention_value = proxy.backup_retention_value == null ? 0 : long.Parse(proxy.backup_retention_value); backup_frequency = proxy.backup_frequency == null ? (vmpp_backup_frequency) 0 : (vmpp_backup_frequency)Helper.EnumParseDefault(typeof(vmpp_backup_frequency), (string)proxy.backup_frequency); backup_schedule = proxy.backup_schedule == null ? null : Maps.convert_from_proxy_string_string(proxy.backup_schedule); is_backup_running = (bool)proxy.is_backup_running; @@ -173,7 +173,7 @@ namespace XenAPI result_.archive_schedule = Maps.convert_to_proxy_string_string(archive_schedule); result_.is_archive_running = is_archive_running; result_.archive_last_run_time = archive_last_run_time; - result_.VMs = (VMs != null) ? Helper.RefListToStringArray(VMs) : new string[] {}; + result_.VMs = VMs == null ? new string[] {} : Helper.RefListToStringArray(VMs); result_.is_alarm_enabled = is_alarm_enabled; result_.alarm_config = Maps.convert_to_proxy_string_string(alarm_config); result_.recent_alerts = recent_alerts; @@ -453,7 +453,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmpp_get_uuid(session.opaque_ref, _vmpp); else - return (string)session.proxy.vmpp_get_uuid(session.opaque_ref, _vmpp ?? "").parse(); + return session.proxy.vmpp_get_uuid(session.opaque_ref, _vmpp ?? "").parse(); } /// @@ -467,7 +467,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmpp_get_name_label(session.opaque_ref, _vmpp); else - return (string)session.proxy.vmpp_get_name_label(session.opaque_ref, _vmpp ?? "").parse(); + return session.proxy.vmpp_get_name_label(session.opaque_ref, _vmpp ?? "").parse(); } /// @@ -481,7 +481,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmpp_get_name_description(session.opaque_ref, _vmpp); else - return (string)session.proxy.vmpp_get_name_description(session.opaque_ref, _vmpp ?? "").parse(); + return session.proxy.vmpp_get_name_description(session.opaque_ref, _vmpp ?? "").parse(); } /// @@ -523,7 +523,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmpp_get_backup_retention_value(session.opaque_ref, _vmpp); else - return long.Parse((string)session.proxy.vmpp_get_backup_retention_value(session.opaque_ref, _vmpp ?? "").parse()); + return long.Parse(session.proxy.vmpp_get_backup_retention_value(session.opaque_ref, _vmpp ?? "").parse()); } /// @@ -793,7 +793,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmpp_protect_now(session.opaque_ref, _vmpp); else - return (string)session.proxy.vmpp_protect_now(session.opaque_ref, _vmpp ?? "").parse(); + return session.proxy.vmpp_protect_now(session.opaque_ref, _vmpp ?? "").parse(); } /// @@ -807,7 +807,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmpp_archive_now(session.opaque_ref, _snapshot); else - return (string)session.proxy.vmpp_archive_now(session.opaque_ref, _snapshot ?? "").parse(); + return session.proxy.vmpp_archive_now(session.opaque_ref, _snapshot ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VMSS.cs b/XenModel/XenAPI/VMSS.cs index 9b36dfa4d..3b3b4c665 100644 --- a/XenModel/XenAPI/VMSS.cs +++ b/XenModel/XenAPI/VMSS.cs @@ -102,12 +102,12 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VMSS 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; enabled = (bool)proxy.enabled; type = proxy.type == null ? (vmss_type) 0 : (vmss_type)Helper.EnumParseDefault(typeof(vmss_type), (string)proxy.type); - retained_snapshots = proxy.retained_snapshots == null ? 0 : long.Parse((string)proxy.retained_snapshots); + retained_snapshots = proxy.retained_snapshots == null ? 0 : long.Parse(proxy.retained_snapshots); frequency = proxy.frequency == null ? (vmss_frequency) 0 : (vmss_frequency)Helper.EnumParseDefault(typeof(vmss_frequency), (string)proxy.frequency); schedule = proxy.schedule == null ? null : Maps.convert_from_proxy_string_string(proxy.schedule); last_run_time = proxy.last_run_time; @@ -126,7 +126,7 @@ namespace XenAPI result_.frequency = vmss_frequency_helper.ToString(frequency); result_.schedule = Maps.convert_to_proxy_string_string(schedule); result_.last_run_time = last_run_time; - result_.VMs = (VMs != null) ? Helper.RefListToStringArray(VMs) : new string[] {}; + result_.VMs = VMs == null ? new string[] {} : Helper.RefListToStringArray(VMs); return result_; } @@ -349,7 +349,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmss_get_uuid(session.opaque_ref, _vmss); else - return (string)session.proxy.vmss_get_uuid(session.opaque_ref, _vmss ?? "").parse(); + return session.proxy.vmss_get_uuid(session.opaque_ref, _vmss ?? "").parse(); } /// @@ -363,7 +363,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmss_get_name_label(session.opaque_ref, _vmss); else - return (string)session.proxy.vmss_get_name_label(session.opaque_ref, _vmss ?? "").parse(); + return session.proxy.vmss_get_name_label(session.opaque_ref, _vmss ?? "").parse(); } /// @@ -377,7 +377,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmss_get_name_description(session.opaque_ref, _vmss); else - return (string)session.proxy.vmss_get_name_description(session.opaque_ref, _vmss ?? "").parse(); + return session.proxy.vmss_get_name_description(session.opaque_ref, _vmss ?? "").parse(); } /// @@ -419,7 +419,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmss_get_retained_snapshots(session.opaque_ref, _vmss); else - return long.Parse((string)session.proxy.vmss_get_retained_snapshots(session.opaque_ref, _vmss ?? "").parse()); + return long.Parse(session.proxy.vmss_get_retained_snapshots(session.opaque_ref, _vmss ?? "").parse()); } /// @@ -534,7 +534,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vmss_snapshot_now(session.opaque_ref, _vmss); else - return (string)session.proxy.vmss_snapshot_now(session.opaque_ref, _vmss ?? "").parse(); + return session.proxy.vmss_snapshot_now(session.opaque_ref, _vmss ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VM_appliance.cs b/XenModel/XenAPI/VM_appliance.cs index 2928b7449..647731855 100644 --- a/XenModel/XenAPI/VM_appliance.cs +++ b/XenModel/XenAPI/VM_appliance.cs @@ -90,9 +90,9 @@ namespace XenAPI 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; + uuid = proxy.uuid == null ? null : proxy.uuid; + name_label = proxy.name_label == null ? null : proxy.name_label; + name_description = proxy.name_description == null ? null : proxy.name_description; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(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.Create(proxy.VMs); @@ -104,9 +104,9 @@ namespace XenAPI result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_vm_appliance_operation(current_operations); - result_.VMs = (VMs != null) ? Helper.RefListToStringArray(VMs) : new string[] {}; + result_.VMs = VMs == null ? new string[] {} : Helper.RefListToStringArray(VMs); return result_; } @@ -299,7 +299,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_appliance_get_uuid(session.opaque_ref, _vm_appliance); else - return (string)session.proxy.vm_appliance_get_uuid(session.opaque_ref, _vm_appliance ?? "").parse(); + return session.proxy.vm_appliance_get_uuid(session.opaque_ref, _vm_appliance ?? "").parse(); } /// @@ -313,7 +313,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_appliance_get_name_label(session.opaque_ref, _vm_appliance); else - return (string)session.proxy.vm_appliance_get_name_label(session.opaque_ref, _vm_appliance ?? "").parse(); + return session.proxy.vm_appliance_get_name_label(session.opaque_ref, _vm_appliance ?? "").parse(); } /// @@ -327,7 +327,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_appliance_get_name_description(session.opaque_ref, _vm_appliance); else - return (string)session.proxy.vm_appliance_get_name_description(session.opaque_ref, _vm_appliance ?? "").parse(); + return session.proxy.vm_appliance_get_name_description(session.opaque_ref, _vm_appliance ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VM_guest_metrics.cs b/XenModel/XenAPI/VM_guest_metrics.cs index d12354cc4..ee264e8ff 100644 --- a/XenModel/XenAPI/VM_guest_metrics.cs +++ b/XenModel/XenAPI/VM_guest_metrics.cs @@ -114,7 +114,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VM_guest_metrics proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; os_version = proxy.os_version == null ? null : Maps.convert_from_proxy_string_string(proxy.os_version); PV_drivers_version = proxy.PV_drivers_version == null ? null : Maps.convert_from_proxy_string_string(proxy.PV_drivers_version); PV_drivers_up_to_date = (bool)proxy.PV_drivers_up_to_date; @@ -287,7 +287,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_guest_metrics_get_uuid(session.opaque_ref, _vm_guest_metrics); else - return (string)session.proxy.vm_guest_metrics_get_uuid(session.opaque_ref, _vm_guest_metrics ?? "").parse(); + return session.proxy.vm_guest_metrics_get_uuid(session.opaque_ref, _vm_guest_metrics ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VM_metrics.cs b/XenModel/XenAPI/VM_metrics.cs index ac0d87a79..fa8f69162 100644 --- a/XenModel/XenAPI/VM_metrics.cs +++ b/XenModel/XenAPI/VM_metrics.cs @@ -64,7 +64,8 @@ namespace XenAPI Dictionary other_config, bool hvm, bool nested_virt, - bool nomigrate) + bool nomigrate, + domain_type current_domain_type) { this.uuid = uuid; this.memory_actual = memory_actual; @@ -81,6 +82,7 @@ namespace XenAPI this.hvm = hvm; this.nested_virt = nested_virt; this.nomigrate = nomigrate; + this.current_domain_type = current_domain_type; } /// @@ -113,13 +115,14 @@ namespace XenAPI hvm = update.hvm; nested_virt = update.nested_virt; nomigrate = update.nomigrate; + current_domain_type = update.current_domain_type; } internal void UpdateFromProxy(Proxy_VM_metrics proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - memory_actual = proxy.memory_actual == null ? 0 : long.Parse((string)proxy.memory_actual); - VCPUs_number = proxy.VCPUs_number == null ? 0 : long.Parse((string)proxy.VCPUs_number); + uuid = proxy.uuid == null ? null : proxy.uuid; + memory_actual = proxy.memory_actual == null ? 0 : long.Parse(proxy.memory_actual); + VCPUs_number = proxy.VCPUs_number == null ? 0 : long.Parse(proxy.VCPUs_number); VCPUs_utilisation = proxy.VCPUs_utilisation == null ? null : Maps.convert_from_proxy_long_double(proxy.VCPUs_utilisation); VCPUs_CPU = proxy.VCPUs_CPU == null ? null : Maps.convert_from_proxy_long_long(proxy.VCPUs_CPU); VCPUs_params = proxy.VCPUs_params == null ? null : Maps.convert_from_proxy_string_string(proxy.VCPUs_params); @@ -132,6 +135,7 @@ namespace XenAPI hvm = (bool)proxy.hvm; nested_virt = (bool)proxy.nested_virt; nomigrate = (bool)proxy.nomigrate; + current_domain_type = proxy.current_domain_type == null ? (domain_type) 0 : (domain_type)Helper.EnumParseDefault(typeof(domain_type), (string)proxy.current_domain_type); } public Proxy_VM_metrics ToProxy() @@ -152,6 +156,7 @@ namespace XenAPI result_.hvm = hvm; result_.nested_virt = nested_virt; result_.nomigrate = nomigrate; + result_.current_domain_type = domain_type_helper.ToString(current_domain_type); return result_; } @@ -204,6 +209,8 @@ namespace XenAPI nested_virt = Marshalling.ParseBool(table, "nested_virt"); if (table.ContainsKey("nomigrate")) nomigrate = Marshalling.ParseBool(table, "nomigrate"); + if (table.ContainsKey("current_domain_type")) + current_domain_type = (domain_type)Helper.EnumParseDefault(typeof(domain_type), Marshalling.ParseString(table, "current_domain_type")); } public bool DeepEquals(VM_metrics other) @@ -227,7 +234,8 @@ namespace XenAPI Helper.AreEqual2(this._other_config, other._other_config) && Helper.AreEqual2(this._hvm, other._hvm) && Helper.AreEqual2(this._nested_virt, other._nested_virt) && - Helper.AreEqual2(this._nomigrate, other._nomigrate); + Helper.AreEqual2(this._nomigrate, other._nomigrate) && + Helper.AreEqual2(this._current_domain_type, other._current_domain_type); } internal static List ProxyArrayToObjectList(Proxy_VM_metrics[] input) @@ -295,7 +303,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_metrics_get_uuid(session.opaque_ref, _vm_metrics); else - return (string)session.proxy.vm_metrics_get_uuid(session.opaque_ref, _vm_metrics ?? "").parse(); + return session.proxy.vm_metrics_get_uuid(session.opaque_ref, _vm_metrics ?? "").parse(); } /// @@ -309,7 +317,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_metrics_get_memory_actual(session.opaque_ref, _vm_metrics); else - return long.Parse((string)session.proxy.vm_metrics_get_memory_actual(session.opaque_ref, _vm_metrics ?? "").parse()); + return long.Parse(session.proxy.vm_metrics_get_memory_actual(session.opaque_ref, _vm_metrics ?? "").parse()); } /// @@ -323,7 +331,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vm_metrics_get_vcpus_number(session.opaque_ref, _vm_metrics); else - return long.Parse((string)session.proxy.vm_metrics_get_vcpus_number(session.opaque_ref, _vm_metrics ?? "").parse()); + return long.Parse(session.proxy.vm_metrics_get_vcpus_number(session.opaque_ref, _vm_metrics ?? "").parse()); } /// @@ -494,6 +502,20 @@ namespace XenAPI return (bool)session.proxy.vm_metrics_get_nomigrate(session.opaque_ref, _vm_metrics ?? "").parse(); } + /// + /// Get the current_domain_type field of the given VM_metrics. + /// First published in XenServer 7.4. + /// + /// The session + /// The opaque_ref of the given vm_metrics + public static domain_type get_current_domain_type(Session session, string _vm_metrics) + { + if (session.JsonRpcClient != null) + return session.JsonRpcClient.vm_metrics_get_current_domain_type(session.opaque_ref, _vm_metrics); + else + return (domain_type)Helper.EnumParseDefault(typeof(domain_type), (string)session.proxy.vm_metrics_get_current_domain_type(session.opaque_ref, _vm_metrics ?? "").parse()); + } + /// /// Set the other_config field of the given VM_metrics. /// First published in XenServer 5.0. @@ -844,5 +866,25 @@ namespace XenAPI } } private bool _nomigrate = false; + + /// + /// The current domain type of the VM (for running,suspended, or paused VMs). The last-known domain type for halted VMs. + /// First published in XenServer 7.4. + /// + [JsonConverter(typeof(domain_typeConverter))] + public virtual domain_type current_domain_type + { + get { return _current_domain_type; } + set + { + if (!Helper.AreEqual(value, _current_domain_type)) + { + _current_domain_type = value; + Changed = true; + NotifyPropertyChanged("current_domain_type"); + } + } + } + private domain_type _current_domain_type = domain_type.unspecified; } } diff --git a/XenModel/XenAPI/VTPM.cs b/XenModel/XenAPI/VTPM.cs index 402fdfdd8..ab0a51a1b 100644 --- a/XenModel/XenAPI/VTPM.cs +++ b/XenModel/XenAPI/VTPM.cs @@ -81,7 +81,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VTPM proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; VM = proxy.VM == null ? null : XenRef.Create(proxy.VM); backend = proxy.backend == null ? null : XenRef.Create(proxy.backend); } @@ -250,7 +250,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vtpm_get_uuid(session.opaque_ref, _vtpm); else - return (string)session.proxy.vtpm_get_uuid(session.opaque_ref, _vtpm ?? "").parse(); + return session.proxy.vtpm_get_uuid(session.opaque_ref, _vtpm ?? "").parse(); } /// diff --git a/XenModel/XenAPI/VUSB.cs b/XenModel/XenAPI/VUSB.cs index 818523c54..02c0fb4e4 100644 --- a/XenModel/XenAPI/VUSB.cs +++ b/XenModel/XenAPI/VUSB.cs @@ -93,7 +93,7 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_VUSB proxy) { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; + uuid = proxy.uuid == null ? null : proxy.uuid; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vusb_operations(proxy.current_operations); VM = proxy.VM == null ? null : XenRef.Create(proxy.VM); @@ -106,7 +106,7 @@ namespace XenAPI { Proxy_VUSB result_ = new Proxy_VUSB(); result_.uuid = uuid ?? ""; - result_.allowed_operations = (allowed_operations != null) ? Helper.ObjectListToStringArray(allowed_operations) : new string[] {}; + result_.allowed_operations = allowed_operations == null ? new string[] {} : Helper.ObjectListToStringArray(allowed_operations); result_.current_operations = Maps.convert_to_proxy_string_vusb_operations(current_operations); result_.VM = VM ?? ""; result_.USB_group = USB_group ?? ""; @@ -233,7 +233,7 @@ namespace XenAPI if (session.JsonRpcClient != null) return session.JsonRpcClient.vusb_get_uuid(session.opaque_ref, _vusb); else - return (string)session.proxy.vusb_get_uuid(session.opaque_ref, _vusb ?? "").parse(); + return session.proxy.vusb_get_uuid(session.opaque_ref, _vusb ?? "").parse(); } /// diff --git a/XenModel/XenAPI/Vdi_nbd_server_info.cs b/XenModel/XenAPI/Vdi_nbd_server_info.cs index 74b08d332..c3e08c1d3 100644 --- a/XenModel/XenAPI/Vdi_nbd_server_info.cs +++ b/XenModel/XenAPI/Vdi_nbd_server_info.cs @@ -87,11 +87,11 @@ namespace XenAPI internal void UpdateFromProxy(Proxy_Vdi_nbd_server_info proxy) { - exportname = proxy.exportname == null ? null : (string)proxy.exportname; - address = proxy.address == null ? null : (string)proxy.address; - port = proxy.port == null ? 0 : long.Parse((string)proxy.port); - cert = proxy.cert == null ? null : (string)proxy.cert; - subject = proxy.subject == null ? null : (string)proxy.subject; + exportname = proxy.exportname == null ? null : proxy.exportname; + address = proxy.address == null ? null : proxy.address; + port = proxy.port == null ? 0 : long.Parse(proxy.port); + cert = proxy.cert == null ? null : proxy.cert; + subject = proxy.subject == null ? null : proxy.subject; } public Proxy_Vdi_nbd_server_info ToProxy() diff --git a/XenModel/XenAPI/cluster_host_operation.cs b/XenModel/XenAPI/cluster_host_operation.cs index ac5396704..7b4594612 100644 --- a/XenModel/XenAPI/cluster_host_operation.cs +++ b/XenModel/XenAPI/cluster_host_operation.cs @@ -37,7 +37,7 @@ namespace XenAPI [JsonConverter(typeof(cluster_host_operationConverter))] public enum cluster_host_operation { - enable, disable, unknown + enable, disable, destroy, unknown } public static class cluster_host_operation_helper @@ -58,6 +58,8 @@ namespace XenAPI return "enable"; case cluster_host_operation.disable: return "disable"; + case cluster_host_operation.destroy: + return "destroy"; default: return "unknown"; } diff --git a/XenModel/XenAPI/domain_type.cs b/XenModel/XenAPI/domain_type.cs new file mode 100644 index 000000000..e7ea8c948 --- /dev/null +++ b/XenModel/XenAPI/domain_type.cs @@ -0,0 +1,78 @@ +/* + * Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using Newtonsoft.Json; + + +namespace XenAPI +{ + [JsonConverter(typeof(domain_typeConverter))] + public enum domain_type + { + hvm, pv, pv_in_pvh, unspecified, unknown + } + + public static class domain_type_helper + { + public static string ToString(domain_type x) + { + return x.StringOf(); + } + } + + public static partial class EnumExt + { + public static string StringOf(this domain_type x) + { + switch (x) + { + case domain_type.hvm: + return "hvm"; + case domain_type.pv: + return "pv"; + case domain_type.pv_in_pvh: + return "pv_in_pvh"; + case domain_type.unspecified: + return "unspecified"; + default: + return "unknown"; + } + } + } + + internal class domain_typeConverter : XenEnumConverter + { + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(((domain_type)value).StringOf()); + } + } +} diff --git a/XenModel/XenAPI/sr_health.cs b/XenModel/XenAPI/sr_health.cs new file mode 100644 index 000000000..a6ace1111 --- /dev/null +++ b/XenModel/XenAPI/sr_health.cs @@ -0,0 +1,74 @@ +/* + * Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using Newtonsoft.Json; + + +namespace XenAPI +{ + [JsonConverter(typeof(sr_healthConverter))] + public enum sr_health + { + healthy, recovering, unknown + } + + public static class sr_health_helper + { + public static string ToString(sr_health x) + { + return x.StringOf(); + } + } + + public static partial class EnumExt + { + public static string StringOf(this sr_health x) + { + switch (x) + { + case sr_health.healthy: + return "healthy"; + case sr_health.recovering: + return "recovering"; + default: + return "unknown"; + } + } + } + + internal class sr_healthConverter : XenEnumConverter + { + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(((sr_health)value).StringOf()); + } + } +} diff --git a/XenModel/XenModel.csproj b/XenModel/XenModel.csproj index 60598b558..13f9c27e2 100755 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -362,6 +362,7 @@ + @@ -388,6 +389,7 @@ + @@ -396,6 +398,8 @@ + + From b7d3a2b3b5e6bc51b7c1e724661df2232037ce44 Mon Sep 17 00:00:00 2001 From: serenc Date: Tue, 27 Mar 2018 14:17:34 +0100 Subject: [PATCH 02/18] CP-17099: Add gfs2 SR probe Signed-off-by: serenc --- XenAdmin/Dialogs/IscsiChoicesDialog.cs | 6 ++- .../NewSRWizard_Pages/Frontends/LVMoISCSI.cs | 38 +++++++++--------- XenModel/Actions/SR/SrProbeAction.cs | 40 +++++++++++++------ XenModel/Messages.Designer.cs | 13 +++++- XenModel/Messages.resx | 5 +++ XenModel/XenAPI-Extensions/SR.cs | 17 ++++++++ 6 files changed, 85 insertions(+), 34 deletions(-) diff --git a/XenAdmin/Dialogs/IscsiChoicesDialog.cs b/XenAdmin/Dialogs/IscsiChoicesDialog.cs index bd795a768..eaaa3f814 100644 --- a/XenAdmin/Dialogs/IscsiChoicesDialog.cs +++ b/XenAdmin/Dialogs/IscsiChoicesDialog.cs @@ -37,6 +37,7 @@ using System.Text; using System.Windows.Forms; using XenAdmin.Wizards.NewSRWizard_Pages; using XenAdmin.Network; +using XenAPI; namespace XenAdmin.Dialogs @@ -51,13 +52,16 @@ namespace XenAdmin.Dialogs /// public partial class IscsiChoicesDialog : XenDialogBase { - public IscsiChoicesDialog(IXenConnection connection, XenAPI.SR.SRInfo srInfo) + public IscsiChoicesDialog(IXenConnection connection, SR.SRInfo srInfo, SR.SRTypes existingSrType, SR.SRTypes requestedSrType) : base(connection) { InitializeComponent(); this.labelSRinfo.Text = String.Format(Messages.ISCSI_DIALOG_SR_DETAILS, Util.DiskSizeString(srInfo.Size), srInfo.UUID); + + this.labelMessage.Text = String.Format(Messages.EXISTING_SR_FOUND_ON_LUN, SR.getFriendlyTypeName(existingSrType), + SR.getFriendlyTypeName(requestedSrType)); } public IscsiChoicesDialog(IXenConnection connection, FibreChannelDevice dev) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs index 738b6ef57..bb2178738 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs @@ -142,7 +142,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return; } - Dictionary dconf = GetDeviceConfig(SR.SRTypes.lvmoiscsi); // TODO: use SRType + Dictionary dconf = GetDeviceConfig(SrType); if (dconf == null) { cancel = true; @@ -150,7 +150,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends } // Start probe - SrProbeAction IscsiProbeAction = new SrProbeAction(Connection, master, SR.SRTypes.lvmoiscsi, dconf); // TODO: use SRType + SrProbeAction IscsiProbeAction = new SrProbeAction(Connection, master, SrType, dconf); using (var dialog = new ActionProgressDialog(IscsiProbeAction, ProgressBarStyle.Marquee)) { dialog.ShowCancel = true; @@ -328,7 +328,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends { foreach (SR sr in connection.Cache.SRs) { - if (sr.GetSRType(false) != SR.SRTypes.lvmoiscsi) // TODO: use SRType + if (sr.GetSRType(false) != SR.SRTypes.lvmoiscsi && sr.GetSRType(false) != SR.SRTypes.gfs2) continue; if (sr.PBDs.Count < 1) @@ -355,10 +355,15 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends /// private bool UniquenessCheckMiami(IXenConnection connection, PBD pbd) { - if (!pbd.device_config.ContainsKey(SCSIID)) + String scsiID; + + if (pbd.device_config.ContainsKey(SCSIID)) + scsiID = pbd.device_config[SCSIID]; + else if (pbd.device_config.ContainsKey("ScsiId")) + scsiID = pbd.device_config["ScsiId"]; + else return false; - String scsiID = pbd.device_config[SCSIID]; String myLUN = getIscsiLUN(); if (!LunMap.ContainsKey(myLUN)) @@ -732,7 +737,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends try { - List SRs = SR.ParseSRListXML(action.Result); + List SRs = action.ProbeExtResult != null ? SR.ParseSRList(action.ProbeExtResult) : SR.ParseSRListXML(action.Result); if (!String.IsNullOrEmpty(SrWizardType.UUID)) { @@ -806,7 +811,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends // An SR exists on this LUN. Ask the user if they want to attach it, format it and // create a new SR, or cancel. DialogResult result = Program.RunInAutomatedTestMode ? DialogResult.Yes : - new IscsiChoicesDialog(Connection, info).ShowDialog(this); + new IscsiChoicesDialog(Connection, info, action.SrType, SrType).ShowDialog(this); switch (result) { @@ -854,18 +859,13 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (srType == SR.SRTypes.gfs2) { - // build the uri for gfs2 - var jsonUri = new JavaScriptSerializer().Serialize(new - { - provider = "iscsi", - ips = iqn.item.IpAddress, - port = iqn.item.Port.ToString(), - iqns = getIscsiIQN(), - ScsiId = LunMap[getIscsiLUN()].ScsiID, - chapuser = IScsiChapUserTextBox.Text, - chappassword = IScsiChapSecretTextBox.Text - }); - dconf[URI] = jsonUri; + dconf["provider"] = "iscsi"; + dconf["ips"] = iqn.item.IpAddress; + dconf["port"] = iqn.item.Port.ToString(); + dconf["iqns"] = getIscsiIQN(); + dconf["ScsiId"] = LunMap[getIscsiLUN()].ScsiID; + dconf["chapuser"] = IScsiChapUserTextBox.Text; + dconf["chappassword"] = IScsiChapSecretTextBox.Text; return dconf; } diff --git a/XenModel/Actions/SR/SrProbeAction.cs b/XenModel/Actions/SR/SrProbeAction.cs index 13dc7c1d1..2fc7f26b7 100644 --- a/XenModel/Actions/SR/SrProbeAction.cs +++ b/XenModel/Actions/SR/SrProbeAction.cs @@ -41,13 +41,15 @@ namespace XenAdmin.Actions public class SrProbeAction : PureAsyncAction { private readonly Host host; - private readonly SR.SRTypes srType; + public readonly SR.SRTypes SrType; private readonly Dictionary dconf; public const String DEVICE = "device"; public const String SCSIid = "SCSIid"; public const String PATH = "path"; public const String URI = "uri"; + public List ProbeExtResult; + private readonly Dictionary smconf; /// /// Won't appear in the program history (SuppressHistory == true). @@ -58,28 +60,32 @@ namespace XenAdmin.Actions : base(connection, string.Format(Messages.ACTION_SCANNING_SR_FROM, Helpers.GetName(connection)), null, true) { this.host = host; - this.srType = srType; + this.SrType = srType; this.dconf = dconf; switch (srType) { - case XenAPI.SR.SRTypes.nfs: + case SR.SRTypes.nfs: Description = string.Format(Messages.ACTION_SR_SCANNING, - XenAPI.SR.getFriendlyTypeName(srType), dconf["server"]); + SR.getFriendlyTypeName(srType), dconf["server"]); break; - case XenAPI.SR.SRTypes.lvmoiscsi: + case SR.SRTypes.lvmoiscsi: Description = string.Format(Messages.ACTION_SR_SCANNING, - XenAPI.SR.getFriendlyTypeName(srType), dconf["target"]); + SR.getFriendlyTypeName(srType), dconf["target"]); break; - case XenAPI.SR.SRTypes.lvmohba: - case XenAPI.SR.SRTypes.lvmofcoe: + case SR.SRTypes.lvmohba: + case SR.SRTypes.lvmofcoe: String device = dconf.ContainsKey(DEVICE) ? dconf[DEVICE] : dconf[SCSIid]; Description = string.Format(Messages.ACTION_SR_SCANNING, - XenAPI.SR.getFriendlyTypeName(srType), device); + SR.getFriendlyTypeName(srType), device); + break; + case SR.SRTypes.gfs2: + Description = string.Format(Messages.ACTION_SR_SCANNING, + SR.getFriendlyTypeName(srType), dconf["ips"]); break; default: Description = string.Format(Messages.ACTION_SR_SCANNING, - XenAPI.SR.getFriendlyTypeName(srType), Messages.REPAIRSR_SERVER); // this is a bit minging: CA-22111 + SR.getFriendlyTypeName(srType), Messages.REPAIRSR_SERVER); // this is a bit minging: CA-22111 break; } smconf = new Dictionary(); @@ -93,9 +99,17 @@ namespace XenAdmin.Actions protected override void Run() { - RelatedTask = XenAPI.SR.async_probe(this.Session, host.opaque_ref, - dconf, srType.ToString().ToLowerInvariant(), smconf); - PollToCompletion(); + if (SrType != SR.SRTypes.gfs2) + { + RelatedTask = SR.async_probe(this.Session, host.opaque_ref, + dconf, SrType.ToString().ToLowerInvariant(), smconf); + PollToCompletion(); + } + else + { + ProbeExtResult = SR.probe_ext(this.Session, host.opaque_ref, + dconf, SrType.ToString().ToLowerInvariant(), smconf); + } Description = Messages.ACTION_SR_SCAN_SUCCESSFUL; } } diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index ab56e1cb3..49e08169b 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -14664,6 +14664,17 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to An existing {0} SR was found on the selected LUN. Click Reattach to use the existing SR, or click Format to destroy any data present on the disk and create a new {1} SR. + /// + ///Warning: to prevent data loss you must ensure that the LUN is not in use by any other system, including [XenServer] hosts that are not connected to [XenCenter].. + /// + public static string EXISTING_SR_FOUND_ON_LUN { + get { + return ResourceManager.GetString("EXISTING_SR_FOUND_ON_LUN", resourceCulture); + } + } + /// /// Looks up a localized string similar to Exit &Maintenance Mode. /// @@ -36008,7 +36019,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to The virtual network device changes will take effect when you shutdown and then restart the VM. + /// Looks up a localized string similar to The virtual network device changes will take effect when you shutdown and then restart the VM.. /// public static string VIF_HOTPLUG_FAILED_MESSAGE { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 9401e8406..714aa37a9 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -5159,6 +5159,11 @@ Would you like to eject these ISOs before continuing? User canceled. Master needs to be upgraded first. + + An existing {0} SR was found on the selected LUN. Click Reattach to use the existing SR, or click Format to destroy any data present on the disk and create a new {1} SR. + +Warning: to prevent data loss you must ensure that the LUN is not in use by any other system, including [XenServer] hosts that are not connected to [XenCenter]. + Exit &Maintenance Mode diff --git a/XenModel/XenAPI-Extensions/SR.cs b/XenModel/XenAPI-Extensions/SR.cs index d6b4800b6..6ce8535d8 100644 --- a/XenModel/XenAPI-Extensions/SR.cs +++ b/XenModel/XenAPI-Extensions/SR.cs @@ -475,6 +475,23 @@ namespace XenAPI return sm != null && -1 != Array.IndexOf(sm.capabilities, "VDI_CREATE"); } + public static List ParseSRList(List probeExtResult) + { + List results = new List(); + foreach (var probeResult in probeExtResult.Where(p => p.sr != null)) + { + string uuid = probeResult.sr.uuid; + long size = probeResult.sr.total_space; + string aggr = ""; + string name_label = probeResult.sr.name_label; + string name_description = probeResult.sr.name_description; + bool pool_metadata_detected = false; + + results.Add(new SRInfo(uuid, size, aggr, name_label, name_description, pool_metadata_detected)); + } + return results; + } + /// /// Parses an XML list of SRs (as returned by the SR.probe() call) into a list of SRInfos. /// From d3fa68e210d64d0f36690578b68555cd652a12e3 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Fri, 23 Mar 2018 11:56:54 +0000 Subject: [PATCH 03/18] CA-286582: Hide the Provisioning method page if the feature is not present or disabled Signed-off-by: Mihaela Stoica --- XenAdmin/Wizards/NewSRWizard.cs | 6 ++++-- .../NewSRWizard_Pages/Frontends/LVMoFCoE.cs | 1 + .../NewSRWizard_Pages/Frontends/LVMoHBA.cs | 1 + .../NewSRWizard_Pages/Frontends/LVMoISCSI.cs | 1 + XenModel/Network/Cache.cs | 6 ++++++ XenModel/Network/ICache.cs | 1 + XenModel/XenAPI-Extensions/Host.cs | 15 +++++++++++++++ 7 files changed, 29 insertions(+), 2 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard.cs b/XenAdmin/Wizards/NewSRWizard.cs index df49f42f8..79fcf3bc6 100644 --- a/XenAdmin/Wizards/NewSRWizard.cs +++ b/XenAdmin/Wizards/NewSRWizard.cs @@ -284,12 +284,14 @@ namespace XenAdmin.Wizards AddPage(xenTabPageVhdoNFS); else if (m_srWizardType is SrWizardType_Iscsi) { - AddPage(xenTabPageChooseSrProv); + if (Helpers.KolkataOrGreater(xenConnection) && !Helpers.FeatureForbidden(xenConnection, Host.CorosyncDisabled)) + AddPage(xenTabPageChooseSrProv); AddPage(xenTabPageLvmoIscsi); } else if (m_srWizardType is SrWizardType_Hba) { - AddPage(xenTabPageChooseSrProv); + if (Helpers.KolkataOrGreater(xenConnection) && !Helpers.FeatureForbidden(xenConnection, Host.CorosyncDisabled)) + AddPage(xenTabPageChooseSrProv); AddPage(xenTabPageLvmoHba); AddPage(xenTabPageLvmoHbaSummary); } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs index ae68432d8..239f72583 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs @@ -38,6 +38,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends public LVMoFCoE() { InitializeComponent(); + SrType = SR.SRTypes.lvmofcoe; } #region LVMoHBA overrides diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs index c27512de5..6c0243f96 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs @@ -54,6 +54,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends public LVMoHBA() { InitializeComponent(); + SrType = SR.SRTypes.lvmohba; } public virtual SR.SRTypes SrType { get; set; } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs index bb2178738..ff5aa863d 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs @@ -107,6 +107,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends public LVMoISCSI() { InitializeComponent(); + SrType = SR.SRTypes.lvmoiscsi; } #region XentabPage overrides diff --git a/XenModel/Network/Cache.cs b/XenModel/Network/Cache.cs index ba875b706..ae2c6f131 100755 --- a/XenModel/Network/Cache.cs +++ b/XenModel/Network/Cache.cs @@ -52,6 +52,7 @@ namespace XenAdmin.Network private readonly ChangeableDictionary, Cluster> _cluster = new ChangeableDictionary, Cluster>(); private readonly ChangeableDictionary, Cluster_host> _cluster_host = new ChangeableDictionary, Cluster_host>(); private readonly ChangeableDictionary, XenAPI.Console> _console = new ChangeableDictionary, XenAPI.Console>(); + private readonly ChangeableDictionary, Feature> _feature = new ChangeableDictionary, Feature>(); private readonly ChangeableDictionary, Folder> _folders = new ChangeableDictionary, Folder>(); private readonly ChangeableDictionary, DockerContainer> _dockerContainers = new ChangeableDictionary, DockerContainer>(); @@ -141,6 +142,11 @@ namespace XenAdmin.Network get { return contents(_cluster_host); } } + public Feature[] Features + { + get { return contents(_feature); } + } + public Folder[] Folders { get { return contents(_folders); } diff --git a/XenModel/Network/ICache.cs b/XenModel/Network/ICache.cs index b821be2a8..9f4e35b48 100644 --- a/XenModel/Network/ICache.cs +++ b/XenModel/Network/ICache.cs @@ -91,5 +91,6 @@ namespace XenAdmin.Network void CheckDockerContainersBatchChange(); Cluster[] Clusters { get; } Cluster_host[] Cluster_hosts { get; } + Feature[] Features { get; } } } diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index 4856ab1c5..57d7c468d 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -439,6 +439,21 @@ namespace XenAPI { return BoolKeyPreferTrue(h.license_params, "restrict_corosync"); } + + public static bool CorosyncDisabled(Host h) + { + return RestrictCorosync(h) && FeatureDisabled(h, "corosync"); + } + + public static bool FeatureDisabled(Host h, string featureName) + { + foreach (var feature in h.Connection.ResolveAll(h.features)) + { + if (feature.name_label.Equals(featureName, StringComparison.OrdinalIgnoreCase)) + return !feature.enabled; + } + return false; + } public bool HasPBDTo(SR sr) { From 6ad6b4efc75e592a33b8c3b0ba3315490273985e Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Wed, 28 Mar 2018 12:01:53 +0100 Subject: [PATCH 04/18] CP-17099: Use SR.probe_ext for GFS2 over iSCSI to populate the lists of IQNs and LUNs on the New SR wizard Signed-off-by: Mihaela Stoica --- .../NewSRWizard_Pages/Frontends/LVMoISCSI.cs | 12 +-- .../Actions/SR/ISCSIPopulateIQNsAction.cs | 73 ++++++++++++++++--- .../Actions/SR/ISCSIPopulateLunsAction.cs | 72 ++++++++++++++++-- 3 files changed, 132 insertions(+), 25 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs index ff5aa863d..161662f1f 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs @@ -473,12 +473,12 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (IscsiUseChapCheckBox.Checked) { IscsiPopulateIqnsAction = new ISCSIPopulateIQNsAction(Connection, - getIscsiHost(), getIscsiPort(), IScsiChapUserTextBox.Text, IScsiChapSecretTextBox.Text); + getIscsiHost(), getIscsiPort(), IScsiChapUserTextBox.Text, IScsiChapSecretTextBox.Text, SrType); } else { IscsiPopulateIqnsAction = new ISCSIPopulateIQNsAction(Connection, - getIscsiHost(), getIscsiPort(), null, null); + getIscsiHost(), getIscsiPort(), null, null, SrType); } IscsiPopulateIqnsAction.Completed += IscsiPopulateIqnsAction_Completed; @@ -601,13 +601,13 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (IscsiUseChapCheckBox.Checked) { - IscsiPopulateLunsAction = new Actions.ISCSIPopulateLunsAction(Connection, - getIscsiHost(), getIscsiPort(), getIscsiIQN(), IScsiChapUserTextBox.Text, IScsiChapSecretTextBox.Text); + IscsiPopulateLunsAction = new ISCSIPopulateLunsAction(Connection, + getIscsiHost(), getIscsiPort(), getIscsiIQN(), IScsiChapUserTextBox.Text, IScsiChapSecretTextBox.Text, SrType); } else { - IscsiPopulateLunsAction = new Actions.ISCSIPopulateLunsAction(Connection, - getIscsiHost(), getIscsiPort(), getIscsiIQN(), null, null); + IscsiPopulateLunsAction = new ISCSIPopulateLunsAction(Connection, + getIscsiHost(), getIscsiPort(), getIscsiIQN(), null, null, SrType); } IscsiPopulateLunsAction.Completed += IscsiPopulateLunsAction_Completed; diff --git a/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs b/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs index e0c4eed93..d1187874d 100644 --- a/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs +++ b/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs @@ -38,6 +38,7 @@ using XenAdmin.Core; using XenAdmin.Network; using XenAPI; using System.Globalization; +using System.Web.Script.Serialization; using XenCenterLib; namespace XenAdmin.Actions @@ -51,6 +52,7 @@ namespace XenAdmin.Actions private readonly UInt16 targetPort; private readonly string chapUsername; private readonly string chapPassword; + private readonly SR.SRTypes srType; private IScsiIqnInfo[] _iqns; /// @@ -65,13 +67,14 @@ namespace XenAdmin.Actions } public ISCSIPopulateIQNsAction(IXenConnection connection, string targetHost, - UInt16 targetPort, string chapUsername, string chapPassword) + UInt16 targetPort, string chapUsername, string chapPassword, SR.SRTypes srType = SR.SRTypes.lvmoiscsi) : base(connection, string.Format(Messages.ACTION_ISCSI_IQN_SCANNING, targetHost), null, true) { this.targetHost = targetHost; this.targetPort = targetPort; this.chapUsername = chapUsername; this.chapPassword = chapPassword; + this.srType = srType; } public class NoIQNsFoundException : Exception @@ -116,28 +119,34 @@ namespace XenAdmin.Actions if (pool == null) throw new Failure(Failure.INTERNAL_ERROR, Messages.POOL_GONE); + if (srType == SR.SRTypes.gfs2) + { + DoProbeExt(pool.master); + return; + } + Dictionary settings = new Dictionary(); settings["target"] = targetHost; settings["port"] = targetPort.ToString(CultureInfo.InvariantCulture); - if (!string.IsNullOrEmpty(this.chapUsername)) + if (!string.IsNullOrEmpty(chapUsername)) { - settings["chapuser"] = this.chapUsername; - settings["chappassword"] = this.chapPassword; + settings["chapuser"] = chapUsername; + settings["chappassword"] = chapPassword; } - + try { // Perform a create with some missing params: should fail with the error // containing the list of SRs on the filer. - RelatedTask = XenAPI.SR.async_create(Session, pool.master, + RelatedTask = SR.async_create(Session, pool.master, settings, 0, Helpers.GuiTempObjectPrefix, Messages.ISCSI_SHOULD_NO_BE_CREATED, - XenAPI.SR.SRTypes.lvmoiscsi.ToString(), "user", true, new Dictionary()); + srType.ToString(), "user", true, new Dictionary()); this.PollToCompletion(); // Create should always fail and never get here throw new InvalidOperationException(Messages.ISCSI_FAIL); } - catch (XenAPI.Failure exn) + catch (Failure exn) { if (exn.ErrorDescription.Count < 1) throw new BadServerResponse(targetHost); @@ -156,7 +165,7 @@ namespace XenAdmin.Actions List results = new List(); try { - doc.LoadXml(exn.ErrorDescription[3].ToString()); + doc.LoadXml(exn.ErrorDescription[3]); foreach (XmlNode targetListNode in doc.GetElementsByTagName("iscsi-target-iqns")) { foreach (XmlNode targetNode in targetListNode.ChildNodes) @@ -170,7 +179,7 @@ namespace XenAdmin.Actions { if (infoNode.Name.ToLowerInvariant() == "index") { - index = int.Parse(infoNode.InnerText, System.Globalization.CultureInfo.InvariantCulture); + index = int.Parse(infoNode.InnerText, CultureInfo.InvariantCulture); } else if (infoNode.Name.ToLowerInvariant() == "ipaddress") { @@ -179,7 +188,7 @@ namespace XenAdmin.Actions } else if (infoNode.Name.ToLowerInvariant() == "port") { - port = UInt16.Parse(infoNode.InnerText, System.Globalization.CultureInfo.InvariantCulture); + port = UInt16.Parse(infoNode.InnerText, CultureInfo.InvariantCulture); } else if (infoNode.Name.ToLowerInvariant() == "targetiqn") { @@ -201,6 +210,48 @@ namespace XenAdmin.Actions throw new NoIQNsFoundException(targetHost); } } + + private void DoProbeExt(XenRef host) + { + var deviceConfig = new Dictionary(); + deviceConfig["provider"] = "iscsi"; + deviceConfig["ips"] = targetHost; + deviceConfig["port"] = targetPort.ToString(CultureInfo.InvariantCulture); + if (!string.IsNullOrEmpty(chapUsername)) + { + deviceConfig["chapuser"] = chapUsername; + deviceConfig["chappassword"] = chapPassword; + } + + var probeResults = SR.probe_ext(Session, host.opaque_ref, + deviceConfig, srType.ToString().ToLowerInvariant(), new Dictionary()); + + var results = new List(); + try + { + var index = -1; + foreach (var probeResult in probeResults) + { + index++; + var address = probeResult.configuration.ContainsKey("ips") ? probeResult.configuration["ips"] : ""; + UInt16 port; + if (!probeResult.configuration.ContainsKey("port") || !UInt16.TryParse(probeResult.configuration["port"], out port)) + port = Util.DEFAULT_ISCSI_PORT; + var targetIQN = probeResult.configuration.ContainsKey("iqns") ? probeResult.configuration["iqns"] : ""; + + results.Add(new IScsiIqnInfo(index, targetIQN, address, port)); + } + results.Sort(); + _iqns = results.ToArray(); + } + catch + { + throw new BadServerResponse(targetHost); + } + + if (_iqns.Length < 1) + throw new NoIQNsFoundException(targetHost); + } } public struct IScsiIqnInfo : IComparable, IEquatable diff --git a/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs b/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs index 830376630..b9d05074c 100644 --- a/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs +++ b/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs @@ -31,6 +31,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Text; using System.Threading; using System.Xml; @@ -52,6 +53,7 @@ namespace XenAdmin.Actions private readonly string targetIQN; private readonly string chapUsername; private readonly string chapPassword; + private readonly SR.SRTypes srType; private ISCSIInfo[] _luns; /// @@ -66,7 +68,7 @@ namespace XenAdmin.Actions } public ISCSIPopulateLunsAction(IXenConnection connection, string targetHost, - UInt16 targetPort, string targetIQN, string chapUsername, string chapPassword) + UInt16 targetPort, string targetIQN, string chapUsername, string chapPassword, SR.SRTypes srType = SR.SRTypes.lvmoiscsi) : base(connection, string.Format(Messages.ACTION_ISCSI_LUN_SCANNING, targetHost)) { this.targetHost = targetHost; @@ -74,6 +76,7 @@ namespace XenAdmin.Actions this.targetIQN = targetIQN; this.chapUsername = chapUsername; this.chapPassword = chapPassword; + this.srType = srType; } public class NoLUNsFoundException : Exception @@ -98,11 +101,18 @@ namespace XenAdmin.Actions { Pool pool = Helpers.GetPoolOfOne(Connection); if (pool == null) - throw new XenAPI.Failure(XenAPI.Failure.INTERNAL_ERROR, Messages.POOL_GONE); + throw new Failure(Failure.INTERNAL_ERROR, Messages.POOL_GONE); + + if (srType == SR.SRTypes.gfs2) + { + DoProbeExt(pool.master); + return; + } Dictionary settings = new Dictionary(); + settings["target"] = targetHost; - settings["port"] = targetPort.ToString(System.Globalization.CultureInfo.InvariantCulture); + settings["port"] = targetPort.ToString(CultureInfo.InvariantCulture); settings["targetIQN"] = targetIQN; if (!string.IsNullOrEmpty(this.chapUsername)) { @@ -112,13 +122,13 @@ namespace XenAdmin.Actions try { - RelatedTask = XenAPI.SR.async_create(Session, pool.master, settings, 0, + RelatedTask = SR.async_create(Session, pool.master, settings, 0, Helpers.GuiTempObjectPrefix, Messages.ISCSI_SHOULD_NO_BE_CREATED, - XenAPI.SR.SRTypes.lvmoiscsi.ToString(), "user", true, new Dictionary()); + srType.ToString(), "user", true, new Dictionary()); this.PollToCompletion(); throw new InvalidOperationException(Messages.ISCSI_FAIL); } - catch (XenAPI.Failure exn) + catch (Failure exn) { if (exn.ErrorDescription.Count < 1) throw new BadServerResponse(targetHost); @@ -138,7 +148,7 @@ namespace XenAdmin.Actions { List results = new List(); XmlDocument doc = new XmlDocument(); - doc.LoadXml(exn.ErrorDescription[3].ToString()); + doc.LoadXml(exn.ErrorDescription[3]); foreach (XmlNode target_node in doc.GetElementsByTagName("iscsi-target")) { foreach (XmlNode lun_node in target_node.ChildNodes) @@ -152,7 +162,7 @@ namespace XenAdmin.Actions { if (n.Name.ToLowerInvariant() == "lunid") { - lunid = int.Parse(n.InnerText.Trim(), System.Globalization.CultureInfo.InvariantCulture); + lunid = int.Parse(n.InnerText.Trim(), CultureInfo.InvariantCulture); } else if (n.Name.ToLowerInvariant() == "vendor") { @@ -186,6 +196,52 @@ namespace XenAdmin.Actions throw new NoLUNsFoundException(targetHost); } } + + private void DoProbeExt(XenRef host) + { + var deviceConfig = new Dictionary(); + deviceConfig["provider"] = "iscsi"; + deviceConfig["ips"] = targetHost; + deviceConfig["port"] = targetPort.ToString(CultureInfo.InvariantCulture); + deviceConfig["iqns"] = targetIQN; + if (!string.IsNullOrEmpty(chapUsername)) + { + deviceConfig["chapuser"] = chapUsername; + deviceConfig["chappassword"] = chapPassword; + } + + var probeResults = SR.probe_ext(Session, host.opaque_ref, + deviceConfig, srType.ToString().ToLowerInvariant(), new Dictionary()); + + var results = new List(); + try + { + foreach (var probeResult in probeResults) + { + int lunid; + if (!probeResult.extra_info.ContainsKey("LUNid") || !int.TryParse(probeResult.extra_info["LUNid"], out lunid)) + lunid = -1; + var vendor = probeResult.extra_info.ContainsKey("vendor") ? probeResult.extra_info["vendor"] : ""; + var serial = probeResult.extra_info.ContainsKey("serial") ? probeResult.extra_info["serial"] : ""; + long size; + if (!probeResult.extra_info.ContainsKey("size") || !long.TryParse(probeResult.extra_info["size"], out size)) + size = -1; + var scsiid = probeResult.configuration.ContainsKey("ScsiId") ? probeResult.configuration["ScsiId"] : ""; + + results.Add(new ISCSIInfo(scsiid, lunid, vendor, serial, size)); + + } + results.Sort(); + _luns = results.ToArray(); + } + catch + { + throw new BadServerResponse(targetHost); + } + + if (_luns.Length < 1) + throw new NoLUNsFoundException(targetHost); + } } public struct ISCSIInfo : IComparable From fcb63995355801c4b55abf1c265706e9d0d76932 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Wed, 28 Mar 2018 16:17:08 +0100 Subject: [PATCH 05/18] CP-17099: Changes following code review Signed-off-by: Mihaela Stoica --- .../NewSRWizard_Pages/Frontends/LVMoHBA.cs | 2 +- .../NewSRWizard_Pages/Frontends/LVMoISCSI.cs | 32 +++---- .../Actions/SR/ISCSIPopulateIQNsAction.cs | 73 ++++++++-------- .../Actions/SR/ISCSIPopulateLunsAction.cs | 84 +++++++++---------- 4 files changed, 86 insertions(+), 105 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs index 6c0243f96..906891636 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs @@ -57,7 +57,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends SrType = SR.SRTypes.lvmohba; } - public virtual SR.SRTypes SrType { get; set; } + public SR.SRTypes SrType { get; set; } public virtual bool ShowNicColumn { get { return false; } } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs index 161662f1f..2e7d80c4b 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs @@ -470,17 +470,13 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends UpdateButtons(); - if (IscsiUseChapCheckBox.Checked) - { - IscsiPopulateIqnsAction = new ISCSIPopulateIQNsAction(Connection, - getIscsiHost(), getIscsiPort(), IScsiChapUserTextBox.Text, IScsiChapSecretTextBox.Text, SrType); - } - else - { - IscsiPopulateIqnsAction = new ISCSIPopulateIQNsAction(Connection, - getIscsiHost(), getIscsiPort(), null, null, SrType); - } + var chapUser = IscsiUseChapCheckBox.Checked ? IScsiChapUserTextBox.Text : null; + var chapPwd = IscsiUseChapCheckBox.Checked ? IScsiChapSecretTextBox.Text : null; + IscsiPopulateIqnsAction = SrType == SR.SRTypes.gfs2 + ? new Gfs2PopulateIQNsAction(Connection, getIscsiHost(), getIscsiPort(), chapUser, chapPwd) + : new ISCSIPopulateIQNsAction(Connection, getIscsiHost(), getIscsiPort(), chapUser, chapPwd); + IscsiPopulateIqnsAction.Completed += IscsiPopulateIqnsAction_Completed; controlDisabler.Reset(); @@ -599,17 +595,13 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends comboBoxIscsiLuns.Items.Clear(); LunMap.Clear(); - if (IscsiUseChapCheckBox.Checked) - { - IscsiPopulateLunsAction = new ISCSIPopulateLunsAction(Connection, - getIscsiHost(), getIscsiPort(), getIscsiIQN(), IScsiChapUserTextBox.Text, IScsiChapSecretTextBox.Text, SrType); - } - else - { - IscsiPopulateLunsAction = new ISCSIPopulateLunsAction(Connection, - getIscsiHost(), getIscsiPort(), getIscsiIQN(), null, null, SrType); - } + var chapUser = IscsiUseChapCheckBox.Checked ? IScsiChapUserTextBox.Text : null; + var chapPwd = IscsiUseChapCheckBox.Checked ? IScsiChapSecretTextBox.Text : null; + IscsiPopulateLunsAction = SrType == SR.SRTypes.gfs2 + ? new Gfs2PopulateLunsAction(Connection, getIscsiHost(), getIscsiPort(), getIscsiIQN(), chapUser, chapPwd) + : new ISCSIPopulateLunsAction(Connection, getIscsiHost(), getIscsiPort(), getIscsiIQN(), chapUser, chapPwd); + IscsiPopulateLunsAction.Completed += IscsiPopulateLunsAction_Completed; controlDisabler.Reset(); diff --git a/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs b/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs index d1187874d..622b3a952 100644 --- a/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs +++ b/XenModel/Actions/SR/ISCSIPopulateIQNsAction.cs @@ -38,7 +38,6 @@ using XenAdmin.Core; using XenAdmin.Network; using XenAPI; using System.Globalization; -using System.Web.Script.Serialization; using XenCenterLib; namespace XenAdmin.Actions @@ -48,13 +47,12 @@ namespace XenAdmin.Actions /// public class ISCSIPopulateIQNsAction : AsyncAction { - private readonly string targetHost; - private readonly UInt16 targetPort; - private readonly string chapUsername; - private readonly string chapPassword; - private readonly SR.SRTypes srType; + protected readonly string targetHost; + protected readonly UInt16 targetPort; + protected readonly string chapUsername; + protected readonly string chapPassword; - private IScsiIqnInfo[] _iqns; + protected IScsiIqnInfo[] _iqns; /// /// Will be null if the scan has not yet successfully returned. /// @@ -67,14 +65,13 @@ namespace XenAdmin.Actions } public ISCSIPopulateIQNsAction(IXenConnection connection, string targetHost, - UInt16 targetPort, string chapUsername, string chapPassword, SR.SRTypes srType = SR.SRTypes.lvmoiscsi) + UInt16 targetPort, string chapUsername, string chapPassword) : base(connection, string.Format(Messages.ACTION_ISCSI_IQN_SCANNING, targetHost), null, true) { this.targetHost = targetHost; this.targetPort = targetPort; this.chapUsername = chapUsername; this.chapPassword = chapPassword; - this.srType = srType; } public class NoIQNsFoundException : Exception @@ -119,12 +116,6 @@ namespace XenAdmin.Actions if (pool == null) throw new Failure(Failure.INTERNAL_ERROR, Messages.POOL_GONE); - if (srType == SR.SRTypes.gfs2) - { - DoProbeExt(pool.master); - return; - } - Dictionary settings = new Dictionary(); settings["target"] = targetHost; settings["port"] = targetPort.ToString(CultureInfo.InvariantCulture); @@ -140,7 +131,7 @@ namespace XenAdmin.Actions // containing the list of SRs on the filer. RelatedTask = SR.async_create(Session, pool.master, settings, 0, Helpers.GuiTempObjectPrefix, Messages.ISCSI_SHOULD_NO_BE_CREATED, - srType.ToString(), "user", true, new Dictionary()); + SR.SRTypes.lvmoiscsi.ToString(), "user", true, new Dictionary()); this.PollToCompletion(); // Create should always fail and never get here @@ -210,9 +201,20 @@ namespace XenAdmin.Actions throw new NoIQNsFoundException(targetHost); } } + } - private void DoProbeExt(XenRef host) + public class Gfs2PopulateIQNsAction : ISCSIPopulateIQNsAction + { + public Gfs2PopulateIQNsAction(IXenConnection connection, string targetHost, + UInt16 targetPort, string chapUsername, string chapPassword) + : base(connection, targetHost, targetPort, chapUsername, chapPassword) + { } + + protected override void Run() { + Pool pool = Helpers.GetPoolOfOne(Connection); + if (pool == null) + throw new Failure(Failure.INTERNAL_ERROR, Messages.POOL_GONE); var deviceConfig = new Dictionary(); deviceConfig["provider"] = "iscsi"; deviceConfig["ips"] = targetHost; @@ -222,38 +224,31 @@ namespace XenAdmin.Actions deviceConfig["chapuser"] = chapUsername; deviceConfig["chappassword"] = chapPassword; } - - var probeResults = SR.probe_ext(Session, host.opaque_ref, - deviceConfig, srType.ToString().ToLowerInvariant(), new Dictionary()); + + var probeResults = SR.probe_ext(Session, pool.master.opaque_ref, + deviceConfig, SR.SRTypes.gfs2.ToString(), new Dictionary()); var results = new List(); - try + var index = -1; + foreach (var probeResult in probeResults) { - var index = -1; - foreach (var probeResult in probeResults) - { - index++; - var address = probeResult.configuration.ContainsKey("ips") ? probeResult.configuration["ips"] : ""; - UInt16 port; - if (!probeResult.configuration.ContainsKey("port") || !UInt16.TryParse(probeResult.configuration["port"], out port)) - port = Util.DEFAULT_ISCSI_PORT; - var targetIQN = probeResult.configuration.ContainsKey("iqns") ? probeResult.configuration["iqns"] : ""; + index++; + var address = probeResult.configuration.ContainsKey("ips") ? probeResult.configuration["ips"] : ""; + UInt16 port; + if (!probeResult.configuration.ContainsKey("port") || !UInt16.TryParse(probeResult.configuration["port"], out port)) + port = Util.DEFAULT_ISCSI_PORT; + var targetIQN = probeResult.configuration.ContainsKey("iqns") ? probeResult.configuration["iqns"] : ""; - results.Add(new IScsiIqnInfo(index, targetIQN, address, port)); - } - results.Sort(); - _iqns = results.ToArray(); - } - catch - { - throw new BadServerResponse(targetHost); + results.Add(new IScsiIqnInfo(index, targetIQN, address, port)); } + results.Sort(); + _iqns = results.ToArray(); if (_iqns.Length < 1) throw new NoIQNsFoundException(targetHost); } } - + public struct IScsiIqnInfo : IComparable, IEquatable { public readonly int Index; diff --git a/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs b/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs index b9d05074c..5a7b92e3e 100644 --- a/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs +++ b/XenModel/Actions/SR/ISCSIPopulateLunsAction.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Text; -using System.Threading; using System.Xml; using XenAdmin.Core; @@ -48,14 +46,13 @@ namespace XenAdmin.Actions /// public class ISCSIPopulateLunsAction : AsyncAction { - private readonly string targetHost; - private readonly UInt16 targetPort; - private readonly string targetIQN; - private readonly string chapUsername; - private readonly string chapPassword; - private readonly SR.SRTypes srType; + protected readonly string targetHost; + protected readonly UInt16 targetPort; + protected readonly string targetIQN; + protected readonly string chapUsername; + protected readonly string chapPassword; - private ISCSIInfo[] _luns; + protected ISCSIInfo[] _luns; /// /// Will be null if the scan has not yet successfully returned. /// @@ -68,7 +65,7 @@ namespace XenAdmin.Actions } public ISCSIPopulateLunsAction(IXenConnection connection, string targetHost, - UInt16 targetPort, string targetIQN, string chapUsername, string chapPassword, SR.SRTypes srType = SR.SRTypes.lvmoiscsi) + UInt16 targetPort, string targetIQN, string chapUsername, string chapPassword) : base(connection, string.Format(Messages.ACTION_ISCSI_LUN_SCANNING, targetHost)) { this.targetHost = targetHost; @@ -76,7 +73,6 @@ namespace XenAdmin.Actions this.targetIQN = targetIQN; this.chapUsername = chapUsername; this.chapPassword = chapPassword; - this.srType = srType; } public class NoLUNsFoundException : Exception @@ -103,12 +99,6 @@ namespace XenAdmin.Actions if (pool == null) throw new Failure(Failure.INTERNAL_ERROR, Messages.POOL_GONE); - if (srType == SR.SRTypes.gfs2) - { - DoProbeExt(pool.master); - return; - } - Dictionary settings = new Dictionary(); settings["target"] = targetHost; @@ -123,8 +113,8 @@ namespace XenAdmin.Actions try { RelatedTask = SR.async_create(Session, pool.master, settings, 0, - Helpers.GuiTempObjectPrefix, Messages.ISCSI_SHOULD_NO_BE_CREATED, - srType.ToString(), "user", true, new Dictionary()); + Helpers.GuiTempObjectPrefix, Messages.ISCSI_SHOULD_NO_BE_CREATED, + SR.SRTypes.lvmoiscsi.ToString(), "user", true, new Dictionary()); this.PollToCompletion(); throw new InvalidOperationException(Messages.ISCSI_FAIL); } @@ -196,9 +186,21 @@ namespace XenAdmin.Actions throw new NoLUNsFoundException(targetHost); } } - - private void DoProbeExt(XenRef host) + } + + public class Gfs2PopulateLunsAction : ISCSIPopulateLunsAction + { + public Gfs2PopulateLunsAction(IXenConnection connection, string targetHost, + UInt16 targetPort, string targetIQN, string chapUsername, string chapPassword) + : base(connection, targetHost, targetPort, targetIQN, chapUsername, chapPassword) + { } + + protected override void Run() { + Pool pool = Helpers.GetPoolOfOne(Connection); + if (pool == null) + throw new Failure(Failure.INTERNAL_ERROR, Messages.POOL_GONE); + var deviceConfig = new Dictionary(); deviceConfig["provider"] = "iscsi"; deviceConfig["ips"] = targetHost; @@ -209,35 +211,27 @@ namespace XenAdmin.Actions deviceConfig["chapuser"] = chapUsername; deviceConfig["chappassword"] = chapPassword; } - - var probeResults = SR.probe_ext(Session, host.opaque_ref, - deviceConfig, srType.ToString().ToLowerInvariant(), new Dictionary()); + + var probeResults = SR.probe_ext(Session, pool.master.opaque_ref, + deviceConfig, SR.SRTypes.gfs2.ToString().ToLowerInvariant(), new Dictionary()); var results = new List(); - try + foreach (var probeResult in probeResults) { - foreach (var probeResult in probeResults) - { - int lunid; - if (!probeResult.extra_info.ContainsKey("LUNid") || !int.TryParse(probeResult.extra_info["LUNid"], out lunid)) - lunid = -1; - var vendor = probeResult.extra_info.ContainsKey("vendor") ? probeResult.extra_info["vendor"] : ""; - var serial = probeResult.extra_info.ContainsKey("serial") ? probeResult.extra_info["serial"] : ""; - long size; - if (!probeResult.extra_info.ContainsKey("size") || !long.TryParse(probeResult.extra_info["size"], out size)) - size = -1; - var scsiid = probeResult.configuration.ContainsKey("ScsiId") ? probeResult.configuration["ScsiId"] : ""; + int lunid; + if (!probeResult.extra_info.ContainsKey("LUNid") || !int.TryParse(probeResult.extra_info["LUNid"], out lunid)) + lunid = -1; + var vendor = probeResult.extra_info.ContainsKey("vendor") ? probeResult.extra_info["vendor"] : ""; + var serial = probeResult.extra_info.ContainsKey("serial") ? probeResult.extra_info["serial"] : ""; + long size; + if (!probeResult.extra_info.ContainsKey("size") || !long.TryParse(probeResult.extra_info["size"], out size)) + size = -1; + var scsiid = probeResult.configuration.ContainsKey("ScsiId") ? probeResult.configuration["ScsiId"] : ""; - results.Add(new ISCSIInfo(scsiid, lunid, vendor, serial, size)); - - } - results.Sort(); - _luns = results.ToArray(); - } - catch - { - throw new BadServerResponse(targetHost); + results.Add(new ISCSIInfo(scsiid, lunid, vendor, serial, size)); } + results.Sort(); + _luns = results.ToArray(); if (_luns.Length < 1) throw new NoLUNsFoundException(targetHost); From e294e903fd6d3a007ae0f4269a84135f5229bdda Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Thu, 29 Mar 2018 10:04:22 +0100 Subject: [PATCH 06/18] CP-17099: Do the double probe for iSCSI When we scan the LUN to see if there are any existing SRs, we need to do an additional probe if the probe for the desired type didn't find any SRs. E.g. if GFS2 is selected and no GFS2 SR was found on the LUN, then we need to also check if there is a LVM over iSCSI SR, and if there is one we will offer to reattach it (as LVM over iSCSI) or format it as GFS2 Signed-off-by: Mihaela Stoica --- .../NewSRWizard_Pages/Frontends/LVMoISCSI.cs | 126 +++++++++++++----- 1 file changed, 91 insertions(+), 35 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs index 2e7d80c4b..393804692 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs @@ -150,17 +150,91 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return; } + List srs; + // Start probe SrProbeAction IscsiProbeAction = new SrProbeAction(Connection, master, SrType, dconf); - using (var dialog = new ActionProgressDialog(IscsiProbeAction, ProgressBarStyle.Marquee)) + bool success = RunProbe(IscsiProbeAction, out srs); + + if (!success) + { + cancel = iscsiProbeError = true; + return; + } + + var performSecondProbe = Helpers.KolkataOrGreater(Connection) && + !Helpers.FeatureForbidden(Connection, Host.CorosyncDisabled); + if (performSecondProbe && srs.Count == 0) + { + // Start second probe + var secondSrType = SrType == SR.SRTypes.gfs2 ? SR.SRTypes.lvmoiscsi : SR.SRTypes.gfs2; + dconf = GetDeviceConfig(secondSrType); + IscsiProbeAction = new SrProbeAction(Connection, master, secondSrType, dconf); + success = RunProbe(IscsiProbeAction, out srs); + + if (!success) + { + cancel = iscsiProbeError = true; + return; + } + } + + // Probe has been performed. Now ask the user if they want to Reattach/Format/Cancel. + // Will return false on cancel + cancel = iscsiProbeError = !ExamineIscsiProbeResults(IscsiProbeAction, srs); + } + + private bool RunProbe(SrProbeAction action, out List srs) + { + using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) { dialog.ShowCancel = true; dialog.ShowDialog(this); } - // Probe has been performed. Now ask the user if they want to Reattach/Format/Cancel. - // Will return false on cancel - cancel = !ExamineIscsiProbeResults(IscsiProbeAction); - iscsiProbeError = cancel; + + srs = null; + _srToIntroduce = null; + if (action.Succeeded) + { + try + { + srs = action.ProbeExtResult != null ? SR.ParseSRList(action.ProbeExtResult) : SR.ParseSRListXML(action.Result); + return true; + } + catch (Exception) + { + return false; + } + } + + DoOnProbeFailure(action); + return false; + } + + private void DoOnProbeFailure(SrProbeAction action) + { + if (action.Succeeded) + return; + + Exception exn = action.Exception; + log.Warn(exn, exn); + Failure failure = exn as Failure; + if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140") + { + errorIconAtHostOrIP.Visible = true; + errorLabelAtHostname.Visible = true; + errorLabelAtHostname.Text = Messages.INVALID_HOST; + textBoxIscsiHost.Focus(); + } + else if (failure != null) + { + errorIconAtHostOrIP.Visible = true; + errorLabelAtHostname.Visible = true; + errorLabelAtHostname.Text = failure.ErrorDescription.Count > 2 + ? failure.ErrorDescription[2] + : failure.ErrorDescription[0]; + textBoxIscsiHost.Focus(); + } } bool iscsiProbeError = false; @@ -702,42 +776,22 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends /// Whether to continue or not - wheter to format or not is stored in /// iScsiFormatLUN. /// - private bool ExamineIscsiProbeResults(SrProbeAction action) + private bool ExamineIscsiProbeResults(SrProbeAction action, List srs) { _srToIntroduce = null; - if (!action.Succeeded) - { - Exception exn = action.Exception; - log.Warn(exn, exn); - Failure failure = exn as Failure; - if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140") - { - errorIconAtHostOrIP.Visible = true; - errorLabelAtHostname.Visible = true; - errorLabelAtHostname.Text = Messages.INVALID_HOST; - textBoxIscsiHost.Focus(); - } - else if (failure != null) - { - errorIconAtHostOrIP.Visible = true; - errorLabelAtHostname.Visible = true; - errorLabelAtHostname.Text = failure.ErrorDescription.Count > 2 ? failure.ErrorDescription[2] : failure.ErrorDescription[0]; - textBoxIscsiHost.Focus(); - } + if (!action.Succeeded || srs == null) return false; - } - + try { - List SRs = action.ProbeExtResult != null ? SR.ParseSRList(action.ProbeExtResult) : SR.ParseSRListXML(action.Result); - if (!String.IsNullOrEmpty(SrWizardType.UUID)) { // Check LUN contains correct SR - if (SRs.Count == 1 && SRs[0].UUID == SrWizardType.UUID) + if (srs.Count == 1 && srs[0].UUID == SrWizardType.UUID) { - _srToIntroduce = SRs[0]; + _srToIntroduce = srs[0]; + SrType = action.SrType; // the type of the existing SR return true; } @@ -747,7 +801,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return false; } - else if (SRs.Count == 0) + else if (srs.Count == 0) { // No existing SRs were found on this LUN. If allowed to create new SR, ask the user if they want to proceed and format. if (!SrWizardType.AllowToCreateNewSr) @@ -777,11 +831,11 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends else { // There should be 0 or 1 SRs on the LUN - System.Diagnostics.Trace.Assert(SRs.Count == 1); + System.Diagnostics.Trace.Assert(srs.Count == 1); // CA-17230 // Check this isn't a detached SR - SR.SRInfo info = SRs[0]; + SR.SRInfo info = srs[0]; SR sr = SrWizardHelpers.SrInUse(info.UUID); if (sr != null) { @@ -798,6 +852,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return false; _srToIntroduce = info; + SrType = action.SrType; // the type of the existing SR return true; } @@ -810,7 +865,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends { case DialogResult.Yes: // Reattach - _srToIntroduce = SRs[0]; + _srToIntroduce = srs[0]; + SrType = action.SrType; // the type of the existing SR return true; case DialogResult.No: From fc42be5beee792003c7bd06d0520f91f36d98184 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Thu, 29 Mar 2018 10:20:41 +0100 Subject: [PATCH 07/18] CP-17099: Do the probe_ext for HBA - Move the scan for HBA devices after the Provisioning page - Fix the device-config for HBA (removed uri) - Add probe_ext in FibreChannelProbeAction and the method to process the result Signed-off-by: Mihaela Stoica --- XenAdmin/Wizards/NewSRWizard.cs | 25 +++++++++------ .../FibreChannelProbeParsing.cs | 32 +++++++++++++++++-- .../NewSRWizard_Pages/Frontends/LVMoFCoE.cs | 12 +++---- .../NewSRWizard_Pages/Frontends/LVMoHBA.cs | 22 ++++++++----- .../Wizards/NewSRWizard_Pages/SrWizardType.cs | 16 +++------- .../Actions/Host/FibreChannelProbeAction.cs | 31 ++++++++++++------ XenModel/Actions/SR/SrProbeAction.cs | 3 +- 7 files changed, 92 insertions(+), 49 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard.cs b/XenAdmin/Wizards/NewSRWizard.cs index 79fcf3bc6..1212216dd 100644 --- a/XenAdmin/Wizards/NewSRWizard.cs +++ b/XenAdmin/Wizards/NewSRWizard.cs @@ -84,6 +84,8 @@ namespace XenAdmin.Wizards private readonly bool _rbac; + private bool showProvisioningPage; + public NewSRWizard(IXenConnection connection) : this(connection, null) { @@ -148,8 +150,6 @@ namespace XenAdmin.Wizards AddPage(xenTabPageRbacWarning, 0); ConfigureRbacPage(disasterRecoveryTask); } - - } private void ConfigureRbacPage(bool disasterRecoveryTask) @@ -231,21 +231,23 @@ namespace XenAdmin.Wizards protected override bool RunNextPagePrecheck(XenTabPage senderPage) { - // if reattaching and RBAC warning page is visible, then we run the prechecks when leaving the RBAC warning page - // otherwise, when leaving xenTabPageSrName (Ref. CA-61525) - bool runPrechecks = _srToReattach != null && _rbac - ? senderPage == xenTabPageRbacWarning - : senderPage == xenTabPageSrName; + var runPrechecks = showProvisioningPage + ? senderPage == xenTabPageChooseSrProv + : (_srToReattach != null && _rbac + ? senderPage == xenTabPageRbacWarning + : senderPage == xenTabPageSrName); if (runPrechecks) { if (m_srWizardType is SrWizardType_Fcoe) { + xenTabPageLvmoFcoe.SrType = showProvisioningPage && xenTabPageChooseSrProv.IsGfs2 ? SR.SRTypes.gfs2 : SR.SRTypes.lvmofcoe; return SetFCDevicesOnLVMoHBAPage(xenTabPageLvmoFcoe); } if (m_srWizardType is SrWizardType_Hba) { + xenTabPageLvmoHba.SrType = showProvisioningPage && xenTabPageChooseSrProv.IsGfs2 ? SR.SRTypes.gfs2 : SR.SRTypes.lvmohba; return SetFCDevicesOnLVMoHBAPage(xenTabPageLvmoHba); } if (m_srWizardType is SrWizardType_Cslg || m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic) @@ -277,6 +279,7 @@ namespace XenAdmin.Wizards if (senderPagetype == typeof(ChooseSrTypePage)) { #region + showProvisioningPage = false; RemovePagesFrom(_rbac ? 3 : 2); m_srWizardType = xenTabPageChooseSrType.SrWizardType; @@ -284,13 +287,17 @@ namespace XenAdmin.Wizards AddPage(xenTabPageVhdoNFS); else if (m_srWizardType is SrWizardType_Iscsi) { - if (Helpers.KolkataOrGreater(xenConnection) && !Helpers.FeatureForbidden(xenConnection, Host.CorosyncDisabled)) + showProvisioningPage = Helpers.KolkataOrGreater(xenConnection) && + !Helpers.FeatureForbidden(xenConnection, Host.CorosyncDisabled); + if (showProvisioningPage) AddPage(xenTabPageChooseSrProv); AddPage(xenTabPageLvmoIscsi); } else if (m_srWizardType is SrWizardType_Hba) { - if (Helpers.KolkataOrGreater(xenConnection) && !Helpers.FeatureForbidden(xenConnection, Host.CorosyncDisabled)) + showProvisioningPage = Helpers.KolkataOrGreater(xenConnection) && + !Helpers.FeatureForbidden(xenConnection, Host.CorosyncDisabled); + if (showProvisioningPage) AddPage(xenTabPageChooseSrProv); AddPage(xenTabPageLvmoHba); AddPage(xenTabPageLvmoHbaSummary); diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelProbeParsing.cs b/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelProbeParsing.cs index 99fa1a0aa..6df0887c0 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelProbeParsing.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelProbeParsing.cs @@ -29,10 +29,9 @@ * SUCH DAMAGE. */ -using System; using System.Collections.Generic; -using System.Text; using System.Xml; +using XenAPI; namespace XenAdmin.Wizards.NewSRWizard_Pages { @@ -128,5 +127,34 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages return long.Parse(p); } } + + internal static List ProcessProbeExtResult(List probeExtResult) + { + var devices = new List(); + + foreach (var probeResult in probeExtResult) + { + var vendor = probeResult.extra_info.ContainsKey("vendor") ? probeResult.extra_info["vendor"] :""; + long size; + if (!probeResult.extra_info.ContainsKey("size") || !long.TryParse(probeResult.extra_info["size"], out size)) + size = 0; + var serial = probeResult.extra_info.ContainsKey("serial") ? probeResult.extra_info["serial"] : ""; + var path = probeResult.extra_info.ContainsKey("path") ? probeResult.extra_info["path"] : ""; + var scsiid = probeResult.configuration.ContainsKey("ScsiId") ? probeResult.configuration["ScsiId"] : ""; + var adapter = probeResult.extra_info.ContainsKey("adapter") ? probeResult.extra_info["adapter"] : ""; + var channel = probeResult.extra_info.ContainsKey("channel") ? probeResult.extra_info["channel"] : ""; + var id = probeResult.extra_info.ContainsKey("id") ? probeResult.extra_info["id"] : ""; + var lun = probeResult.extra_info.ContainsKey("lun") ? probeResult.extra_info["lun"] : ""; + var name_label = ""; + var name_description = ""; + var pool_metadata_detected = false; + var eth = ""; + + devices.Add(new FibreChannelDevice(serial, path, vendor, size, scsiid, adapter, channel, id, lun, name_label, name_description, pool_metadata_detected, eth)); + + } + + return devices; + } } } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs index 239f72583..c5c7ac95b 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs @@ -47,16 +47,16 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends public override string HelpID { get { return "Location_FCOE"; } } - public override LvmOhbaSrDescriptor CreateSrDescriptor(FibreChannelDevice device) - { - return SrType == SR.SRTypes.gfs2 ? new Gfs2FcoeSrDescriptor(device) : new FcoeSrDescriptor(device); - } - - public override LvmOhbaSrDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) + protected override LvmOhbaSrDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) { return new FcoeSrDescriptor(device); } + protected override LvmOhbaSrDescriptor CreateGfs2Descriptor(FibreChannelDevice device) + { + return new Gfs2FcoeSrDescriptor(device); + } + #endregion } } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs index 906891636..01d47eb02 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs @@ -61,15 +61,20 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends public virtual bool ShowNicColumn { get { return false; } } - public virtual LvmOhbaSrDescriptor CreateSrDescriptor(FibreChannelDevice device) + protected LvmOhbaSrDescriptor CreateSrDescriptor(FibreChannelDevice device) { - return SrType == SR.SRTypes.gfs2 ? new Gfs2HbaSrDescriptor(device) : new LvmOhbaSrDescriptor(device, Connection); + return SrType == SR.SRTypes.gfs2 ? CreateGfs2Descriptor(device) : CreateLvmSrDescriptor(device); } - public virtual LvmOhbaSrDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) + protected virtual LvmOhbaSrDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) { return new LvmOhbaSrDescriptor(device, Connection); } + + protected virtual LvmOhbaSrDescriptor CreateGfs2Descriptor(FibreChannelDevice device) + { + return new Gfs2HbaSrDescriptor(device); + } #region XenTabPage overrides @@ -204,8 +209,11 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return true; } - public override void PopulatePage() + protected override void PageLoadedCore(PageLoadedDirection direction) { + if (direction == PageLoadedDirection.Back) + return; + colNic.Visible = ShowNicColumn; dataGridView.Rows.Clear(); @@ -341,9 +349,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (master == null) return false; - SR.SRTypes srType = this is LVMoFCoE ? SR.SRTypes.lvmofcoe : SR.SRTypes.lvmohba; //srType is a workaround instead of SrType - - FibreChannelProbeAction action = new FibreChannelProbeAction(master, srType);// TODO: use SRType + FibreChannelProbeAction action = new FibreChannelProbeAction(master, SrType); using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) dialog.ShowDialog(owner); //Will block until dialog closes, action completed @@ -352,7 +358,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends try { - devices = FibreChannelProbeParsing.ProcessXML(action.Result); + devices = SrType == SR.SRTypes.gfs2 ? FibreChannelProbeParsing.ProcessProbeExtResult(action.ProbeExtResult) : FibreChannelProbeParsing.ProcessXML(action.Result); if (devices.Count == 0) { diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs index 9ea61c74f..9c754c984 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs @@ -90,12 +90,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages public Gfs2HbaSrDescriptor(FibreChannelDevice device) : base(device) { - var jsonUri = new JavaScriptSerializer().Serialize(new - { - provider = "hba", - ScsiId = device.SCSIid - }); - DeviceConfig[SrProbeAction.URI] = jsonUri; + DeviceConfig["provider"] = "hba"; + DeviceConfig["ScsiId"] = device.SCSIid; Description = string.Format(Messages.NEWSR_LVMOHBA_DESCRIPTION, device.Vendor, device.Serial); } } @@ -105,12 +101,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages public Gfs2FcoeSrDescriptor(FibreChannelDevice device) : base(device) { - var jsonUri = new JavaScriptSerializer().Serialize(new - { - provider = "fcoe", - ScsiId = device.SCSIid - }); - DeviceConfig[SrProbeAction.URI] = jsonUri; + DeviceConfig["provider"] = "fcoe"; + DeviceConfig["ScsiId"] = device.SCSIid; Description = string.Format(Messages.NEWSR_LVMOFCOE_DESCRIPTION, device.Vendor, device.Serial); } } diff --git a/XenModel/Actions/Host/FibreChannelProbeAction.cs b/XenModel/Actions/Host/FibreChannelProbeAction.cs index 00a14a464..8860216c0 100644 --- a/XenModel/Actions/Host/FibreChannelProbeAction.cs +++ b/XenModel/Actions/Host/FibreChannelProbeAction.cs @@ -45,6 +45,8 @@ namespace XenAdmin.Actions } private SR.SRTypes srType = SR.SRTypes.lvmohba; + public List ProbeExtResult; + public FibreChannelProbeAction(Host master, SR.SRTypes srType) : this(master) @@ -54,20 +56,29 @@ namespace XenAdmin.Actions protected override void Run() { - this.Description = Messages.PROBING_HBA; - try + Description = Messages.PROBING_HBA; + if (srType != SR.SRTypes.gfs2) { - Result = XenAPI.SR.probe(Session, Host.opaque_ref, new Dictionary(), srType.ToString(), new Dictionary()); + try + { + Result = SR.probe(Session, Host.opaque_ref, new Dictionary(), srType.ToString(), new Dictionary()); + } + catch (Failure f) + { + if (f.ErrorDescription[0] == "SR_BACKEND_FAILURE_90" + || f.ErrorDescription[0] == "SR_BACKEND_FAILURE_107") + Result = f.ErrorDescription[3]; + else + throw; + } } - catch (XenAPI.Failure f) + else { - if (f.ErrorDescription[0] == "SR_BACKEND_FAILURE_90" - || f.ErrorDescription[0] == "SR_BACKEND_FAILURE_107") - Result = f.ErrorDescription[3]; - else - throw; + var deviceConfig = new Dictionary(); + deviceConfig["provider"] = "hba"; + ProbeExtResult = SR.probe_ext(Session, Host.opaque_ref, deviceConfig, srType.ToString(), new Dictionary()); } - this.Description = Messages.PROBED_HBA; + Description = Messages.PROBED_HBA; } } } diff --git a/XenModel/Actions/SR/SrProbeAction.cs b/XenModel/Actions/SR/SrProbeAction.cs index 2fc7f26b7..79ee2eb90 100644 --- a/XenModel/Actions/SR/SrProbeAction.cs +++ b/XenModel/Actions/SR/SrProbeAction.cs @@ -46,7 +46,6 @@ namespace XenAdmin.Actions public const String DEVICE = "device"; public const String SCSIid = "SCSIid"; public const String PATH = "path"; - public const String URI = "uri"; public List ProbeExtResult; @@ -81,7 +80,7 @@ namespace XenAdmin.Actions break; case SR.SRTypes.gfs2: Description = string.Format(Messages.ACTION_SR_SCANNING, - SR.getFriendlyTypeName(srType), dconf["ips"]); + SR.getFriendlyTypeName(srType), dconf.ContainsKey("ips") ? dconf["ips"] : dconf["ScsiId"]); break; default: Description = string.Format(Messages.ACTION_SR_SCANNING, From 6d5e8116c43a04fc5390f5463fa8c9214fed08a4 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Thu, 29 Mar 2018 13:46:09 +0100 Subject: [PATCH 08/18] CP-17099: Fix the usage of IscsiChoiceDialog in the tests Signed-off-by: Mihaela Stoica --- XenAdminTests/DialogTests/DialogsForConnection.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XenAdminTests/DialogTests/DialogsForConnection.cs b/XenAdminTests/DialogTests/DialogsForConnection.cs index 36a27e7c2..8b18eb0a8 100644 --- a/XenAdminTests/DialogTests/DialogsForConnection.cs +++ b/XenAdminTests/DialogTests/DialogsForConnection.cs @@ -36,6 +36,7 @@ using NUnit.Framework; using XenAdmin.Dialogs; using XenAdmin.Network; using XenAdmin.Wizards.NewVMWizard; +using XenAPI; namespace XenAdminTests.DialogTests.state1_xml.DialogsForConnection { @@ -113,7 +114,7 @@ namespace XenAdminTests.DialogTests.state1_xml.DialogsForConnection protected override IscsiChoicesDialog NewDialog() { XenAPI.SR.SRInfo srinfo = new XenAPI.SR.SRInfo("1234-5678-9012-3456", 200000000000); - return new IscsiChoicesDialog(GetAnyConnection(), srinfo); + return new IscsiChoicesDialog(GetAnyConnection(), srinfo, SR.SRTypes.lvmoiscsi, SR.SRTypes.lvmoiscsi); } } From 959e43480cfe24b58205bd79d56fdfe2cb05230b Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 29 Mar 2018 14:32:39 +0100 Subject: [PATCH 09/18] CP-17099: Double probe for iSCSI - minor refactoring to reduce code duplication. Signed-off-by: Konstantina Chremmou --- .../NewSRWizard_Pages/Frontends/LVMoISCSI.cs | 75 ++++++++----------- 1 file changed, 30 insertions(+), 45 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs index 393804692..3db4558b2 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs @@ -143,20 +143,12 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return; } - Dictionary dconf = GetDeviceConfig(SrType); - if (dconf == null) - { - cancel = true; - return; - } + // Start probe List srs; + var currentSrType = SrType; - // Start probe - SrProbeAction IscsiProbeAction = new SrProbeAction(Connection, master, SrType, dconf); - bool success = RunProbe(IscsiProbeAction, out srs); - - if (!success) + if (!RunProbe(master, currentSrType, out srs)) { cancel = iscsiProbeError = true; return; @@ -167,12 +159,9 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (performSecondProbe && srs.Count == 0) { // Start second probe - var secondSrType = SrType == SR.SRTypes.gfs2 ? SR.SRTypes.lvmoiscsi : SR.SRTypes.gfs2; - dconf = GetDeviceConfig(secondSrType); - IscsiProbeAction = new SrProbeAction(Connection, master, secondSrType, dconf); - success = RunProbe(IscsiProbeAction, out srs); + currentSrType = SrType == SR.SRTypes.gfs2 ? SR.SRTypes.lvmoiscsi : SR.SRTypes.gfs2; - if (!success) + if (!RunProbe(master, currentSrType, out srs)) { cancel = iscsiProbeError = true; return; @@ -181,18 +170,24 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends // Probe has been performed. Now ask the user if they want to Reattach/Format/Cancel. // Will return false on cancel - cancel = iscsiProbeError = !ExamineIscsiProbeResults(IscsiProbeAction, srs); + cancel = iscsiProbeError = !ExamineIscsiProbeResults(currentSrType, srs); } - private bool RunProbe(SrProbeAction action, out List srs) + private bool RunProbe(Host master, SR.SRTypes srType, out List srs) { + srs = null; + + Dictionary dconf = GetDeviceConfig(srType); + if (dconf == null) + return false; + + var action = new SrProbeAction(Connection, master, srType, dconf); using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) { dialog.ShowCancel = true; dialog.ShowDialog(this); } - srs = null; _srToIntroduce = null; if (action.Succeeded) { @@ -207,34 +202,24 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends } } - DoOnProbeFailure(action); - return false; - } - - private void DoOnProbeFailure(SrProbeAction action) - { - if (action.Succeeded) - return; - Exception exn = action.Exception; log.Warn(exn, exn); + Failure failure = exn as Failure; - if (failure != null && failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140") + if (failure != null) { errorIconAtHostOrIP.Visible = true; errorLabelAtHostname.Visible = true; - errorLabelAtHostname.Text = Messages.INVALID_HOST; - textBoxIscsiHost.Focus(); - } - else if (failure != null) - { - errorIconAtHostOrIP.Visible = true; - errorLabelAtHostname.Visible = true; - errorLabelAtHostname.Text = failure.ErrorDescription.Count > 2 - ? failure.ErrorDescription[2] - : failure.ErrorDescription[0]; + + errorLabelAtHostname.Text = failure.ErrorDescription[0] == "SR_BACKEND_FAILURE_140" + ? Messages.INVALID_HOST + : (failure.ErrorDescription.Count > 2 + ? failure.ErrorDescription[2] + : failure.ErrorDescription[0]); + textBoxIscsiHost.Focus(); } + return false; } bool iscsiProbeError = false; @@ -776,11 +761,11 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends /// Whether to continue or not - wheter to format or not is stored in /// iScsiFormatLUN. /// - private bool ExamineIscsiProbeResults(SrProbeAction action, List srs) + private bool ExamineIscsiProbeResults(SR.SRTypes currentSrType, List srs) { _srToIntroduce = null; - if (!action.Succeeded || srs == null) + if (srs == null) return false; try @@ -791,7 +776,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (srs.Count == 1 && srs[0].UUID == SrWizardType.UUID) { _srToIntroduce = srs[0]; - SrType = action.SrType; // the type of the existing SR + SrType = currentSrType; // the type of the existing SR return true; } @@ -852,21 +837,21 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return false; _srToIntroduce = info; - SrType = action.SrType; // the type of the existing SR + SrType = currentSrType; // the type of the existing SR return true; } // An SR exists on this LUN. Ask the user if they want to attach it, format it and // create a new SR, or cancel. DialogResult result = Program.RunInAutomatedTestMode ? DialogResult.Yes : - new IscsiChoicesDialog(Connection, info, action.SrType, SrType).ShowDialog(this); + new IscsiChoicesDialog(Connection, info, currentSrType, SrType).ShowDialog(this); switch (result) { case DialogResult.Yes: // Reattach _srToIntroduce = srs[0]; - SrType = action.SrType; // the type of the existing SR + SrType = currentSrType; // the type of the existing SR return true; case DialogResult.No: From 0e55a4f0782a5b64e81d22af511ab37b4094cfae Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 29 Mar 2018 15:01:58 +0100 Subject: [PATCH 10/18] Tidied up SrProbeAction constructors. Signed-off-by: Konstantina Chremmou --- XenModel/Actions/SR/SrProbeAction.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/XenModel/Actions/SR/SrProbeAction.cs b/XenModel/Actions/SR/SrProbeAction.cs index 79ee2eb90..40de73adb 100644 --- a/XenModel/Actions/SR/SrProbeAction.cs +++ b/XenModel/Actions/SR/SrProbeAction.cs @@ -50,19 +50,20 @@ namespace XenAdmin.Actions public List ProbeExtResult; private readonly Dictionary smconf; + /// /// Won't appear in the program history (SuppressHistory == true). /// - /// The UUID of the host from which to perform the probe (usually the pool master). - /// netapp or iscsi - public SrProbeAction(IXenConnection connection, Host host, SR.SRTypes srType, Dictionary dconf) + public SrProbeAction(IXenConnection connection, Host host, SR.SRTypes srType, + Dictionary dconf, Dictionary smconf) : base(connection, string.Format(Messages.ACTION_SCANNING_SR_FROM, Helpers.GetName(connection)), null, true) { this.host = host; this.SrType = srType; this.dconf = dconf; - switch (srType) { + switch (srType) + { case SR.SRTypes.nfs: Description = string.Format(Messages.ACTION_SR_SCANNING, SR.getFriendlyTypeName(srType), dconf["server"]); @@ -87,13 +88,13 @@ namespace XenAdmin.Actions SR.getFriendlyTypeName(srType), Messages.REPAIRSR_SERVER); // this is a bit minging: CA-22111 break; } - smconf = new Dictionary(); + + this.smconf = smconf; } - public SrProbeAction(IXenConnection connection, Host host, SR.SRTypes srType, Dictionary dconf, Dictionary smconf) - : this(connection, host, srType, dconf) + public SrProbeAction(IXenConnection connection, Host host, SR.SRTypes srType, Dictionary dconf) + : this(connection, host, srType, dconf, new Dictionary()) { - this.smconf = smconf; } protected override void Run() From 4452318d1db237d4e41493d03d7403474d89520d Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 29 Mar 2018 16:40:42 +0100 Subject: [PATCH 11/18] Moved the classes FibreChannelDevice and FibreChannelProbeParsing to XenModel. Signed-off-by: Konstantina Chremmou --- XenAdmin/Dialogs/IscsiChoicesDialog.cs | 7 +------ XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs | 2 +- XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs | 1 + XenAdmin/XenAdmin.csproj | 2 -- XenAdminTests/DialogTests/DialogsForConnection.cs | 4 ++-- .../Actions/Host}/FibreChannelDevice.cs | 2 +- .../Actions/Host}/FibreChannelProbeParsing.cs | 8 ++++---- XenModel/XenModel.csproj | 2 ++ 8 files changed, 12 insertions(+), 16 deletions(-) rename {XenAdmin/Wizards/NewSRWizard_Pages => XenModel/Actions/Host}/FibreChannelDevice.cs (96%) rename {XenAdmin/Wizards/NewSRWizard_Pages => XenModel/Actions/Host}/FibreChannelProbeParsing.cs (94%) diff --git a/XenAdmin/Dialogs/IscsiChoicesDialog.cs b/XenAdmin/Dialogs/IscsiChoicesDialog.cs index eaaa3f814..9c2ea2bc6 100644 --- a/XenAdmin/Dialogs/IscsiChoicesDialog.cs +++ b/XenAdmin/Dialogs/IscsiChoicesDialog.cs @@ -30,12 +30,7 @@ */ using System; -using System.Collections.Generic; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using XenAdmin.Wizards.NewSRWizard_Pages; +using XenAdmin.Actions; using XenAdmin.Network; using XenAPI; diff --git a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs index b2c5035c0..ab514e79e 100644 --- a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs +++ b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs @@ -32,8 +32,8 @@ using System; using System.Drawing; using System.Windows.Forms; +using XenAdmin.Actions; using XenAdmin.Core; -using XenAdmin.Wizards.NewSRWizard_Pages; using XenAdmin.Wizards.NewSRWizard_Pages.Frontends; namespace XenAdmin.Dialogs.WarningDialogs diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs index c5c7ac95b..c4210320e 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs @@ -29,6 +29,7 @@ * SUCH DAMAGE. */ +using XenAdmin.Actions; using XenAPI; namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index 3cc2d4a77..49c4cdc06 100755 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -856,7 +856,6 @@ CIFS_ISO.cs - UserControl @@ -1510,7 +1509,6 @@ NewSRWizard.cs - UserControl diff --git a/XenAdminTests/DialogTests/DialogsForConnection.cs b/XenAdminTests/DialogTests/DialogsForConnection.cs index 8b18eb0a8..c6c9bdee4 100644 --- a/XenAdminTests/DialogTests/DialogsForConnection.cs +++ b/XenAdminTests/DialogTests/DialogsForConnection.cs @@ -33,9 +33,9 @@ using System; using System.Collections.Generic; using System.Text; using NUnit.Framework; +using XenAdmin.Actions; using XenAdmin.Dialogs; using XenAdmin.Network; -using XenAdmin.Wizards.NewVMWizard; using XenAPI; namespace XenAdminTests.DialogTests.state1_xml.DialogsForConnection @@ -123,7 +123,7 @@ namespace XenAdminTests.DialogTests.state1_xml.DialogsForConnection { protected override IscsiChoicesDialog NewDialog() { - XenAdmin.Wizards.NewSRWizard_Pages.FibreChannelDevice dev = new XenAdmin.Wizards.NewSRWizard_Pages.FibreChannelDevice( + var dev = new FibreChannelDevice( "1234-5678-9012-3456", "path", "vendor", 200000000000, null, "adapter", "1", "ID", "lun"); return new IscsiChoicesDialog(GetAnyConnection(), dev); } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelDevice.cs b/XenModel/Actions/Host/FibreChannelDevice.cs similarity index 96% rename from XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelDevice.cs rename to XenModel/Actions/Host/FibreChannelDevice.cs index 33be7c508..00b078040 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelDevice.cs +++ b/XenModel/Actions/Host/FibreChannelDevice.cs @@ -34,7 +34,7 @@ using System.Collections.Generic; using System.Text; using XenCenterLib; -namespace XenAdmin.Wizards.NewSRWizard_Pages +namespace XenAdmin.Actions { public class FibreChannelDevice : IComparable { diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelProbeParsing.cs b/XenModel/Actions/Host/FibreChannelProbeParsing.cs similarity index 94% rename from XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelProbeParsing.cs rename to XenModel/Actions/Host/FibreChannelProbeParsing.cs index 6df0887c0..fbec14dc5 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/FibreChannelProbeParsing.cs +++ b/XenModel/Actions/Host/FibreChannelProbeParsing.cs @@ -33,11 +33,11 @@ using System.Collections.Generic; using System.Xml; using XenAPI; -namespace XenAdmin.Wizards.NewSRWizard_Pages +namespace XenAdmin.Actions { - class FibreChannelProbeParsing + public class FibreChannelProbeParsing { - internal static List ProcessXML(string p) + public static List ProcessXML(string p) { XmlDocument doc = new XmlDocument(); doc.LoadXml(p); @@ -128,7 +128,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages } } - internal static List ProcessProbeExtResult(List probeExtResult) + public static List ProcessProbeExtResult(List probeExtResult) { var devices = new List(); diff --git a/XenModel/XenModel.csproj b/XenModel/XenModel.csproj index 13f9c27e2..4f021f62e 100755 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -86,6 +86,8 @@ + + From 4b0aa132d27cd3a08680d99d29a839b28e0aaabe Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 29 Mar 2018 17:58:00 +0100 Subject: [PATCH 12/18] Simplified the FibreChannelProbeAction and compacted the methods and helper classes for parsing the results for the various SR types. Signed-off-by: Konstantina Chremmou --- .../DRWizards/DRFailoverWizardStoragePage.cs | 16 +- .../NewSRWizard_Pages/Frontends/LVMoHBA.cs | 34 +--- XenModel/Actions/Host/FibreChannelDevice.cs | 82 +++++++-- .../Actions/Host/FibreChannelProbeAction.cs | 51 ++++-- .../Actions/Host/FibreChannelProbeParsing.cs | 160 ------------------ XenModel/Messages.Designer.cs | 2 +- XenModel/Messages.resx | 2 +- XenModel/XenModel.csproj | 1 - 8 files changed, 116 insertions(+), 232 deletions(-) delete mode 100644 XenModel/Actions/Host/FibreChannelProbeParsing.cs diff --git a/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs b/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs index 823101b68..ad80dcb1b 100644 --- a/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs +++ b/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs @@ -303,23 +303,11 @@ namespace XenAdmin.Wizards.DRWizards if (master == null) return null; - FibreChannelProbeAction action = new FibreChannelProbeAction(master); + var action = new FibreChannelProbeAction(master); using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) dialog.ShowDialog(this); //Will block until dialog closes, action completed - if (!action.Succeeded) - return null; - - try - { - return FibreChannelProbeParsing.ProcessXML(action.Result); - } - catch (Exception e) - { - log.Debug("Exception parsing result of fibre channel scan", e); - log.Debug(e, e); - return null; - } + return action.Succeeded ? action.FibreChannelDevices : null; } private Dictionary GetFCDeviceConfig(FibreChannelDevice device) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs index 01d47eb02..81642876f 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs @@ -349,41 +349,23 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (master == null) return false; - FibreChannelProbeAction action = new FibreChannelProbeAction(master, SrType); + var action = new FibreChannelProbeAction(master, SrType); using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) dialog.ShowDialog(owner); //Will block until dialog closes, action completed if (!action.Succeeded) return false; - try - { - devices = SrType == SR.SRTypes.gfs2 ? FibreChannelProbeParsing.ProcessProbeExtResult(action.ProbeExtResult) : FibreChannelProbeParsing.ProcessXML(action.Result); - - if (devices.Count == 0) - { - using (var dlg = new ThreeButtonDialog( - new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_NO_RESULTS, Messages.XENCENTER))) - { - dlg.ShowDialog(); - } - - return false; - } + devices = action.FibreChannelDevices; + if (devices != null && devices.Count > 0) return true; - } - catch (Exception e) - { - log.Debug("Exception parsing result of fibre channel scan", e); - log.Debug(e, e); - using (var dlg = new ThreeButtonDialog( - new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_XML_ERROR, Messages.XENCENTER))) - { - dlg.ShowDialog(); - } - return false; + using (var dlg = new ThreeButtonDialog( + new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_NO_RESULTS, Messages.XENCENTER))) + { + dlg.ShowDialog(); } + return false; } #region Accessors diff --git a/XenModel/Actions/Host/FibreChannelDevice.cs b/XenModel/Actions/Host/FibreChannelDevice.cs index 00b078040..c5ade660b 100644 --- a/XenModel/Actions/Host/FibreChannelDevice.cs +++ b/XenModel/Actions/Host/FibreChannelDevice.cs @@ -70,25 +70,30 @@ namespace XenAdmin.Actions this.pool_metadata_detected = false; } - public FibreChannelDevice(String serial, String path, - String vendor, long size, String SCSIid, String adapter, - String channel, String id, String lun, - String name_label, String name_description, bool pool_metadata_detected, - String eth) + public FibreChannelDevice(Dictionary dict) { - this.Serial = serial; - this.Path = path; - this.Vendor = vendor; - this.Size = size; - this.SCSIid = SCSIid; - this.adapter = adapter; - this.channel = channel; - this.id = id; - this.lun = lun; - this.name_label = name_label; - this.name_description = name_description; - this.pool_metadata_detected = pool_metadata_detected; - this.eth = eth; + Vendor = dict.ContainsKey("vendor") ? dict["vendor"] : ""; + Serial = dict.ContainsKey("serial") ? dict["serial"] : ""; + Path = dict.ContainsKey("path") ? dict["path"] : ""; + adapter = dict.ContainsKey("adapter") ? dict["adapter"] : ""; + channel = dict.ContainsKey("channel") ? dict["channel"] : ""; + id = dict.ContainsKey("id") ? dict["id"] : ""; + lun = dict.ContainsKey("lun") ? dict["lun"] : ""; + name_label = dict.ContainsKey("name_label") ? dict["name_label"] : ""; + name_description = dict.ContainsKey("name_description") ? dict["name_description"] : ""; + eth = dict.ContainsKey("eth") ? dict["eth"] : ""; + + SCSIid = dict.ContainsKey("scsiid") + ? dict["scsiid"] + : dict.ContainsKey("ScsiId") + ? dict["ScsiId"] : ""; + + if (!dict.ContainsKey("size") || !TryParseSizeWithUnits(dict["size"], out Size)) + Size = 0; + + if (!dict.ContainsKey("pool_metadata_detected") || + !bool.TryParse(dict["pool_metadata_detected"], out pool_metadata_detected)) + pool_metadata_detected = false; } public int CompareTo(FibreChannelDevice other) @@ -96,5 +101,46 @@ namespace XenAdmin.Actions long n = Size - other.Size; return n == 0 ? StringUtility.NaturalCompare(Serial, other.Serial) : (int)n; } + + /// + /// Sometimes, the XML that is returned contains units. + /// (SR.probe XML earlier than Miami GA. + /// + private bool TryParseSizeWithUnits(string p, out long size) + { + if (long.TryParse(p, out size)) + return true; + + p = p.ToLowerInvariant(); + + if (p.Contains("kb")) + { + if (!long.TryParse(p.Replace("kb", ""), out size)) + return false; + + size *= Util.BINARY_KILO; + return true; + } + + if (p.Contains("mb")) + { + if (!long.TryParse(p.Replace("mb", ""), out size)) + return false; + + size *= Util.BINARY_MEGA; + return true; + } + + if (p.Contains("gb")) + { + if (!long.TryParse(p.Replace("mb", ""), out size)) + return false; + + size *= Util.BINARY_GIGA; + return true; + } + + return false; + } } } diff --git a/XenModel/Actions/Host/FibreChannelProbeAction.cs b/XenModel/Actions/Host/FibreChannelProbeAction.cs index 8860216c0..5a2057aa0 100644 --- a/XenModel/Actions/Host/FibreChannelProbeAction.cs +++ b/XenModel/Actions/Host/FibreChannelProbeAction.cs @@ -30,6 +30,8 @@ */ using System.Collections.Generic; +using System.Linq; +using System.Xml; using XenAPI; @@ -37,20 +39,14 @@ namespace XenAdmin.Actions { public class FibreChannelProbeAction : PureAsyncAction { + private readonly SR.SRTypes srType; - public FibreChannelProbeAction(Host master) + public List FibreChannelDevices; + + public FibreChannelProbeAction(Host master, SR.SRTypes srType = SR.SRTypes.lvmohba) : base(master.Connection, string.Format(Messages.PROBING_HBA_TITLE, master.Name()), null, true) { Host = master; - } - - private SR.SRTypes srType = SR.SRTypes.lvmohba; - public List ProbeExtResult; - - - public FibreChannelProbeAction(Host master, SR.SRTypes srType) - : this(master) - { this.srType = srType; } @@ -71,14 +67,47 @@ namespace XenAdmin.Actions else throw; } + + FibreChannelDevices = ProcessXml(Result); } else { var deviceConfig = new Dictionary(); deviceConfig["provider"] = "hba"; - ProbeExtResult = SR.probe_ext(Session, Host.opaque_ref, deviceConfig, srType.ToString(), new Dictionary()); + var result = SR.probe_ext(Session, Host.opaque_ref, deviceConfig, srType.ToString(), new Dictionary()); + FibreChannelDevices = (from Probe_result r in result select new FibreChannelDevice(r.extra_info)).ToList(); } Description = Messages.PROBED_HBA; } + + + private static List ProcessXml(string p) + { + try + { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(p); + + var devices = new List(); + + var blockDevices = doc.GetElementsByTagName("BlockDevice"); + + foreach (XmlNode device in blockDevices) + { + var properties = new Dictionary(); + + foreach (XmlNode node in device.ChildNodes) + properties.Add(node.Name.ToLowerInvariant(), node.InnerText.Trim()); + + devices.Add(new FibreChannelDevice(properties)); + } + + return devices; + } + catch (XmlException e) + { + throw new Failure(Messages.FIBRECHANNEL_XML_ERROR, e); + } + } } } diff --git a/XenModel/Actions/Host/FibreChannelProbeParsing.cs b/XenModel/Actions/Host/FibreChannelProbeParsing.cs deleted file mode 100644 index fbec14dc5..000000000 --- a/XenModel/Actions/Host/FibreChannelProbeParsing.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System.Collections.Generic; -using System.Xml; -using XenAPI; - -namespace XenAdmin.Actions -{ - public class FibreChannelProbeParsing - { - public static List ProcessXML(string p) - { - XmlDocument doc = new XmlDocument(); - doc.LoadXml(p); - - var devices = new List(); - - foreach (XmlNode device in doc.GetElementsByTagName("BlockDevice")) - { - var dev = ParseDevice(device); - devices.Add(dev); - } - return devices; - } - - private static FibreChannelDevice ParseDevice(XmlNode device) - { - string vendor = ""; - long size = 0; - string serial = ""; - string path = ""; - string scsiid = ""; - string adapter = ""; - string channel = ""; - string id = ""; - string lun = ""; - string name_label = ""; - string name_description = ""; - bool pool_metadata_detected = false; - string eth = ""; - - foreach (XmlNode node in device.ChildNodes) - { - if (node.Name.ToLowerInvariant() == "vendor") - vendor = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "size") - size = ParseSizeWithUnits(node.InnerText.Trim()); - if (node.Name.ToLowerInvariant() == "serial") - serial = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "path") - path = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "scsiid") - scsiid = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "adapter") - adapter = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "channel") - channel = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "id") - id = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "lun") - lun = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "name_label") - name_label = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "name_description") - name_description = node.InnerText.Trim(); - if (node.Name.ToLowerInvariant() == "pool_metadata_detected") - pool_metadata_detected = bool.Parse(node.InnerText.Trim()); - if (node.Name.ToLowerInvariant() == "eth") - eth = node.InnerText.Trim(); - } - - return new FibreChannelDevice(serial, path, vendor, size, - scsiid, adapter, channel, id, lun, name_label, name_description, pool_metadata_detected, eth); - } - - /// - /// Sometimes, the XML that is returned contains units. I think that we're not doing this in - /// Miami GA. - /// - private static long ParseSizeWithUnits(string p) - { - p = p.ToLowerInvariant(); - - if (p.Contains("kb")) - { - return long.Parse(p.Replace("kb", "")) * Util.BINARY_KILO; - } - else if (p.Contains("mb")) - { - return long.Parse(p.Replace("mb", "")) * Util.BINARY_MEGA; - } - else if (p.Contains("gb")) - { - return long.Parse(p.Replace("gb", "")) * Util.BINARY_GIGA; - } - else - { - return long.Parse(p); - } - } - - public static List ProcessProbeExtResult(List probeExtResult) - { - var devices = new List(); - - foreach (var probeResult in probeExtResult) - { - var vendor = probeResult.extra_info.ContainsKey("vendor") ? probeResult.extra_info["vendor"] :""; - long size; - if (!probeResult.extra_info.ContainsKey("size") || !long.TryParse(probeResult.extra_info["size"], out size)) - size = 0; - var serial = probeResult.extra_info.ContainsKey("serial") ? probeResult.extra_info["serial"] : ""; - var path = probeResult.extra_info.ContainsKey("path") ? probeResult.extra_info["path"] : ""; - var scsiid = probeResult.configuration.ContainsKey("ScsiId") ? probeResult.configuration["ScsiId"] : ""; - var adapter = probeResult.extra_info.ContainsKey("adapter") ? probeResult.extra_info["adapter"] : ""; - var channel = probeResult.extra_info.ContainsKey("channel") ? probeResult.extra_info["channel"] : ""; - var id = probeResult.extra_info.ContainsKey("id") ? probeResult.extra_info["id"] : ""; - var lun = probeResult.extra_info.ContainsKey("lun") ? probeResult.extra_info["lun"] : ""; - var name_label = ""; - var name_description = ""; - var pool_metadata_detected = false; - var eth = ""; - - devices.Add(new FibreChannelDevice(serial, path, vendor, size, scsiid, adapter, channel, id, lun, name_label, name_description, pool_metadata_detected, eth)); - - } - - return devices; - } - } -} diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 49e08169b..0d4d56e69 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -15298,7 +15298,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to The scan failed. Please try again.. + /// Looks up a localized string similar to The scan failed.. /// public static string FIBRECHANNEL_XML_ERROR { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 714aa37a9..eb230ff4b 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -5373,7 +5373,7 @@ Warning: to prevent data loss you must ensure that the LUN is not in use by any No LUNs were found. Please verify your hardware configuration. - The scan failed. Please try again. + The scan failed. This feature is disabled due to license restrictions on the server. diff --git a/XenModel/XenModel.csproj b/XenModel/XenModel.csproj index 4f021f62e..da5ffbedf 100755 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -87,7 +87,6 @@ - From 6adcd2b83fdf050b8f6f729efc746c68ba92d9c1 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 29 Mar 2018 19:16:44 +0100 Subject: [PATCH 13/18] Some more code simplifications. Signed-off-by: Konstantina Chremmou --- .../DRWizards/DRFailoverWizardStoragePage.cs | 23 ++++--------------- .../Wizards/NewSRWizard_Pages/SrWizardType.cs | 8 +++---- XenModel/Actions/SR/SrProbeAction.cs | 23 +++++++------------ 3 files changed, 16 insertions(+), 38 deletions(-) diff --git a/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs b/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs index ad80dcb1b..6df3a3b0f 100644 --- a/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs +++ b/XenAdmin/Wizards/DRWizards/DRFailoverWizardStoragePage.cs @@ -248,6 +248,7 @@ namespace XenAdmin.Wizards.DRWizards private const String LUNSERIAL = "LUNSerial"; private const String SCSIID = "SCSIid"; + private const String METADATA = "metadata"; private void ScanForSRs(SR.SRTypes type) { @@ -262,7 +263,8 @@ namespace XenAdmin.Wizards.DRWizards foreach (FibreChannelDevice device in devices) { string deviceId = string.IsNullOrEmpty(device.SCSIid) ? device.Path : device.SCSIid; - var metadataSrs = ScanDeviceForSRs(SR.SRTypes.lvmohba, deviceId, GetFCDeviceConfig(device)); + var metadataSrs = ScanDeviceForSRs(SR.SRTypes.lvmohba, deviceId, + new Dictionary {{SCSIID, device.SCSIid}}); if (metadataSrs != null && metadataSrs.Count > 0) srs.AddRange(metadataSrs); } @@ -310,30 +312,15 @@ namespace XenAdmin.Wizards.DRWizards return action.Succeeded ? action.FibreChannelDevices : null; } - private Dictionary GetFCDeviceConfig(FibreChannelDevice device) - { - if (device == null) - return null; - - var dconf = new Dictionary(); - dconf[SrProbeAction.SCSIid] = device.SCSIid; - - return dconf; - } - - private const String METADATA = "metadata"; - private List ScanDeviceForSRs(SR.SRTypes type, string deviceId, Dictionary dconf) { Host master = Helpers.GetMaster(Connection); if (master == null || dconf == null) return null; - Dictionary smconf = new Dictionary(); - smconf[METADATA] = "true"; - // Start probe - SrProbeAction srProbeAction = new SrProbeAction(Connection, master, type, dconf, smconf); + SrProbeAction srProbeAction = new SrProbeAction(Connection, master, type, dconf, + new Dictionary {{METADATA, "true"}}); using (var dlg = new ActionProgressDialog(srProbeAction, ProgressBarStyle.Marquee)) dlg.ShowDialog(this); diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs index 9c754c984..a194158cd 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs @@ -31,9 +31,7 @@ using System; using System.Collections.Generic; -using System.Web.Script.Serialization; using XenAdmin.Actions; -using XenAdmin.Core; using XenAdmin.Network; using XenAPI; @@ -59,7 +57,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages public LvmOhbaSrDescriptor(FibreChannelDevice device, IXenConnection connection) { Device = device; - DeviceConfig[SrProbeAction.SCSIid] = device.SCSIid; + DeviceConfig["SCSIid"] = device.SCSIid; Description = string.Format(Messages.NEWSR_LVMOHBA_DESCRIPTION, device.Vendor, device.Serial); } @@ -78,8 +76,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages { public FcoeSrDescriptor(FibreChannelDevice device) : base(device) { - DeviceConfig[SrProbeAction.SCSIid] = device.SCSIid; - DeviceConfig[SrProbeAction.PATH] = device.Path; + DeviceConfig["SCSIid"] = device.SCSIid; + DeviceConfig["path"] = device.Path; Description = string.Format(Messages.NEWSR_LVMOFCOE_DESCRIPTION, device.Vendor, device.Serial); } diff --git a/XenModel/Actions/SR/SrProbeAction.cs b/XenModel/Actions/SR/SrProbeAction.cs index 40de73adb..80ad1c5b6 100644 --- a/XenModel/Actions/SR/SrProbeAction.cs +++ b/XenModel/Actions/SR/SrProbeAction.cs @@ -43,9 +43,6 @@ namespace XenAdmin.Actions private readonly Host host; public readonly SR.SRTypes SrType; private readonly Dictionary dconf; - public const String DEVICE = "device"; - public const String SCSIid = "SCSIid"; - public const String PATH = "path"; public List ProbeExtResult; @@ -62,33 +59,29 @@ namespace XenAdmin.Actions this.SrType = srType; this.dconf = dconf; + string target; switch (srType) { case SR.SRTypes.nfs: - Description = string.Format(Messages.ACTION_SR_SCANNING, - SR.getFriendlyTypeName(srType), dconf["server"]); + target = dconf["server"]; break; case SR.SRTypes.lvmoiscsi: - Description = string.Format(Messages.ACTION_SR_SCANNING, - SR.getFriendlyTypeName(srType), dconf["target"]); + target = dconf["target"]; break; case SR.SRTypes.lvmohba: case SR.SRTypes.lvmofcoe: - String device = dconf.ContainsKey(DEVICE) ? - dconf[DEVICE] : dconf[SCSIid]; - Description = string.Format(Messages.ACTION_SR_SCANNING, - SR.getFriendlyTypeName(srType), device); + target = dconf.ContainsKey("device") ? dconf["device"] : dconf["SCSIid"]; break; case SR.SRTypes.gfs2: - Description = string.Format(Messages.ACTION_SR_SCANNING, - SR.getFriendlyTypeName(srType), dconf.ContainsKey("ips") ? dconf["ips"] : dconf["ScsiId"]); + target = dconf.ContainsKey("ips") ? dconf["ips"] : dconf["ScsiId"]; break; default: - Description = string.Format(Messages.ACTION_SR_SCANNING, - SR.getFriendlyTypeName(srType), Messages.REPAIRSR_SERVER); // this is a bit minging: CA-22111 + target = Messages.REPAIRSR_SERVER; break; } + Description = string.Format(Messages.ACTION_SR_SCANNING, SR.getFriendlyTypeName(srType), target); + this.smconf = smconf; } From ff13eff7ddcbcadc08c590b81430d9ba3175476e Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Tue, 3 Apr 2018 10:18:08 +0100 Subject: [PATCH 14/18] Some information (ScsiId) is contained in the Probe_result.configuration, the Probe_result.extra_info does not contain everything we need. Signed-off-by: Konstantina Chremmou --- XenModel/Actions/Host/FibreChannelProbeAction.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/XenModel/Actions/Host/FibreChannelProbeAction.cs b/XenModel/Actions/Host/FibreChannelProbeAction.cs index 5a2057aa0..3cd792715 100644 --- a/XenModel/Actions/Host/FibreChannelProbeAction.cs +++ b/XenModel/Actions/Host/FibreChannelProbeAction.cs @@ -75,7 +75,15 @@ namespace XenAdmin.Actions var deviceConfig = new Dictionary(); deviceConfig["provider"] = "hba"; var result = SR.probe_ext(Session, Host.opaque_ref, deviceConfig, srType.ToString(), new Dictionary()); - FibreChannelDevices = (from Probe_result r in result select new FibreChannelDevice(r.extra_info)).ToList(); + + var list = new List(); + foreach (var r in result) + { + var dict = new Dictionary(r.configuration); + r.extra_info.ToList().ForEach(kvp => dict.Add(kvp.Key, kvp.Value)); + list.Add(new FibreChannelDevice(dict)); + } + FibreChannelDevices = list; } Description = Messages.PROBED_HBA; } From 6a8b65b21e49c7c27f9ae1dd34de19eb86ca4c49 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Tue, 3 Apr 2018 11:49:50 +0100 Subject: [PATCH 15/18] CP-17099: Do the double probe for HBA - The LVMOHBAWarningDialog class has been changed to display the type of the existing SR and the requested type (that will be used for formatting) Signed-off-by: Mihaela Stoica --- .../WarningDialogs/LVMoHBAWarningDialog.cs | 20 +++- .../WarningDialogs/LVMoHBAWarningDialog.resx | 57 +++++----- XenAdmin/Wizards/NewSRWizard.cs | 7 +- .../NewSRWizard_Pages/Frontends/LVMoHBA.cs | 104 +++++++++++++----- .../NewSRWizard_Pages/Frontends/LVMoISCSI.cs | 1 - .../NewSRWizard_Pages/SrWizardHelpers.cs | 12 -- .../Wizards/NewSRWizard_Pages/SrWizardType.cs | 10 ++ XenModel/Messages.Designer.cs | 38 ++++++- XenModel/Messages.resx | 14 ++- 9 files changed, 185 insertions(+), 78 deletions(-) diff --git a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs index ab514e79e..5333453da 100644 --- a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs +++ b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.cs @@ -35,6 +35,7 @@ using System.Windows.Forms; using XenAdmin.Actions; using XenAdmin.Core; using XenAdmin.Wizards.NewSRWizard_Pages.Frontends; +using XenAPI; namespace XenAdmin.Dialogs.WarningDialogs { @@ -44,17 +45,21 @@ namespace XenAdmin.Dialogs.WarningDialogs private FibreChannelDevice currentDevice; private int remainingDevicesCount; private bool foundExistingSR; + private readonly SR.SRTypes existingSrType; + private readonly SR.SRTypes requestedSrType; public LVMoHBA.UserSelectedOption SelectedOption { get; private set; } public bool RepeatForRemainingLUNs { get { return checkBoxRepeat.Checked; } } public LVMoHBAWarningDialog(FibreChannelDevice currentDevice, int remainingDevicesCount, - bool foundExistingSR) + bool foundExistingSR, SR.SRTypes existingSrType, SR.SRTypes requestedSrType) { InitializeComponent(); this.currentDevice = currentDevice; this.remainingDevicesCount = remainingDevicesCount; this.foundExistingSR = foundExistingSR; + this.existingSrType = existingSrType; + this.requestedSrType = requestedSrType; PopulateControls(); ActiveControl = buttonCancel; } @@ -128,7 +133,7 @@ namespace XenAdmin.Dialogs.WarningDialogs private void PopulateControls() { labelHeader.Text = foundExistingSR - ? Messages.LVMOHBA_WARNING_DIALOG_HEADER_FOUND_EXISTING_SR + ? string.Format(Messages.LVMOHBA_WARNING_DIALOG_HEADER_FOUND_EXISTING_SR, SR.getFriendlyTypeName(existingSrType)) : Messages.LVMOHBA_WARNING_DIALOG_HEADER_NO_EXISTING_SRS; checkBoxRepeat.Text = foundExistingSR @@ -143,12 +148,17 @@ namespace XenAdmin.Dialogs.WarningDialogs : currentDevice.SCSIid, Util.DiskSizeString(currentDevice.Size)); + labelReattachInfo.Text = foundExistingSR + ? string.Format(Messages.LVMOHBA_WARNING_DIALOG_REATTACH_INFO, SR.getFriendlyTypeName(existingSrType)) + : Messages.LVMOHBA_WARNING_DIALOG_REATTACH_LABEL_TEXT; + + labelFormatInfo.Text = string.Format(Messages.LVMOHBA_WARNING_DIALOG_FORMAT_INFO, SR.getFriendlyTypeName(requestedSrType)); + panelReattach.Enabled = foundExistingSR; if (!panelReattach.Enabled) - { - labelReattachInfo.Text = Messages.LVMOHBA_WARNING_DIALOG_REATTACH_LABEL_TEXT; pictureBoxArrowReattach.Image = Drawing.ConvertToGreyScale(pictureBoxArrowReattach.Image); - } + + } private void buttonCancel_Click(object sender, EventArgs e) diff --git a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx index 23559fbb9..0fc7056aa 100644 --- a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx +++ b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.resx @@ -112,16 +112,16 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Bottom, Right - + Segoe UI, 9pt @@ -131,7 +131,7 @@ 75, 23 - + 7 @@ -142,7 +142,7 @@ buttonCancel - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -181,7 +181,7 @@ checkBoxRepeat - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -211,7 +211,7 @@ labelHeader - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -241,7 +241,7 @@ labelSelectOption - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -274,7 +274,7 @@ pictureBoxArrowReattach - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panelReattach @@ -310,7 +310,7 @@ buttonReattach - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panelReattach @@ -318,9 +318,6 @@ 1 - - True - Segoe UI, 9pt @@ -328,7 +325,7 @@ 33, 32 - 105, 15 + 358, 30 1 @@ -340,7 +337,7 @@ labelReattachInfo - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panelReattach @@ -355,7 +352,7 @@ 12, 135 - 393, 58 + 393, 62 3 @@ -397,7 +394,7 @@ pictureBoxArrowFormat - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panelFormat @@ -436,7 +433,7 @@ buttonFormat - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panelFormat @@ -444,17 +441,17 @@ 1 - - True - Segoe UI, 9pt + + NoControl + 33, 32 - 306, 15 + 357, 30 1 @@ -466,7 +463,7 @@ labelFormatInfo - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panelFormat @@ -481,7 +478,7 @@ 12, 199 - 393, 58 + 393, 64 4 @@ -559,7 +556,7 @@ pictureBox2 - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -589,7 +586,7 @@ labelWarning - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -623,7 +620,7 @@ Size: labelLUNDetails - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -631,7 +628,7 @@ Size: 0 - + True @@ -652,4 +649,4 @@ Size: XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - + \ No newline at end of file diff --git a/XenAdmin/Wizards/NewSRWizard.cs b/XenAdmin/Wizards/NewSRWizard.cs index 1212216dd..ebe9fb1b1 100644 --- a/XenAdmin/Wizards/NewSRWizard.cs +++ b/XenAdmin/Wizards/NewSRWizard.cs @@ -637,6 +637,7 @@ namespace XenAdmin.Wizards foreach (var srDescriptor in m_srWizardType.SrDescriptors) { + var srType = srDescriptor is LvmOhbaSrDescriptor ? (srDescriptor as LvmOhbaSrDescriptor).SrType : m_srWizardType.Type; if (String.IsNullOrEmpty(srDescriptor.UUID)) { // Don't need to show any warning, as the only destructive creates @@ -644,7 +645,7 @@ namespace XenAdmin.Wizards finalActions.Add(new SrCreateAction(xenConnection, master, srDescriptor.Name, srDescriptor.Description, - m_srWizardType.Type, + srType, m_srWizardType.ContentType, srDescriptor.DeviceConfig, srDescriptor.SMConfig)); @@ -656,7 +657,7 @@ namespace XenAdmin.Wizards (_srToReattach == null || SR.SupportsDatabaseReplication(xenConnection, _srToReattach))) { // "Find existing SRs" or "Attach SR needed for DR" cases - ScannedDeviceInfo deviceInfo = new ScannedDeviceInfo(m_srWizardType.Type, + ScannedDeviceInfo deviceInfo = new ScannedDeviceInfo(srType, srDescriptor.DeviceConfig, srDescriptor.UUID); finalActions.Add(new DrTaskCreateAction(xenConnection, deviceInfo)); @@ -666,7 +667,7 @@ namespace XenAdmin.Wizards srDescriptor.UUID, srDescriptor.Name, srDescriptor.Description, - m_srWizardType.Type, + srType, m_srWizardType.ContentType, srDescriptor.DeviceConfig)); } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs index 81642876f..c92a9fd0b 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs @@ -101,32 +101,43 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends var existingSrDescriptors = new List(); var formatDiskDescriptors = new List(); + var performSecondProbe = Helpers.KolkataOrGreater(Connection) && !Helpers.FeatureForbidden(Connection, Host.CorosyncDisabled) + && SrType != SR.SRTypes.lvmofcoe; // gfs2 over fcoe is not supported yet + foreach (var device in _selectedDevices) { - LvmOhbaSrDescriptor descr = CreateSrDescriptor(device); + // Start probe + var formatDiskDescriptor = CreateSrDescriptor(device); + List srs; - // create an LVM descriptor, to be used with sr.probe - LvmOhbaSrDescriptor lvmdescr = CreateLvmSrDescriptor(device); - SR.SRTypes srType = lvmdescr is FcoeSrDescriptor ? SR.SRTypes.lvmofcoe : SR.SRTypes.lvmohba; //srType is a workaround instead of SrType + var currentSrDescriptor = formatDiskDescriptor; - var action = new SrProbeAction(Connection, master, srType, lvmdescr.DeviceConfig);// TODO: use SRType and descr - using (var dlg = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) - dlg.ShowDialog(this); - - if (!action.Succeeded) + if (!RunProbe(master, currentSrDescriptor, out srs)) { cancel = true; return; } - descr.UUID = SrWizardHelpers.ExtractUUID(action.Result); + if (performSecondProbe && srs.Count == 0) + { + // Start second probe + currentSrDescriptor = SrType == SR.SRTypes.gfs2 ? CreateLvmSrDescriptor(device) : CreateGfs2Descriptor(device); + + if (!RunProbe(master, currentSrDescriptor, out srs)) + { + cancel = true; + return; + } + } + + currentSrDescriptor.UUID = srs.Select(sr => sr.UUID).FirstOrDefault(); if (!string.IsNullOrEmpty(SrWizardType.UUID)) { // Check LUN contains correct SR - if (descr.UUID == SrWizardType.UUID) + if (currentSrDescriptor.UUID == SrWizardType.UUID) { - SrDescriptors.Add(descr); + SrDescriptors.Add(currentSrDescriptor); continue; } @@ -140,8 +151,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends cancel = true; return; } - - if (string.IsNullOrEmpty(descr.UUID)) + + if (string.IsNullOrEmpty(currentSrDescriptor.UUID)) { // No existing SRs were found on this LUN. If allowed to create // a new SR, ask the user if they want to proceed and format. @@ -159,26 +170,45 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends } if (!Program.RunInAutomatedTestMode) - formatDiskDescriptors.Add(descr); + formatDiskDescriptors.Add(formatDiskDescriptor); } else { - // CA-17230: Check this isn't a detached SR. If it is then just continue - SR sr = SrWizardHelpers.SrInUse(descr.UUID); - if (sr != null) + // Check this isn't an existing SR on the current pool + var existingSr = Connection.Cache.SRs.FirstOrDefault(sr => sr.uuid == currentSrDescriptor.UUID); + if (existingSr != null) { - SrDescriptors.Add(descr); + var pool = Helpers.GetPool(existingSr.Connection); + var errorText = pool != null + ? string.Format(Messages.NEWSR_LUN_IN_USE_ON_SELECTED_POOL, device.SCSIid, existingSr.Name()) + : string.Format(Messages.NEWSR_LUN_IN_USE_ON_SELECTED_SERVER, device.SCSIid, existingSr.Name()); + + using (var dlog = new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Error, + errorText, Messages.XENCENTER))) + { + dlog.ShowDialog(this); + } + cancel = true; + return; + } + + // CA-17230: Check this isn't an existing SR on any of the known pools. + // If it is then just continue (i.e. do not ask the user if they want to format or reattach it, we will just reattach it) + existingSr = SrWizardHelpers.SrInUse(currentSrDescriptor.UUID); + if (existingSr != null) + { + SrDescriptors.Add(currentSrDescriptor); continue; } // We found a SR on this LUN. Will ask user for choice later. - existingSrDescriptors.Add(descr); + existingSrDescriptors.Add(currentSrDescriptor); } } if (!cancel && existingSrDescriptors.Count > 0) { - var launcher = new LVMoHBAWarningDialogLauncher(this, existingSrDescriptors, true); + var launcher = new LVMoHBAWarningDialogLauncher(this, existingSrDescriptors, true, SrType); launcher.ShowWarnings(); cancel = launcher.Cancelled; if (!cancel && launcher.SrDescriptors.Count > 0) @@ -187,7 +217,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends if (!cancel && formatDiskDescriptors.Count > 0) { - var launcher = new LVMoHBAWarningDialogLauncher(this, formatDiskDescriptors, false); + var launcher = new LVMoHBAWarningDialogLauncher(this, formatDiskDescriptors, false, SrType); launcher.ShowWarnings(); cancel = launcher.Cancelled; if (!cancel && launcher.SrDescriptors.Count > 0) @@ -195,6 +225,29 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends } } + private bool RunProbe(Host master, LvmOhbaSrDescriptor srDescriptor, out List srs) + { + srs = null; + var action = new SrProbeAction(Connection, master, srDescriptor.SrType, srDescriptor.DeviceConfig); + + using (var dlg = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) + dlg.ShowDialog(this); + + if (action.Succeeded) + { + try + { + srs = action.ProbeExtResult != null ? SR.ParseSRList(action.ProbeExtResult) : SR.ParseSRListXML(action.Result); + return true; + } + catch (Exception) + { + return false; + } + } + return false; + } + public override bool EnableNext() { UpdateSelectionButtons(); @@ -471,16 +524,18 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends private readonly List inputSrDescriptors; private readonly bool foundExistingSRs; private readonly IWin32Window owner; + private readonly SR.SRTypes requestedSrType; public List SrDescriptors { get; private set; } public bool Cancelled { get; private set; } public LVMoHBAWarningDialogLauncher(IWin32Window owner, List srDescriptors, - bool foundExistingSRs) + bool foundExistingSRs, SR.SRTypes requestedSrType) { this.owner = owner; this.foundExistingSRs = foundExistingSRs; inputSrDescriptors = srDescriptors; + this.requestedSrType = requestedSrType; SrDescriptors = new List(); } @@ -488,8 +543,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends out bool repeatForRemainingLUNs) { int remainingCount = inputSrDescriptors.Count - 1 - inputSrDescriptors.IndexOf(lvmOhbaSrDescriptor); - - using (var dialog = new LVMoHBAWarningDialog(lvmOhbaSrDescriptor.Device, remainingCount, foundExistingSRs)) + using (var dialog = new LVMoHBAWarningDialog(lvmOhbaSrDescriptor.Device, remainingCount, foundExistingSRs, lvmOhbaSrDescriptor.SrType, requestedSrType)) { dialog.ShowDialog(owner); repeatForRemainingLUNs = dialog.RepeatForRemainingLUNs; diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs index 3db4558b2..2c4633716 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoISCSI.cs @@ -73,7 +73,6 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends private const string SCSIID = "SCSIid"; private const string CHAPUSER = "chapuser"; private const string CHAPPASSWORD = "chappassword"; - private const string URI = "uri"; private IEnumerable ErrorIcons { diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs index bea70abfe..69ee0b621 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs @@ -108,18 +108,6 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages return DefaultSRName(potentialName, connection.Cache.SRs.Select(sr => sr.Name())); } - public static String ExtractUUID(String p) - { - List lst = SR.ParseSRListXML(p); - - foreach (SR.SRInfo sr in lst) - { - return sr.UUID; - } - - return null; - } - public static String GetEntry(Dictionary dconf, String Key, String Default) { if (dconf.ContainsKey(Key)) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs index a194158cd..371158b09 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs @@ -70,6 +70,16 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages } public FibreChannelDevice Device { get; private set; } + + public SR.SRTypes SrType + { + get + { + return this is Gfs2HbaSrDescriptor || this is Gfs2FcoeSrDescriptor + ? SR.SRTypes.gfs2 + : this is FcoeSrDescriptor ? SR.SRTypes.lvmofcoe : SR.SRTypes.lvmohba; + } + } } public class FcoeSrDescriptor : LvmOhbaSrDescriptor diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 0d4d56e69..a9f61ee65 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -20655,7 +20655,16 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to An existing SR was found on the selected LUN. + /// Looks up a localized string similar to Destroy any data present on the disk and create a new {0} SR. + /// + public static string LVMOHBA_WARNING_DIALOG_FORMAT_INFO { + get { + return ResourceManager.GetString("LVMOHBA_WARNING_DIALOG_FORMAT_INFO", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An existing {0} SR was found on the selected LUN. /// public static string LVMOHBA_WARNING_DIALOG_HEADER_FOUND_EXISTING_SR { get { @@ -20684,6 +20693,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Use the existing {0} SR. + /// + public static string LVMOHBA_WARNING_DIALOG_REATTACH_INFO { + get { + return ResourceManager.GetString("LVMOHBA_WARNING_DIALOG_REATTACH_INFO", resourceCulture); + } + } + /// /// Looks up a localized string similar to There is no existing SR to reattach. /// @@ -24444,6 +24462,24 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to The LUN {0} is already in use as SR {1} on your pool. Please select another LUN.. + /// + public static string NEWSR_LUN_IN_USE_ON_SELECTED_POOL { + get { + return ResourceManager.GetString("NEWSR_LUN_IN_USE_ON_SELECTED_POOL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The LUN {0} is already in use as SR {1} on your server. Please select another LUN.. + /// + public static string NEWSR_LUN_IN_USE_ON_SELECTED_SERVER { + get { + return ResourceManager.GetString("NEWSR_LUN_IN_USE_ON_SELECTED_SERVER", resourceCulture); + } + } + /// /// Looks up a localized string similar to This LUN is already in use as SR {0} on server {1}.. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index eb230ff4b..2cf834116 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -7191,8 +7191,11 @@ Standard features only Map virtual disks (VDIs) to individual LUNs on the target SR + + Destroy any data present on the disk and create a new {0} SR + - An existing SR was found on the selected LUN + An existing {0} SR was found on the selected LUN No existing SRs were found on the selected LUN @@ -7203,6 +7206,9 @@ Serial Number: {1} SCSI ID: {2} Size: {3} + + Use the existing {0} SR + There is no existing SR to reattach @@ -8342,6 +8348,12 @@ Do you want to format the disk? This LUN is already in use as SR {0} on pool {1}. + + The LUN {0} is already in use as SR {1} on your pool. Please select another LUN. + + + The LUN {0} is already in use as SR {1} on your server. Please select another LUN. + This LUN is already in use as SR {0} on server {1}. From d4c5a8669803ca62f6992868c1274d3c4ec42589 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Tue, 3 Apr 2018 13:32:22 +0100 Subject: [PATCH 16/18] Fix the SR wizard tests Signed-off-by: Mihaela Stoica --- XenAdminTests/WizardTests/NewSRWizardTest.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XenAdminTests/WizardTests/NewSRWizardTest.cs b/XenAdminTests/WizardTests/NewSRWizardTest.cs index e73a3fc24..ec02291c5 100644 --- a/XenAdminTests/WizardTests/NewSRWizardTest.cs +++ b/XenAdminTests/WizardTests/NewSRWizardTest.cs @@ -106,7 +106,7 @@ namespace XenAdminTests.WizardTests.state1_xml.NewSRWizardTests public class NewSRWizardTest_iSCSI : WizardTest { public NewSRWizardTest_iSCSI() - : base(new string[] { "Type", "Name", "Provisioning", "Location" }, false, false) // can't finish because we haven't implemented probes of iSCSI LUNs etc. + : base(new string[] { "Type", "Name", "Location" }, false, false) // can't finish because we haven't implemented probes of iSCSI LUNs etc. { } protected override NewSRWizard NewWizard() @@ -125,7 +125,7 @@ namespace XenAdminTests.WizardTests.state1_xml.NewSRWizardTests public class NewSRWizardTest_HBA : WizardTest { public NewSRWizardTest_HBA() - : base(new string[] { "Type", "Name", "Provisioning", "Location" }, true, false) + : base(new string[] { "Type", "Name", "Location" }, true, false) { } protected override NewSRWizard NewWizard() @@ -149,7 +149,7 @@ namespace XenAdminTests.WizardTests.state1_xml.NewSRWizardTests public class NewSRWizardTest_HBANoSelection : WizardTest { public NewSRWizardTest_HBANoSelection() - : base(new string[] { "Type", "Name", "Provisioning", "Location" }, false, false) + : base(new string[] { "Type", "Name", "Location" }, false, false) { } protected override NewSRWizard NewWizard() From 2943b048fad729a483f279e2b4a5429e0428715b Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Tue, 3 Apr 2018 13:52:34 +0100 Subject: [PATCH 17/18] CP-17099: Remove unused function Signed-off-by: Mihaela Stoica --- XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs index 69ee0b621..d75d8a8ab 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardHelpers.cs @@ -107,13 +107,5 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages { return DefaultSRName(potentialName, connection.Cache.SRs.Select(sr => sr.Name())); } - - public static String GetEntry(Dictionary dconf, String Key, String Default) - { - if (dconf.ContainsKey(Key)) - return dconf[Key]; - - return Default; - } } } From 5d4a9270ebd18a8b9f18168c0c691e03a1fdea7a Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Tue, 3 Apr 2018 15:14:42 +0100 Subject: [PATCH 18/18] Simplified class hierarchies for the SrDescriptors. Among others, we avoid the presence of irrelevant key-value pairs in the DeviceConfig . Signed-off-by: Konstantina Chremmou --- XenAdmin/Wizards/NewSRWizard.cs | 14 ++-- .../NewSRWizard_Pages/Frontends/LVMoFCoE.cs | 4 +- .../NewSRWizard_Pages/Frontends/LVMoHBA.cs | 44 ++++++------- .../Frontends/LVMoHBASummary.cs | 30 ++++----- .../Wizards/NewSRWizard_Pages/SrWizardType.cs | 64 +++++++++++-------- 5 files changed, 83 insertions(+), 73 deletions(-) diff --git a/XenAdmin/Wizards/NewSRWizard.cs b/XenAdmin/Wizards/NewSRWizard.cs index ebe9fb1b1..a914b2572 100644 --- a/XenAdmin/Wizards/NewSRWizard.cs +++ b/XenAdmin/Wizards/NewSRWizard.cs @@ -199,7 +199,7 @@ namespace XenAdmin.Wizards return success; } - private bool CanShowLVMoHBASummaryPage(List SrDescriptors) + private bool CanShowLVMoHBASummaryPage(List SrDescriptors) { string description = m_srWizardType.Description; string name = m_srWizardType.SrName; @@ -207,14 +207,14 @@ namespace XenAdmin.Wizards List names = xenConnection.Cache.SRs.Select(sr => sr.Name()).ToList(); m_srWizardType.SrDescriptors.Clear(); - foreach (var lvmOhbaSrDescriptor in SrDescriptors) + foreach (var descriptor in SrDescriptors) { - lvmOhbaSrDescriptor.Name = name; + descriptor.Name = name; if (!string.IsNullOrEmpty(description)) - lvmOhbaSrDescriptor.Description = description; + descriptor.Description = description; - m_srWizardType.SrDescriptors.Add(lvmOhbaSrDescriptor); - m_srWizardType.IsGfs2 = lvmOhbaSrDescriptor is Gfs2HbaSrDescriptor || lvmOhbaSrDescriptor is Gfs2FcoeSrDescriptor; + m_srWizardType.SrDescriptors.Add(descriptor); + m_srWizardType.IsGfs2 = descriptor is Gfs2HbaSrDescriptor || descriptor is Gfs2FcoeSrDescriptor; names.Add(name); name = SrWizardHelpers.DefaultSRName(m_srWizardType is SrWizardType_Hba ? Messages.NEWSR_HBA_DEFAULT_NAME @@ -637,7 +637,7 @@ namespace XenAdmin.Wizards foreach (var srDescriptor in m_srWizardType.SrDescriptors) { - var srType = srDescriptor is LvmOhbaSrDescriptor ? (srDescriptor as LvmOhbaSrDescriptor).SrType : m_srWizardType.Type; + var srType = srDescriptor is FibreChannelDescriptor ? (srDescriptor as FibreChannelDescriptor).SrType : m_srWizardType.Type; if (String.IsNullOrEmpty(srDescriptor.UUID)) { // Don't need to show any warning, as the only destructive creates diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs index c4210320e..a7e2bd760 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoFCoE.cs @@ -48,12 +48,12 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends public override string HelpID { get { return "Location_FCOE"; } } - protected override LvmOhbaSrDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) + protected override FibreChannelDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) { return new FcoeSrDescriptor(device); } - protected override LvmOhbaSrDescriptor CreateGfs2Descriptor(FibreChannelDevice device) + protected override FibreChannelDescriptor CreateGfs2Descriptor(FibreChannelDevice device) { return new Gfs2FcoeSrDescriptor(device); } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs index c92a9fd0b..4c75c0920 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs @@ -61,17 +61,17 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends public virtual bool ShowNicColumn { get { return false; } } - protected LvmOhbaSrDescriptor CreateSrDescriptor(FibreChannelDevice device) + private FibreChannelDescriptor CreateSrDescriptor(FibreChannelDevice device) { return SrType == SR.SRTypes.gfs2 ? CreateGfs2Descriptor(device) : CreateLvmSrDescriptor(device); } - protected virtual LvmOhbaSrDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) + protected virtual FibreChannelDescriptor CreateLvmSrDescriptor(FibreChannelDevice device) { - return new LvmOhbaSrDescriptor(device, Connection); + return new LvmOhbaSrDescriptor(device); } - protected virtual LvmOhbaSrDescriptor CreateGfs2Descriptor(FibreChannelDevice device) + protected virtual FibreChannelDescriptor CreateGfs2Descriptor(FibreChannelDevice device) { return new Gfs2HbaSrDescriptor(device); } @@ -95,11 +95,11 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends cancel = true; return; } - - SrDescriptors = new List(); - var existingSrDescriptors = new List(); - var formatDiskDescriptors = new List(); + SrDescriptors = new List(); + + var existingSrDescriptors = new List(); + var formatDiskDescriptors = new List(); var performSecondProbe = Helpers.KolkataOrGreater(Connection) && !Helpers.FeatureForbidden(Connection, Host.CorosyncDisabled) && SrType != SR.SRTypes.lvmofcoe; // gfs2 over fcoe is not supported yet @@ -225,7 +225,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends } } - private bool RunProbe(Host master, LvmOhbaSrDescriptor srDescriptor, out List srs) + private bool RunProbe(Host master, FibreChannelDescriptor srDescriptor, out List srs) { srs = null; var action = new SrProbeAction(Connection, master, srDescriptor.SrType, srDescriptor.DeviceConfig); @@ -446,7 +446,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends } } - public List SrDescriptors { get; private set; } + public List SrDescriptors { get; private set; } /// /// min size @@ -521,29 +521,29 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends private class LVMoHBAWarningDialogLauncher { - private readonly List inputSrDescriptors; + private readonly List inputSrDescriptors; private readonly bool foundExistingSRs; private readonly IWin32Window owner; private readonly SR.SRTypes requestedSrType; - public List SrDescriptors { get; private set; } + public List SrDescriptors { get; private set; } public bool Cancelled { get; private set; } - public LVMoHBAWarningDialogLauncher(IWin32Window owner, List srDescriptors, + public LVMoHBAWarningDialogLauncher(IWin32Window owner, List srDescriptors, bool foundExistingSRs, SR.SRTypes requestedSrType) { this.owner = owner; this.foundExistingSRs = foundExistingSRs; inputSrDescriptors = srDescriptors; this.requestedSrType = requestedSrType; - SrDescriptors = new List(); + SrDescriptors = new List(); } - private UserSelectedOption GetSelectedOption(LvmOhbaSrDescriptor lvmOhbaSrDescriptor, + private UserSelectedOption GetSelectedOption(FibreChannelDescriptor descriptor, out bool repeatForRemainingLUNs) { - int remainingCount = inputSrDescriptors.Count - 1 - inputSrDescriptors.IndexOf(lvmOhbaSrDescriptor); - using (var dialog = new LVMoHBAWarningDialog(lvmOhbaSrDescriptor.Device, remainingCount, foundExistingSRs, lvmOhbaSrDescriptor.SrType, requestedSrType)) + int remainingCount = inputSrDescriptors.Count - 1 - inputSrDescriptors.IndexOf(descriptor); + using (var dialog = new LVMoHBAWarningDialog(descriptor.Device, remainingCount, foundExistingSRs, descriptor.SrType, requestedSrType)) { dialog.ShowDialog(owner); repeatForRemainingLUNs = dialog.RepeatForRemainingLUNs; @@ -556,21 +556,21 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends bool repeatForRemainingLUNs = false; UserSelectedOption selectedOption = UserSelectedOption.Cancel; - foreach (LvmOhbaSrDescriptor lvmOhbaSrDescriptor in inputSrDescriptors) + foreach (var descriptor in inputSrDescriptors) { if (!repeatForRemainingLUNs) { - selectedOption = GetSelectedOption(lvmOhbaSrDescriptor, out repeatForRemainingLUNs); + selectedOption = GetSelectedOption(descriptor, out repeatForRemainingLUNs); } switch (selectedOption) { case UserSelectedOption.Format: - lvmOhbaSrDescriptor.UUID = null; - SrDescriptors.Add(lvmOhbaSrDescriptor); + descriptor.UUID = null; + SrDescriptors.Add(descriptor); break; case UserSelectedOption.Reattach: - SrDescriptors.Add(lvmOhbaSrDescriptor); + SrDescriptors.Add(descriptor); break; case UserSelectedOption.Cancel: SrDescriptors.Clear(); diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBASummary.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBASummary.cs index fd8fc31e9..a94136b76 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBASummary.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBASummary.cs @@ -104,9 +104,9 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends return; dataGridViewSummary.Rows.Add(new LVMoHBASummaryHeaderGridViewRow(success, srDescriptors.Count)); - foreach (var lvmOhbaSrDescriptor in srDescriptors) - { - DataGridViewRow row = new LVMoHBASrDescriptorGridViewRow(lvmOhbaSrDescriptor) {Visible = false}; + foreach (var descriptor in srDescriptors) + { + DataGridViewRow row = new LVMoHBASrDescriptorGridViewRow(descriptor) { Visible = false }; dataGridViewSummary.Rows.Add(row); } } @@ -241,19 +241,19 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends protected override DataGridViewTextBoxCell GetDetailsCell() { - LvmOhbaSrDescriptor lvmOhbaSrDescriptor = srDescriptor as LvmOhbaSrDescriptor; - string text = lvmOhbaSrDescriptor != null - ? string.Format(Messages.NEWSR_LVMOHBA_SUMMARY_DETAILS_CELL_TEXT, - lvmOhbaSrDescriptor.Name, - Util.DiskSizeString(lvmOhbaSrDescriptor.Device.Size), - lvmOhbaSrDescriptor.Device.Serial) - : srDescriptor.Name; - + var descriptor = srDescriptor as FibreChannelDescriptor; + string text = descriptor != null + ? string.Format(Messages.NEWSR_LVMOHBA_SUMMARY_DETAILS_CELL_TEXT, + descriptor.Name, + Util.DiskSizeString(descriptor.Device.Size), + descriptor.Device.Serial) + : srDescriptor.Name; + return new DataGridViewTextBoxCell - { - Value = text, - Style = {Padding = new Padding(10, 0, 0, 0)} - }; + { + Value = text, + Style = {Padding = new Padding(10, 0, 0, 0)} + }; } } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs index 371158b09..29315784f 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs @@ -52,66 +52,76 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages public string UUID { get; set; } } - public class LvmOhbaSrDescriptor : SrDescriptor + public abstract class FibreChannelDescriptor : SrDescriptor { - public LvmOhbaSrDescriptor(FibreChannelDevice device, IXenConnection connection) + protected FibreChannelDescriptor(FibreChannelDevice device, string descrFormat) { Device = device; - DeviceConfig["SCSIid"] = device.SCSIid; - - Description = string.Format(Messages.NEWSR_LVMOHBA_DESCRIPTION, device.Vendor, device.Serial); + Description = string.Format(descrFormat, device.Vendor, device.Serial); } - public LvmOhbaSrDescriptor(FibreChannelDevice device) - { - Device = device; - - Description = string.Format(Messages.NEWSR_LVMOHBA_DESCRIPTION, device.Vendor, device.Serial); - } + public abstract SR.SRTypes SrType { get; } public FibreChannelDevice Device { get; private set; } + } - public SR.SRTypes SrType + public class LvmOhbaSrDescriptor : FibreChannelDescriptor + { + public LvmOhbaSrDescriptor(FibreChannelDevice device) + : base(device, Messages.NEWSR_LVMOHBA_DESCRIPTION) { - get - { - return this is Gfs2HbaSrDescriptor || this is Gfs2FcoeSrDescriptor - ? SR.SRTypes.gfs2 - : this is FcoeSrDescriptor ? SR.SRTypes.lvmofcoe : SR.SRTypes.lvmohba; - } + DeviceConfig["SCSIid"] = device.SCSIid; + } + + public override SR.SRTypes SrType + { + get { return SR.SRTypes.lvmohba; } } } - public class FcoeSrDescriptor : LvmOhbaSrDescriptor + public class FcoeSrDescriptor : FibreChannelDescriptor { - public FcoeSrDescriptor(FibreChannelDevice device) : base(device) + public FcoeSrDescriptor(FibreChannelDevice device) + : base(device, Messages.NEWSR_LVMOFCOE_DESCRIPTION) { DeviceConfig["SCSIid"] = device.SCSIid; DeviceConfig["path"] = device.Path; + } - Description = string.Format(Messages.NEWSR_LVMOFCOE_DESCRIPTION, device.Vendor, device.Serial); + public override SR.SRTypes SrType + { + get { return SR.SRTypes.lvmofcoe; } } } - public class Gfs2HbaSrDescriptor : LvmOhbaSrDescriptor + public class Gfs2HbaSrDescriptor : FibreChannelDescriptor { public Gfs2HbaSrDescriptor(FibreChannelDevice device) - : base(device) + : base(device, Messages.NEWSR_LVMOHBA_DESCRIPTION) { DeviceConfig["provider"] = "hba"; DeviceConfig["ScsiId"] = device.SCSIid; - Description = string.Format(Messages.NEWSR_LVMOHBA_DESCRIPTION, device.Vendor, device.Serial); + } + + public override SR.SRTypes SrType + { + get { return SR.SRTypes.gfs2; } } } - public class Gfs2FcoeSrDescriptor : FcoeSrDescriptor + public class Gfs2FcoeSrDescriptor : FibreChannelDescriptor { public Gfs2FcoeSrDescriptor(FibreChannelDevice device) - : base(device) + : base(device, Messages.NEWSR_LVMOFCOE_DESCRIPTION) { DeviceConfig["provider"] = "fcoe"; DeviceConfig["ScsiId"] = device.SCSIid; - Description = string.Format(Messages.NEWSR_LVMOFCOE_DESCRIPTION, device.Vendor, device.Serial); + DeviceConfig["path"] = device.Path; + } + + public override SR.SRTypes SrType + { + get { return SR.SRTypes.gfs2; } } }