The following quickstart tutorial showcases how to create a
Hub Integration extension project by using
the CloudBlue Connect CLI tool.
Make sure that the following prerequisites are met:
- Python (3.8, 3.9 or 3.10) is installed
- Docker is installed
- The latest release of Poetry is installed
- Latest release of Connect CLI is installed
- A distributor or reseller account on CloudBlue Connect is required
Prepare distributor/reseller account
It is required to generate an API token and add your
reseller account via the CLI tool.
Create a new token by using the Connect interface:
- Navigate to
- Click the
+ Create Tokenbutton.
- Proivde a
descriptionand an optional
external idfor your token.
- Next, choose
Custom Integrationfrom the extension list.
- Select required permissions for your token, at least the
DevOpsoption should be selected.
- On the summary screen, click
Go To Detailsto access your token details.
- Click the button to copy your token.
Next, open your terminal and run:
$ ccli account add "<your copied token>"
<your copied token> must be replaced with your generated API token.
Create an extension in DevOps
Use the DevOps module on the Connect platform to create a
Hub Integration extension:
1) Click on the
+ Add Extension button to start configuring a new extension object.
2) Provide your extension name, select your hub and then click
3) Click the
Open button to access the details page of your created extension.
4) Locate the
Local Access widget and click on the button to copy your
Extension Project Bootstrap wizard
The CLI tool provides a wizard to bootstrap your extension project.
Use the following command to launch this wizard:
$ ccli project extension bootstrap
The wizard provides the welcome screen and the following options to configure your extension:
Name your extension
Your provided extension name will be used for packaging metadata.
Project root folder name
The root folder with all required files will be created once all operations with the wizard are completed.
Describe your extension
Your provided description will be used to generate a readme file and for packaging metadata.
Set initial version number
Your provided version is used for packaging metadata.
Provide the author name
Your provided author name will be used for packaging metadata and to add a copyright header in each generated file.
Choose python package name
Select a package name for your extension. It must be a valid python identifier (e.g., connect_ext).
Synchronous or asynchronous programming
In case you are familiar with python asyncio programming, select
yes in the following step:
If you plan to host your git repository on github.com and you want to automate the
continuous integration of your project, select
yes in the following step and an actions workflow file
will be created for you:
The wizard will propose to use a hostname of the Connect production environment by default:
The wizard will propose to use the same Api Key that is configured for your distributor/reseller account:
Use your copied
environment ID value from the
Local Access widget of the details screen:
Hub Integration for this scenario:
Events Processing to generate an
Events Application class:
Select categories of events you want to handle:
Specify your required background events:
In case your extension should use environment variables, choose
generate example environment variables:
As a result, the wizard will provide a summary with your selected options:
Create and press Enter to generate your extension project.
Run your extension locally
In order to run your extension locally, it is required to build a docker image for your extension.
Go to your generated project folder and run:
$ docker compose build
Thereafter, use the following command to execute your extension:
$ docker compose up <your_extension_slug>_dev
Go to your extension details page via the Connect UI
DevOps module and
click the button to see your extension up and running!