caf_platform/plug_paas

A plug to access properties of external services managed by a PaaS, such as Kubernetes, Marathon or Cloud Foundry.

Properties:

 {paas: string, port: number, internalPort: number, host: string,
  home:string, redis: {port: number, hostname: string, password: string}
 }

where:

  • paas: name of the PaaS, e.g., "cloudfoundry", "marathon" or "kubernetes".
  • port: the external port number for this platform.
  • internalPort: the internal, i.e., inside container, port.
  • host: the hostname. Under "kubernetes" the value "localhost" is replaced by the container IP address.
  • home : the home directory.
  • redis: an example of the configuration of a service.
Source:

Extends

Methods

getAppHost() → {string}

Source:

Gets the local host name.

Returns:

The local host name.

Type
string

getAppInternalPort() → {number}

Source:

Gets the internal port the app is listening to.

The internal port can be different from the external one when using Docker containers.

A value of -1 just means use the external port.

Returns:

The application internal port number.

Type
number

getAppPort() → {number}

Source:

Gets the external port is listening to.

Returns:

The external application port number.

Type
number

getHome() → {string}

Source:

Gets the home directory.

Returns:

The home directory.

Type
string

getPaaS() → {string}

Source:

Gets the name of the PaaS used for deployment, e.g., "cloudfoundry", "marathon" or "kubernetes".

Returns:

The name of the PaaS.

Type
string

getServiceConfig(typePrefix, nameopt) → {Object}

Source:

Gets configuration data for a remote service.

Parameters:
Name Type Attributes Description
typePrefix string

A prefix for the type of service wanted, e.g., redis.

name string <optional>

A specific name for the service or undefined.

Returns:

Configuration data for a remote service.

Type
Object