Module: caf_deploy/proxy_deploy

Proxy that enables a CA to deploy other applications.

Source:

Extends

Methods

createApp(appLocalName, image, options) → {string}

Creates a new app.

The type caf.createAppOptions is:

{args: Array.<caf.json>, instances: number, memory: number}
Parameters:
Name Type Description
appLocalName string

A name for this app that will be qualified by the owner of this CA, i.e., 'owner-appLocalName'.

image string

A Docker image containing the app.

options caf.createAppOptions

Extra options to configure this app. Memory is in megabytes.

Source:
Returns:

An id to identify this app instance.

Type
string

deleteApp(id) → {string}

Deletes deployed app.

Parameters:
Name Type Description
id string

An instance identifier.

Source:
Returns:

A request identifier.

Type
string

flexApp(id) → {string}

Changes the number of instances for this app.

A zero value suspends the app without losing its state.

Parameters:
Name Type Description
id string

An instance identifier.

Source:
Returns:

A request identifier.

Type
string

getAllRedisPorts() → {Object.<string, number>}

Returns all the Redis ports being used by deployed applications.

This is useful for management applications that need to have a global view of what has been deployed.

Kubernetes uses the default Redis port 6379 for all instances. Calling this method with a Kubernetes backend throws an error.

This is a privileged operation that needs to be explicitly enabled with spec.env.listAllRedisPorts=true in framework.json.

Source:
Returns:

Map of appName/ports used by Redis instances.

Type
Object.<string, number>

restartApp(id) → {string}

Restarts the app, using a newer image if available.

Parameters:
Name Type Description
id string

An instance identifier.

Source:
Returns:

A request identifier.

Type
string

setHandleReplyMethod(methodName)

Sets the name of the method in this CA that will process reply messages.

To ignore replies, just set it to null.

The type of the method should be function(requestId, error, data, cb)

where:

  • requestId: is an unique identifier to match the request.
  • error: a deployment error.
  • data: a deployment response.
  • cb: the standard callback to notify completion.
Parameters:
Name Type Description
methodName string | null

The name of this CA's method that process reply messages.

Source:

statApps(ids) → {Array.<Object>}

Returns the most recent, locally-cached information about a collection of apps.

Parameters:
Name Type Description
ids Array.<string>

An array of app identifiers.

Source:
Returns:

Status info for these apps. null element in the array means missing app.

Type
Array.<Object>