2016-08-09 12:12:34 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) Citrix Systems, Inc.
|
|
|
|
* All rights reserved.
|
2017-09-13 18:14:07 +02:00
|
|
|
*
|
2016-08-09 12:12:34 +02:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
2017-09-13 18:14:07 +02:00
|
|
|
*
|
2016-08-09 12:12:34 +02:00
|
|
|
* 1) Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
2017-09-13 18:14:07 +02:00
|
|
|
*
|
2016-08-09 12:12:34 +02:00
|
|
|
* 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.
|
2017-09-13 18:14:07 +02:00
|
|
|
*
|
2016-08-09 12:12:34 +02:00
|
|
|
* 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;
|
2017-09-13 18:14:07 +02:00
|
|
|
using System.ComponentModel;
|
|
|
|
using System.Globalization;
|
|
|
|
using Newtonsoft.Json;
|
2016-08-09 12:12:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
namespace XenAPI
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// individual machine serving provisioning (block) data
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
public partial class PVS_server : XenObject<PVS_server>
|
|
|
|
{
|
2019-06-19 10:11:30 +02:00
|
|
|
#region Constructors
|
|
|
|
|
2016-08-09 12:12:34 +02:00
|
|
|
public PVS_server()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public PVS_server(string uuid,
|
|
|
|
string[] addresses,
|
|
|
|
long first_port,
|
|
|
|
long last_port,
|
|
|
|
XenRef<PVS_site> site)
|
|
|
|
{
|
|
|
|
this.uuid = uuid;
|
|
|
|
this.addresses = addresses;
|
|
|
|
this.first_port = first_port;
|
|
|
|
this.last_port = last_port;
|
|
|
|
this.site = site;
|
|
|
|
}
|
|
|
|
|
2019-06-19 10:11:30 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new PVS_server from a Hashtable.
|
|
|
|
/// Note that the fields not contained in the Hashtable
|
|
|
|
/// will be created with their default values.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="table"></param>
|
|
|
|
public PVS_server(Hashtable table)
|
|
|
|
: this()
|
|
|
|
{
|
|
|
|
UpdateFrom(table);
|
|
|
|
}
|
|
|
|
|
2016-08-09 12:12:34 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new PVS_server from a Proxy_PVS_server.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="proxy"></param>
|
|
|
|
public PVS_server(Proxy_PVS_server proxy)
|
|
|
|
{
|
2019-06-19 10:11:30 +02:00
|
|
|
UpdateFrom(proxy);
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
2019-06-19 10:11:30 +02:00
|
|
|
#endregion
|
|
|
|
|
2018-02-16 17:27:30 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Updates each field of this instance with the value of
|
|
|
|
/// the corresponding field of a given PVS_server.
|
|
|
|
/// </summary>
|
2016-08-09 12:12:34 +02:00
|
|
|
public override void UpdateFrom(PVS_server update)
|
|
|
|
{
|
|
|
|
uuid = update.uuid;
|
|
|
|
addresses = update.addresses;
|
|
|
|
first_port = update.first_port;
|
|
|
|
last_port = update.last_port;
|
|
|
|
site = update.site;
|
|
|
|
}
|
|
|
|
|
2019-06-19 10:11:30 +02:00
|
|
|
internal void UpdateFrom(Proxy_PVS_server proxy)
|
2016-08-09 12:12:34 +02:00
|
|
|
{
|
2018-03-22 13:30:43 +01:00
|
|
|
uuid = proxy.uuid == null ? null : proxy.uuid;
|
2016-08-09 12:12:34 +02:00
|
|
|
addresses = proxy.addresses == null ? new string[] {} : (string [])proxy.addresses;
|
2018-03-22 13:30:43 +01:00
|
|
|
first_port = proxy.first_port == null ? 0 : long.Parse(proxy.first_port);
|
|
|
|
last_port = proxy.last_port == null ? 0 : long.Parse(proxy.last_port);
|
2016-08-09 12:12:34 +02:00
|
|
|
site = proxy.site == null ? null : XenRef<PVS_site>.Create(proxy.site);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Proxy_PVS_server ToProxy()
|
|
|
|
{
|
|
|
|
Proxy_PVS_server result_ = new Proxy_PVS_server();
|
2017-09-13 18:14:07 +02:00
|
|
|
result_.uuid = uuid ?? "";
|
2016-08-09 12:12:34 +02:00
|
|
|
result_.addresses = addresses;
|
|
|
|
result_.first_port = first_port.ToString();
|
|
|
|
result_.last_port = last_port.ToString();
|
2017-09-13 18:14:07 +02:00
|
|
|
result_.site = site ?? "";
|
2016-08-09 12:12:34 +02:00
|
|
|
return result_;
|
|
|
|
}
|
|
|
|
|
2018-02-16 17:27:30 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Given a Hashtable with field-value pairs, it updates the fields of this PVS_server
|
|
|
|
/// 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.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="table"></param>
|
2018-02-16 17:27:30 +01:00
|
|
|
public void UpdateFrom(Hashtable table)
|
2016-08-09 12:12:34 +02:00
|
|
|
{
|
2018-02-16 17:27:30 +01:00
|
|
|
if (table.ContainsKey("uuid"))
|
2018-02-23 17:06:32 +01:00
|
|
|
uuid = Marshalling.ParseString(table, "uuid");
|
2018-02-16 17:27:30 +01:00
|
|
|
if (table.ContainsKey("addresses"))
|
2018-02-23 17:06:32 +01:00
|
|
|
addresses = Marshalling.ParseStringArray(table, "addresses");
|
2018-02-16 17:27:30 +01:00
|
|
|
if (table.ContainsKey("first_port"))
|
2018-02-23 17:06:32 +01:00
|
|
|
first_port = Marshalling.ParseLong(table, "first_port");
|
2018-02-16 17:27:30 +01:00
|
|
|
if (table.ContainsKey("last_port"))
|
2018-02-23 17:06:32 +01:00
|
|
|
last_port = Marshalling.ParseLong(table, "last_port");
|
2018-02-16 17:27:30 +01:00
|
|
|
if (table.ContainsKey("site"))
|
2018-02-23 17:06:32 +01:00
|
|
|
site = Marshalling.ParseRef<PVS_site>(table, "site");
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public bool DeepEquals(PVS_server other)
|
|
|
|
{
|
|
|
|
if (ReferenceEquals(null, other))
|
|
|
|
return false;
|
|
|
|
if (ReferenceEquals(this, other))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return Helper.AreEqual2(this._uuid, other._uuid) &&
|
|
|
|
Helper.AreEqual2(this._addresses, other._addresses) &&
|
|
|
|
Helper.AreEqual2(this._first_port, other._first_port) &&
|
|
|
|
Helper.AreEqual2(this._last_port, other._last_port) &&
|
|
|
|
Helper.AreEqual2(this._site, other._site);
|
|
|
|
}
|
|
|
|
|
2017-11-17 12:19:01 +01:00
|
|
|
internal static List<PVS_server> ProxyArrayToObjectList(Proxy_PVS_server[] input)
|
|
|
|
{
|
|
|
|
var result = new List<PVS_server>();
|
|
|
|
foreach (var item in input)
|
|
|
|
result.Add(new PVS_server(item));
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2016-08-09 12:12:34 +02:00
|
|
|
public override string SaveChanges(Session session, string opaqueRef, PVS_server server)
|
|
|
|
{
|
|
|
|
if (opaqueRef == null)
|
2018-02-14 12:03:48 +01:00
|
|
|
{
|
|
|
|
System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server");
|
2016-08-09 12:12:34 +02:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
throw new InvalidOperationException("This type has no read/write properties");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// Get a record containing the current state of the given PVS_server.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static PVS_server get_record(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_record(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return new PVS_server(session.XmlRpcProxy.pvs_server_get_record(session.opaque_ref, _pvs_server ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get a reference to the PVS_server instance with the specified UUID.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_uuid">UUID of object to return</param>
|
|
|
|
public static XenRef<PVS_server> get_by_uuid(Session session, string _uuid)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_by_uuid(session.opaque_ref, _uuid);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return XenRef<PVS_server>.Create(session.XmlRpcProxy.pvs_server_get_by_uuid(session.opaque_ref, _uuid ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the uuid field of the given PVS_server.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static string get_uuid(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_uuid(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return session.XmlRpcProxy.pvs_server_get_uuid(session.opaque_ref, _pvs_server ?? "").parse();
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the addresses field of the given PVS_server.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static string[] get_addresses(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_addresses(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return (string [])session.XmlRpcProxy.pvs_server_get_addresses(session.opaque_ref, _pvs_server ?? "").parse();
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the first_port field of the given PVS_server.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static long get_first_port(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_first_port(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return long.Parse(session.XmlRpcProxy.pvs_server_get_first_port(session.opaque_ref, _pvs_server ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the last_port field of the given PVS_server.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static long get_last_port(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_last_port(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return long.Parse(session.XmlRpcProxy.pvs_server_get_last_port(session.opaque_ref, _pvs_server ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the site field of the given PVS_server.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static XenRef<PVS_site> get_site(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_site(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return XenRef<PVS_site>.Create(session.XmlRpcProxy.pvs_server_get_site(session.opaque_ref, _pvs_server ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// introduce new PVS server
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_addresses">IPv4 addresses of the server</param>
|
|
|
|
/// <param name="_first_port">first UDP port accepted by this server</param>
|
|
|
|
/// <param name="_last_port">last UDP port accepted by this server</param>
|
|
|
|
/// <param name="_site">PVS site this server is a part of</param>
|
|
|
|
public static XenRef<PVS_server> introduce(Session session, string[] _addresses, long _first_port, long _last_port, string _site)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_introduce(session.opaque_ref, _addresses, _first_port, _last_port, _site);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return XenRef<PVS_server>.Create(session.XmlRpcProxy.pvs_server_introduce(session.opaque_ref, _addresses, _first_port.ToString(), _last_port.ToString(), _site ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// introduce new PVS server
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_addresses">IPv4 addresses of the server</param>
|
|
|
|
/// <param name="_first_port">first UDP port accepted by this server</param>
|
|
|
|
/// <param name="_last_port">last UDP port accepted by this server</param>
|
|
|
|
/// <param name="_site">PVS site this server is a part of</param>
|
|
|
|
public static XenRef<Task> async_introduce(Session session, string[] _addresses, long _first_port, long _last_port, string _site)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.async_pvs_server_introduce(session.opaque_ref, _addresses, _first_port, _last_port, _site);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return XenRef<Task>.Create(session.XmlRpcProxy.async_pvs_server_introduce(session.opaque_ref, _addresses, _first_port.ToString(), _last_port.ToString(), _site ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// forget a PVS server
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static void forget(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
session.JsonRpcClient.pvs_server_forget(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
session.XmlRpcProxy.pvs_server_forget(session.opaque_ref, _pvs_server ?? "").parse();
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// forget a PVS server
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
/// <param name="_pvs_server">The opaque_ref of the given pvs_server</param>
|
|
|
|
public static XenRef<Task> async_forget(Session session, string _pvs_server)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.async_pvs_server_forget(session.opaque_ref, _pvs_server);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return XenRef<Task>.Create(session.XmlRpcProxy.async_pvs_server_forget(session.opaque_ref, _pvs_server ?? "").parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Return a list of all the PVS_servers known to the system.
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
public static List<XenRef<PVS_server>> get_all(Session session)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_all(session.opaque_ref);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return XenRef<PVS_server>.Create(session.XmlRpcProxy.pvs_server_get_all(session.opaque_ref).parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get all the PVS_server Records at once, in a single XML RPC call
|
2017-09-13 18:14:07 +02:00
|
|
|
/// First published in XenServer 7.1.
|
2016-08-09 12:12:34 +02:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session</param>
|
|
|
|
public static Dictionary<XenRef<PVS_server>, PVS_server> get_all_records(Session session)
|
|
|
|
{
|
2017-09-13 18:14:07 +02:00
|
|
|
if (session.JsonRpcClient != null)
|
2018-02-23 17:06:32 +01:00
|
|
|
return session.JsonRpcClient.pvs_server_get_all_records(session.opaque_ref);
|
2017-09-13 18:14:07 +02:00
|
|
|
else
|
2020-01-30 01:02:24 +01:00
|
|
|
return XenRef<PVS_server>.Create<Proxy_PVS_server>(session.XmlRpcProxy.pvs_server_get_all_records(session.opaque_ref).parse());
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Unique identifier/object reference
|
|
|
|
/// </summary>
|
|
|
|
public virtual string uuid
|
|
|
|
{
|
|
|
|
get { return _uuid; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
if (!Helper.AreEqual(value, _uuid))
|
|
|
|
{
|
|
|
|
_uuid = value;
|
|
|
|
NotifyPropertyChanged("uuid");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-13 18:14:07 +02:00
|
|
|
private string _uuid = "";
|
2016-08-09 12:12:34 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// IPv4 addresses of this server
|
|
|
|
/// </summary>
|
|
|
|
public virtual string[] addresses
|
|
|
|
{
|
|
|
|
get { return _addresses; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
if (!Helper.AreEqual(value, _addresses))
|
|
|
|
{
|
|
|
|
_addresses = value;
|
|
|
|
NotifyPropertyChanged("addresses");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-13 18:14:07 +02:00
|
|
|
private string[] _addresses = {};
|
2016-08-09 12:12:34 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// First UDP port accepted by this server
|
|
|
|
/// </summary>
|
|
|
|
public virtual long first_port
|
|
|
|
{
|
|
|
|
get { return _first_port; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
if (!Helper.AreEqual(value, _first_port))
|
|
|
|
{
|
|
|
|
_first_port = value;
|
|
|
|
NotifyPropertyChanged("first_port");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-13 18:14:07 +02:00
|
|
|
private long _first_port = 0;
|
2016-08-09 12:12:34 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Last UDP port accepted by this server
|
|
|
|
/// </summary>
|
|
|
|
public virtual long last_port
|
|
|
|
{
|
|
|
|
get { return _last_port; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
if (!Helper.AreEqual(value, _last_port))
|
|
|
|
{
|
|
|
|
_last_port = value;
|
|
|
|
NotifyPropertyChanged("last_port");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-13 18:14:07 +02:00
|
|
|
private long _last_port = 0;
|
2016-08-09 12:12:34 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// PVS site this server is part of
|
|
|
|
/// </summary>
|
2017-09-13 18:14:07 +02:00
|
|
|
[JsonConverter(typeof(XenRefConverter<PVS_site>))]
|
2016-08-09 12:12:34 +02:00
|
|
|
public virtual XenRef<PVS_site> site
|
|
|
|
{
|
|
|
|
get { return _site; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
if (!Helper.AreEqual(value, _site))
|
|
|
|
{
|
|
|
|
_site = value;
|
|
|
|
NotifyPropertyChanged("site");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-13 18:14:07 +02:00
|
|
|
private XenRef<PVS_site> _site = new XenRef<PVS_site>("OpaqueRef:NULL");
|
2016-08-09 12:12:34 +02:00
|
|
|
}
|
|
|
|
}
|