Module: 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}

Gets the local host name.

Source:
Returns:

The local host name.

Type
string

getAppInternalPort() → {number}

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.

Source:
Returns:

The application internal port number.

Type
number

getAppPort() → {number}

Gets the external port is listening to.

Source:
Returns:

The external application port number.

Type
number

getHome() → {string}

Gets the home directory.

Source:
Returns:

The home directory.

Type
string

getPaaS() → {string}

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

Source:
Returns:

The name of the PaaS.

Type
string

getServiceConfig(typePrefix, nameopt) → {Object}

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.

Source:
Returns:

Configuration data for a remote service.

Type
Object