Use this API to add vlan.
333204
public static base_response add(nitro_service client, vlan resource) throws Exception {
		vlan addresource = new vlan();
		addresource.id = resource.id;
		addresource.aliasname = resource.aliasname;
		addresource.ipv6dynamicrouting = resource.ipv6dynamicrouting;
		return addresource.add_resource(client);
	}
917171
public static base_response update(nitro_service client, vlan resource) throws Exception {
		vlan updateresource = new vlan();
		updateresource.id = resource.id;
		updateresource.aliasname = resource.aliasname;
		updateresource.ipv6dynamicrouting = resource.ipv6dynamicrouting;
		return updateresource.update_resource(client);
	}
1189620
def add_subnet(subnet_name, vnet_config, subnets)
      new_subnet_prefix = nil
      vnet_address_prefix_count = 0
      vnet_address_space = vnet_config[:addressPrefixes]

      ## search for space in all the address prefixes of the virtual network ##
      while new_subnet_prefix.nil? && vnet_address_space.length > vnet_address_prefix_count
        new_subnet_prefix = new_subnet_address_prefix(
          vnet_address_space[vnet_address_prefix_count],
          subnets_list_for_specific_address_space(
            vnet_address_space[vnet_address_prefix_count], subnets
          )
        )
        vnet_address_prefix_count += 1
      end

      if new_subnet_prefix ## found space for new subnet ##
        vnet_config[:subnets].push(
          subnet(subnet_name, new_subnet_prefix)
        )
      else ## no space available in the virtual network for the new subnet ##
        raise "Unable to add subnet #{subnet_name} into the virtual network #{vnet_config[:virtualNetworkName]}, no address space available !!!"
      end

      vnet_config
    end
111771
def _setup_trunk(self, trunk, vlan_id=None):
        """"""

        LOG.info('Binding trunk port: %s.', trunk)
        try:
            # bind sub_ports to host.
            self._trunk_rpc.update_subport_bindings(self._context,
                                                    trunk.sub_ports)

            vlan_trunk = [s.segmentation_id for s in trunk.sub_ports]
            self._set_port_vlan(trunk.port_id, vlan_id, vlan_trunk)

            self._trunk_rpc.update_trunk_status(self._context, trunk.id,
                                                t_const.ACTIVE_STATUS)
        except Exception:
            # something broke
            LOG.exception("Failure setting up subports for %s", trunk.port_id)
            self._trunk_rpc.update_trunk_status(self._context, trunk.id,
                                                t_const.DEGRADED_STATUS)
154532
def add(self, *args, **kwargs):
        """"""
        return self.cat.select.add(*args, **kwargs)
707673
def add(self, ipaddr=None, proto=None, port=None, fields=None):
        
        return self.send.service_add(ipaddr, proto, port, fields)
