Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

common JavaScript API


Use the clmContext.common API to get information about the My Cloud Services console and user.

Summary

Types

Properties

Methods

getLoggedInUserUserInfo clmContext.common.getLoggedInUser()

getLocalizedString string clmContext.common.getLocalizedString(string i18nkey)

Types

UserInfo 

properties

string

userName

User name that was used to log in

string

email

Email address of the user

string

tenant

Primary organization of the user

string

role

Role of the user

static string

ROLE_CLOUD_ADMIN

Static string that represents the cloud admin role

static string

ROLE_TENANT_ADMIN

Static string that represents the tenant admin role

static string

ROLE_END_USER

Static string that represents the end user role

ServiceOffering 

properties

string

name

Name of the service offering.

string

id

Reconciliation ID of the service offering.

string

roId

Reconciliation ID of the corresponding requestable offering.

Request 

properties

string

name

Name of the service.

string

guid

GUID of the request. This GUID is the same as that of the corresponding object in the backend.

technicalOwner

Technical owner for this service.

number

quantity

Number of instances of the service requested.

string

totalEstimatedPrice

Total estimated price for this request (for example, in this format: "31 USD").

object

customFieldsNameValueMap

A dictionary (name/value) representing the custom fields in the request.

offering

The service offering that this request is based on.

Properties

clmContext.common.CLM_BASE_URL 

The context to prepend to BMC Cloud Lifecycle Management commands when making REST calls. For example, for issuing a CLM REST call from the custom UI to search for the offerings, use the following URI: 

clmContext.common.CLM_BASE_URL + "/ServiceOffering/search"
clmContext.common.apiVersion

The version of the API that is loaded. The version is formatted as major.minor (for example, 4.6). Customizations can request a particular version of the API, but if the requested one is not available, the nearest compatible version is loaded.

Methods

getLoggedInUser 

UserInfo clmContext.common.getLoggedInUser()

Gets information about the currently logged in user.

Return Value

Details about the user

getLocalizedString 

string clmContext.common.getLocalizedString(i18nkey)

Gets the localized string for the given key based on the browser locale. The lookup is done in the locale-specific version of the resources-locale*.js file. If an entry is not found, the i18nkey is returned.

Parameters

string

i18nkey

The key of the string to lookup in the resources-locale*.js file.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*