This method updates a load balancer connected to a service
@param options
@param mCb
@returns {*}
500314
function (options, mCb) {
		options.params.info = options.infra.info;
		const envCode = options.params.envCode.toUpperCase();
		const opts = {
			name: options.params.name,
			ElbName: options.params.ElbName
		};
		const stack = options.infra.stack;
		const aws = options.infra.api;
		const ports = options.params.ports;
		let deleted = [];
		const elb = getConnector({
			api: 'elb',
			region: stack.options.zone,
			keyId: aws.keyId,
			secretAccessKey: aws.secretAccessKey
		});
		let params = {
			LoadBalancerNames: [opts.ElbName.name]
		};
		elb.describeLoadBalancers(params, function (err, loadBalancer) {
			if (err) {
				return mCb(err);
			}
			else {
				let listenerDescriptions;
				//get listeners
				if (loadBalancer.LoadBalancerDescriptions && loadBalancer.LoadBalancerDescriptions.length > 0
					&& loadBalancer.LoadBalancerDescriptions[0].ListenerDescriptions
					&& loadBalancer.LoadBalancerDescriptions[0].ListenerDescriptions.length > 0) {
					listenerDescriptions = loadBalancer.LoadBalancerDescriptions[0].ListenerDescriptions;
				}
				//check if listener is found
				if (listenerDescriptions) {
					for (let s = 0; s < ports.length; s++) {
						for (let y = listenerDescriptions.length - 1; y >= 0; y--) {
							if (listenerDescriptions[y] && listenerDescriptions[y].Listener && listenerDescriptions[y].Listener.LoadBalancerPort) {
								if (ports[s].target === listenerDescriptions[y].Listener.LoadBalancerPort &&
									ports[s].published === listenerDescriptions[y].Listener.InstancePort) {
									listenerDescriptions.splice(y, 1);
								}
							}
						}
					}
					//get list of listeners to be deleted
					if (listenerDescriptions.length > 0) {
						listenerDescriptions.forEach(function (oneListen) {
							deleted.push(oneListen.Listener.LoadBalancerPort)
						});
					}
				}
				if (deleted.length > 0) {
					let deletedParams = {
						LoadBalancerName: opts.ElbName.name,
						LoadBalancerPorts: deleted
					};
					options.soajs.log.debug(deletedParams);
					//delete unused listeners
					elb.deleteLoadBalancerListeners(deletedParams, function (err) {
						if (err) {
							return mCb(err);
						}
						else {
							updateListeners();
						}
					});
				}
				else {
					updateListeners();
				}
			}
			
			function updateListeners() {
				let listener = {};
				params = {
					Listeners: [],
					LoadBalancerName: opts.ElbName.name
				};
				let healthCheckPort;
				for (let i = 0; i < ports.length; i++) {
					listener = {
						InstancePort: ports[i].published,
						InstanceProtocol: "TCP",
						LoadBalancerPort: ports[i].target,
						Protocol: "TCP",
					};
					if (ports[i].target === 80) {
						listener.Protocol = 'HTTP';
						listener.InstanceProtocol = 'HTTP';
						healthCheckPort = listener.InstancePort;
					}
					params.Listeners.push(listener);
				}
				if (!healthCheckPort) {
					healthCheckPort = params.Listeners[0].InstancePort;
				}
				options.soajs.log.debug(params);
				elb.createLoadBalancerListeners(params, function (err) {
					if (err) {
						return mCb(err);
					}
					//check if health check port is deleted ==> if yes update the health check
					if (loadBalancer.LoadBalancerDescriptions[0].HealthCheck && loadBalancer.LoadBalancerDescriptions[0].HealthCheck.Target
						&& loadBalancer.LoadBalancerDescriptions[0].HealthCheck.Target.split(":")[1]
						&& deleted.indexOf(loadBalancer.LoadBalancerDescriptions[0].HealthCheck.Target.split(":")[1]) === -1) {
						updateHealthCheck(elb, healthCheckPort, function (err) {
							if (err) {
								return mCb(err);
							}
							//update the exposed ports of the service //check if db was tampered with
							if (options.infra.deployments && options.infra.deployments[options.params.info[2]]
								&& options.infra.deployments[options.params.info[2]].loadBalancers
								&& options.infra.deployments[options.params.info[2]].loadBalancers[envCode]
								&& options.infra.deployments[options.params.info[2]].loadBalancers[envCode][opts.name]) {
								options.infra.deployments[options.params.info[2]].loadBalancers[envCode][opts.name].ports = ports;
							}
							return mCb(null, true);
						});
					}
					else {
						//update the exposed ports of the service //check if db was tampered with
						if (options.infra.deployments && options.infra.deployments[options.params.info[2]]
							&& options.infra.deployments[options.params.info[2]].loadBalancers
							&& options.infra.deployments[options.params.info[2]].loadBalancers[envCode]
							&& options.infra.deployments[options.params.info[2]].loadBalancers[envCode][opts.name]) {
							options.infra.deployments[options.params.info[2]].loadBalancers[envCode][opts.name].ports = ports;
						}
						return mCb(null, true);
					}
				});
			}
			
			function updateHealthCheck(elb, healthCheckPort, cb) {
				let healthCheckParams = {
					HealthCheck: loadBalancer.LoadBalancerDescriptions[0].HealthCheck,
					LoadBalancerName: opts.ElbName.name
				};
				if (healthCheckPort === 80) {
					healthCheckParams.HealthCheck.Target = "HTTP:80/";
				}
				else {
					healthCheckParams.HealthCheck.Target = `TCP:${healthCheckPort}`;
				}
				options.soajs.log.debug(healthCheckParams);
				elb.configureHealthCheck(healthCheckParams, function (err) {
					return cb(err, true);
				});
			}
		});
	}
