Create new interface on IxNetwork.

        Set enabled and description (==name).

        :return: interface object reference.
345512
def _create(self, **attributes):
        

        attributes['enabled'] = True
        if 'name' in self._data:
            attributes['description'] = self._data['name']
        obj_ref = self.api.add(self.obj_parent(), self.obj_type(), **attributes)
        self.api.commit()
        return self.api.remapIds(obj_ref)
904728
def add_implemented_interfaces(cls, interfaces):
    
    implemented = set(
        six.moves.reduce(
            lambda x, y: x.union(y),
            map(operator.attrgetter('implied'), interfaces),
            set()
        )
    )
    implemented.update(*map(
        get_implemented_interfaces,
        inspect.getmro(cls)
    ))
    setattr(cls, '__interfaces__', frozenset(implemented))
154939
def createNetwork(self, data, headers=None, query_params=None, content_type="application/json"):
        
        uri = self.client.base_url + "/network"
        return self.client.post(uri, data, headers, query_params, content_type)
12833
def create(cls, address, ospf_area=None, **kwargs):
        
        return super(LoopbackClusterInterface, cls).create(
            address=address,
            network_value='{}/32'.format(address),
            interface_id='Loopback Interface',
            ospfv2_area_ref=ospf_area,
            **kwargs)
1249446
def create_api_interface_request(self):
        """"""

        return ApiInterfaceRequest(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
226471
def create(cls, interface_id, address, network_value,
               nodeid=1, **kwargs):
        
        data = {'address': address,
                'network_value': network_value,
                'nicid': str(interface_id),
                'auth_request': False,
                'backup_heartbeat': False,
                'nodeid': nodeid,
                'outgoing': False,
                'primary_mgt': False,
                'primary_heartbeat': False}

        for k, v in kwargs.items():
            data.update({k: v})

        return cls(data)
927376
def _add_interface(self, interface_id, **kw):
        
        base_interface = ElementCache()

        base_interface.update(
            interface_id=str(interface_id),
            interfaces=[])
        
        if 'zone_ref' in kw:
            zone_ref = kw.pop('zone_ref')
            base_interface.update(zone_ref=zone_helper(zone_ref) if zone_ref else None)
                
        if 'comment' in kw:
            base_interface.update(comment=kw.pop('comment'))
            
        self.data = base_interface
                          
        interfaces = kw.pop('interfaces', [])
        if interfaces:
            for interface in interfaces:
                if interface.get('cluster_virtual', None) or \
                    len(interface.get('nodes', [])) > 1:    # Cluster
                    
                    kw.update(interface_id=interface_id, interfaces=interfaces)
                    cvi = ClusterPhysicalInterface(**kw)
                    cvi.data.pop('vlanInterfaces', None)
                    self.data.update(cvi.data)
                else:
                    # Single interface FW
                    for node in interface.get('nodes', []):
                        node.update(nodeid=1)
                        sni = SingleNodeInterface.create(interface_id, **node)
                        base_interface.setdefault('interfaces', []).append(
                            {sni.typeof: sni.data})
745830
private static Service<NetworkInterfaceBinding> createInterfaceService(String name, ParsedInterfaceCriteria criteria) {
        return NetworkInterfaceService.create(name, criteria);
    }
958532
def create_new_client(self, give_focus=True, filename='', is_cython=False,
                          is_pylab=False, is_sympy=False, given_name=None):
        """"""
        self.master_clients += 1
        client_id = dict(int_id=to_text_string(self.master_clients),
                         str_id='A')
        cf = self._new_connection_file()
        show_elapsed_time = self.get_option('show_elapsed_time')
        reset_warning = self.get_option('show_reset_namespace_warning')
        ask_before_restart = self.get_option('ask_before_restart')
        client = ClientWidget(self, id_=client_id,
                              history_filename=get_conf_path('history.py'),
                              config_options=self.config_options(),
                              additional_options=self.additional_options(
                                      is_pylab=is_pylab,
                                      is_sympy=is_sympy),
                              interpreter_versions=self.interpreter_versions(),
                              connection_file=cf,
                              menu_actions=self.menu_actions,
                              options_button=self.options_button,
                              show_elapsed_time=show_elapsed_time,
                              reset_warning=reset_warning,
                              given_name=given_name,
                              ask_before_restart=ask_before_restart,
                              css_path=self.css_path)

        # Change stderr_dir if requested
        if self.test_dir is not None:
            client.stderr_dir = self.test_dir

        self.add_tab(client, name=client.get_name(), filename=filename)

        if cf is None:
            error_msg = self.permission_error_msg.format(jupyter_runtime_dir())
            client.show_kernel_error(error_msg)
            return

        # Check if ipykernel is present in the external interpreter.
        # Else we won't be able to create a client
        if not CONF.get('main_interpreter', 'default'):
            pyexec = CONF.get('main_interpreter', 'executable')
            has_spyder_kernels = programs.is_module_installed(
                                                        'spyder_kernels',
                                                        interpreter=pyexec,
                                                        version='>=1.0.0')
            if not has_spyder_kernels:
                client.show_kernel_error(
                        _("Your Python environment or installation doesn't "
                          "have the <tt>spyder-kernels</tt> module or the "
                          "right version of it installed. "
                          "Without this module is not possible for "
                          "Spyder to create a console for you.<br><br>"
                          "You can install it by running in a system terminal:"
                          "<br><br>"
                          "<tt>conda install spyder-kernels</tt>"
                          "<br><br>or<br><br>"
                          "<tt>pip install spyder-kernels</tt>"))
                return

        self.connect_client_to_kernel(client, is_cython=is_cython,
                                      is_pylab=is_pylab, is_sympy=is_sympy)
        if client.shellwidget.kernel_manager is None:
            return
        self.register_client(client)
1091838
def create(self, virtual_interfaces):
        

        data = {'virtual_interfaces': virtual_interfaces}
        return super(ApiV4VirtualInterface, self).post\
            ('api/v4/virtual-interface/', data)
1196104
def add_interface(self, interface):
        
        if not isinstance(interface, Interface):
            raise TypeError

        self._interfaces[interface.name] = interface
102302
def dev_from_name(self, name):
        
        try:
            return next(iface for iface in six.itervalues(self)
                        if (iface.name == name or iface.description == name))
        except (StopIteration, RuntimeError):
            raise ValueError("Unknown network interface %r" % name)
370273
def bridged_interface_object
      VirtualBox::Global.global.host.network_interfaces.find do |ni|
        ni.name == bridged_interface
      end
    end
550288
def create(self, networkipv4s):
        

        data = {'networks': networkipv4s}
        return super(ApiNetworkIPv4, self).post('api/v3/networkv4/', data)
394135
def set_source_interface(self, name):
        
        cmd = self.command_builder('ntp source', value=name)
        return self.configure(cmd)
704425
def virtual_interface_create(name, net_name, **kwargs):
    '''
    
    '''
    conn = get_conn()
    return conn.virtual_interface_create(name, net_name)
137793
def create_network(self):
        """"""
        return Network(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)