API Docs for:
Show:

BaseEnvironment Class

Module: env.base
Parent Module: env

The Base Juju environment.

This class is intended to be subclassed by real environment implementations.

Methods

_firePermissionDenied

(
  • op
)
Undefined private

Fire a "permissionDenied" event passing the attempted operation.

Parameters:

  • op Object

    The attempted operation (with an "op" attr).

Returns:

Undefined: Fires an event only.

dispatch_result

(
  • data
)
Undefined

Dispatch the results returned by the API backend. Take care of calling attached callbacks and firing events. Subclasses must implement the "dispatchrpcresult" and "dispatch_event" methods or override this method directly.

Parameters:

  • data Object

    The JSON contents returned by the API backend.

Returns:

Undefined: Dispatches only.

get

() Boolean

Returns whether or not credentials are populated.

Returns:

Boolean: Whether or not user and password are set.

getCredentials

() Object

Retrieve the stored user credentials.

Returns:

Object: The stored user credentials with a 'user' and a 'password' attribute.

logout

() Undefined

Clear login information.

Returns:

Undefined: Nothing.

on_message

(
  • evt
)
Undefined

Fire a "msg" event when a message is received from the WebSocket.

Parameters:

  • evt Object

    The event triggered by the WebSocket.

Returns:

Undefined: Fire an event only.

setCredentials

(
  • The
)
Undefined

Store the user's credentials in session storage.

Parameters:

  • The Object

    credentials to store, with a 'user' and a 'password' attribute included.

Returns:

Undefined: Stores data only.

Attributes

conn

Object

The connection object.

connected

Boolean

Whether or not the connection is open.

debug

Boolean

Whether or not to run in debug mode.

defaultSeries

String

The default series (e.g.: precise) as provided by juju.

environmentName

String

The environment name as provided by juju.

password

String

The password used to connect.

providerType

String

The provider type (e.g.: ec2) as provided by juju.

readOnly

Boolean

Whether or not to run in read-only mode

socket_url

String

The websocket URL to connect to.

user

String

The username used to connect.