networks

Contains ways to interact with docker networks.

Since: 3.0.0
Example

// Get the networks
return lando.networks.get()

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

networks.get([opts]) ⇒ Promise

Gets the docker networks.

Kind: static method of networks
Returns: Promise - A Promise with an array of network objects.
See: docker api network docs for info on filters option.
Since: 3.0.0

Param Type Description
[opts] Object Options to pass into the docker networks call
[opts.filters] Object Filters options

Example

// Options to filter the networks
 var opts = {
   filters: {
     driver: {bridge: true},
     name: {_default: true}
   }
 };

 // Get the networks
 return lando.networks.get(opts)

 // Filter out lando_default
 .filter(function(network) {
   return network.Name !== 'lando_default';
 })

 // Map to list of network names
 .map(function(network) {
   return network.Name;
 });

networks.prune([opts]) ⇒ Promise

Prunes the docker networks.

Kind: static method of networks
Returns: Promise - A Promise with teh status
See: docker api network docs for info on filters option.
Since: 3.0.0

Param Type Description
[opts] Object Options to pass into the docker networks call
[opts.filters] Object Filters options

Example

// Prune the networks
 return lando.networks.prune()

results matching ""

    No results matching ""