The
app
interface provides context object information and
helps your plug-in navigate and control the
vSphere
Client
user interface.
app.getApiEndpoints()
method
Signature | app.getApiEndpoints():UiApiEndpoint |
Description | Returns the URLs of the
vsphere-ui service API endpoints available to plug-ins. |
app.getContextObjects()
method
Signature | app.getContextObjects():any[] |
Description | Returns the current
context objects. |
Return value:
|
- for global view
- Returns empty
array. Global views have no context.
- for vSphere object
- Returns a context
item for the associated vSphere object.
- for dialog opened
by
modal.open()
- If dialog opened
by
htmlClientSdk.modal.open(configObj) , returns
value of
configObj.contextObjects (or empty array, if
contextObjects undefined)
- for dialog opened
by
plugin.json actions
- If dialog opened
by action defined in
plugin.json, returns
an array of context items.
A context item is a
JavaScript object containing a single property,
id:string . This is the ID of the associated
vSphere object.
|
app.navigateTo()
method
Signature | app.navigateTo(options:NavigationOptions):void |
Description | Navigates to a specified
view, and optionally passes custom data to the view. |
Parameter:
options | Specifies the
destination view and custom data. |
app.getNavigationData()
method
Signature | app.getNavigationData():any |
Description | Returns the custom data
passed to the view by the
navigateTo() method. (If no custom data passed,
returns
null .) |
app.getClientInfo()
method
Signature | app.getClientInfo():ClientInfo |
Description | Returns type and version
info for the
vSphere
Client.
|
app.getClientLocale()
method
Signature | app.getClientLocale():string |
Description | Returns the current
locale of the
vSphere
Client.
|
app.getSessionInfo()
method
Signature | app.getSessionInfo(callback):void |
Description | Retrieves information
about the client's authentication session.
The callback function
must have the following signature:
function callback(sessionInfo:SessionInfo)
|
app.getTheme()
method
Signature | app.getTheme():PluginTheme |
Description | Retrieves information
about the theme the plug-in should use.
|
app.ClientInfo
type
Description | Documents type and
version of
vSphere
Client. |
Name | Type | Required? | Notes |
---|
type | string |
info only | The vSphere Client type (HTML or
Flex ) |
version | string | info
only | The vSphere Client version string. |
app.NavigationOptions
type
Description | Specifies a destination
view and custom data for the view. |
Name | Type | Required? | Notes |
---|
targetViewId | string | yes | Navigation
ID of the destination view. (For a remote plug-in, this property must identify
a view created by the same plug-in.) |
objectId | string | no | ID
of any object associated with the view. (For a global view, this field is not
required.) |
customData | any | no | A
custom data structure passed to the view. |
app.PluginTheme
type
Description | Indicates the UI theme
that is currently selected. |
Name | Type | Required? | Notes |
---|
name | string |
info only | Possible values:
light or
dark . |
app.QueryParam
type
Description | Holds a single query
parameter of a URL. |
Name | Type | Required? | Notes |
---|
name | string |
info only | Name of query parameter, as in
?name=value . |
value | string | info
only | Value of query parameter, as in
?name=value . |
app.SessionInfo
type
Description | Holds information about
the current session of the
vSphere
Client. |
Name | Type | Required? | Notes |
---|
sessionToken | string |
info only | Identifier of the plug-in authentication session
with vCenter Server. |
app.UiApiEndpoint
type
Description | Holds the parsed elements
of the plug-in URL. |
Name | Type | Required? | Notes |
---|
origin | string |
info
only | <protocol>://<hostname><port> |
pathname | string | info
only | |
queryParams | Array<QueryParam> | info
only | <name>=<value> |
fullUrl | string | info
only | <origin>/<pathname>?<queryParams> |