Пример #1
0
        /// <summary>
        /// Backward compatibility for PIF.db_introduce in XenServer 6.0.
        /// </summary>
        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)
        {
            if (Helper.APIVersionMeets(session, API_Version.API_1_10))
                System.Diagnostics.Debug.Assert(false, "Cannot use this call on XenServer 6.1 or newer.");

            return XenRef<PIF>.Create(session.proxy.pif_db_introduce(session.uuid, (_device != null) ? _device : "", (_network != null) ? _network : "", (_host != null) ? _host : "", (_mac != null) ? _mac : "", _mtu.ToString(), _vlan.ToString(), _physical, ip_configuration_mode_helper.ToString(_ip_configuration_mode), (_ip != null) ? _ip : "", (_netmask != null) ? _netmask : "", (_gateway != null) ? _gateway : "", (_dns != null) ? _dns : "", (_bond_slave_of != null) ? _bond_slave_of : "", (_vlan_master_of != null) ? _vlan_master_of : "", _management, Maps.convert_to_proxy_string_string(_other_config), _disallow_unplug).parse());
        }
Пример #2
0
 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,
            primary_address_type primary_address_type)
 {
     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;
 }
        private void ProcessRecordIpConfigurationMode(string pif)
        {
            RunApiCall(() =>
            {
                ip_configuration_mode obj = XenAPI.PIF.get_ip_configuration_mode(session, pif);

                WriteObject(obj, true);
            });
        }
Пример #4
0
 public static string ToString(ip_configuration_mode x)
 {
     switch (x)
     {
         case ip_configuration_mode.None:
             return "None";
         case ip_configuration_mode.DHCP:
             return "DHCP";
         case ip_configuration_mode.Static:
             return "Static";
         default:
             return "unknown";
     }
 }
Пример #5
0
        public static string ToString(ip_configuration_mode x)
        {
            switch (x)
            {
            case ip_configuration_mode.None:
                return("None");

            case ip_configuration_mode.DHCP:
                return("DHCP");

            case ip_configuration_mode.Static:
                return("Static");
            }
            return("unknown");
        }
Пример #6
0
        public static string StringOf(this ip_configuration_mode x)
        {
            switch (x)
            {
            case ip_configuration_mode.None:
                return("None");

            case ip_configuration_mode.DHCP:
                return("DHCP");

            case ip_configuration_mode.Static:
                return("Static");

            default:
                return("unknown");
            }
        }
Пример #7
0
 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)
 {
     return(XenRef <Task> .Create(session.proxy.async_pif_db_introduce(session.uuid, (_device != null) ? _device : "", (_network != null) ? _network : "", (_host != null) ? _host : "", (_mac != null) ? _mac : "", _mtu.ToString(), _vlan.ToString(), _physical, ip_configuration_mode_helper.ToString(_ip_configuration_mode), (_ip != null) ? _ip : "", (_netmask != null) ? _netmask : "", (_gateway != null) ? _gateway : "", (_dns != null) ? _dns : "", (_bond_slave_of != null) ? _bond_slave_of : "", (_vlan_master_of != null) ? _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 != null) ? _ipv6_gateway : "", primary_address_type_helper.ToString(_primary_address_type)).parse()));
 }
Пример #8
0
 public static XenRef <Task> async_reconfigure_ip(Session session, string _self, ip_configuration_mode _mode, string _ip, string _netmask, string _gateway, string _dns)
 {
     return(XenRef <Task> .Create(session.proxy.async_pif_reconfigure_ip(session.uuid, (_self != null) ? _self : "", ip_configuration_mode_helper.ToString(_mode), (_ip != null) ? _ip : "", (_netmask != null) ? _netmask : "", (_gateway != null) ? _gateway : "", (_dns != null) ? _dns : "").parse()));
 }
Пример #9
0
 public static void reconfigure_ip(Session session, string _self, ip_configuration_mode _mode, string _ip, string _netmask, string _gateway, string _dns)
 {
     session.proxy.pif_reconfigure_ip(session.uuid, (_self != null) ? _self : "", ip_configuration_mode_helper.ToString(_mode), (_ip != null) ? _ip : "", (_netmask != null) ? _netmask : "", (_gateway != null) ? _gateway : "", (_dns != null) ? _dns : "").parse();
 }
Пример #10
0
 public static string ToString(ip_configuration_mode x)
 {
     return(x.StringOf());
 }
Пример #11
0
        /// <summary>
        /// Backward compatibility for PIF.async_db_introduce in XenServer 6.0.
        /// </summary>
        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)
        {
            if (Helper.APIVersionMeets(session, API_Version.API_1_10))
            {
                System.Diagnostics.Debug.Assert(false, "Cannot use this call on XenServer 6.1 or newer.");
            }

            return(XenRef <Task> .Create(session.proxy.async_pif_db_introduce(session.uuid, (_device != null) ? _device : "", (_network != null) ? _network : "", (_host != null) ? _host : "", (_mac != null) ? _mac : "", _mtu.ToString(), _vlan.ToString(), _physical, ip_configuration_mode_helper.ToString(_ip_configuration_mode), (_ip != null) ? _ip : "", (_netmask != null) ? _netmask : "", (_gateway != null) ? _gateway : "", (_dns != null) ? _dns : "", (_bond_slave_of != null) ? _bond_slave_of : "", (_vlan_master_of != null) ? _vlan_master_of : "", _management, Maps.convert_to_proxy_string_string(_other_config), _disallow_unplug).parse()));
        }