2013-06-24 13:41:48 +02:00
/ *
* Copyright ( c ) Citrix Systems , Inc .
* All rights reserved .
2017-09-13 18:14:07 +02:00
*
2013-06-24 13:41:48 +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
*
2013-06-24 13:41:48 +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
*
2013-06-24 13:41:48 +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
*
2013-06-24 13:41:48 +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 .
* /
2013-07-03 12:22:08 +02:00
2013-06-24 13:41:48 +02:00
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 ;
2013-06-24 13:41:48 +02:00
namespace XenAPI
{
2014-05-16 17:58:13 +02:00
/// <summary>
/// A physical network interface (note separate VLANs are represented as several PIFs)
/// First published in XenServer 4.0.
/// </summary>
2013-06-24 13:41:48 +02:00
public partial class PIF : XenObject < PIF >
{
2019-06-19 10:11:30 +02:00
#region Constructors
2013-06-24 13:41:48 +02:00
public PIF ( )
{
}
public PIF ( string uuid ,
string device ,
XenRef < Network > network ,
XenRef < Host > host ,
string MAC ,
long MTU ,
long VLAN ,
XenRef < PIF_metrics > metrics ,
bool physical ,
bool currently_attached ,
ip_configuration_mode ip_configuration_mode ,
string IP ,
string netmask ,
string gateway ,
string DNS ,
XenRef < Bond > bond_slave_of ,
List < XenRef < Bond > > bond_master_of ,
XenRef < VLAN > VLAN_master_of ,
List < XenRef < VLAN > > VLAN_slave_of ,
bool management ,
Dictionary < string , string > other_config ,
bool disallow_unplug ,
List < XenRef < Tunnel > > tunnel_access_PIF_of ,
List < XenRef < Tunnel > > tunnel_transport_PIF_of ,
ipv6_configuration_mode ipv6_configuration_mode ,
string [ ] IPv6 ,
string ipv6_gateway ,
2014-05-16 17:58:13 +02:00
primary_address_type primary_address_type ,
bool managed ,
2015-06-25 11:38:12 +02:00
Dictionary < string , string > properties ,
2017-11-17 12:19:01 +01:00
string [ ] capabilities ,
2018-01-17 09:58:15 +01:00
pif_igmp_status igmp_snooping_status ,
List < XenRef < Network_sriov > > sriov_physical_PIF_of ,
List < XenRef < Network_sriov > > sriov_logical_PIF_of ,
2018-02-27 12:34:57 +01:00
XenRef < PCI > PCI )
2013-06-24 13:41:48 +02:00
{
this . uuid = uuid ;
this . device = device ;
this . network = network ;
this . host = host ;
this . MAC = MAC ;
this . MTU = MTU ;
this . VLAN = VLAN ;
this . metrics = metrics ;
this . physical = physical ;
this . currently_attached = currently_attached ;
this . ip_configuration_mode = ip_configuration_mode ;
this . IP = IP ;
this . netmask = netmask ;
this . gateway = gateway ;
this . DNS = DNS ;
this . bond_slave_of = bond_slave_of ;
this . bond_master_of = bond_master_of ;
this . VLAN_master_of = VLAN_master_of ;
this . VLAN_slave_of = VLAN_slave_of ;
this . management = management ;
this . other_config = other_config ;
this . disallow_unplug = disallow_unplug ;
this . tunnel_access_PIF_of = tunnel_access_PIF_of ;
this . tunnel_transport_PIF_of = tunnel_transport_PIF_of ;
this . ipv6_configuration_mode = ipv6_configuration_mode ;
this . IPv6 = IPv6 ;
this . ipv6_gateway = ipv6_gateway ;
this . primary_address_type = primary_address_type ;
2014-05-16 17:58:13 +02:00
this . managed = managed ;
this . properties = properties ;
2015-06-25 11:38:12 +02:00
this . capabilities = capabilities ;
2017-11-17 12:19:01 +01:00
this . igmp_snooping_status = igmp_snooping_status ;
2018-01-17 09:58:15 +01:00
this . sriov_physical_PIF_of = sriov_physical_PIF_of ;
this . sriov_logical_PIF_of = sriov_logical_PIF_of ;
2018-02-27 12:34:57 +01:00
this . PCI = PCI ;
2013-06-24 13:41:48 +02:00
}
2019-06-19 10:11:30 +02:00
/// <summary>
/// Creates a new PIF 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 PIF ( Hashtable table )
: this ( )
{
UpdateFrom ( table ) ;
}
2013-06-24 13:41:48 +02:00
/// <summary>
/// Creates a new PIF from a Proxy_PIF.
/// </summary>
/// <param name="proxy"></param>
public PIF ( Proxy_PIF proxy )
{
2019-06-19 10:11:30 +02:00
UpdateFrom ( proxy ) ;
2013-06-24 13:41:48 +02:00
}
2019-06-19 10:11:30 +02:00
#endregion
2018-03-15 04:16:00 +01:00
/// <summary>
/// Updates each field of this instance with the value of
/// the corresponding field of a given PIF.
/// </summary>
2013-06-24 13:41:48 +02:00
public override void UpdateFrom ( PIF update )
{
uuid = update . uuid ;
device = update . device ;
network = update . network ;
host = update . host ;
MAC = update . MAC ;
MTU = update . MTU ;
VLAN = update . VLAN ;
metrics = update . metrics ;
physical = update . physical ;
currently_attached = update . currently_attached ;
ip_configuration_mode = update . ip_configuration_mode ;
IP = update . IP ;
netmask = update . netmask ;
gateway = update . gateway ;
DNS = update . DNS ;
bond_slave_of = update . bond_slave_of ;
bond_master_of = update . bond_master_of ;
VLAN_master_of = update . VLAN_master_of ;
VLAN_slave_of = update . VLAN_slave_of ;
management = update . management ;
other_config = update . other_config ;
disallow_unplug = update . disallow_unplug ;
tunnel_access_PIF_of = update . tunnel_access_PIF_of ;
tunnel_transport_PIF_of = update . tunnel_transport_PIF_of ;
ipv6_configuration_mode = update . ipv6_configuration_mode ;
IPv6 = update . IPv6 ;
ipv6_gateway = update . ipv6_gateway ;
primary_address_type = update . primary_address_type ;
2014-05-16 17:58:13 +02:00
managed = update . managed ;
properties = update . properties ;
2015-06-25 11:38:12 +02:00
capabilities = update . capabilities ;
2017-11-17 12:19:01 +01:00
igmp_snooping_status = update . igmp_snooping_status ;
2018-01-17 09:58:15 +01:00
sriov_physical_PIF_of = update . sriov_physical_PIF_of ;
sriov_logical_PIF_of = update . sriov_logical_PIF_of ;
2018-02-27 12:34:57 +01:00
PCI = update . PCI ;
2013-06-24 13:41:48 +02:00
}
2019-06-19 10:11:30 +02:00
internal void UpdateFrom ( Proxy_PIF proxy )
2013-06-24 13:41:48 +02:00
{
2018-03-22 13:30:43 +01:00
uuid = proxy . uuid = = null ? null : proxy . uuid ;
device = proxy . device = = null ? null : proxy . device ;
2013-06-24 13:41:48 +02:00
network = proxy . network = = null ? null : XenRef < Network > . Create ( proxy . network ) ;
host = proxy . host = = null ? null : XenRef < Host > . Create ( proxy . host ) ;
2018-03-22 13:30:43 +01:00
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 ) ;
2013-06-24 13:41:48 +02:00
metrics = proxy . metrics = = null ? null : XenRef < PIF_metrics > . 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 ) ;
2018-03-22 13:30:43 +01:00
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 ;
2013-06-24 13:41:48 +02:00
bond_slave_of = proxy . bond_slave_of = = null ? null : XenRef < Bond > . Create ( proxy . bond_slave_of ) ;
bond_master_of = proxy . bond_master_of = = null ? null : XenRef < Bond > . Create ( proxy . bond_master_of ) ;
VLAN_master_of = proxy . VLAN_master_of = = null ? null : XenRef < VLAN > . Create ( proxy . VLAN_master_of ) ;
VLAN_slave_of = proxy . VLAN_slave_of = = null ? null : XenRef < VLAN > . Create ( proxy . VLAN_slave_of ) ;
management = ( bool ) proxy . management ;
other_config = proxy . other_config = = null ? null : Maps . convert_from_proxy_string_string ( proxy . other_config ) ;
disallow_unplug = ( bool ) proxy . disallow_unplug ;
tunnel_access_PIF_of = proxy . tunnel_access_PIF_of = = null ? null : XenRef < Tunnel > . Create ( proxy . tunnel_access_PIF_of ) ;
tunnel_transport_PIF_of = proxy . tunnel_transport_PIF_of = = null ? null : XenRef < Tunnel > . 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 ;
2018-03-22 13:30:43 +01:00
ipv6_gateway = proxy . ipv6_gateway = = null ? null : proxy . ipv6_gateway ;
2013-06-24 13:41:48 +02:00
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 ) ;
2014-05-16 17:58:13 +02:00
managed = ( bool ) proxy . managed ;
properties = proxy . properties = = null ? null : Maps . convert_from_proxy_string_string ( proxy . properties ) ;
2015-06-25 11:38:12 +02:00
capabilities = proxy . capabilities = = null ? new string [ ] { } : ( string [ ] ) proxy . capabilities ;
2017-11-17 12:19:01 +01:00
igmp_snooping_status = proxy . igmp_snooping_status = = null ? ( pif_igmp_status ) 0 : ( pif_igmp_status ) Helper . EnumParseDefault ( typeof ( pif_igmp_status ) , ( string ) proxy . igmp_snooping_status ) ;
2018-01-17 09:58:15 +01:00
sriov_physical_PIF_of = proxy . sriov_physical_PIF_of = = null ? null : XenRef < Network_sriov > . Create ( proxy . sriov_physical_PIF_of ) ;
sriov_logical_PIF_of = proxy . sriov_logical_PIF_of = = null ? null : XenRef < Network_sriov > . Create ( proxy . sriov_logical_PIF_of ) ;
2018-02-27 12:34:57 +01:00
PCI = proxy . PCI = = null ? null : XenRef < PCI > . Create ( proxy . PCI ) ;
2013-06-24 13:41:48 +02:00
}
public Proxy_PIF ToProxy ( )
{
Proxy_PIF result_ = new Proxy_PIF ( ) ;
2017-09-13 18:14:07 +02:00
result_ . uuid = uuid ? ? "" ;
result_ . device = device ? ? "" ;
result_ . network = network ? ? "" ;
result_ . host = host ? ? "" ;
result_ . MAC = MAC ? ? "" ;
2013-06-24 13:41:48 +02:00
result_ . MTU = MTU . ToString ( ) ;
result_ . VLAN = VLAN . ToString ( ) ;
2017-09-13 18:14:07 +02:00
result_ . metrics = metrics ? ? "" ;
2013-06-24 13:41:48 +02:00
result_ . physical = physical ;
result_ . currently_attached = currently_attached ;
result_ . ip_configuration_mode = ip_configuration_mode_helper . ToString ( ip_configuration_mode ) ;
2017-09-13 18:14:07 +02:00
result_ . IP = IP ? ? "" ;
result_ . netmask = netmask ? ? "" ;
result_ . gateway = gateway ? ? "" ;
result_ . DNS = DNS ? ? "" ;
result_ . bond_slave_of = bond_slave_of ? ? "" ;
2018-03-22 13:30:43 +01:00
result_ . bond_master_of = bond_master_of = = null ? new string [ ] { } : Helper . RefListToStringArray ( bond_master_of ) ;
2017-09-13 18:14:07 +02:00
result_ . VLAN_master_of = VLAN_master_of ? ? "" ;
2018-03-22 13:30:43 +01:00
result_ . VLAN_slave_of = VLAN_slave_of = = null ? new string [ ] { } : Helper . RefListToStringArray ( VLAN_slave_of ) ;
2013-06-24 13:41:48 +02:00
result_ . management = management ;
result_ . other_config = Maps . convert_to_proxy_string_string ( other_config ) ;
result_ . disallow_unplug = disallow_unplug ;
2018-03-22 13:30:43 +01:00
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 ) ;
2013-06-24 13:41:48 +02:00
result_ . ipv6_configuration_mode = ipv6_configuration_mode_helper . ToString ( ipv6_configuration_mode ) ;
result_ . IPv6 = IPv6 ;
2017-09-13 18:14:07 +02:00
result_ . ipv6_gateway = ipv6_gateway ? ? "" ;
2013-06-24 13:41:48 +02:00
result_ . primary_address_type = primary_address_type_helper . ToString ( primary_address_type ) ;
2014-05-16 17:58:13 +02:00
result_ . managed = managed ;
result_ . properties = Maps . convert_to_proxy_string_string ( properties ) ;
2015-06-25 11:38:12 +02:00
result_ . capabilities = capabilities ;
2017-11-17 12:19:01 +01:00
result_ . igmp_snooping_status = pif_igmp_status_helper . ToString ( igmp_snooping_status ) ;
2018-04-10 15:04:11 +02:00
result_ . sriov_physical_PIF_of = sriov_physical_PIF_of = = null ? new string [ ] { } : Helper . RefListToStringArray ( sriov_physical_PIF_of ) ;
result_ . sriov_logical_PIF_of = sriov_logical_PIF_of = = null ? new string [ ] { } : Helper . RefListToStringArray ( sriov_logical_PIF_of ) ;
2018-02-27 12:34:57 +01:00
result_ . PCI = PCI ? ? "" ;
2013-06-24 13:41:48 +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 PIF
/// 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.
2013-06-24 13:41:48 +02:00
/// </summary>
/// <param name="table"></param>
2018-02-16 17:27:30 +01:00
public void UpdateFrom ( Hashtable table )
2013-06-24 13:41:48 +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 ( "device" ) )
2018-02-23 17:06:32 +01:00
device = Marshalling . ParseString ( table , "device" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "network" ) )
2018-02-23 17:06:32 +01:00
network = Marshalling . ParseRef < Network > ( table , "network" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "host" ) )
2018-02-23 17:06:32 +01:00
host = Marshalling . ParseRef < Host > ( table , "host" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "MAC" ) )
2018-02-23 17:06:32 +01:00
MAC = Marshalling . ParseString ( table , "MAC" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "MTU" ) )
2018-02-23 17:06:32 +01:00
MTU = Marshalling . ParseLong ( table , "MTU" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "VLAN" ) )
2018-02-23 17:06:32 +01:00
VLAN = Marshalling . ParseLong ( table , "VLAN" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "metrics" ) )
2018-02-23 17:06:32 +01:00
metrics = Marshalling . ParseRef < PIF_metrics > ( table , "metrics" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "physical" ) )
2018-02-23 17:06:32 +01:00
physical = Marshalling . ParseBool ( table , "physical" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "currently_attached" ) )
2018-02-23 17:06:32 +01:00
currently_attached = Marshalling . ParseBool ( table , "currently_attached" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "ip_configuration_mode" ) )
2018-02-23 17:06:32 +01:00
ip_configuration_mode = ( ip_configuration_mode ) Helper . EnumParseDefault ( typeof ( ip_configuration_mode ) , Marshalling . ParseString ( table , "ip_configuration_mode" ) ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "IP" ) )
2018-02-23 17:06:32 +01:00
IP = Marshalling . ParseString ( table , "IP" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "netmask" ) )
2018-02-23 17:06:32 +01:00
netmask = Marshalling . ParseString ( table , "netmask" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "gateway" ) )
2018-02-23 17:06:32 +01:00
gateway = Marshalling . ParseString ( table , "gateway" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "DNS" ) )
2018-02-23 17:06:32 +01:00
DNS = Marshalling . ParseString ( table , "DNS" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "bond_slave_of" ) )
2018-02-23 17:06:32 +01:00
bond_slave_of = Marshalling . ParseRef < Bond > ( table , "bond_slave_of" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "bond_master_of" ) )
2018-02-23 17:06:32 +01:00
bond_master_of = Marshalling . ParseSetRef < Bond > ( table , "bond_master_of" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "VLAN_master_of" ) )
2018-02-23 17:06:32 +01:00
VLAN_master_of = Marshalling . ParseRef < VLAN > ( table , "VLAN_master_of" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "VLAN_slave_of" ) )
2018-02-23 17:06:32 +01:00
VLAN_slave_of = Marshalling . ParseSetRef < VLAN > ( table , "VLAN_slave_of" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "management" ) )
2018-02-23 17:06:32 +01:00
management = Marshalling . ParseBool ( table , "management" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "other_config" ) )
2018-02-23 17:06:32 +01:00
other_config = Maps . convert_from_proxy_string_string ( Marshalling . ParseHashTable ( table , "other_config" ) ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "disallow_unplug" ) )
2018-02-23 17:06:32 +01:00
disallow_unplug = Marshalling . ParseBool ( table , "disallow_unplug" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "tunnel_access_PIF_of" ) )
2018-02-23 17:06:32 +01:00
tunnel_access_PIF_of = Marshalling . ParseSetRef < Tunnel > ( table , "tunnel_access_PIF_of" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "tunnel_transport_PIF_of" ) )
2018-02-23 17:06:32 +01:00
tunnel_transport_PIF_of = Marshalling . ParseSetRef < Tunnel > ( table , "tunnel_transport_PIF_of" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "ipv6_configuration_mode" ) )
2018-02-23 17:06:32 +01:00
ipv6_configuration_mode = ( ipv6_configuration_mode ) Helper . EnumParseDefault ( typeof ( ipv6_configuration_mode ) , Marshalling . ParseString ( table , "ipv6_configuration_mode" ) ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "IPv6" ) )
2018-02-23 17:06:32 +01:00
IPv6 = Marshalling . ParseStringArray ( table , "IPv6" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "ipv6_gateway" ) )
2018-02-23 17:06:32 +01:00
ipv6_gateway = Marshalling . ParseString ( table , "ipv6_gateway" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "primary_address_type" ) )
2018-02-23 17:06:32 +01:00
primary_address_type = ( primary_address_type ) Helper . EnumParseDefault ( typeof ( primary_address_type ) , Marshalling . ParseString ( table , "primary_address_type" ) ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "managed" ) )
2018-02-23 17:06:32 +01:00
managed = Marshalling . ParseBool ( table , "managed" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "properties" ) )
2018-02-23 17:06:32 +01:00
properties = Maps . convert_from_proxy_string_string ( Marshalling . ParseHashTable ( table , "properties" ) ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "capabilities" ) )
2018-02-23 17:06:32 +01:00
capabilities = Marshalling . ParseStringArray ( table , "capabilities" ) ;
2018-02-16 17:27:30 +01:00
if ( table . ContainsKey ( "igmp_snooping_status" ) )
2018-02-23 17:06:32 +01:00
igmp_snooping_status = ( pif_igmp_status ) Helper . EnumParseDefault ( typeof ( pif_igmp_status ) , Marshalling . ParseString ( table , "igmp_snooping_status" ) ) ;
2018-02-27 12:34:57 +01:00
if ( table . ContainsKey ( "sriov_physical_PIF_of" ) )
sriov_physical_PIF_of = Marshalling . ParseSetRef < Network_sriov > ( table , "sriov_physical_PIF_of" ) ;
if ( table . ContainsKey ( "sriov_logical_PIF_of" ) )
sriov_logical_PIF_of = Marshalling . ParseSetRef < Network_sriov > ( table , "sriov_logical_PIF_of" ) ;
if ( table . ContainsKey ( "PCI" ) )
PCI = Marshalling . ParseRef < PCI > ( table , "PCI" ) ;
2013-06-24 13:41:48 +02:00
}
public bool DeepEquals ( PIF other )
{
if ( ReferenceEquals ( null , other ) )
return false ;
if ( ReferenceEquals ( this , other ) )
return true ;
return Helper . AreEqual2 ( this . _uuid , other . _uuid ) & &
Helper . AreEqual2 ( this . _device , other . _device ) & &
Helper . AreEqual2 ( this . _network , other . _network ) & &
Helper . AreEqual2 ( this . _host , other . _host ) & &
Helper . AreEqual2 ( this . _MAC , other . _MAC ) & &
Helper . AreEqual2 ( this . _MTU , other . _MTU ) & &
Helper . AreEqual2 ( this . _VLAN , other . _VLAN ) & &
Helper . AreEqual2 ( this . _metrics , other . _metrics ) & &
Helper . AreEqual2 ( this . _physical , other . _physical ) & &
Helper . AreEqual2 ( this . _currently_attached , other . _currently_attached ) & &
Helper . AreEqual2 ( this . _ip_configuration_mode , other . _ip_configuration_mode ) & &
Helper . AreEqual2 ( this . _IP , other . _IP ) & &
Helper . AreEqual2 ( this . _netmask , other . _netmask ) & &
Helper . AreEqual2 ( this . _gateway , other . _gateway ) & &
Helper . AreEqual2 ( this . _DNS , other . _DNS ) & &
Helper . AreEqual2 ( this . _bond_slave_of , other . _bond_slave_of ) & &
Helper . AreEqual2 ( this . _bond_master_of , other . _bond_master_of ) & &
Helper . AreEqual2 ( this . _VLAN_master_of , other . _VLAN_master_of ) & &
Helper . AreEqual2 ( this . _VLAN_slave_of , other . _VLAN_slave_of ) & &
Helper . AreEqual2 ( this . _management , other . _management ) & &
Helper . AreEqual2 ( this . _other_config , other . _other_config ) & &
Helper . AreEqual2 ( this . _disallow_unplug , other . _disallow_unplug ) & &
Helper . AreEqual2 ( this . _tunnel_access_PIF_of , other . _tunnel_access_PIF_of ) & &
Helper . AreEqual2 ( this . _tunnel_transport_PIF_of , other . _tunnel_transport_PIF_of ) & &
Helper . AreEqual2 ( this . _ipv6_configuration_mode , other . _ipv6_configuration_mode ) & &
Helper . AreEqual2 ( this . _IPv6 , other . _IPv6 ) & &
Helper . AreEqual2 ( this . _ipv6_gateway , other . _ipv6_gateway ) & &
2014-05-16 17:58:13 +02:00
Helper . AreEqual2 ( this . _primary_address_type , other . _primary_address_type ) & &
Helper . AreEqual2 ( this . _managed , other . _managed ) & &
2015-06-25 11:38:12 +02:00
Helper . AreEqual2 ( this . _properties , other . _properties ) & &
2017-11-17 12:19:01 +01:00
Helper . AreEqual2 ( this . _capabilities , other . _capabilities ) & &
2018-01-17 09:58:15 +01:00
Helper . AreEqual2 ( this . _igmp_snooping_status , other . _igmp_snooping_status ) & &
Helper . AreEqual2 ( this . _sriov_physical_PIF_of , other . _sriov_physical_PIF_of ) & &
Helper . AreEqual2 ( this . _sriov_logical_PIF_of , other . _sriov_logical_PIF_of ) & &
2018-02-27 12:34:57 +01:00
Helper . AreEqual2 ( this . _PCI , other . _PCI ) ;
2017-11-17 12:19:01 +01:00
}
internal static List < PIF > ProxyArrayToObjectList ( Proxy_PIF [ ] input )
{
var result = new List < PIF > ( ) ;
foreach ( var item in input )
result . Add ( new PIF ( item ) ) ;
return result ;
2013-06-24 13:41:48 +02:00
}
public override string SaveChanges ( Session session , string opaqueRef , PIF 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" ) ;
2013-06-24 13:41:48 +02:00
return "" ;
}
else
{
if ( ! Helper . AreEqual2 ( _other_config , server . _other_config ) )
{
PIF . set_other_config ( session , opaqueRef , _other_config ) ;
}
return null ;
}
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get a record containing the current state of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static PIF get_record ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_record ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return new PIF ( session . XmlRpcProxy . pif_get_record ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get a reference to the PIF instance with the specified UUID.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_uuid">UUID of object to return</param>
2013-06-24 13:41:48 +02:00
public static XenRef < PIF > 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 . pif_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 < PIF > . Create ( session . XmlRpcProxy . pif_get_by_uuid ( session . opaque_ref , _uuid ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the uuid field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_uuid ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_uuid ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_uuid ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the device field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_device ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_device ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_device ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the network field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static XenRef < Network > get_network ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_network ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Network > . Create ( session . XmlRpcProxy . pif_get_network ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the host field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static XenRef < Host > get_host ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_host ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Host > . Create ( session . XmlRpcProxy . pif_get_host ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the MAC field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_MAC ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_mac ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_mac ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the MTU field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static long get_MTU ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_mtu ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return long . Parse ( session . XmlRpcProxy . pif_get_mtu ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the VLAN field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static long get_VLAN ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_vlan ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return long . Parse ( session . XmlRpcProxy . pif_get_vlan ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the metrics field of the given PIF.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static XenRef < PIF_metrics > get_metrics ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_metrics ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF_metrics > . Create ( session . XmlRpcProxy . pif_get_metrics ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the physical field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static bool get_physical ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_physical ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( bool ) session . XmlRpcProxy . pif_get_physical ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the currently_attached field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static bool get_currently_attached ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_currently_attached ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( bool ) session . XmlRpcProxy . pif_get_currently_attached ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the ip_configuration_mode field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static ip_configuration_mode get_ip_configuration_mode ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_ip_configuration_mode ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( ip_configuration_mode ) Helper . EnumParseDefault ( typeof ( ip_configuration_mode ) , ( string ) session . XmlRpcProxy . pif_get_ip_configuration_mode ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the IP field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_IP ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_ip ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_ip ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the netmask field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_netmask ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_netmask ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_netmask ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the gateway field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_gateway ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_gateway ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_gateway ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the DNS field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_DNS ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_dns ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_dns ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the bond_slave_of field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static XenRef < Bond > get_bond_slave_of ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_bond_slave_of ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Bond > . Create ( session . XmlRpcProxy . pif_get_bond_slave_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the bond_master_of field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static List < XenRef < Bond > > get_bond_master_of ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_bond_master_of ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Bond > . Create ( session . XmlRpcProxy . pif_get_bond_master_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the VLAN_master_of field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static XenRef < VLAN > get_VLAN_master_of ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_vlan_master_of ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < VLAN > . Create ( session . XmlRpcProxy . pif_get_vlan_master_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the VLAN_slave_of field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static List < XenRef < VLAN > > get_VLAN_slave_of ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_vlan_slave_of ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < VLAN > . Create ( session . XmlRpcProxy . pif_get_vlan_slave_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the management field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static bool get_management ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_management ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( bool ) session . XmlRpcProxy . pif_get_management ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the other_config field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static Dictionary < string , string > get_other_config ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_other_config ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return Maps . convert_from_proxy_string_string ( session . XmlRpcProxy . pif_get_other_config ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the disallow_unplug field of the given PIF.
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static bool get_disallow_unplug ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_disallow_unplug ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( bool ) session . XmlRpcProxy . pif_get_disallow_unplug ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the tunnel_access_PIF_of field of the given PIF.
/// First published in XenServer 5.6 FP1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static List < XenRef < Tunnel > > get_tunnel_access_PIF_of ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_tunnel_access_pif_of ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Tunnel > . Create ( session . XmlRpcProxy . pif_get_tunnel_access_pif_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the tunnel_transport_PIF_of field of the given PIF.
/// First published in XenServer 5.6 FP1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static List < XenRef < Tunnel > > get_tunnel_transport_PIF_of ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_tunnel_transport_pif_of ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Tunnel > . Create ( session . XmlRpcProxy . pif_get_tunnel_transport_pif_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the ipv6_configuration_mode field of the given PIF.
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static ipv6_configuration_mode get_ipv6_configuration_mode ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_ipv6_configuration_mode ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( ipv6_configuration_mode ) Helper . EnumParseDefault ( typeof ( ipv6_configuration_mode ) , ( string ) session . XmlRpcProxy . pif_get_ipv6_configuration_mode ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the IPv6 field of the given PIF.
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string [ ] get_IPv6 ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_ipv6 ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( string [ ] ) session . XmlRpcProxy . pif_get_ipv6 ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the ipv6_gateway field of the given PIF.
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static string get_ipv6_gateway ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_ipv6_gateway ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return session . XmlRpcProxy . pif_get_ipv6_gateway ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the primary_address_type field of the given PIF.
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2013-06-24 13:41:48 +02:00
public static primary_address_type get_primary_address_type ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_primary_address_type ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( primary_address_type ) Helper . EnumParseDefault ( typeof ( primary_address_type ) , ( string ) session . XmlRpcProxy . pif_get_primary_address_type ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get the managed field of the given PIF.
/// First published in XenServer 6.2 SP1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static bool get_managed ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_managed ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( bool ) session . XmlRpcProxy . pif_get_managed ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Get the properties field of the given PIF.
2015-04-23 15:16:53 +02:00
/// First published in XenServer 6.5.
2014-05-16 17:58:13 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static Dictionary < string , string > get_properties ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_properties ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return Maps . convert_from_proxy_string_string ( session . XmlRpcProxy . pif_get_properties ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
2015-06-25 11:38:12 +02:00
/// <summary>
/// Get the capabilities field of the given PIF.
2017-06-28 18:00:22 +02:00
/// First published in XenServer 7.0.
2015-06-25 11:38:12 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static string [ ] get_capabilities ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_capabilities ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return ( string [ ] ) session . XmlRpcProxy . pif_get_capabilities ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2015-06-25 11:38:12 +02:00
}
2017-11-17 12:19:01 +01:00
/// <summary>
/// Get the igmp_snooping_status field of the given PIF.
2017-11-22 15:33:26 +01:00
/// First published in XenServer 7.3.
2017-11-17 12:19:01 +01:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static pif_igmp_status get_igmp_snooping_status ( Session session , string _pif )
{
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_get_igmp_snooping_status ( session . opaque_ref , _pif ) ;
2017-11-17 12:19:01 +01:00
else
2020-01-30 01:02:24 +01:00
return ( pif_igmp_status ) Helper . EnumParseDefault ( typeof ( pif_igmp_status ) , ( string ) session . XmlRpcProxy . pif_get_igmp_snooping_status ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2017-11-17 12:19:01 +01:00
}
2018-01-17 09:58:15 +01:00
/// <summary>
/// Get the sriov_physical_PIF_of field of the given PIF.
2018-07-03 11:40:50 +02:00
/// First published in XenServer 7.5.
2018-01-17 09:58:15 +01:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static List < XenRef < Network_sriov > > get_sriov_physical_PIF_of ( Session session , string _pif )
{
2018-02-27 12:34:57 +01:00
if ( session . JsonRpcClient ! = null )
2018-03-15 04:16:00 +01:00
return session . JsonRpcClient . pif_get_sriov_physical_pif_of ( session . opaque_ref , _pif ) ;
2018-02-27 12:34:57 +01:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Network_sriov > . Create ( session . XmlRpcProxy . pif_get_sriov_physical_pif_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2018-01-17 09:58:15 +01:00
}
/// <summary>
/// Get the sriov_logical_PIF_of field of the given PIF.
2018-07-03 11:40:50 +02:00
/// First published in XenServer 7.5.
2018-01-17 09:58:15 +01:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static List < XenRef < Network_sriov > > get_sriov_logical_PIF_of ( Session session , string _pif )
{
2018-02-27 12:34:57 +01:00
if ( session . JsonRpcClient ! = null )
2018-03-15 04:16:00 +01:00
return session . JsonRpcClient . pif_get_sriov_logical_pif_of ( session . opaque_ref , _pif ) ;
2018-02-27 12:34:57 +01:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Network_sriov > . Create ( session . XmlRpcProxy . pif_get_sriov_logical_pif_of ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2018-01-17 09:58:15 +01:00
}
/// <summary>
2018-02-27 12:34:57 +01:00
/// Get the PCI field of the given PIF.
2018-07-03 11:40:50 +02:00
/// First published in XenServer 7.5.
2018-01-17 09:58:15 +01:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2018-02-27 12:34:57 +01:00
public static XenRef < PCI > get_PCI ( Session session , string _pif )
2018-01-17 09:58:15 +01:00
{
2018-02-27 12:34:57 +01:00
if ( session . JsonRpcClient ! = null )
2018-03-15 04:16:00 +01:00
return session . JsonRpcClient . pif_get_pci ( session . opaque_ref , _pif ) ;
2018-02-27 12:34:57 +01:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PCI > . Create ( session . XmlRpcProxy . pif_get_pci ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2018-01-17 09:58:15 +01:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Set the other_config field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_other_config">New value to set</param>
2013-06-24 13:41:48 +02:00
public static void set_other_config ( Session session , string _pif , Dictionary < string , string > _other_config )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_set_other_config ( session . opaque_ref , _pif , _other_config ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_set_other_config ( session . opaque_ref , _pif ? ? "" , Maps . convert_to_proxy_string_string ( _other_config ) ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Add the given key-value pair to the other_config field of the given PIF.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_key">Key to add</param>
/// <param name="_value">Value to add</param>
2013-06-24 13:41:48 +02:00
public static void add_to_other_config ( Session session , string _pif , string _key , string _value )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_add_to_other_config ( session . opaque_ref , _pif , _key , _value ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_add_to_other_config ( session . opaque_ref , _pif ? ? "" , _key ? ? "" , _value ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Remove the given key and its corresponding value from the other_config field of the given PIF. If the key is not in that Map, then do nothing.
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_key">Key to remove</param>
2013-06-24 13:41:48 +02:00
public static void remove_from_other_config ( Session session , string _pif , string _key )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_remove_from_other_config ( session . opaque_ref , _pif , _key ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_remove_from_other_config ( session . opaque_ref , _pif ? ? "" , _key ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a VLAN interface from an existing physical interface. This call is deprecated: use VLAN.create instead
/// First published in XenServer 4.0.
2016-01-28 22:29:29 +01:00
/// Deprecated since XenServer 4.1.
2014-05-16 17:58:13 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device">physical interface on which to create the VLAN interface</param>
/// <param name="_network">network to which this interface should be connected</param>
/// <param name="_host">physical machine to which this PIF is connected</param>
/// <param name="_vlan">VLAN tag for the new interface</param>
2016-01-28 22:29:29 +01:00
[Deprecated("XenServer 4.1")]
2013-06-24 13:41:48 +02:00
public static XenRef < PIF > create_VLAN ( Session session , string _device , string _network , string _host , long _vlan )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_create_vlan ( session . opaque_ref , _device , _network , _host , _vlan ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_create_vlan ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _vlan . ToString ( ) ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a VLAN interface from an existing physical interface. This call is deprecated: use VLAN.create instead
/// First published in XenServer 4.0.
2016-01-28 22:29:29 +01:00
/// Deprecated since XenServer 4.1.
2014-05-16 17:58:13 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device">physical interface on which to create the VLAN interface</param>
/// <param name="_network">network to which this interface should be connected</param>
/// <param name="_host">physical machine to which this PIF is connected</param>
/// <param name="_vlan">VLAN tag for the new interface</param>
2016-01-28 22:29:29 +01:00
[Deprecated("XenServer 4.1")]
2013-06-24 13:41:48 +02:00
public static XenRef < Task > async_create_VLAN ( Session session , string _device , string _network , string _host , long _vlan )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_create_vlan ( session . opaque_ref , _device , _network , _host , _vlan ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_create_vlan ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _vlan . ToString ( ) ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Destroy the PIF object (provided it is a VLAN interface). This call is deprecated: use VLAN.destroy or Bond.destroy instead
/// First published in XenServer 4.0.
2016-01-28 22:29:29 +01:00
/// Deprecated since XenServer 4.1.
2014-05-16 17:58:13 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2016-01-28 22:29:29 +01:00
[Deprecated("XenServer 4.1")]
2014-05-16 17:58:13 +02:00
public static void destroy ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_destroy ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_destroy ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Destroy the PIF object (provided it is a VLAN interface). This call is deprecated: use VLAN.destroy or Bond.destroy instead
/// First published in XenServer 4.0.
2016-01-28 22:29:29 +01:00
/// Deprecated since XenServer 4.1.
2014-05-16 17:58:13 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
2016-01-28 22:29:29 +01:00
[Deprecated("XenServer 4.1")]
2014-05-16 17:58:13 +02:00
public static XenRef < Task > async_destroy ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_destroy ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_destroy ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Reconfigure the IP address settings for this interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_mode">whether to use dynamic/static/no-assignment</param>
/// <param name="_ip">the new IP address</param>
/// <param name="_netmask">the new netmask</param>
/// <param name="_gateway">the new gateway</param>
/// <param name="_dns">the new DNS settings</param>
public static void reconfigure_ip ( Session session , string _pif , ip_configuration_mode _mode , string _ip , string _netmask , string _gateway , string _dns )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_reconfigure_ip ( session . opaque_ref , _pif , _mode , _ip , _netmask , _gateway , _dns ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_reconfigure_ip ( session . opaque_ref , _pif ? ? "" , ip_configuration_mode_helper . ToString ( _mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Reconfigure the IP address settings for this interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_mode">whether to use dynamic/static/no-assignment</param>
/// <param name="_ip">the new IP address</param>
/// <param name="_netmask">the new netmask</param>
/// <param name="_gateway">the new gateway</param>
/// <param name="_dns">the new DNS settings</param>
public static XenRef < Task > async_reconfigure_ip ( Session session , string _pif , ip_configuration_mode _mode , string _ip , string _netmask , string _gateway , string _dns )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_reconfigure_ip ( session . opaque_ref , _pif , _mode , _ip , _netmask , _gateway , _dns ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_reconfigure_ip ( session . opaque_ref , _pif ? ? "" , ip_configuration_mode_helper . ToString ( _mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Reconfigure the IPv6 address settings for this interface
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_mode">whether to use dynamic/static/no-assignment</param>
2017-09-13 18:14:07 +02:00
/// <param name="_ipv6">the new IPv6 address (in <addr>/<prefix length> format)</param>
2014-05-16 17:58:13 +02:00
/// <param name="_gateway">the new gateway</param>
/// <param name="_dns">the new DNS settings</param>
public static void reconfigure_ipv6 ( Session session , string _pif , ipv6_configuration_mode _mode , string _ipv6 , string _gateway , string _dns )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_reconfigure_ipv6 ( session . opaque_ref , _pif , _mode , _ipv6 , _gateway , _dns ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_reconfigure_ipv6 ( session . opaque_ref , _pif ? ? "" , ipv6_configuration_mode_helper . ToString ( _mode ) , _ipv6 ? ? "" , _gateway ? ? "" , _dns ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Reconfigure the IPv6 address settings for this interface
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_mode">whether to use dynamic/static/no-assignment</param>
2017-09-13 18:14:07 +02:00
/// <param name="_ipv6">the new IPv6 address (in <addr>/<prefix length> format)</param>
2014-05-16 17:58:13 +02:00
/// <param name="_gateway">the new gateway</param>
/// <param name="_dns">the new DNS settings</param>
public static XenRef < Task > async_reconfigure_ipv6 ( Session session , string _pif , ipv6_configuration_mode _mode , string _ipv6 , string _gateway , string _dns )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_reconfigure_ipv6 ( session . opaque_ref , _pif , _mode , _ipv6 , _gateway , _dns ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_reconfigure_ipv6 ( session . opaque_ref , _pif ? ? "" , ipv6_configuration_mode_helper . ToString ( _mode ) , _ipv6 ? ? "" , _gateway ? ? "" , _dns ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Change the primary address type used by this PIF
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_primary_address_type">Whether to prefer IPv4 or IPv6 connections</param>
public static void set_primary_address_type ( Session session , string _pif , primary_address_type _primary_address_type )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_set_primary_address_type ( session . opaque_ref , _pif , _primary_address_type ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_set_primary_address_type ( session . opaque_ref , _pif ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Change the primary address type used by this PIF
/// Experimental. First published in XenServer 6.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_primary_address_type">Whether to prefer IPv4 or IPv6 connections</param>
public static XenRef < Task > async_set_primary_address_type ( Session session , string _pif , primary_address_type _primary_address_type )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_set_primary_address_type ( session . opaque_ref , _pif , _primary_address_type ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_set_primary_address_type ( session . opaque_ref , _pif ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Scan for physical interfaces on a host and create PIF objects to represent them
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_host">The host on which to scan</param>
2013-06-24 13:41:48 +02:00
public static void scan ( Session session , string _host )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_scan ( session . opaque_ref , _host ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_scan ( session . opaque_ref , _host ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Scan for physical interfaces on a host and create PIF objects to represent them
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_host">The host on which to scan</param>
2013-06-24 13:41:48 +02:00
public static XenRef < Task > async_scan ( Session session , string _host )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_scan ( session . opaque_ref , _host ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_scan ( session . opaque_ref , _host ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a PIF object matching a particular network interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_host">The host on which the interface exists</param>
/// <param name="_mac">The MAC address of the interface</param>
/// <param name="_device">The device name to use for the interface</param>
2013-06-24 13:41:48 +02:00
public static XenRef < PIF > introduce ( Session session , string _host , string _mac , string _device )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_introduce ( session . opaque_ref , _host , _mac , _device ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_introduce ( session . opaque_ref , _host ? ? "" , _mac ? ? "" , _device ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a PIF object matching a particular network interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_host">The host on which the interface exists</param>
/// <param name="_mac">The MAC address of the interface</param>
/// <param name="_device">The device name to use for the interface</param>
2013-06-24 13:41:48 +02:00
public static XenRef < Task > async_introduce ( Session session , string _host , string _mac , string _device )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_introduce ( session . opaque_ref , _host , _mac , _device ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_introduce ( session . opaque_ref , _host ? ? "" , _mac ? ? "" , _device ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a PIF object matching a particular network interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_host">The host on which the interface exists</param>
/// <param name="_mac">The MAC address of the interface</param>
/// <param name="_device">The device name to use for the interface</param>
/// <param name="_managed">Indicates whether the interface is managed by xapi (defaults to "true") First published in XenServer 6.2 SP1.</param>
public static XenRef < PIF > introduce ( Session session , string _host , string _mac , string _device , bool _managed )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_introduce ( session . opaque_ref , _host , _mac , _device , _managed ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_introduce ( session . opaque_ref , _host ? ? "" , _mac ? ? "" , _device ? ? "" , _managed ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Create a PIF object matching a particular network interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_host">The host on which the interface exists</param>
/// <param name="_mac">The MAC address of the interface</param>
/// <param name="_device">The device name to use for the interface</param>
/// <param name="_managed">Indicates whether the interface is managed by xapi (defaults to "true") First published in XenServer 6.2 SP1.</param>
public static XenRef < Task > async_introduce ( Session session , string _host , string _mac , string _device , bool _managed )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_introduce ( session . opaque_ref , _host , _mac , _device , _managed ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_introduce ( session . opaque_ref , _host ? ? "" , _mac ? ? "" , _device ? ? "" , _managed ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Destroy the PIF object matching a particular network interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static void forget ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_forget ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_forget ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Destroy the PIF object matching a particular network interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static XenRef < Task > async_forget ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_forget ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_forget ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Attempt to bring down a physical interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static void unplug ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_unplug ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_unplug ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Attempt to bring down a physical interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static XenRef < Task > async_unplug ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_unplug ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_unplug ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2018-04-10 15:04:11 +02:00
/// <summary>
/// Set whether unplugging the PIF is allowed
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_value">New value to set</param>
public static void set_disallow_unplug ( Session session , string _pif , bool _value )
{
if ( session . JsonRpcClient ! = null )
session . JsonRpcClient . pif_set_disallow_unplug ( session . opaque_ref , _pif , _value ) ;
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_set_disallow_unplug ( session . opaque_ref , _pif ? ? "" , _value ) . parse ( ) ;
2018-04-10 15:04:11 +02:00
}
/// <summary>
/// Set whether unplugging the PIF is allowed
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_value">New value to set</param>
public static XenRef < Task > async_set_disallow_unplug ( Session session , string _pif , bool _value )
{
if ( session . JsonRpcClient ! = null )
return session . JsonRpcClient . async_pif_set_disallow_unplug ( session . opaque_ref , _pif , _value ) ;
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_set_disallow_unplug ( session . opaque_ref , _pif ? ? "" , _value ) . parse ( ) ) ;
2018-04-10 15:04:11 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Attempt to bring up a physical interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static void plug ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_plug ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_plug ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Attempt to bring up a physical interface
/// First published in XenServer 4.1.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static XenRef < Task > async_plug ( Session session , string _pif )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_plug ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_plug ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
public static XenRef < PIF > db_introduce ( Session 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 < string , string > _other_config , bool _disallow_unplug )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
public static XenRef < Task > async_db_introduce ( Session 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 < string , string > _other_config , bool _disallow_unplug )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
/// <param name="_ipv6_configuration_mode"> First published in XenServer 6.0.</param>
/// <param name="_ipv6"> First published in XenServer 6.0.</param>
/// <param name="_ipv6_gateway"> First published in XenServer 6.0.</param>
/// <param name="_primary_address_type"> First published in XenServer 6.0.</param>
2013-06-24 13:41:48 +02:00
public static XenRef < PIF > db_introduce ( Session 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 < string , string > _other_config , bool _disallow_unplug , ipv6_configuration_mode _ipv6_configuration_mode , string [ ] _ipv6 , string _ipv6_gateway , primary_address_type _primary_address_type )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug , _ipv6_configuration_mode , _ipv6 , _ipv6_gateway , _primary_address_type ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug , ipv6_configuration_mode_helper . ToString ( _ipv6_configuration_mode ) , _ipv6 , _ipv6_gateway ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
/// <param name="_ipv6_configuration_mode"> First published in XenServer 6.0.</param>
/// <param name="_ipv6"> First published in XenServer 6.0.</param>
/// <param name="_ipv6_gateway"> First published in XenServer 6.0.</param>
/// <param name="_primary_address_type"> First published in XenServer 6.0.</param>
2013-06-24 13:41:48 +02:00
public static XenRef < Task > async_db_introduce ( Session 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 < string , string > _other_config , bool _disallow_unplug , ipv6_configuration_mode _ipv6_configuration_mode , string [ ] _ipv6 , string _ipv6_gateway , primary_address_type _primary_address_type )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug , _ipv6_configuration_mode , _ipv6 , _ipv6_gateway , _primary_address_type ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug , ipv6_configuration_mode_helper . ToString ( _ipv6_configuration_mode ) , _ipv6 , _ipv6_gateway ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
/// <param name="_ipv6_configuration_mode"> First published in XenServer 6.0.</param>
/// <param name="_ipv6"> First published in XenServer 6.0.</param>
/// <param name="_ipv6_gateway"> First published in XenServer 6.0.</param>
/// <param name="_primary_address_type"> First published in XenServer 6.0.</param>
/// <param name="_managed"> First published in XenServer 6.2 SP1.</param>
public static XenRef < PIF > db_introduce ( Session 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 < string , string > _other_config , bool _disallow_unplug , ipv6_configuration_mode _ipv6_configuration_mode , string [ ] _ipv6 , string _ipv6_gateway , primary_address_type _primary_address_type , bool _managed )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug , _ipv6_configuration_mode , _ipv6 , _ipv6_gateway , _primary_address_type , _managed ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug , ipv6_configuration_mode_helper . ToString ( _ipv6_configuration_mode ) , _ipv6 , _ipv6_gateway ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) , _managed ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
/// <param name="_ipv6_configuration_mode"> First published in XenServer 6.0.</param>
/// <param name="_ipv6"> First published in XenServer 6.0.</param>
/// <param name="_ipv6_gateway"> First published in XenServer 6.0.</param>
/// <param name="_primary_address_type"> First published in XenServer 6.0.</param>
/// <param name="_managed"> First published in XenServer 6.2 SP1.</param>
public static XenRef < Task > async_db_introduce ( Session 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 < string , string > _other_config , bool _disallow_unplug , ipv6_configuration_mode _ipv6_configuration_mode , string [ ] _ipv6 , string _ipv6_gateway , primary_address_type _primary_address_type , bool _managed )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug , _ipv6_configuration_mode , _ipv6 , _ipv6_gateway , _primary_address_type , _managed ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug , ipv6_configuration_mode_helper . ToString ( _ipv6_configuration_mode ) , _ipv6 , _ipv6_gateway ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) , _managed ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
/// <param name="_ipv6_configuration_mode"> First published in XenServer 6.0.</param>
/// <param name="_ipv6"> First published in XenServer 6.0.</param>
/// <param name="_ipv6_gateway"> First published in XenServer 6.0.</param>
/// <param name="_primary_address_type"> First published in XenServer 6.0.</param>
/// <param name="_managed"> First published in XenServer 6.2 SP1.</param>
2015-04-23 15:16:53 +02:00
/// <param name="_properties"> First published in XenServer 6.5.</param>
2014-05-16 17:58:13 +02:00
public static XenRef < PIF > db_introduce ( Session 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 < string , string > _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 < string , string > _properties )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug , _ipv6_configuration_mode , _ipv6 , _ipv6_gateway , _primary_address_type , _managed , _properties ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug , ipv6_configuration_mode_helper . ToString ( _ipv6_configuration_mode ) , _ipv6 , _ipv6_gateway ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) , _managed , Maps . convert_to_proxy_string_string ( _properties ) ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Create a new PIF record in the database only
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_device"></param>
/// <param name="_network"></param>
/// <param name="_host"></param>
/// <param name="_mac"></param>
/// <param name="_mtu"></param>
/// <param name="_vlan"></param>
/// <param name="_physical"></param>
/// <param name="_ip_configuration_mode"></param>
/// <param name="_ip"></param>
/// <param name="_netmask"></param>
/// <param name="_gateway"></param>
/// <param name="_dns"></param>
/// <param name="_bond_slave_of"></param>
/// <param name="_vlan_master_of"></param>
/// <param name="_management"></param>
/// <param name="_other_config"></param>
/// <param name="_disallow_unplug"></param>
/// <param name="_ipv6_configuration_mode"> First published in XenServer 6.0.</param>
/// <param name="_ipv6"> First published in XenServer 6.0.</param>
/// <param name="_ipv6_gateway"> First published in XenServer 6.0.</param>
/// <param name="_primary_address_type"> First published in XenServer 6.0.</param>
/// <param name="_managed"> First published in XenServer 6.2 SP1.</param>
2015-04-23 15:16:53 +02:00
/// <param name="_properties"> First published in XenServer 6.5.</param>
2014-05-16 17:58:13 +02:00
public static XenRef < Task > async_db_introduce ( Session 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 < string , string > _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 < string , string > _properties )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_db_introduce ( session . opaque_ref , _device , _network , _host , _mac , _mtu , _vlan , _physical , _ip_configuration_mode , _ip , _netmask , _gateway , _dns , _bond_slave_of , _vlan_master_of , _management , _other_config , _disallow_unplug , _ipv6_configuration_mode , _ipv6 , _ipv6_gateway , _primary_address_type , _managed , _properties ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_db_introduce ( session . opaque_ref , _device ? ? "" , _network ? ? "" , _host ? ? "" , _mac ? ? "" , _mtu . ToString ( ) , _vlan . ToString ( ) , _physical , ip_configuration_mode_helper . ToString ( _ip_configuration_mode ) , _ip ? ? "" , _netmask ? ? "" , _gateway ? ? "" , _dns ? ? "" , _bond_slave_of ? ? "" , _vlan_master_of ? ? "" , _management , Maps . convert_to_proxy_string_string ( _other_config ) , _disallow_unplug , ipv6_configuration_mode_helper . ToString ( _ipv6_configuration_mode ) , _ipv6 , _ipv6_gateway ? ? "" , primary_address_type_helper . ToString ( _primary_address_type ) , _managed , Maps . convert_to_proxy_string_string ( _properties ) ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Destroy a PIF database record.
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static void db_forget ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_db_forget ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_db_forget ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Destroy a PIF database record.
/// First published in XenServer 5.0.
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
public static XenRef < Task > async_db_forget ( Session session , string _pif )
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_db_forget ( session . opaque_ref , _pif ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_db_forget ( session . opaque_ref , _pif ? ? "" ) . parse ( ) ) ;
2014-05-16 17:58:13 +02:00
}
/// <summary>
/// Set the value of a property of the PIF
2015-04-23 15:16:53 +02:00
/// First published in XenServer 6.5.
2014-05-16 17:58:13 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_name">The property name</param>
/// <param name="_value">The property value</param>
public static void set_property ( Session session , string _pif , string _name , string _value )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
session . JsonRpcClient . pif_set_property ( session . opaque_ref , _pif , _name , _value ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
session . XmlRpcProxy . pif_set_property ( session . opaque_ref , _pif ? ? "" , _name ? ? "" , _value ? ? "" ) . parse ( ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Set the value of a property of the PIF
2015-04-23 15:16:53 +02:00
/// First published in XenServer 6.5.
2014-05-16 17:58:13 +02:00
/// </summary>
/// <param name="session">The session</param>
/// <param name="_pif">The opaque_ref of the given pif</param>
/// <param name="_name">The property name</param>
/// <param name="_value">The property value</param>
public static XenRef < Task > async_set_property ( Session session , string _pif , string _name , string _value )
2013-06-24 13:41:48 +02:00
{
2017-09-13 18:14:07 +02:00
if ( session . JsonRpcClient ! = null )
2018-02-23 17:06:32 +01:00
return session . JsonRpcClient . async_pif_set_property ( session . opaque_ref , _pif , _name , _value ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < Task > . Create ( session . XmlRpcProxy . async_pif_set_property ( session . opaque_ref , _pif ? ? "" , _name ? ? "" , _value ? ? "" ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Return a list of all the PIFs known to the system.
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
2013-06-24 13:41:48 +02:00
public static List < XenRef < PIF > > 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 . pif_get_all ( session . opaque_ref ) ;
2017-09-13 18:14:07 +02:00
else
2020-01-30 01:02:24 +01:00
return XenRef < PIF > . Create ( session . XmlRpcProxy . pif_get_all ( session . opaque_ref ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +02:00
/// <summary>
/// Get all the PIF Records at once, in a single XML RPC call
/// First published in XenServer 4.0.
/// </summary>
/// <param name="session">The session</param>
2013-06-24 13:41:48 +02:00
public static Dictionary < XenRef < PIF > , PIF > 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 . pif_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 < PIF > . Create < Proxy_PIF > ( session . XmlRpcProxy . pif_get_all_records ( session . opaque_ref ) . parse ( ) ) ;
2013-06-24 13:41:48 +02:00
}
2014-05-16 17:58:13 +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 = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// machine-readable name of the interface (e.g. eth0)
/// </summary>
public virtual string device
{
get { return _device ; }
set
{
if ( ! Helper . AreEqual ( value , _device ) )
{
_device = value ;
NotifyPropertyChanged ( "device" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string _device = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// virtual network to which this pif is connected
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefConverter<Network>))]
2014-05-16 17:58:13 +02:00
public virtual XenRef < Network > network
{
get { return _network ; }
set
{
if ( ! Helper . AreEqual ( value , _network ) )
{
_network = value ;
NotifyPropertyChanged ( "network" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private XenRef < Network > _network = new XenRef < Network > ( Helper . NullOpaqueRef ) ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// physical machine to which this pif is connected
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefConverter<Host>))]
2014-05-16 17:58:13 +02:00
public virtual XenRef < Host > host
{
get { return _host ; }
set
{
if ( ! Helper . AreEqual ( value , _host ) )
{
_host = value ;
NotifyPropertyChanged ( "host" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private XenRef < Host > _host = new XenRef < Host > ( Helper . NullOpaqueRef ) ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// ethernet MAC address of physical interface
/// </summary>
public virtual string MAC
{
get { return _MAC ; }
set
{
if ( ! Helper . AreEqual ( value , _MAC ) )
{
_MAC = value ;
NotifyPropertyChanged ( "MAC" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string _MAC = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// MTU in octets
/// </summary>
public virtual long MTU
{
get { return _MTU ; }
set
{
if ( ! Helper . AreEqual ( value , _MTU ) )
{
_MTU = value ;
NotifyPropertyChanged ( "MTU" ) ;
}
}
}
2013-06-24 13:41:48 +02:00
private long _MTU ;
2014-05-16 17:58:13 +02:00
/// <summary>
/// VLAN tag for all traffic passing through this interface
/// </summary>
public virtual long VLAN
{
get { return _VLAN ; }
set
{
if ( ! Helper . AreEqual ( value , _VLAN ) )
{
_VLAN = value ;
NotifyPropertyChanged ( "VLAN" ) ;
}
}
}
2013-06-24 13:41:48 +02:00
private long _VLAN ;
2014-05-16 17:58:13 +02:00
/// <summary>
/// metrics associated with this PIF
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefConverter<PIF_metrics>))]
2014-05-16 17:58:13 +02:00
public virtual XenRef < PIF_metrics > metrics
{
get { return _metrics ; }
set
{
if ( ! Helper . AreEqual ( value , _metrics ) )
{
_metrics = value ;
NotifyPropertyChanged ( "metrics" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private XenRef < PIF_metrics > _metrics = new XenRef < PIF_metrics > ( Helper . NullOpaqueRef ) ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// true if this represents a physical network interface
/// First published in XenServer 4.1.
/// </summary>
public virtual bool physical
{
get { return _physical ; }
set
{
if ( ! Helper . AreEqual ( value , _physical ) )
{
_physical = value ;
NotifyPropertyChanged ( "physical" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private bool _physical = false ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// true if this interface is online
/// First published in XenServer 4.1.
/// </summary>
public virtual bool currently_attached
{
get { return _currently_attached ; }
set
{
if ( ! Helper . AreEqual ( value , _currently_attached ) )
{
_currently_attached = value ;
NotifyPropertyChanged ( "currently_attached" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private bool _currently_attached = true ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Sets if and how this interface gets an IP address
/// First published in XenServer 4.1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(ip_configuration_modeConverter))]
2014-05-16 17:58:13 +02:00
public virtual ip_configuration_mode ip_configuration_mode
{
get { return _ip_configuration_mode ; }
set
{
if ( ! Helper . AreEqual ( value , _ip_configuration_mode ) )
{
_ip_configuration_mode = value ;
NotifyPropertyChanged ( "ip_configuration_mode" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private ip_configuration_mode _ip_configuration_mode = ip_configuration_mode . None ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// IP address
/// First published in XenServer 4.1.
/// </summary>
public virtual string IP
{
get { return _IP ; }
set
{
if ( ! Helper . AreEqual ( value , _IP ) )
{
_IP = value ;
NotifyPropertyChanged ( "IP" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string _IP = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// IP netmask
/// First published in XenServer 4.1.
/// </summary>
public virtual string netmask
{
get { return _netmask ; }
set
{
if ( ! Helper . AreEqual ( value , _netmask ) )
{
_netmask = value ;
NotifyPropertyChanged ( "netmask" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string _netmask = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// IP gateway
/// First published in XenServer 4.1.
/// </summary>
public virtual string gateway
{
get { return _gateway ; }
set
{
if ( ! Helper . AreEqual ( value , _gateway ) )
{
_gateway = value ;
NotifyPropertyChanged ( "gateway" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string _gateway = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
2018-12-05 12:42:36 +01:00
/// Comma separated list of the IP addresses of the DNS servers to use
2014-05-16 17:58:13 +02:00
/// First published in XenServer 4.1.
/// </summary>
public virtual string DNS
{
get { return _DNS ; }
set
{
if ( ! Helper . AreEqual ( value , _DNS ) )
{
_DNS = value ;
NotifyPropertyChanged ( "DNS" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string _DNS = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Indicates which bond this interface is part of
/// First published in XenServer 4.1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefConverter<Bond>))]
2014-05-16 17:58:13 +02:00
public virtual XenRef < Bond > bond_slave_of
{
get { return _bond_slave_of ; }
set
{
if ( ! Helper . AreEqual ( value , _bond_slave_of ) )
{
_bond_slave_of = value ;
NotifyPropertyChanged ( "bond_slave_of" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private XenRef < Bond > _bond_slave_of = new XenRef < Bond > ( Helper . NullOpaqueRef ) ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Indicates this PIF represents the results of a bond
/// First published in XenServer 4.1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefListConverter<Bond>))]
2014-05-16 17:58:13 +02:00
public virtual List < XenRef < Bond > > bond_master_of
{
get { return _bond_master_of ; }
set
{
if ( ! Helper . AreEqual ( value , _bond_master_of ) )
{
_bond_master_of = value ;
NotifyPropertyChanged ( "bond_master_of" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private List < XenRef < Bond > > _bond_master_of = new List < XenRef < Bond > > ( ) { } ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Indicates wich VLAN this interface receives untagged traffic from
/// First published in XenServer 4.1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefConverter<VLAN>))]
2014-05-16 17:58:13 +02:00
public virtual XenRef < VLAN > VLAN_master_of
{
get { return _VLAN_master_of ; }
set
{
if ( ! Helper . AreEqual ( value , _VLAN_master_of ) )
{
_VLAN_master_of = value ;
NotifyPropertyChanged ( "VLAN_master_of" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private XenRef < VLAN > _VLAN_master_of = new XenRef < VLAN > ( Helper . NullOpaqueRef ) ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Indicates which VLANs this interface transmits tagged traffic to
/// First published in XenServer 4.1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefListConverter<VLAN>))]
2014-05-16 17:58:13 +02:00
public virtual List < XenRef < VLAN > > VLAN_slave_of
{
get { return _VLAN_slave_of ; }
set
{
if ( ! Helper . AreEqual ( value , _VLAN_slave_of ) )
{
_VLAN_slave_of = value ;
NotifyPropertyChanged ( "VLAN_slave_of" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private List < XenRef < VLAN > > _VLAN_slave_of = new List < XenRef < VLAN > > ( ) { } ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Indicates whether the control software is listening for connections on this interface
/// First published in XenServer 4.1.
/// </summary>
public virtual bool management
{
get { return _management ; }
set
{
if ( ! Helper . AreEqual ( value , _management ) )
{
_management = value ;
NotifyPropertyChanged ( "management" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private bool _management = false ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Additional configuration
/// First published in XenServer 4.1.
/// </summary>
2018-02-27 15:52:46 +01:00
[JsonConverter(typeof(StringStringMapConverter))]
2014-05-16 17:58:13 +02:00
public virtual Dictionary < string , string > other_config
{
get { return _other_config ; }
set
{
if ( ! Helper . AreEqual ( value , _other_config ) )
{
_other_config = value ;
NotifyPropertyChanged ( "other_config" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private Dictionary < string , string > _other_config = new Dictionary < string , string > ( ) { } ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Prevent this PIF from being unplugged; set this to notify the management tool-stack that the PIF has a special use and should not be unplugged under any circumstances (e.g. because you're running storage traffic over it)
/// First published in XenServer 5.0.
/// </summary>
public virtual bool disallow_unplug
{
get { return _disallow_unplug ; }
set
{
if ( ! Helper . AreEqual ( value , _disallow_unplug ) )
{
_disallow_unplug = value ;
NotifyPropertyChanged ( "disallow_unplug" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private bool _disallow_unplug = false ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Indicates to which tunnel this PIF gives access
/// First published in XenServer 5.6 FP1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefListConverter<Tunnel>))]
2014-05-16 17:58:13 +02:00
public virtual List < XenRef < Tunnel > > tunnel_access_PIF_of
{
get { return _tunnel_access_PIF_of ; }
set
{
if ( ! Helper . AreEqual ( value , _tunnel_access_PIF_of ) )
{
_tunnel_access_PIF_of = value ;
NotifyPropertyChanged ( "tunnel_access_PIF_of" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private List < XenRef < Tunnel > > _tunnel_access_PIF_of = new List < XenRef < Tunnel > > ( ) { } ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Indicates to which tunnel this PIF provides transport
/// First published in XenServer 5.6 FP1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(XenRefListConverter<Tunnel>))]
2014-05-16 17:58:13 +02:00
public virtual List < XenRef < Tunnel > > tunnel_transport_PIF_of
{
get { return _tunnel_transport_PIF_of ; }
set
{
if ( ! Helper . AreEqual ( value , _tunnel_transport_PIF_of ) )
{
_tunnel_transport_PIF_of = value ;
NotifyPropertyChanged ( "tunnel_transport_PIF_of" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private List < XenRef < Tunnel > > _tunnel_transport_PIF_of = new List < XenRef < Tunnel > > ( ) { } ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Sets if and how this interface gets an IPv6 address
/// Experimental. First published in XenServer 6.1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(ipv6_configuration_modeConverter))]
2014-05-16 17:58:13 +02:00
public virtual ipv6_configuration_mode ipv6_configuration_mode
{
get { return _ipv6_configuration_mode ; }
set
{
if ( ! Helper . AreEqual ( value , _ipv6_configuration_mode ) )
{
_ipv6_configuration_mode = value ;
NotifyPropertyChanged ( "ipv6_configuration_mode" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private ipv6_configuration_mode _ipv6_configuration_mode = ipv6_configuration_mode . None ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// IPv6 address
/// Experimental. First published in XenServer 6.1.
/// </summary>
public virtual string [ ] IPv6
{
get { return _IPv6 ; }
set
{
if ( ! Helper . AreEqual ( value , _IPv6 ) )
{
_IPv6 = value ;
NotifyPropertyChanged ( "IPv6" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string [ ] _IPv6 = { } ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// IPv6 gateway
/// Experimental. First published in XenServer 6.1.
/// </summary>
public virtual string ipv6_gateway
{
get { return _ipv6_gateway ; }
set
{
if ( ! Helper . AreEqual ( value , _ipv6_gateway ) )
{
_ipv6_gateway = value ;
NotifyPropertyChanged ( "ipv6_gateway" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string _ipv6_gateway = "" ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Which protocol should define the primary address of this interface
/// Experimental. First published in XenServer 6.1.
/// </summary>
2017-09-13 18:14:07 +02:00
[JsonConverter(typeof(primary_address_typeConverter))]
2014-05-16 17:58:13 +02:00
public virtual primary_address_type primary_address_type
{
get { return _primary_address_type ; }
set
{
if ( ! Helper . AreEqual ( value , _primary_address_type ) )
{
_primary_address_type = value ;
NotifyPropertyChanged ( "primary_address_type" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private primary_address_type _primary_address_type = primary_address_type . IPv4 ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
2018-05-18 15:29:50 +02:00
/// Indicates whether the interface is managed by xapi. If it is not, then xapi will not configure the interface, the commands PIF.plug/unplug/reconfigure_ip(v6) cannot be used, nor can the interface be bonded or have VLANs based on top through xapi.
2014-05-16 17:58:13 +02:00
/// First published in XenServer 6.2 SP1.
/// </summary>
public virtual bool managed
{
get { return _managed ; }
set
{
if ( ! Helper . AreEqual ( value , _managed ) )
{
_managed = value ;
NotifyPropertyChanged ( "managed" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private bool _managed = true ;
2013-06-24 13:41:48 +02:00
2014-05-16 17:58:13 +02:00
/// <summary>
/// Additional configuration properties for the interface.
2015-04-23 15:16:53 +02:00
/// First published in XenServer 6.5.
2014-05-16 17:58:13 +02:00
/// </summary>
2018-02-27 15:52:46 +01:00
[JsonConverter(typeof(StringStringMapConverter))]
2014-05-16 17:58:13 +02:00
public virtual Dictionary < string , string > properties
{
get { return _properties ; }
set
{
if ( ! Helper . AreEqual ( value , _properties ) )
{
_properties = value ;
NotifyPropertyChanged ( "properties" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private Dictionary < string , string > _properties = new Dictionary < string , string > ( ) { } ;
2015-06-25 11:38:12 +02:00
/// <summary>
/// Additional capabilities on the interface.
2017-06-28 18:00:22 +02:00
/// First published in XenServer 7.0.
2015-06-25 11:38:12 +02:00
/// </summary>
public virtual string [ ] capabilities
{
get { return _capabilities ; }
set
{
if ( ! Helper . AreEqual ( value , _capabilities ) )
{
_capabilities = value ;
NotifyPropertyChanged ( "capabilities" ) ;
}
}
}
2017-09-13 18:14:07 +02:00
private string [ ] _capabilities = { } ;
2017-11-17 12:19:01 +01:00
/// <summary>
/// The IGMP snooping status of the corresponding network bridge
2017-11-22 15:33:26 +01:00
/// First published in XenServer 7.3.
2017-11-17 12:19:01 +01:00
/// </summary>
[JsonConverter(typeof(pif_igmp_statusConverter))]
public virtual pif_igmp_status igmp_snooping_status
{
get { return _igmp_snooping_status ; }
set
{
if ( ! Helper . AreEqual ( value , _igmp_snooping_status ) )
{
_igmp_snooping_status = value ;
NotifyPropertyChanged ( "igmp_snooping_status" ) ;
}
}
}
private pif_igmp_status _igmp_snooping_status = pif_igmp_status . unknown ;
2018-01-17 09:58:15 +01:00
/// <summary>
/// Indicates which network_sriov this interface is physical of
2018-07-03 11:40:50 +02:00
/// First published in XenServer 7.5.
2018-01-17 09:58:15 +01:00
/// </summary>
2018-02-27 12:34:57 +01:00
[JsonConverter(typeof(XenRefListConverter<Network_sriov>))]
2018-01-17 09:58:15 +01:00
public virtual List < XenRef < Network_sriov > > sriov_physical_PIF_of
{
get { return _sriov_physical_PIF_of ; }
set
{
if ( ! Helper . AreEqual ( value , _sriov_physical_PIF_of ) )
{
_sriov_physical_PIF_of = value ;
NotifyPropertyChanged ( "sriov_physical_PIF_of" ) ;
}
}
}
2018-02-27 12:34:57 +01:00
private List < XenRef < Network_sriov > > _sriov_physical_PIF_of = new List < XenRef < Network_sriov > > ( ) { } ;
2018-01-17 09:58:15 +01:00
/// <summary>
/// Indicates which network_sriov this interface is logical of
2018-07-03 11:40:50 +02:00
/// First published in XenServer 7.5.
2018-01-17 09:58:15 +01:00
/// </summary>
2018-02-27 12:34:57 +01:00
[JsonConverter(typeof(XenRefListConverter<Network_sriov>))]
2018-01-17 09:58:15 +01:00
public virtual List < XenRef < Network_sriov > > sriov_logical_PIF_of
{
get { return _sriov_logical_PIF_of ; }
set
{
if ( ! Helper . AreEqual ( value , _sriov_logical_PIF_of ) )
{
_sriov_logical_PIF_of = value ;
NotifyPropertyChanged ( "sriov_logical_PIF_of" ) ;
}
}
}
2018-02-27 12:34:57 +01:00
private List < XenRef < Network_sriov > > _sriov_logical_PIF_of = new List < XenRef < Network_sriov > > ( ) { } ;
2018-01-17 09:58:15 +01:00
/// <summary>
2018-02-27 12:34:57 +01:00
/// Link to underlying PCI device
2018-07-03 11:40:50 +02:00
/// First published in XenServer 7.5.
2018-01-17 09:58:15 +01:00
/// </summary>
2018-02-27 12:34:57 +01:00
[JsonConverter(typeof(XenRefConverter<PCI>))]
public virtual XenRef < PCI > PCI
2018-01-17 09:58:15 +01:00
{
2018-02-27 12:34:57 +01:00
get { return _PCI ; }
2018-01-17 09:58:15 +01:00
set
{
2018-02-27 12:34:57 +01:00
if ( ! Helper . AreEqual ( value , _PCI ) )
2018-01-17 09:58:15 +01:00
{
2018-02-27 12:34:57 +01:00
_PCI = value ;
NotifyPropertyChanged ( "PCI" ) ;
2018-01-17 09:58:15 +01:00
}
}
}
2018-02-27 12:34:57 +01:00
private XenRef < PCI > _PCI = new XenRef < PCI > ( "OpaqueRef:NULL" ) ;
2013-06-24 13:41:48 +02:00
}
}