1366842
public function update_options($options = null) {
        global $DB;
        $classname = 'repository_' . $this->_typename;
        $instanceoptions = repository::static_function($this->_typename, 'get_instance_option_names');
        if (empty($instanceoptions)) {
            // update repository instance name if this plugin type doesn't have muliti instances
            $params = array();
            $params['type'] = $this->_typename;
            $instances = repository::get_instances($params);
            $instance = array_pop($instances);
            if ($instance) {
                $DB->set_field('repository_instances', 'name', $options['pluginname'], array('id'=>$instance->id));
            }
            unset($options['pluginname']);
        }

        if (!empty($options)) {
            $this->_options = $options;
        }

        foreach ($this->_options as $name => $value) {
            set_config($name, $value, $this->_typename);
        }

        cache::make('core', 'repositories')->purge();
        return true;
    }
469777
async function update (nameId, target, options = {}) {
  const opt = R.merge(this.Ae.defaults, options)
  const nameUpdateTx = await this.nameUpdateTx(R.merge(opt, {
    nameId: nameId,
    accountId: await this.address(),
    pointers: [R.fromPairs([['id', target], ['key', classify(target)]])]
  }))

  return this.send(nameUpdateTx, opt)
}
802001
private void addLoadBalancerListener() {
        if (!(lbContext.getLoadBalancer() instanceof BaseLoadBalancer)) {
            return;
        }
        
        ((BaseLoadBalancer) lbContext.getLoadBalancer()).addServerListChangeListener(new ServerListChangeListener() {
            @Override
            public void serverListChanged(List<Server> oldList, List<Server> newList) {
                Set<Server> removedServers = new HashSet<Server>(oldList);
                removedServers.removeAll(newList);
                for (Server server: rxClientCache.keySet()) {
                    if (removedServers.contains(server)) {
                        // this server is no longer in UP status
                        removeClient(server);
                    }
                }
            }
        });
    }
