Adapters Set-Up

Overview

Working with adapters is a straightforward process. You can create, update and delete adapters like any other object in a ClearBlade system. Each Adapter consists of a name, a small number of administrative commands, and a small number of files comprising the administrative and executable assets of an adapter.

Create Adapter

Note

While it is not required, it is assumed that any executable code and dependant libraries comprising an adapter have been created.

  1. Navigate to the “Adapters” tab on the sidebar or menu of the developers console
  2. Click + Add Adapter.
  3. Enter the name, architecture, and description for the adapter and click Create.

    Heads Up!

    Adapter names must be unique within a system!


The new adapter will now be displayed in the list of adapters defined within the selected system.

Edit Adapter Architecture and Description

  1. Navigate to the “Adapters” tab on the sidebar or menu of the developers console
  2. Click on the adapter you want edit properties for
  3. Click on the icon under the adapter name next to the architecture description
  4. Make the necessary changes to the Architecture and Description fields and click Edit

Configure Adapter

When configuring an adapter, you can add, modify, and delete adapter files; and modify the commands associated with the adapter. It is important to note that files are optional for storing executable commands. If you elect to store commands inside of files, a command to execute the file must be provided. For a description of the commands that can be configured on the adapter, see Adapter Commands For a description of how to add files to an adapter, see Adapter File Management

  1. Navigate to the “Adapters” tab on the sidebar or menu of the developers console
  2. Click on the adapter you want edit the configurations for
  3. Click on the icon next to Configuration
  4. Click the Configuration button.

Edit Adapter Commands


4. Enter shell commands that should be executed for each of the associated fields. These can be direct commands or commands to execute the associated file for the process.
* Deploy Command - A command or shell script that will be run after the files are installed on a ClearBlade Edge
* Start-up Command - A command or shell script that will be executed to start the adapter on a ClearBlade Edge
* Stop Command - A command or shell script that will be run to stop the adapter on a ClearBlade Edge
* Status Command - A command or shell script that will be run to determine the status of the adapter on a specific ClearBlade Edge. Status command should explicitly return “Running” or “Stopped” to indicate to the console the status of the adapter. (See example of status.sh below)
* Undeploy Command - A command or shell script that will be run to uninstall the adapter from a ClearBlade Edge
* Logs Command - A command or shell script that will be used to retrieve any logs printed out by the adapter while it is executing
5. Select the updated file and click Open

6. Click Update Adapter

Deploy Adapter

In order to be able to manage and administrate adapters using the ClearBlade Platform developers console, the adapter must be deployed to a gateway device running the ClearBlade Edge. 1. Navigate to the “Deploy” tab on the sidebar or “Deployments” in the menu of the developers console

  1. Click on the name of the Deployment you wish to deploy the adapter on
  2. Choose Adapters from the list of assets
  3. Select the adapter to deploy

  4. Select the edge to deploy the adapter on and click Save and Exit

    Note

    If the start button is disabled, that would indicate a Start Command has not been specified in the Config tab of the adapter settings. See adapter management

  5. A message will be displayed indicating the adapter was started or an appropriate error will be displayed if the adapter could not be started.

Note

Once an adapter is deployed, you will need to start the adapter. It will not be automatically started.

Undeploy Adapter

To undeploy an adapter from 1 or more Edges: 1. Navigate to the “Deploy” tab on the sidebar or menu of the developers console

2. Click on the name of the Deployment you wish to deploy the adapter on
3. Uncheck the box for the Edge and click Save and Exit

Delete Adapter

Heads Up!

You must UNDEPLOY the adapter from all Edges prior to deleting it

Go back to the Adapters tab and select the adapter you undeployed. Click on Delete Adapter at the bottom left of the page. Tap “Confirm” in the dialog that appears.