client.addNetwork

@description Add an existing network to a project

@param {String|object}   network   The network or networkId to add
@param {Function}        callback
504040
function (network, callback) {
      var networkId = (typeof network === 'object') ? network.id : network;

      return this._request({
        path: urlJoin(this._extension, 'add'),
        method: 'POST',
        body: {
          id: networkId
        }
      }, function (err) {
        return callback(err);
      });
    }
359029
def server_add(s_name, s_ip, s_state=None, **connection_args):
    '''
    
    '''
    ret = True
    if server_exists(s_name, **connection_args):
        return False
    nitro = _connect(**connection_args)
    if nitro is None:
        return False
    server = NSServer()
    server.set_name(s_name)
    server.set_ipaddress(s_ip)
    if s_state is not None:
        server.set_state(s_state)
    try:
        NSServer.add(nitro, server)
    except NSNitroError as error:
        log.debug('netscaler module error - NSServer.add() failed: %s', error)
        ret = False
    _disconnect(nitro)
    return ret
786443
def add_node(self, compute, name, node_id, dump=True, node_type=None, **kwargs):
        

        if node_id in self._nodes:
            return self._nodes[node_id]

        node = Node(self, compute, name, node_id=node_id, node_type=node_type, **kwargs)
        if compute not in self._project_created_on_compute:
            # For a local server we send the project path
            if compute.id == "local":
                yield from compute.post("/projects", data={
                    "name": self._name,
                    "project_id": self._id,
                    "path": self._path
                })
            else:
                yield from compute.post("/projects", data={
                    "name": self._name,
                    "project_id": self._id,
                })

            self._project_created_on_compute.add(compute)
        yield from node.create()
        self._nodes[node.id] = node
        self.controller.notification.emit("node.created", node.__json__())
        if dump:
            self.dump()
        return node
485597
function subscribeNode (client, subscriptions, channel, callback, done_callback) {
    if (subscriptions[channel]===undefined) {
        subscriptions[channel] = [callback];
        client.subscribe(channel, {qos: 0}, function() {
            // If there is a done_callback defined, execute it
            if (done_callback!==undefined) done_callback();
        });
    } else {
        subscriptions[channel].push(callback);
    }
}
56177
def add_node_to_network(self, node, network):
        """"""
        network.add_node(node)
        parents = node.neighbors(direction="from")
        if len(parents):
            parent = parents[0]
            parent.transmit()
        node.receive()
1067656
def update(self, callback=None, errback=None, **kwargs):
        
        if not self.data:
            raise NetworkException('Network not loaded')

        def success(result, *args):
            self.data = result
            self.id = result['id']
            self.name = result['name']
            self.report = self._rest.report(self.id)
            if callback:
                return callback(self)
            else:
                return self

        return self._rest.update(self.id, callback=success, errback=errback,
                                 **kwargs)
400903
private void deployNetwork(final NetworkContext context, final Handler<AsyncResult<NetworkContext>> doneHandler) {
    log.debug(String.format("%s - Deploying network", NetworkManager.this));
    final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size());
    complete.setHandler(new Handler<AsyncResult<Void>>() {
      @Override
      public void handle(AsyncResult<Void> result) {
        if (result.failed()) {
          new DefaultFutureResult<NetworkContext>(result.cause()).setHandler(doneHandler);
        } else {
          new DefaultFutureResult<NetworkContext>(context).setHandler(doneHandler);
        }
      }
    });
    deployComponents(context.components(), complete);
  }
632227
def append(self, network):
        
        arr = network.to_array(self.hg.mappings)
        if len(self.__matrix):
            self.__matrix = np.append(self.__matrix, [arr], axis=0)
            self.__networks = np.append(self.__networks, network.networks)
        else:
            self.__matrix = np.array([arr])
            self.__networks = np.array([network.networks])
32294
function updateNode(node, callback) {
  syncDb.update(node._id, node, (err, result) => {
    if(err) return callback(err);

    callback(null, node);
  });
}
196030
public void addConnection(WebSocketConnection conn) {
        WebSocketScope scope = getScope(conn);
        scope.addConnection(conn);
    }
220067
function createPayment(data, callback) {
    var client = new this.clients.Payments();
    client.create(data, callback);
  }
661562
def add(env, securitygroup_id, network_component, server, interface):
    """"""
    _validate_args(network_component, server, interface)

    mgr = SoftLayer.NetworkManager(env.client)
    component_id = _get_component_id(env, network_component, server, interface)

    ret = mgr.attach_securitygroup_component(securitygroup_id,
                                             component_id)
    if not ret:
        raise exceptions.CLIAbort("Could not attach network component")

    table = formatting.Table(REQUEST_COLUMNS)
    table.add_row([ret['requestId']])

    env.fout(table)
1183533
private void updateNetwork(final NetworkContext context, final Handler<AsyncResult<Void>> doneHandler) {
    final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size());
    complete.setHandler(new Handler<AsyncResult<Void>>() {
      @Override
      public void handle(AsyncResult<Void> result) {
        if (result.failed()) {
          new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
        } else {
          new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
        }
      }
    });
    updateComponents(context.components(), complete);
  }
1113581
def add_callback(self, callback=None, errorback=None):
        
        self._callback = callback
        self._errorback = errorback
502571
def create(params)
      network = Network.new(params.merge(config: {}))
      @config.transaction do
        check_name_available!(network.name)
        @config.networks << network
        network_feedback(network, :created) unless params[:quiet]
      end
    end
573081
function(callback) {

      var self = this;

      this.queue.add(function() {
        if (callback) {
          callback(self.error, self._getUrl()); 
        }
      });

    }
1165885
@Override
    public void onConnect(final Object newClient) {
        meta.commandsForDomainModel(new CommandsForDomainModelCallback() {
            @Override
            public void commandsReady(final List<Command> commands) {
                networkLayer.onConnectFinished(newClient);
                networkLayer.send(commands, newClient);
            }
        });
        // TODO networkLayer onConnectFinished(); javadoc that networklayer should then enable sendToAll for new
        // client.

    }