1298302
function(server, model, options, logger) {
      // This line must come first
      validationHelper.validateModel(model, logger)
      const Log = logger.bind(chalk.yellow('Update'))

      let collectionName = model.collectionDisplayName || model.modelName
      if (config.logRoutes) {
        Log.note('Generating Update endpoint for ' + collectionName)
      }

      options = options || {}

      let resourceAliasForRoute

      if (model.routeOptions) {
        resourceAliasForRoute = model.routeOptions.alias || model.modelName
      } else {
        resourceAliasForRoute = model.modelName
      }

      let handler = HandlerHelper.generateUpdateHandler(model, options, Log)

      let updateModel = joiMongooseHelper.generateJoiUpdateModel(model, Log)

      if (!config.enablePayloadValidation) {
        let label = updateModel._flags.label
        updateModel = Joi.alternatives()
          .try(updateModel, Joi.any())
          .label(label)
      }

      let readModel = joiMongooseHelper.generateJoiReadModel(model, Log)

      if (!config.enableResponseValidation) {
        let label = readModel._flags.label
        readModel = Joi.alternatives()
          .try(readModel, Joi.any())
          .label(label)
      }

      let auth = false
      let updateHeadersValidation = Object.assign(headersValidation, {})

      if (config.authStrategy && model.routeOptions.updateAuth !== false) {
        auth = {
          strategy: config.authStrategy
        }

        let scope = authHelper.generateScopeForEndpoint(model, 'update', Log)

        if (!_.isEmpty(scope)) {
          auth.scope = scope
          if (config.logScopes) {
            Log.debug(
              'Scope for PUT/' + resourceAliasForRoute + '/{_id}' + ':',
              scope
            )
          }
        }
      } else {
        updateHeadersValidation = null
      }

      let policies = []

      if (model.routeOptions.policies && config.enablePolicies) {
        policies = model.routeOptions.policies
        policies = (policies.rootPolicies || []).concat(
          policies.updatePolicies || []
        )
      }

      if (config.enableDocumentScopes && auth) {
        policies.push(restHapiPolicies.enforceDocumentScopePre(model, Log))
        policies.push(restHapiPolicies.enforceDocumentScopePost(model, Log))
      }

      if (config.enableUpdatedBy) {
        policies.push(restHapiPolicies.addUpdatedBy(model, Log))
      }

      if (config.enableDuplicateFields) {
        policies.push(
          restHapiPolicies.populateDuplicateFields(model, mongoose, Log)
        )
        if (config.trackDuplicatedFields) {
          policies.push(
            restHapiPolicies.trackDuplicatedFields(model, mongoose, Log)
          )
        }
      }

      if (config.enableAuditLog) {
        policies.push(restHapiPolicies.logUpdate(mongoose, model, Log))
      }

      server.route({
        method: 'PUT',
        path: '/' + resourceAliasForRoute + '/{_id}',
        config: {
          handler: handler,
          auth: auth,
          cors: config.cors,
          description: 'Update a ' + collectionName,
          tags: ['api', collectionName],
          validate: {
            params: {
              _id: Joi.objectId().required()
            },
            payload: updateModel,
            headers: updateHeadersValidation
          },
          plugins: {
            model: model,
            'hapi-swagger': {
              responseMessages: [
                {
                  code: 200,
                  message: 'The resource was updated successfully.'
                },
                { code: 400, message: 'The request was malformed.' },
                {
                  code: 401,
                  message:
                    'The authentication header was missing/malformed, or the token has expired.'
                },
                {
                  code: 404,
                  message: 'There was no resource found with that ID.'
                },
                { code: 500, message: 'There was an unknown error.' },
                {
                  code: 503,
                  message: 'There was a problem with the database.'
                }
              ]
            },
            policies: policies
          },
          response: {
            failAction: config.enableResponseFail ? 'error' : 'log',
            schema: readModel
          }
        }
      })
    }
390989
function (options) {
        W.extend(this, W.eventMixin);
        this.socketUrl = options.socketUrl;
        this._connectionDesired = false;
        this.attemptReconnectionAfterMS = (typeof options.attemptReconnectionAfterMS !== 'undefined') ? options.attemptReconnectionAfterMS : 10000;
    }