256382
def add_vhost(vhost, runas=None):
    '''
    
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    res = __salt__['cmd.run_all'](
        [RABBITMQCTL, 'add_vhost', vhost],
        reset_system_locale=False,
        runas=runas,
        python_shell=False)

    msg = 'Added'
    return _format_response(res, msg)
802930
@Override
	public void addSipConnector(String ipAddress, int port, String transport) throws LifecycleException
	{
		SipConnector sipConnector = mssContainer.createSipConnector(ipAddress, port, transport);
		mssContainer.addSipConnector(sipConnector);
	}
696690
def _add_interface(self, interface_id, mgt=None, **kw):
        
        _kw = copy.deepcopy(kw) # Preserve original kw, especially lists
        mgt = mgt if mgt else {}
        
        if 'cvi_mode' in _kw:
            self.data.update(cvi_mode=_kw.pop('cvi_mode'))
        
        if 'macaddress' in _kw:
            self.data.update(
                macaddress=_kw.pop('macaddress'))
            if 'cvi_mode' not in self.data:
                self.data.update(cvi_mode='packetdispatch')
        
        if 'zone_ref' in _kw:
            zone_ref = _kw.pop('zone_ref')
            self.data.update(zone_ref=zone_helper(zone_ref) if zone_ref else None)
        
        if 'comment' in _kw:
            self.data.update(comment=_kw.pop('comment'))

        interfaces = _kw.pop('interfaces', [])
        for interface in interfaces:
            vlan_id = interface.pop('vlan_id', None)
            if vlan_id:
                _interface_id = '{}.{}'.format(interface_id, vlan_id)
            else:
                _interface_id = interface_id
    
            _interface = []
            if_mgt = {k: str(v) == str(_interface_id) for k, v in mgt.items()}
            
            if 'cluster_virtual' in interface and 'network_value' in interface:
                cluster_virtual = interface.pop('cluster_virtual')
                network_value = interface.pop('network_value')
                if cluster_virtual and network_value:
                    cvi = ClusterVirtualInterface.create(
                        _interface_id, cluster_virtual, network_value,
                        auth_request=True if if_mgt.get('primary_mgt') else False)
                      
                    _interface.append({cvi.typeof: cvi.data})
    
            for node in interface.pop('nodes', []):
                _node = if_mgt.copy()
                _node.update(outgoing=True if if_mgt.get('primary_mgt') else False)
                # Add node specific key/value pairs set on the node. This can
                # also be used to override management settings
                _node.update(node)
                ndi = NodeInterface.create(
                    interface_id=_interface_id, **_node)
                _interface.append({ndi.typeof: ndi.data})

            if vlan_id:
                vlan_interface = {
                    'interface_id': _interface_id,
                    'zone_ref': zone_helper(interface.pop('zone_ref', None)),
                    'comment': interface.pop('comment', None),
                    'interfaces': _interface}
                # Add remaining kwargs on vlan level to VLAN physical interface
                for name, value in interface.items():
                    vlan_interface[name] = value
                self.data.setdefault('vlanInterfaces', []).append(
                    vlan_interface)
            else:
                self.data.setdefault('interfaces', []).extend(
                    _interface)

        # Remaining kw go to base level interface
        for name, value in _kw.items():
            self.data[name] = value
971926
def add(self, name, *args):
        """"""
        self._add(False, self.authority, name, *args)
775131
public static base_response add(nitro_service client, dnsnsrec resource) throws Exception {
		dnsnsrec addresource = new dnsnsrec();
		addresource.domain = resource.domain;
		addresource.nameserver = resource.nameserver;
		addresource.ttl = resource.ttl;
		return addresource.add_resource(client);
	}
1277296
public static base_response add(nitro_service client, dnssuffix resource) throws Exception {
		dnssuffix addresource = new dnssuffix();
		addresource.Dnssuffix = resource.Dnssuffix;
		return addresource.add_resource(client);
	}
254170
def add(self, packet):
        """"""
        for name in self._names:
            value = getattr(packet, name)
            if value is not None:
                self._dict[name] = value
1223443
def create(self, vid):
        
        command = 'vlan %s' % vid
        return self.configure(command) if isvlan(vid) else False
968392
public static base_responses add(nitro_service client, nsip resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			nsip addresources[] = new nsip[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new nsip();
				addresources[i].ipaddress = resources[i].ipaddress;
				addresources[i].netmask = resources[i].netmask;
				addresources[i].type = resources[i].type;
				addresources[i].arp = resources[i].arp;
				addresources[i].icmp = resources[i].icmp;
				addresources[i].vserver = resources[i].vserver;
				addresources[i].telnet = resources[i].telnet;
				addresources[i].ftp = resources[i].ftp;
				addresources[i].gui = resources[i].gui;
				addresources[i].ssh = resources[i].ssh;
				addresources[i].snmp = resources[i].snmp;
				addresources[i].mgmtaccess = resources[i].mgmtaccess;
				addresources[i].restrictaccess = resources[i].restrictaccess;
				addresources[i].dynamicrouting = resources[i].dynamicrouting;
				addresources[i].ospf = resources[i].ospf;
				addresources[i].bgp = resources[i].bgp;
				addresources[i].rip = resources[i].rip;
				addresources[i].hostroute = resources[i].hostroute;
				addresources[i].hostrtgw = resources[i].hostrtgw;
				addresources[i].metric = resources[i].metric;
				addresources[i].vserverrhilevel = resources[i].vserverrhilevel;
				addresources[i].ospflsatype = resources[i].ospflsatype;
				addresources[i].ospfarea = resources[i].ospfarea;
				addresources[i].state = resources[i].state;
				addresources[i].vrid = resources[i].vrid;
				addresources[i].icmpresponse = resources[i].icmpresponse;
				addresources[i].ownernode = resources[i].ownernode;
				addresources[i].arpresponse = resources[i].arpresponse;
				addresources[i].td = resources[i].td;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
1313454
def add_nic(self, instance_id, net_id):
        """"""
        #TODO: upgrade with port_id and fixed_ip in future
        self.client.servers.interface_attach(
            instance_id, None, net_id, None)
        return True
1327381
def get_create_vlan(self, nexus_host, vlanid, vni, conf_str):
        """"""

        starttime = time.time()

        if vni:
            body_snip = snipp.BODY_VXLAN_ALL_INCR % (vlanid, vni)
        else:
            body_snip = snipp.BODY_VLAN_ALL_INCR % vlanid
        conf_str += body_snip + snipp.BODY_VLAN_ALL_CONT

        self.capture_and_print_timeshot(
            starttime, "get_create_vlan",
            switch=nexus_host)

        return conf_str