You configure dynamic extensions for your plug-in by using properties in the plugin.json manifest file. These properties identify the dynamic extensions and provide SPI endpoints for queries from the client code.
Dynamic Monitor and Configure extensions are configured in the same way. Dynamic Summary extensions and dynamic Menu extensions are similar. Where the steps differ, the examples show the differences.
Procedure
- Edit the manifest file,
plugin.json
.
{ "manifestVersion": "1.0.0",
"requirements": {"plugin.api.version": "1.0.0"}
...
- Within the
objects
object, locate the type of vSphere managed object for which the plug-in can supply a dynamic extension.
{ "manifestVersion": "1.0.0",
"requirements": {"plugin.api.version": "1.0.0"}
...
"objects": { ...
"VirtualMachine": {
...
- Within the managed object type, locate the extension type for which the plug-in can supply a dynamic extension.
Option |
Description |
For a dynamic extension in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
... |
For a dynamic extension in the Monitor tab. |
...
"objects": { ...
"VirtualMachine": { ...
"monitor": {
... |
For a dynamic extension in the Configure tab. |
...
"objects": { ...
"VirtualMachine": { ...
"configure": {
... |
For a dynamic extension in the Actions menu. |
...
"objects": { ...
"VirtualMachine": { ...
"menu": {
... |
- Within the object representing the extension type object, add a
dynamicUri
property to identify the endpoint where the client code will query the plug-in server for its filter choices.
If the plug-in manifest server will supply filter choices, you can specify a string containing the URI path. If an auxiliary server will supply filter choices, specify a JSON object containing a path
property (type string
) and a serverType
property (type string
), where the serverType
corresponds to the ServerInfo.type
property in the Extension Manager registration record. The serverType
value maps to the auxiliary server base URI that the user interface code uses to construct the endpoint for the dynamic extension filter query.
Note:
When you register an auxiliary server that will supply filter choices, its ServerInfo.url
property in the Extension
record must end with a slash (/
). See Registering Auxiliary Plug-in Servers.
Option |
Description |
For a dynamic extension in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
... |
(if an auxiliary server handles filter queries) |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": {
"serverType": "DYNAMIC_AUX_SERVER",
"path": "rest/dynamics/vm/summary"
}, ... |
For a dynamic extension in the Monitor tab. |
...
"objects": { ...
"VirtualMachine": { ...
"monitor": {
"dynamicUri": "rest/dynamics/vm/monitor",
... |
(if an auxiliary server handles filter queries) |
...
"objects": { ...
"VirtualMachine": { ...
"monitor": {
"dynamicUri": {
"serverType": "DYNAMIC_AUX_SERVER",
"path": "rest/dynamics/vm/monitor"
},
... |
For a dynamic extension in the Configure tab. |
...
"objects": { ...
"VirtualMachine": { ...
"configure": {
"dynamicUri": "rest/dynamics/vm/configure",
... |
(if an auxiliary server handles filter queries) |
...
"objects": { ...
"VirtualMachine": { ...
"configure": {
"dynamicUri": {
"serverType": "DYNAMIC_AUX_SERVER",
"path": "rest/dynamics/vm/configure"
},
... |
For a dynamic extension in the Actions menu. |
...
"objects": { ...
"VirtualMachine": { ...
"menu": {
"dynamicUri": "rest/dynamics/vm/actions",
... |
(if an auxiliary server handles filter queries) |
...
"objects": { ...
"VirtualMachine": { ...
"menu": {
"dynamicUri": {
"serverType": "DYNAMIC_AUX_SERVER",
"path": "rest/dynamics/vm/actions"
},
... |
- At the same level as the
dynamicUri
property, locate the views
array or the view
object (for Summary extensions), the views
array (for Monitor or Configure extensions) or the actions
array (for Menu extensions)
Option |
Description |
For a single dynamic extension in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
"view": {
... |
For multiple dynamic extensions in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
"views": [
...
]
}
... |
For a dynamic extension in the Monitor tab. |
...
"objects": { ...
"VirtualMachine": { ...
"monitor": {
"dynamicUri": "rest/dynamics/vm/monitor",
"views": [
... |
For a dynamic extension in the Configure tab. |
...
"objects": { ...
"VirtualMachine": { ...
"configure": {
"dynamicUri": "rest/dynamics/vm/configure",
"views": [
... |
For a dynamic extension in the Actions menu. |
...
"objects": { ...
"VirtualMachine": { ...
"menu": {
"dynamicUri": "rest/dynamics/vm/actions",
"actions": [
... |
- To each view or action that will be treated as dynamic, add the
dynamic
property.
Option |
Description |
For a single dynamic extension in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
"view": {
"dynamic": true
... |
For multiple dynamic extensions in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
"views": [
{
"dynamic": true,
...
},
{
"dynamic": true,
...
}
]
}
... |
For a dynamic extension in the Monitor tab. |
...
"objects": { ...
"VirtualMachine": { ...
"monitor": {
"dynamicUri": "rest/dynamics/vm/monitor",
"views": [
{
"dynamic": true,
... |
For a dynamic extension in the Configure tab. |
...
"objects": { ...
"VirtualMachine": { ...
"configure": {
"dynamicUri": "rest/dynamics/vm/configure",
"views": [
{
"dynamic": true,
... |
For a dynamic extension in the Actions menu. |
...
"objects": { ...
"VirtualMachine": { ...
"menu": {
"dynamicUri": "rest/dynamics/vm/actions",
"actions": [
{
"dynamic": true,
... |
- Add an
id
property to each Summary card or Menu action, and a navigationId
to each Monitor or Configure view, if not already present.
Option |
Description |
For a single dynamic extension in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
"view": {
"dynamic": true
"id": "vmSummaryCard",
... |
For multiple dynamic extensions in the Summary tab. |
...
"objects": { ...
"VirtualMachine": { ...
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
"views": [
{
"dynamic": true,
"id": "summary-card-1",
...
},
{
"dynamic": true,
"id": "summary-card-2",
...
}
]
}
... |
For a dynamic extension in the Monitor tab. |
...
"objects": { ...
"VirtualMachine": { ...
"monitor": {
"dynamicUri": "rest/dynamics/vm/monitor",
"views": [
{
"dynamic": true,
"navigationId": "MonitorDynView",
... |
For a dynamic extension in the Configure tab. |
...
"objects": { ...
"VirtualMachine": { ...
"configure": {
"dynamicUri": "rest/dynamics/vm/configure",
"views": [
{
"dynamic": true,
"navigationId": "ConfigureDynView",
... |
For a dynamic extension in the Actions menu. |
...
"objects": { ...
"VirtualMachine": { ...
"menu": {
"dynamicUri": "rest/dynamics/vm/actions",
"actions": [
{
"dynamic": true,
"id": "TakeAction",
... |
A navigationId
or id
string is required to identify the dynamic view or action in the plug-in server's response to a filter query.
Results
The following example shows a plugin.json
file with a dynamic Summary card, a dynamic Monitor view, a fixed Configure view, and a dynamic action. The dynamic Summary view is filtered by the manifest server, which is the default when a specific server is not named. The dynamic Monitor view is filtered by the the manifest server, configured with an explicit reference. The dynamic menu action is filtered by an auxiliary server.
Example: plugin.json With Dynamic Extensions
{ "manifestVersion": "1.0.0",
"requirements": {"plugin.api.version": "1.0.0"},
"configuration": {
"nameKey": "Dynamic Extension Manifest Example"
}
"objects": {
"VirtualMachine": {
"summary": {
"dynamicUri": "rest/dynamics/vm/summary",
"view": {
"dynamic": true
"id": "vmSummaryCard",
"uri": "index.html#vm-portlet",
}
},
"monitor": {
"dynamicUri": {
"serverType": "MANIFEST_SERVER",
"path": "rest/dynamics/vm/monitor"
},
"views": [
{
"dynamic": true,
"navigationId": "MonitorDynView",
"uri": "rest/views/vm/monitor/index.html"
}
],
"configure": {
"views": [
{
"navigationId": "ConfigureFixView",
"uri": "rest/views/vm/configure/index.html"
},
"menu": {
"dynamicUri": {
"serverType": "DYNAMIC_AUX_SERVER",
"path": "rest/dynamics/vm/actions"
},
"actions": [
{
"dynamic": true,
"id": "TakeAction",
"labelKey": "Take action",
"trigger": {
"type": "modal",
"uri": "rest/actions/vm/action1.html"
}
}
]
}
}
}
}
What to do next
Implement server-side code to handle filter queries at the endpoints that you configured in the manifest file. For more information about filter queries, see Dynamic Extensions Filter Query.