764499
function deployMQTrigger(mqType, name, namespace, topic, options) {
  const opts = _.defaults({}, options, {
    log: console.log,
  });
  const trigger = {
    apiVersion: 'kubeless.io/v1beta1',
    kind: `${mqType}Trigger`,
    metadata: {
      name: _.kebabCase(`${name}-${topic}`),
      namespace,
      labels: {
        'created-by': 'kubeless',
      },
    },
    spec: {
      functionSelector: {
        matchLabels: {
          'created-by': 'kubeless',
          function: name,
        },
      },
      topic,
    },
  };
  const triggerApi = new CRD(
    'apis/kubeless.io',
    'v1beta1',
    namespace,
    `${mqType.toLowerCase()}triggers`
  );
  opts.log(`Deploying ${mqType} trigger: ${trigger.metadata.name}`);
  return triggerApi.getItem(trigger.metadata.name)
    .then((res) => {
      if (res.code === 404) {
        return triggerApi.post({ body: trigger });
      }
      opts.log(`Updating existing ${mqType} trigger`);
      return triggerApi.put(trigger.metadata.name, { body: trigger });
    });
}
365723
function Node(options) {
  if (!(this instanceof Node))
    return new Node(options);

  AsyncObject.call(this);

  this.config = new Config('wmcc');
  this.config.inject(options);
  this.config.load(options);

  if (options.config)
    this.config.open('wmcc.conf');

  this.network = Network.get(this.config.network);
  this.startTime = -1;
  this.bound = [];
  this.plugins = Object.create(null);
  this.stack = [];

  this.logger = null;
  this.workers = null;

  this.spv = false;
  this.chain = null;
  this.fees = null;
  this.mempool = null;
  this.pool = null;
  this.miner = null;
  this.http = null;

  this.init();
}
1210772
def update(options={}, &block)
      object = resource

      if update_resource(object, resource_params)
        options[:location] ||= smart_resource_url
      end

      respond_with_dual_blocks(object, options, &block)
    end
569641
public OperationFuture<List<LoadBalancer>> update(
            LoadBalancerFilter loadBalancerFilter,
            LoadBalancerConfig config
    ) {
        checkNotNull(loadBalancerFilter, "Load balancer filter must be not null");

        List<LoadBalancer> loadBalancerList = findLazy(loadBalancerFilter)
                .map(metadata -> LoadBalancer.refById(
                    metadata.getId(),
                    DataCenter.refById(metadata.getDataCenterId())
                ))
                .collect(toList());

        return update(loadBalancerList, config);
    }
1195663
function HTTPBase(options) {
  if (!(this instanceof HTTPBase))
    return new HTTPBase(options);

  AsyncObject.call(this);

  this.config = new HTTPBaseOptions(options);
  this.config.load();

  this.server = null;
  this.io = null;
  this.sockets = new List();
  this.channels = new Map();
  this.routes = new Routes();
  this.mounts = [];
  this.stack = [];
  this.hooks = [];

  this._init();
}
258935
function (options) {
    this.queue = [];
    this.ownerTokenId = null;
    this.options = _.extend({}, AsyncLock.defaultOptions, options);
}
561114
function (options, mCb) {
		const aws = options.infra.api;
		getElbMethod(options.params.elbType || 'classic', 'list', (elbResponse) => {
			const elb = getConnector({
				api: elbResponse.api,
				region: options.params.region,
				keyId: aws.keyId,
				secretAccessKey: aws.secretAccessKey
			});
			const ec2 = getConnector({
				api: 'ec2',
				region: options.params.region,
				keyId: aws.keyId,
				secretAccessKey: aws.secretAccessKey
			});
			elb[elbResponse.method]({}, function (err, response) {
				if (err) {
					return mCb(err);
				}
				async.map(response.LoadBalancerDescriptions, function (lb, callback) {
					async.parallel({
						subnets: function (callback) {
							if (lb && lb.Subnets && Array.isArray(lb.Subnets) && lb.Subnets.length > 0) {
								let sParams = {SubnetIds: lb.Subnets};
								ec2.describeSubnets(sParams, callback);
							}
							else {
								return callback(null, null);
							}
						},
						instances: function (callback) {
							let iParams = {LoadBalancerName: lb.LoadBalancerName};
							elb.describeInstanceHealth(iParams, callback);
						}
					}, function (err, results) {
						return callback(err, helper[elbResponse.helper]({
							lb,
							region: options.params.region,
							subnets: results.subnets ? results.subnets.Subnets : [],
							instances: results.instances ? results.instances.InstanceStates : []
						}));
					});
				}, mCb);
			});
		});
	}
