Creates a container-to-app or app-to-container socket for communication
@method register
@param {F2.AppConfig} [appConfig] The F2.AppConfig object
@param {F2.AppManifest} [appManifest] The F2.AppManifest object
188562
function(appConfig, appManifest) {
			if (!!appConfig && !!appManifest) {
				_apps[appConfig.instanceId] = {
					config:appConfig,
					socket:_createContainerToAppSocket(appConfig, appManifest)
				};
			} else {
				F2.log('Unable to register socket connection. Please check container configuration.');
			}
		}
997031
function create() {
  function app(stanza) { app.handle(stanza); }
  utils.merge(app, application);
  app._stack = [];
  app._filters = [];
  for (var i = 0; i < arguments.length; ++i) {
    app.use(arguments[i]);
  }
  return app;
}
764298
function createApplication() {
  var app = connect();
  utils.merge(app, proto);
  app.request = { __proto__: req };
  app.response = { __proto__: res };
  app.init();
  return app;
}
506876
function mergeApp(env, app, conf, ENV, fn) {
  fetch(conf, 'apps', function(err, apps) {
    if (err) return fn(err);
    debug('# APP');
    debug(app);
    mergeConf(env, apps, app, ENV, fn);
  });
}
826475
function _createManifest(){
        let file = repositoryPath + '/manifest.json';
        let manifest = {
            machines: {}
        };

        return new Promise(function(resolve, reject) {
            debug("Creating manifest file");
            jsonfile.writeFile(file, manifest, function (err) {
                if(err){
                    debug("Failed to create the manifest file");
                    reject(err);
                    return;
                }
                resolve();
            });
        });
    }
845929
function register(app, targetEndpoint) {
  var builder = new Builder(app, targetEndpoint);

  // create and update APIs
  app.put('/apiql/apis/:name', bodyParsers(), function (req, res, done) {
    builder.buildAPI(req.params.name, req.headers['content-type'], req.body, function (err) {
      if (err) {
        res.sendStatus(400);
      } else {
        res.sendStatus(204);
      }
      done();
    });
  });

  app.get('/apiql/apis', function (req, res, done) {
    API.listAPIs(function (err, apis) {
      if (err) {
        console.log(err);
      }
      res.format({
        json: function () {
          res.json({ items: _.map(apis, (api) => api.toJson()) }); // returns empty array even with error
        },
        default: function () {
          res.sendStatus(406);
        }
      });
      done();
    });
  });

  app.get('/apiql/apis/:name', function (req, res, done) {
    API.findByName(req.params.name, function (err, api) {
      if (err) {
        res.sendStatus(404);
      } else {
        res.format({
          html: function () {
            res.send(docs({ name: req.params.name, description: api.description }));
          },
          json: function () {
            res.json(api.toJson());
          },
          'application/openapi+json': function () {
            res.json(api.formattedDescription(OPENAPI_JSON));
          },
          'application/openapi+yaml': function () {
            res.send(api.formattedDescription(OPENAPI_YAML));
          },
          default: function () {
            res.sendStatus(406);
          }
        });
      }
      done();
    });
  });

  app.delete('/apiql/apis/:name', function (req, res, done) {
    builder.removeExistingAPI(req.params.name)(function (err) {
      if (err) {
        if (err.message == NOT_FOUND) {
          res.sendStatus(404);
        } else {
          res.status(500).send(err.message);
        }
      } else {
        res.sendStatus(204); // return the deleted item
      }
      done();
    });
  });

  // returns apiql OpenApi 3.0 API Description document or rendered documentation via conneg
  app.get('/apiql/api-description', function (req, res, done) {
    var description;

    try {
      description = yaml.safeLoad(fs.readFileSync(descriptionFilePath, 'utf8'));
    } catch (err) {
      console.log(err);
      res.status(500).send(err.message);
    }

    res.format({
      html: function () {
        res.send(docs({ name: 'APIQL Docs', description: description }));
      },
      'application/openapi+json': function () {
        res.send(description);
      },
      'application/openapi+yaml': function () {
        res.send(yaml.safeDump(description));
      },
      default: function () {
        res.sendStatus(406);
      }
    });
    done();
  });
}
1160314
function() {
			if (!_isInit()) {
				F2.log('F2.init() must be called before F2.getContainerState()');
				return;
			}

			return jQuery.map(_apps, function(app) {
				return {
					appId: app.config.appId
				};
			});
		}
