Fleet Manager Plugin SDK – Demo Plugin¶
Warning
Please note, that Fleet Manager is going to be replaced by Operations Insight. Therefore this SDK is not maintained anymore.
Use the Operations Insight Plugin SDK from now, which has been enhanced with further functionality and is fully compatible with this SDK.
In the FAQ you can also find a description, how to update.
The distribution files provide a fully working sample for the Fleet Manager Plugin in the demo
folder.
The sample demonstrates the basic functionality of the plugin interface and can be enhanced with custom functionality for your own application. This section describes how to get the sample plugin running.
Prerequisites¶
- Source code editor, e.g., Visual Studio Code.
- MindSphere Developer plan.
- Node.js and npm are installed and configured.
- You have at least the role
mdsp:core:Developer
in your tenant. - You have at least
SpaceDeveloper
rights in your Cloud Foundry space.
Building the Plugin¶
- Unzip the SDK and open the
demo
directory in your IDE. -
Install the SDK using the following command (use the version provided with the sources):
npm install ../src/mindsphere-fleetmanager-plugin-sdk-1.0.2.tgz
-
Install all other public dependencies:
npm install
-
Open the
manifest.yml
file and customize the plugin name. -
Build the demo plugin using:
npm run build
Deploying the Plugin to Cloud Foundry¶
- Open a command line interface (CLI) inside the folder with the plugin binary.
-
Configure the proxy settings, if necessary.
Click here for detailed information on proxy settings
If you are in a company network behind a proxy, you may have to set the proxies to reach the Cloud Foundry endpoints. Contact your administrator, if you face any timeouts or connectivity problems.
Set the proxies for the Cloud Foundry CLI as shown below:
set http_proxy=http://PROXY_IP:PROXY_PORT set https_proxy=http://PROXY_IP:PROXY_PORT
export http_proxy=http://PROXY_IP:PROXY_PORT export https_proxy=http://PROXY_IP:PROXY_PORT
-
Login to CF using CF CLI. Enter
cf login -a https://api.cf.{region}.{mindsphere-domain} --sso
. - Open the URL printed by the CLI and log in using your WebKey credentials to get a One Time Code.
- Enter the One Time Code in the CLI.
-
Select your Cloud Foundry org and space using the following command:
cf target -o {org_name} -s {space_name}
No Cloud Foundry Orgs displayed
If you do not see any Cloud Foundry orgs, you need to be added to your org. Refer to the How Tos for Cloud Foundry.
-
Push the plugin to your Cloud Foundry space using:
cf push
Configuring the Plugin via the Developer Cockpit¶
Plugin configuration in the Developer Cockpit is very similar to application configuration. For a more detailed description of the following steps, refer to the instructions for Register the Application in the Developer Cockpit.
- Open the Developer Cockpit from the Launchpad and select the Dashboard tab.
- Click on Create new application.
- Select the type Fleet Manager Plugin and infrastructure Cloud Foundry.
- Enter a display name, an internal name and a version number. The display name will be displayed in the Fleet Manager.
- Upload an icon for your plugin.
- Enter the component name as in the manifest file.
- Add one endpoint for the component using
/**
to match all paths. - Enter the Cloud Foundry URL of your plugin.
- Use
cf app {pluginName}
to get the URL for your deployed plugin.
- Use
-
Set the following content security policy to enable Bootstrap for styling the plugin correctly:
default-src 'self' static.eu1.mindsphere.io; style-src * 'unsafe-inline' maxcdn.bootstrapcdn.com; script-src 'self' 'unsafe-inline' static.eu1.mindsphere.io; img-src * data:;
-
Click on Save.
- Switch to Authorization Management tab and add at least one plugin scope.
- Switch back to the Dashboard tab and select the plugin.
- Click on Register.
- Open the Settings app from the Launchpad and switch to the Roles tab.
- Assign yourself the plugin role and click on End editing.
- Log out from MindSphere and log in again.
After the login the plugin will be visible in Fleet Manager.
Congratulations! You have deployed and configured your first Fleet Manager plugin. You can now prepare your plugin for productive use in the same way as an application.
Related Links¶
Any questions left?
Except where otherwise noted, content on this site is licensed under the Development License Agreement.