561041
function(options){
			options = options || {};
			
			var message = options.message || messages["loadingDeploymentSettings..."];
			var showMessage = options.showMessage;
			var hideMessage = options.hideMessage;
			
			var preferences = options.preferences;
			var fileClient = options.fileClient;
			var resource = options.resource;
			
			var d = new Deferred();
			showMessage(message);

			fileClient.read(resource.ContentLocation, true).then(
				function(result){
					mCfUtil.getTargets(preferences, result).then(function(result){
					hideMessage();
					d.resolve(result);
				}, d.reject);
			}, d.reject);
			
			return d;
		}
1269489
def _update_limits_from_api(self):
        
        self.connect()
        logger.debug("Querying ELB DescribeAccountLimits for limits")
        attribs = self.conn.describe_account_limits()
        name_to_limits = {
            'classic-load-balancers': 'Active load balancers',
            'classic-listeners': 'Listeners per load balancer',
            'classic-registered-instances':
                'Registered instances per load balancer'
        }
        for attrib in attribs['Limits']:
            if int(attrib.get('Max', 0)) == 0:
                continue
            name = attrib.get('Name', 'unknown')
            if name not in name_to_limits:
                continue
            self.limits[name_to_limits[name]]._set_api_limit(int(attrib['Max']))
        # connect to ELBv2 API as well
        self.conn2 = client('elbv2', **self._boto3_connection_kwargs)
        logger.debug("Connected to %s in region %s",
                     'elbv2', self.conn2._client_config.region_name)
        logger.debug("Querying ELBv2 (ALB) DescribeAccountLimits for limits")
        attribs = self.conn2.describe_account_limits()
        name_to_limits = {
            'target-groups': 'Target groups',
            'listeners-per-application-load-balancer':
                'Listeners per application load balancer',
            'rules-per-application-load-balancer':
                'Rules per application load balancer',
            'network-load-balancers': 'Network load balancers',
            'listeners-per-network-load-balancer':
                'Listeners per network load balancer'
        }
        for attrib in attribs['Limits']:
            if int(attrib.get('Max', 0)) == 0:
                continue
            name = attrib.get('Name', 'unknown')
            if name not in name_to_limits:
                continue
            self.limits[name_to_limits[name]]._set_api_limit(int(attrib['Max']))
        logger.debug("Done setting limits from API")
1162386
@Override
	public synchronized void optionsUpdated(IOptions options, long sequence) {
		String previousCacheBust = cacheBust;
		cacheBust = options.getCacheBust();
		if (sequence > 1 && cacheBust != null && !cacheBust.equals(previousCacheBust) && rawConfig != null) {
			// Cache bust property has been updated subsequent to server startup
			processDeps(false, false, sequence);
		}
	}
241252
function ChainOptions(options) {
  if (!(this instanceof ChainOptions))
    return new ChainOptions(options);

  this.network = Network.primary;
  this.logger = Logger.global;
  this.workers = null;

  this.prefix = null;
  this.location = null;
  this.db = 'memory';
  this.maxFiles = 64;
  this.cacheSize = 32 << 20;
  this.compression = true;
  this.bufferKeys = ChainDB.layout.binary;

  this.spv = false;
  this.bip91 = false;
  this.bip148 = false;
  this.prune = false;
  this.indexTX = true;
  this.indexAddress = true;
  this.forceFlags = false;

  this.coinCache = 0;
  this.entryCache = 5000;
  this.maxOrphans = 20;
  this.checkpoints = true;

  this.blockNotify = null;
  this.subscribeCmd = null;

  if (options)
    this.fromOptions(options);
}