173731
function createContainer(cluster, options, callback) {
  var blobSvc = azure.createBlobService(cluster.account, cluster.key);
  var container = cluster.container || options.container;
  blobSvc.createContainerIfNotExists(container, function(error, result, response) {
    if (error) {
      return callback(error);
    }
    return initializeContainer(blobSvc, container, options, callback);
  });
}
474364
function(protoApp, results, callback) {

    // Create some globally vars for use in and-thens
    var dir = (results.dir) ? results.dir : process.cwd();
    var dest = path.join(dir, results.name);

    /*
     * Utility function to double check just in case
     * we are in an app but it has not been registered
     */
    var isAppByFiles = function() {
      var kalaboxYaml = path.join(dest, 'kalabox.yml');
      var pkgJson = path.join(dest, 'package.json');
      return fs.existsSync(kalaboxYaml) && fs.existsSync(pkgJson);
    };

    // Check to make sure we aren't already inside another app
    // since chaos can ensue this way
    if (kbox.core.deps.contains('app') || isAppByFiles()) {
      throw new Error('Looks like an app already exists at ' + dest);
    }

    // Emit pre create event.
    kbox.core.log.status('Creating.');
    return kbox.core.events.emit('pre-create', results)

    // Make sure we are in a clean place before we get dirty
    .then(function() {
      kbox.core.log.status('Cleaning up.');
      return kbox.app.cleanup();
    })

    // Download the app skeleton and extract it to our destination
    .then(function() {
      kbox.core.log.status('Creating app structure.');
      return createAppSkeleton(protoApp, dest, results.from);
    })

    // Merge in our settings to the new app
    .then(function() {
      kbox.core.log.status('Configuring app.');
      return configureApp(protoApp, results);
    })

    // Install the new app
    .then(function() {

      // Get app config from new app
      var config = kbox.core.config.getAppConfig(dest);

      // Emit pre create event.
      kbox.core.log.status('Running pre create tasks.');
      return kbox.core.events.emit('pre-create-app', config)

      // Create a new app object
      .then(function() {
        return kbox.app.create(results.name, config, results);
      })

      // Emit post create event.
      .tap(function(app) {
        return kbox.core.events.emit('post-create-app', app);
      })

      // Report to metrics.
      .tap(function(app) {
        return kbox.metrics.reportAction(
          ['create', protoApp.name].join(':'),
          {app: app}
        );
      })

      // Install and start the SOB
      .tap(function(app) {
        app.status('Starting app.');
        // Set a flag so app.start events know if we are creating or not
        app.creating = true;
        return kbox.app.start(app);
      });

    })

    // Emit post create event.
    .tap(function(app) {
      app.status('Running post create tasks.');
      return app.events.emit('post-create');
    })

    // Print message
    .then(function(app) {
      console.log(kbox.art.appStart(app));
    })

    // Return.
    .nodeify(callback);

  }
569467
function(appConfig) {

		// check for valid app configurations
		if (!appConfig.appId) {
			F2.log('"appId" missing from app object');
			return false;
		}
		else if (!appConfig.root && !appConfig.manifestUrl) {
			F2.log('"manifestUrl" missing from app object');
			return false;
		}

		return true;
	}
544344
function PushApp(options) {
    ActionFactoryAbstract.call(this, options);
    this.device = new PushAppDevice(options);
    this.channel = new PushAppChannel(options);
    this.analytics = new PushAppAnalytics(options);
}
358468
function getAppContextFromCwdConfig(/*apps*/) {
  return Promise.try(function() {
    var cwd = process.cwd();
    var configFilepath = path.join(cwd, 'kalabox.yml');
    if (fs.existsSync(configFilepath)) {
      var config = kbox.core.config.getAppConfig(cwd);
      if (config.name) {
        return kbox.app.create(config.name, config);
      }
    }
  });
}
16999
def register_manifest(app, filename='manifest.json'):
    ''''''
    if current_app.config.get('TESTING'):
        return  # Do not spend time here when testing
    if not has_manifest(app, filename):
        msg = '{filename} not found for {app}'.format(**locals())
        raise ValueError(msg)
    manifest = _manifests.get(app, {})
    manifest.update(load_manifest(app, filename))
    _manifests[app] = manifest
392643
function create(appName, callback) {
    commons.post(format('/%s/apps/', deis.version), {
      id: appName
    }, callback);
  }
936136
function (token, deviceId, appId, events) {
    var options = {
      deviceId: deviceId,
      appId: appId,
    };

    require('./helpers').startAppUninstall(options, events);

  }
314765
function initContainer(opts) {
    var apps, appDir;

    container = opts.container;

    // if batch, preload that dir
    container === 'batch' ?
        opts.preload.push('batch') :
        opts.preload.push('middleware');

    if (container === 'webserver') {
        appDir = path.join(opts.rootDir, '/app');
        apps = fs.readdirSync(appDir);
        _.each(apps, function (app) {
            opts.preload = opts.preload.concat([
                'app/' + app + '/filters',
                'app/' + app + '/utils'
            ]);
        });
    }

    init(opts);
}
1354977
public function register(Container $app)
    {
        $app[DataInterface::class] = $app->factory(Data::class);
        $app[ConfigInterface::class] = $app->factory(FileConfig::class);
    }