/// <summary> /// Set the protocol field of the given tunnel. /// First published in Unreleased. /// </summary> /// <param name="session">The session</param> /// <param name="_tunnel">The opaque_ref of the given tunnel</param> /// <param name="_protocol">New value to set</param> public static void set_protocol(Session session, string _tunnel, tunnel_protocol _protocol) { if (session.JsonRpcClient != null) { session.JsonRpcClient.tunnel_set_protocol(session.opaque_ref, _tunnel, _protocol); } else { session.XmlRpcProxy.tunnel_set_protocol(session.opaque_ref, _tunnel ?? "", tunnel_protocol_helper.ToString(_protocol)).parse(); } }
public static string StringOf(this tunnel_protocol x) { switch (x) { case tunnel_protocol.gre: return("gre"); case tunnel_protocol.vxlan: return("vxlan"); default: return("unknown"); } }
public Tunnel(string uuid, XenRef <PIF> access_PIF, XenRef <PIF> transport_PIF, Dictionary <string, string> status, Dictionary <string, string> other_config, tunnel_protocol protocol) { this.uuid = uuid; this.access_PIF = access_PIF; this.transport_PIF = transport_PIF; this.status = status; this.other_config = other_config; this.protocol = protocol; }
public static string ToString(tunnel_protocol x) { return(x.StringOf()); }
/// <summary> /// Create a tunnel /// First published in XenServer 5.6 FP1. /// </summary> /// <param name="session">The session</param> /// <param name="_transport_pif">PIF which receives the tagged traffic First published in XenServer 7.0.</param> /// <param name="_network">Network to receive the tunnelled traffic First published in XenServer 7.0.</param> /// <param name="_protocol">Protocol used for the tunnel (GRE or VxLAN) First published in Unreleased.</param> public static XenRef <Task> async_create(Session session, string _transport_pif, string _network, tunnel_protocol _protocol) { if (session.JsonRpcClient != null) { return(session.JsonRpcClient.async_tunnel_create(session.opaque_ref, _transport_pif, _network, _protocol)); } else { return(XenRef <Task> .Create(session.XmlRpcProxy.async_tunnel_create(session.opaque_ref, _transport_pif ?? "", _network ?? "", tunnel_protocol_helper.ToString(_protocol)).parse())); } }