registry

Contains functions to interact with the appRegistry.

Since: 3.0.0
Example

// Register an app
return lando.registry.register({name: app.name, dir: app.root});

// Return the apps in the registry
return lando.registry.getApps();

// Return apps that might be in a bad state
return lando.registry.getBadApps();

// Remove from the registry
return lando.registry.remove({name: app.name});

registry.getApps([opts]) ⇒ Promise

Gets a list of apps from the appRegistry

Kind: static method of registry
Returns: Promise - A Promise with an array of returned apps.
Since: 3.0.0

Param Type Default Description
[opts] Object Options to determine how we get the apps.
[opts.useCache] Boolean true Whether we should grab the appRegistry from cache or regenerate it.

Example

// Regenerate the registry, return the list and print it
return lando.registry.getApps({useCache: false})

// Print the list
.then(function(apps) {
  console.log(apps);
})

registry.getBadApps() ⇒ Promise

Gets a list of apps from the appRegistry that might be in a bad state.

Kind: static method of registry
Returns: Promise - A Promise with an array of returned bad apps.
Since: 3.0.0
Example

// Return the bad list and print it
return lando.registry.getBadApps()

// Print the list
.then(function(apps) {
  console.log(apps);
})

registry.register(app) ⇒ Promise

Adds an app to the app registry.

Kind: static method of registry
Returns: Promise - A Promise
Since: 3.0.0

Param Type Description
app Object The app to add
app.name String The name of the app.
app.dir String The absolute path to this app's lando.yml file.
[app.data] Object Optional metadata

Example

// Define an app with some additional and optional metadata
var app = {
  name: 'starfleet.mil',
  dir: '/Users/picard/Desktop/lando/starfleet',
  data: {
    warpfactor: 9
  }
};

// Register the app
return lando.registry.register(app);

registry.remove(app) ⇒ Promise

Removes an app from the app registry.

Kind: static method of registry
Returns: Promise - A Promise
Since: 3.0.0

Param Type Description
app Object The app to remove
app.name String The name of the app.
app.dir String The absolute path to this app's lando.yml file.

Example

// Define an app with some additional and optional metadata
var app = {
  name: 'starfleet.mil',
  dir: '/Users/picard/Desktop/lando/starfleet'
};

// Remove the app
return lando.registry.remove(app);

results matching ""

    No results matching ""