HPCloud-JS

API Docs for: 1.0.0
Show:

Identity Class

Defined in: lib/identity.js:24
Module: hpcloud

Identity object. Identity objects represent an individual identity from Identity Services.

Constructor

Identity

(
  • jsonObject
)

Defined in lib/identity.js:24

Parameters:

  • jsonObject Object

    The JSON respone from Identity Services.

Methods

isExpired

() Boolean

Defined in lib/identity.js:47

Check if the current token has expired.

Returns:

Boolean: TRUE if the token as expired and FALSE if still valid.

roles

() Array

Defined in lib/identity.js:151

Get the user roles

Returns:

Array: The roles a user has.

serviceByName

(
  • name
  • region
)
Object

Defined in lib/identity.js:99

Given a service name, get the service endpoint.

This also takes a zone name.

Parameters:

  • name String

    The name of the service, e.g. 'objectStorage' or 'ext:cdn'.

  • region String

    The name of the availability zone, e.g. 'az-1.region-a.geo-1'

Returns:

Object: The service record.

serviceCatalog

() Object

Defined in lib/identity.js:89

The catalog of activated services.

Returns:

Object: The service catalog.

tenantId

() String

Defined in lib/identity.js:59

Get the current tenantId.

Returns:

String: The tenantId.

tenantName

() String

Defined in lib/identity.js:69

Get the current tenantName.

Returns:

String: The tenantName.

token

() String

Defined in lib/identity.js:37

Get the token.

Returns:

String: The token.

tokenDetails

() Object

Defined in lib/identity.js:79

The details around a token including expires, tenant, etc.

Returns:

Object: An object with the details about the token.

user

() Object

Defined in lib/identity.js:141

Get the user object.

Returns:

Object: The user object.