Skip to content

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

  1. Unzip the SDK and open the demo directory in your IDE.
  2. 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
    
  3. Install all other public dependencies:

    npm install
    
  4. Open the manifest.yml file and customize the plugin name.

  5. Build the demo plugin using:

    npm run build
    

Deploying the Plugin to Cloud Foundry

  1. Open a command line interface (CLI) inside the folder with the plugin binary.
  2. 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
    
  3. Login to CF using CF CLI. Enter cf login -a https://api.cf.{region}.{mindsphere-domain} --sso.

  4. Open the URL printed by the CLI and log in using your WebKey credentials to get a One Time Code.
  5. Enter the One Time Code in the CLI.
  6. 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.

  7. 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.

  1. Open the Developer Cockpit from the Launchpad and select the Dashboard tab.
  2. Click on Create new application.
  3. Select the type Fleet Manager Plugin and infrastructure Cloud Foundry. Developer Cockpit with Fleet Manager Plugin
  4. Enter a display name, an internal name and a version number. The display name will be displayed in the Fleet Manager.
  5. Upload an icon for your plugin.
  6. Enter the component name as in the manifest file.
  7. Add one endpoint for the component using /** to match all paths.
  8. Enter the Cloud Foundry URL of your plugin.
    • Use cf app {pluginName} to get the URL for your deployed plugin.
  9. 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:;
    
  10. Click on Save.

  11. Switch to Authorization Management tab and add at least one plugin scope. Fleet Manager Plugin create role
  12. Switch back to the Dashboard tab and select the plugin.
  13. Click on Register.
  14. Open the Settings app from the Launchpad and switch to the Roles tab.
  15. Assign yourself the plugin role and click on End editing.
  16. Log out from MindSphere and log in again.

After the login the plugin will be visible in Fleet Manager. Fleet Manager Plugin Overview

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.

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the Development License Agreement.


Last update: March 17, 2023