搜索

此内容没有您所选择的语言版本。

Installing and Operating Fuse Online on OpenShift Container Platform

download PDF
Red Hat Fuse 7.4

Install, configure, and upgrade Fuse Online, and export/import integrations for CI/CD pipeines

Red Hat Fuse Documentation Team

Abstract

Information and instructions for installing, managing, and operating Fuse Online on OpenShift Container Platform in a customer-managed environment on-site, in the cloud, or in a hybrid cloud.

Preface

You can install and operate Fuse Online on-site on OpenShift Container Platform (OCP). When Fuse Online is running on-site, additional features are available beyond the features that are provided when Fuse Online is managed by Red Hat and running on OpenShift Online or on OpenShift Dedicated.

The term on-site means a customer-managed environment; Red Hat is not managing the Fuse Online environment. A customer-managed environment can be on-premise, in the cloud, or in a hybrid cloud.

Each installation of Fuse Online is referred to as a Fuse Online environment. In a given OpenShift project, there can be exactly one Fuse Online environment. Each Fuse Online environment has its own URL. In a single OpenShift cluster, there can be multiple Fuse Online environments.

See the following topics for details:

Chapter 1. Installation of Fuse Online on OCP

To install Fuse Online on OCP on-site, the main steps are:

  1. A user with cluster administration permissions:

    1. Downloads the installation script.
    2. Registers a custom resource definition (CRD) at the cluster level.
    3. Grants permission for a user to install Fuse Online in their projects.
  2. A user who is granted permission to install Fuse Online:

    1. Ensures that all prerequisites are met.
    2. Decides how to install Fuse Online with regard to the OpenShift project to install into, the OpenShift route for Fuse Online, and the level of accessibility of OpenShift logs.
    3. Downloads the installation script.
    4. Invokes the installation script with the command that implements decisions.
    5. Confirms that Fuse Online is running.

The following topics provide details:

1.1. Registering a custom resource definition for deploying Fuse Online resources

To enable installation of Fuse Online, a cluster administrator registers a custom resource definition. The administrator needs to do this only once for the OpenShift cluster. The administrator also grants permission for installing Fuse Online to the appropriate users. Each user can then install Fuse Online in their projects.

Prerequisites

  • You must have cluster administration permissions.
  • You installed the oc client tool and it is connected to the OCP cluster into which Fuse Online will be installed.

Procedure

  1. Download the package that contains the Fuse Online installation scripts from the following location:

    https://github.com/syndesisio/fuse-online-install/releases/tag/1.7

    Unpack the downloaded archive at a convenient location on your file system. The fuse-online-install-1.7 directory contains the scripts and supporting files for installing Fuse Online.

  2. To verify that you are properly connected and can list custom resource definitions, invoke the following command:

    $ oc get crd

  3. To register the custom resource definition at the cluster level, go to the fuse-online-install-1.7 directory and invoke the following command:

    $ bash install_ocp.sh --setup

  4. Grant installation permission to each user who needs to install Fuse Online. For example, suppose you want to grant permission to an account with the user name developer. The following command grants permission to developer to install Fuse Online into any project that the developer account can access on the currently connected cluster:

    $ bash install_ocp.sh --grant developer --cluster

    Repeat this command for each user account that needs permission to install Fuse Online.

1.2. Decisions to make before you install Fuse Online on OCP

To correctly specify the Fuse Online installation command, decide on the answers to these questions:

  • Which OpenShift project do you want to install Fuse Online in?

    Default: The script installs Fuse Online in the current project.

    Option: Install Fuse Online in the project that you specify. When you run the installation script, specify the --project option followed by a project name. If this project does not yet exist, the script creates it. If this project exists, the installation script prompts you to confirm that it is okay to delete the project’s content. To continue, you must confirm. The installation script then deletes the project and re-creates it.

  • Do you want to specify the URL for Fuse Online?

    Default: The script calculates the OpenShift route by which Fuse Online can be reached.

    Option: Specify the URL for Fuse Online. When you run the installation script, specify the --route option followed by a URL.

  • Enable links from Fuse Online to OpenShift integration runtime logs?

    Default: No. Access OpenShift logs manually in OpenShift.

    Option: Provide links in Fuse Online. When you run the installation script, specify the --console option followed by the URL for your OpenShift console. These links appear in Fuse Online in an integration’s Activity tab.

1.3. Installing Fuse Online on OCP

To install Fuse Online on OCP on-site, download the installation package, run it, and confirm that Fuse Online is installed.

Prerequisites

  • You are running OCP on-site.
  • You installed the oc client tool and it is connected to the OCP cluster in which you want to install Fuse Online.
  • A user with cluster administration permissions gave you permission to install Fuse Online in any project that you have permission to access in the cluster.
  • You decided whether to perform the default installation or specify options to customize the installation.
  • You have a Red Hat developer account for which you know your user name and password. The installation script prompts you for these credentials so it can authenticate you against https://developers.redhat.com. For details about creating an account, see Accessing and Configuring the Red Hat Registry.

Procedure

  1. If you did not already download the package that contains the Fuse Online installation scripts, download it now from the following location:

    https://github.com/syndesisio/fuse-online-install/releases/tag/1.7

  2. Unpack the downloaded archive at a convenient location on your file system. The fuse-online-install-1.7 directory contains the scripts and supporting files for installing Fuse Online.
  3. Log in to OpenShift with an account that has permission to install Fuse Online. For example:

    $ oc login -u developer -p developer

  4. Ensure that the current project is the project into which you want to install Fuse Online. To view the current project:

    $ oc project

    Alternatively, you can specify the installation project when you run the installation script.

  5. In the directory in which you downloaded the installation script, invoke the installation script:

    • To perform the default installation, invoke:

      $ bash install_ocp.sh
    • To perform the default installation and also enable the data virtualization user interface, invoke:

      $ bash install_ocp.sh --datavirt

      Enable the data virtualization user interface in only development environments. Data virtualization lets a Fuse Online developer integrate data from multiple heterogeneous sources to create a virtual database image that is deployable on OpenShift. Applications can run SQL queries on the virtual database, including any non-SQL sources. For details, see the Red Hat Integration data virtualization documentation.

      Important

      Data virtualization is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.

    • To specify several installation options, you might invoke something like the following command:

      $ bash install_ocp.sh \
          --project my-project \
          --route my-project.6a63.fuse-online.openshiftapps.com \
          --console https://console.fuse-online.openshift.com/console
          --datavirt
      • --project specifies the name of the OpenShift project in which you want to install Fuse Online. You need to specify this option only when you want to install Fuse Online into an OpenShift project other than the current OpenShift project.
      • --route specifies the URL that your Fuse Online environment will have. This URL will be where you access your Fuse Online environment. The format of the URL is the name of the project in which you are installing Fuse Online followed by the domain that is specific to your OpenShift cluster.

        In other words, specify the project name followed by the hostname that is associated with the OpenShift route that is used to access Fuse Online. The DNS resolution of the specified hostname must point to the OpenShift Router.

      • --console specifies the full URL for your OpenShift console.
      • --datavirt enables the data virtualization user interface, a Technology Preview feature for use in development environments only.

    To learn more about the installation script options, invoke the $ bash install_ocp.sh --help command.

  6. Confirm that installation was successful:

    1. Display the OpenShift OAuth proxy log-in page at https://openshift-route.

      If you specified the --route option when you ran the installation script, replace openshift-route with the route name that you specified. If you chose to let the installation script calculate the OpenShift route, then the script displays the calculated route near the end of its execution. Replace openshift-route with the value that the script provided.

    2. If you are not already logged in to the OpenShift console, its log-in page appears. Enter your OpenShift user name and password to log in.

    The Fuse Online home page appears either immediately or after you log in to the OpenShift console.

1.4. Enabling data virtualization in Fuse Online on OCP

Data virtualization is a Technology Preview feature that lets a Fuse Online developer integrate data from multiple heterogeneous sources to create a virtual database image that is deployable on OpenShift.

Important

Data virtualization is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.

When you install Fuse Online on OCP, you can enable data virtualization. See Installing Fuse Online on OCP. If you do not enable data virtualization during installation of Fuse Online, you can enable it later by following the procedure described here. Enable the data virtualization user interface in only development environments.

For details, see the Red Hat Integration data virtualization documentation.

Prerequisites

  • Fuse Online 7.4 is installed and running on OCP on-site.
  • The oc client tool is installed and it is connected to the OCP cluster in which Fuse Online is installed.
  • A user with cluster administration permissions gave you permission to install Fuse Online in any project that you have permission to access in the cluster.
  • You have a Red Hat developer account for which you know your user name and password. The installation script prompts you for these credentials so it can authenticate you against https://developers.redhat.com. For details about creating an account, see Accessing and Configuring the Red Hat Registry.

Procedure

  1. Log in to OpenShift with an account that has permission to install Fuse Online. For example:

    $ oc login -u developer -p developer
  2. Ensure that the current project is the project in which Fuse Online is running. To view the current project:

    $ oc project
  3. Scale the komodo-server deployment to 1 by invoking:

    oc scale dc komodo-server --replicas 1

    If you upgraded to 7.4 (you ran the update_ocp.sh script and not the install_ocp.sh script) then this is already done. You can skip this step, though invoking this command has no effect.

  4. Enable the data virtualization endpoint in the Fuse Online user interface:

    oc edit cm syndesis-ui-config
  5. Under datavirt, change enabled 0 to enabled 1, and save.
  6. Trigger a new user interface deployment:

    oc rollout latest syndesis-ui
  7. Confirm that enabling data virtualization was successful:

    1. Display the OpenShift OAuth proxy log-in page at https://openshift-route.

      Replace openshift-route with the URL for your Fuse Online environment.

    2. If you are not already logged in to the OpenShift console, its log-in page appears. Enter your OpenShift user name and password to log in.

      The Fuse Online home page appears either immediately or after you log in to the OpenShift console.

    3. In the left panel, click Data.
    4. On the Data Virtualizations page, you should be able to add data views.

Chapter 2. Managing Fuse Online on OCP

After you install Fuse Online on OpenShift Container Platform (OCP) on-site, you can configure it to:

  • Bypass OpenShift access authorization
  • Make APIs for API provider integrations discoverable in Red Hat 3scale

As needed, you can upgrade Fuse Online, uninstall Fuse Online, or delete an OCP project that contains Fuse Online.

See the following topics for details:

2.1. Bypassing the OpenShift access authorization page

By default, when users access Fuse Online, they need to log in to OpenShift and then authorize access from Fuse Online to their OpenShift account. If you want to, you can configure OpenShift so that users bypass the page that prompts for access authorization.

To do this, a cluster administrator creates an OAuthClient resource. Then the administrator, or any user with permission to modify objects in the namespace in which Fuse Online is installed, updates the syndesis-oauthproxyDeploymentConfig resource. The update changes the container arguments to refer to the OAuth client ID and secret in the OAuthClient resource.

Prerequisites

  • Fuse Online is installed on OCP on-site.
  • A user with an OpenShift account that has the privileges that are associated with members of the system:cluster-admins group must create an OAuthClient resource. To obtain a list of the accounts that have this ability, run:

    oc policy who-can create OAuthClient

Procedure

  1. Create an OAuthClient resource with the following content and format:

    apiVersion: oauth.openshift.io/v1
    kind: OAuthClient
    grantMethod: auto
    metadata:
      name: ${CLIENT_ID}
    redirectURIs:
    - https://${ROUTE_HOSTNAME}/oauth/callback
    secret: ${SECRET}
  2. In the OAuthClient resource:

    1. Replace ${CLIENT_ID} with a unique string that distinguishes a particular Fuse Online installation. For example, you might prefix the OpenShift namespace in which Fuse Online is installed: fuse-online-proj123456.

      Or, you might specify something like fuse-online-1. Typically, a name that indicates where the resource is used is most helpful. Then when an administrator lists OAuth clients, the purpose of each client is clear.

    2. Replace ${ROUTE_HOSTNAME} with the fully qualified hostname that is configured for the Fuse Online route. For example, fuse-online.mycorp.com.
    3. Replace ${SECRET} with a sequence of random alphanumeric characters that will be used to authenticate Fuse Online requests to OpenShift.

      For example:

    apiVersion: oauth.openshift.io/v1
    kind: OAuthClient
    grantMethod: auto
    metadata:
      name: fuse-online-1
    redirectURIs:
    - https://fuse-online.mycorp.com/oauth/callback
    secret: lFCbZTwrTOdZi1h86azxoixXkN7wnsUf3gjoSKbb
  3. Run the following command to update the syndesis-oauthproxy DeploymentConfig resource:

    oc patch dc syndesis-oauthproxy --type json --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/args/1\", \"value\": \"--client-id=$CLIENT_ID\"}, {\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/args/2\", \"value\": \"--client-secret=$CLIENT_SECRET\"}]"

    When you installed Fuse Online, the installation script created the syndesis-oauthproxy DeploymentConfig resource. This oc patch command updates the resource so that its container arguments refer to the OAuth client ID and the OAuth secret defined in the new OAuthClient resource. For example, the updated resource looks like this:

    apiVersion: apps.openshift.io/v1
    kind: DeploymentConfig
    metadata:
      name: syndesis-oauthproxy
    spec:
      template:
        spec:
          containers:
          - args:
            - --client-id=fuse-online-1
            - --client-secret=lFCbZTwrTOdZi1h86azxoixXkN7wnsUf3gjoSKbb

Result

When users try to display the Fuse Online console, they log in to OpenShift and the Fuse Online console displays in the browser. The user does not have to authorize access from Fuse Online to OpenShift.

2.2. Configuring Fuse Online to enable 3scale discovery of APIs

If you create an API provider integration, you might want to enable discovery of the API for that integration in 3scale. For Fuse Online environments that are installed on OCP, a user with cluster administration permissions can enable 3scale discovery of APIs by setting a Fuse Online server configuration environment variable.

The default behavior is that APIs are not exposed for automatic discovery in 3scale. Turning on 3scale service discovery applies to all API provider integrations in your Fuse Online environment. You cannot choose which APIs are discoverable.

When 3scale service discovery is turned on:

  • Fuse Online does not provide an external URL for an API provider integration that is running.
  • The API is accessible only through 3scale. Configuration in 3scale is required to expose the endpoint. For details, see Red Hat 3scale API Management, Service Discovery.

Prerequisites

  • Fuse Online is installed on OCP on-site.
  • You have cluster administration permissions.

Procedure

Edit the syndesis-server DeploymentConfig object to set the CONTROLLERS_EXPOSE_VIA3SCALE environment variable to true. To do this, enter the following command on one line:

$ oc patch dc syndesis-server -p '{"spec":{"template":{"spec":{"containers":[{"name":"syndesis-server","env":[{"name":"CONTROLLERS_EXPOSE_VIA3SCALE","value":"true"}]}]}}}}'

2.3. Upgrading Fuse Online on OCP

To upgrade Fuse Online on OCP on-site, download the latest Fuse Online release and run the update script.

From time to time, fresh application images, which incorporate patches and security fixes, are released for Fuse Online. You are notified of these updates through Red Hat’s errata update channel. You can then upgrade your Fuse Online images.

The upgrade procedure for the following upgrades is the same:

  • From Fuse Online 7.3 to Fuse Online 7.4
  • From a Fuse Online 7.4 version to a newer Fuse Online 7.4 version

Prerequisites

  • You installed and are running version 7.3 of Fuse Online on OCP on-site. OR, you installed and are running a version of 7.4 of Fuse Online on OCP on-site and you want to upgrade to fresh application images.

    If you are running version 7.2 of Fuse Online on OCP, then you must upgrade to 7.3 and then you can upgrade to 7.4.

    If you are running version 7.1 of Fuse Online on OCP, then you must upgrade to 7.2 and then 7.3, and then you can upgrade to 7.4.

  • You installed the oc client tool and it is connected to the OCP cluster in which Fuse Online is installed.
  • A user with cluster administration permissions gave you permission to install or upgrade Fuse Online in any project that you have permission to access in the cluster.
  • If you are upgrading from 7.3 to 7.4, you have a Red Hat developer account for which you know your user name and password. The upgrade script prompts you for these credentials so it can authenticate you against https://developers.redhat.com. For details about creating an account, see Accessing and Configuring the Red Hat Registry.

Procedure

  1. Download the package containing the Fuse Online installation scripts from the following location:

    https://github.com/syndesisio/fuse-online-install/releases/tag/1.7

    Unpack the downloaded archive at a convenient location on your file system. The fuse-online-install-1.7 directory contains the scripts and supporting files for upgrading Fuse Online.

  2. Change to the directory that contains the extracted archive. For example:

    $ cd fuse-online-install-1.7

  3. Log in to OpenShift with an account that has permission to upgrade Fuse Online. For example:

    $ oc login -u developer

  4. Invoke the following command, which returns the name of the current project, to ensure that the current project is the project where Fuse Online is installed:

    $ oc project

    If you need to switch to the project where Fuse Online is installed then invoke the following command with the name of the OpenShift project that contains Fuse Online:

    $ oc project project-name

  5. To check which version you are about to upgrade to, run the update script with the --version option, as follows:

    $ bash update_ocp.sh --version

  6. Invoke the update script as follows:

    $ bash update_ocp.sh

    To learn more about the script, invoke $ bash update_ocp.sh --help.

    During and after an infrastructure upgrade, existing integrations continue to run with the older versions of Fuse Online libraries and dependencies.

  7. Upgrade Fuse Online integrations that are running as follows:

    1. In Fuse Online, select the integration that you want to upgrade.
    2. Select Edit.
    3. Select Publish to republish the integration.

    Republishing the integration forces a rebuild that uses the latest Fuse Online dependencies.

2.4. Uninstalling Fuse Online from an OCP project

You can uninstall Fuse Online from an OCP project without deleting the project nor anything else in that project. After uninstalling Fuse Online, integrations that are running continue to run but you can no longer edit or republish them.

Prerequisite

  • You have an OCP project in which Fuse Online is installed.
  • You exported any integrations that you might want to use in some other OpenShift project in which Fuse Online is installed. If necessary, see Export integrations.

Procedure

Invoke the following command:

$ oc delete syndesis app

This command deletes the Fuse Online infrastructure.

2.5. Deleting an OCP project that contains Fuse Online

Deleting an OpenShift project in which Fuse Online is installed deletes everything in the project. This includes all integrations that have been defined as well as all integrations that are running.

Prerequisites

  • You have an OCP project in which Fuse Online is installed.
  • You exported any integrations that you might want to use in some other OpenShift project in which Fuse Online is installed. If necessary, see Exporting integrations.

Procedure

Invoke the oc delete project command. For example, to delete an OpenShift project whose name is fuseonline, enter the following command:

$ oc delete project fuseonline

Chapter 3. Monitoring Fuse Online integrations on OCP with Prometheus

When you install Fuse Online on OCP on-site, the environment includes an instance of Prometheus in the OpenShift project in which you installed Fuse Online. You can access the Prometheus dashboard to monitor Fuse Online integrations.

Prerequisites

  • You are running OCP on-site.
  • Fuse Online is installed in an OpenShift project.

Procedure

  1. Log in to the OpenShift console.
  2. Open the project in which you installed Fuse Online.
  3. In the left pane of the OpenShift console, select Applications > Routes.
  4. Click the syndesis-prometheus Hostname URL to open the Prometheus dashboard in a new browser tab or window.

Additional resources

For information about how to configure an existing external Prometheus instance to monitor Fuse Online, see Monitoring Red Hat Integration.

Chapter 4. How to invoke Fuse Online public REST API endpoints

When you are running Fuse Online on OCP, each Fuse Online environment can expose public REST API endpoints. External Continuous Integration/Continuous Delivery (CI/CD) tools can invoke these endpoints to operate on the resources that are in that Fuse Online environment.

In each Fuse Online environment, an OpenShift administrator must expose Fuse Online public REST API endpoints before external tools can invoke those endpoints. The command that invokes an API endpoint specifies the URL for the Fuse Online environment on which the endpoint operates, a secret token, and an authorization token.

See the following topics for details:

4.1. Exposing Fuse Online public REST APIs for use by external tools

When you are running Fuse Online on OCP on-site, you might want to use an external tool to copy Fuse Online integrations from one Fuse Online environment to another Fuse Online environment. An external CI/CD tool might be a Jenkins job, an Ansible playbook, a cron-based shell script, or something else. For example, an Ansible playbook can export an integration from a Fuse Online development environment and import it into a Fuse Online testing environment.

To enable this, you must expose Fuse Online public REST API endpoints for each Fuse Online environment. In other words, you must repeat the procedure here for each installation of Fuse Online. For Fuse Online environments on the same cluster, while you can use the same service account to expose the public APIs, the recommendation is to use a different service account for each installation for better security.

Prerequisites

  • You have an OCP project in which Fuse Online is installed.
  • You use an external CI/CD tool and you want it to copy marked integrations from one Fuse Online environment to another.
  • The user who creates the OpenShift public OAuth proxy application must have cluster administration privileges.

Procedure

  1. Create an OpenShift service account that has a name that you specify. For example, the following command creates the cicd-client service account:

    $ oc create serviceaccount cicd-client

  2. Give your new service account permission to access the Fuse Online public API. For example, if cicd-client is the name of your new service account, then you would invoke the following command:

    $ oc policy add-role-to-user edit system:serviceaccount:syndesis:cicd-client

  3. Invoke the following command to create an OpenShift template for exposing Fuse Online public REST API endpoints:

    $ oc create -f https://raw.githubusercontent.com/syndesisio/fuse-online-install/1.7.x/resources/syndesis-public-oauth-proxy.yml

    Note

    In the template, the name of the resource is syndesis-public-oauth-proxy, while the name of the template itself is syndesis-public-oauthproxy. As you can see, the resource name hyphenates oauth and proxy but the template file name does not.

  4. Invoke the following command to create an OpenShift application that runs a Fuse Online public OAuth proxy process:

    $ oc new-app --template=syndesis-public-oauthproxy \
        -p PUBLIC_API_ROUTE_HOSTNAME=EXTERNAL_HOSTNAME \
        -p OPENSHIFT_PROJECT=$(oc project -q) \
        -p OPENSHIFT_OAUTH_CLIENT_SECRET=$(oc sa get-token syndesis-oauth-client) \
        -p SAR_PROJECT=$(oc project -q)

    Replace EXTERNAL_HOSTNAME with the public address of your Fuse Online environment. For example, the address might be something like public-fuse-online.127.0.0.1.nip.io.

    This command uses the syndesis-public-oauthproxy template, which you created in the previous step, to create an OAuth proxy process that exposes the Fuse Online public REST API. This OAuth proxy allows external tools to access the Fuse Online public API at a new public network address by using an OpenShift service account token.

Result

External CI/CD tools can use Fuse Online public REST API endpoints to export and import Fuse Online integrations across Fuse Online environments.

Next steps

4.2. Description of base URL for Fuse Online public REST API endpoints

The base URL for Fuse Online public REST API endpoints is something like this:

https://public-syndesis.192.168.64.42.nip.io/api/v1/public

The first part of the base URL is different for each Fuse Online environment. When you create the OpenShift application that runs the Fuse Online public OAuth proxy that enables access to public REST API endpoints, you specify the public address of your Fuse Online environment. This address is the first part of the base URL for calling endpoints that operate in that Fuse Online environment. For example:

https://public-syndesis.192.168.64.42.nip.io

The second part of the base URL is the same for all Fuse Online environments:

/api/v1/public

The Fuse Online public REST API provides endpoints that operate on three resources:

  • /integrations are the integrations that are in the Fuse Online environment that is identified in the base URL.
  • /connections are the connections that are in the Fuse Online environment that is identified in the base URL.
  • /environments is the set of environment labels that are in the Fuse Online environment that is identified in the base URL.

4.3. Obtaining a secret token for calling a public REST API endpoint

A command that calls a Fuse Online public REST API endpoint must specify a secret token. This token is for the service account that you created when you exposed the Fuse Online public REST API in a given Fuse Online environment.

Prerequisites

  • You are running Fuse Online on OCP on-site.
  • You exposed the public REST API that is provided by a Fuse Online environment in which you want to invoke endpoints.

Procedure

  1. Obtain the names of the secret tokens for the service account that you created when you exposed the public REST API for this Fuse Online environment. For example, if cicd-client is the name of the service account, you would invoke the following command:

    $ oc describe serviceaccount cicd-client

    This displays a list of information about the cicd-client service account including the names of its two tokens, which looks something like this:

    Tokens:      cicd-client-token-gxb25
                 cicd-client-token-gxdnv
  2. Display the content of either one of the tokens. For example:

    $ oc describe secret cicd-client-token-gxb25

    This displays a list of information, including a Data section that displays token: followed by a long series of random characters. This is one of the service account’s two secret tokens.

  3. Copy the secret token, paste it into a file, and save it.

Result

In a curl command, specification of the secret token looks like this:

-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJzeW5kZXNpcyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJzeW5kZXNpcy1jZC1jbGllbnQtdG9rZW4tMnZjNmwiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoic3luZGVzaXMtY2QtY2xpZW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiNjUxMjYxNGMtMmYwMS0xMWU5LTk3OWEtNDI1YWNlMzY3MTcyIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50OnN5bmRlc2lzOnN5bmRlc2lzLWNkLWNsaWVudCJ9.uKsri0JSKJDbgHoQwAhBJSNuWKwJgjegf2QlrCkhxVssSK1zIMZQaF9P5a4R7ZcWRnrZ_345UTqxYVeRlfHWVH0PqBkD-n7PAS9dcKJIFdS1jUHOmL1FTGgc3YW-bz1SlWT93tvK1EhorZ4_-EBfXhSAP4Uumi5qAg3_QUTMDstq233NSwBKYtFOw3Pp1ys3p3y0hcaiLMimeCH60vR4iWvptqqzc5QDigHiPySZNWxs_5awZlwdoIDvR-nSj690aC-49UKFgyEEdzdFU4bI2W4hOyDyhN9fVaIAZQKeJUrJBU-lnFTHI_NAd2OwzOEBpWZuj31Za5w9fU4kf4UDGA'

Next step

Copy the token from your saved file into a command that calls a public REST API endpoint in the given Fuse Online environment.

4.4. How to find integration IDs

In a command that invokes a Fuse Online public REST API endpoint that operates on only a particular integration, you must specify the ID of the integration that you want the endpoint to operate on. Specify one of the following:

  • The integration’s name

    You must specify it exactly as it appears in the Fuse Online console, for example, timer-to-log. If the integration name has any spaces or special characters, then you must specify HTML escape characters.

  • The internal integration ID

    This ID is in the Fuse Online console URL when you view an integration’s summary. To view an integration’s summary, in the left navigation panel, click Integrations. In the list of integrations, click the entry for the integration whose ID you need.

    With the integration summary visible in the browser, you would see something like this at the end of the URL: /integrations/i-Lauq5ShznJ4LcuWwiwcz. This integration’s ID is i-Lauq5ShznJ4LcuWwiwcz.

4.5. Format for specifying curl commands to invoke Fuse Online public endpoints

A curl command that calls a Fuse Online public REST API endpoint has the following format:

curl [options] \
     -H "Content-Type: <media-type>" \
     -H "SYNDESIS-XSRF-TOKEN: awesome" \
     -H `Authorization: Bearer <token>` \
     <base-url><endpoint> \
     [--request <HTTP-method>] \
     [-d <data>] \
     [-o <filename>]

[options]

Specify curl options that you choose.

<media-type>

For the export endpoint, specify multipart/form-data. For all other endpoints, specify application/json.

<token>

Specify a secret token for the OpenShift service account that you created when you exposed the public REST API.

<base-url>

Specify the base URL for the Fuse Online environment that has the integration, connection, or environment label, that you want the endpoint to operate on.

<endpoint>

Specify the endpoint that you want to call.

[--request <HTTP-method>]

Optionally, specify the HTTP method, for example, --request POST.

[-d <data>]

Optionally, depending on the endpoint that is being called, specify arguments that the endpoint requires. For example, to change an integration’s environment label to test, you would specify -d `test`

[-o <filename>]

Optionally, if you need to specify the name of a file that contains output, specify the -o curl option with the name of a file, for example, -o export.zip.

The following curl command invokes the Fuse Online public API endpoint that marks an integration for one or more environments that you specify:

curl -v -k -L -H "Content-Type: application/json" -H "SYNDESIS-XSRF-TOKEN: awesome" -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJzeW5kZXNpcyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJzeW5kZXNpcy1jZC1jbGllbnQtdG9rZW4tMnZjNmwiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoic3luZGVzaXMtY2QtY2xpZW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiNjUxMjYxNGMtMmYwMS0xMWU5LTk3OWEtNDI1YWNlMzY3MTcyIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50OnN5bmRlc2lzOnN5bmRlc2lzLWNkLWNsaWVudCJ9.uKsri0JSKJDbgHoQwAhBJSNuWKwJgjegf2QlrCkhxVssSK1zIMZQaF9P5a4R7ZcWRnrZ_345UTqxYVeRlfHWVH0PqBkD-n7PAS9dcKJIFdS1jUHOmL1FTGgc3YW-bz1SlWT93tvK1EhorZ4_-EBfXhSAP4Uumi5qAg3_QUTMDstq233NSwBKYtFOw3Pp1ys3p3y0hcaiLMimeCH60vR4iWvptqqzc5QDigHiPySZNWxs_5awZlwdoIDvR-nSj690aC-49UKFgyEEdzdFU4bI2W4hOyDyhN9fVaIAZQKeJUrJBU-lnFTHI_NAd2OwzOEBpWZuj31Za5w9fU4kf4UDGA'
https://public-syndesis.192.168.64.42.nip.io/api/v1/public/integrations/timer-to-log/tags -d '["test","staging"]' --request PUT

In the sample curl command:

  • The URL at the end of the command identifies the Fuse Online environment whose endpoint you are invoking.
  • timer-to-log indicates that you are marking the timer-to-log integration for the specified environments.
  • Specification of test and staging marks the timer-to-log integration for those environments.

Chapter 5. Using external tools to export/import integrations for CI/CD

When you are running Fuse Online on OCP on-site, you might have Continuous Integration/Continuous Deployment (CI/CD) pipelines that you want to act on certain integrations. Implementing this requires the completion of these tasks:

  • In the Fuse Online console, mark integrations for CI/CD pipelines.
  • In OpenShift, expose the Fuse Online public API.
  • Use external tools to invoke Fuse Online public API endpoints that export and import integrations.

See the following topics for details:

5.1. About marking integrations for CI/CD

When you are running Fuse Online on OCP on-site, to identify an integration for pipelines, mark the integration for a CI/CD environment that you specify. This applies a time-stamped label to the integration. Backend CI/CD Fuse Online public APIs use the label and its timestamp to filter integrations to find an integration that a pipeline needs to act on.

For example, suppose that in Fuse Online you mark an integration for the test1 environment. You can then invoke the Fuse Online public API export endpoint to export integrations that have the test1 environment label. The endpoint packages test1 integrations into an export file and returns that file. To copy test1 integrations to a Fuse Online test environment, you would invoke the public API import endpoint and provide the file that contains the exported test1 integrations.

Now suppose that you iteratively update and publish an integration that you previously marked for the test1 environment. You now have a new version of the integration and you want to export the updated version to the test1 environment. You must mark the integration again, even though it is already marked for the test1 environment. Marking the integration again updates the timestamp on the test1 environment label. This indicates to external tools that the integration has been updated and it is ready to be exported.

To mark an integration again, that is, to refresh the timestamp on an environment label that is already assigned to an integration, start the procedure for Marking integrations for CI/CD. In the CI/CD dialog, click Save since the checkbox for the desired environment should already be selected.

5.2. Marking an integration for CI/CD

When you are running Fuse Online on OCP on-site, to identify an integration for pipelines, mark the integration for a CI/CD environment that you specify. This applies a label to the integration.

Prerequisite

You have an OCP project in which Fuse Online is installed.

Procedure

  1. In the Fuse Online navigation panel on the left, click Integrations.
  2. In the list of integrations, at the right of the entry for the integration that you want to mark, click Kebab to display a popup menu and click Manage CI/CD.
  3. In the dialog that appears, do one or more of the following:

    • If the environment for which you want to mark this integration already appears, select the checkbox to the left of that environment.
    • If the environment for which you want to mark this integration is already selected, leave it selected.
    • If you need to create a label for an environment, then click Manage CI/CD, which displays a dialog for creating new environment labels. Create the label that you need, and then return to this procedure to mark the integration.

    Fuse Online applies selected environment label(s) to the integration. You can apply any number of environment labels to an integration.

  4. Click Save.

Result

Fuse Online labels the integration for release in the selected environment. Backend APIs can filter integrations to find the integrations that have, for example, the test1 label.

Next step

You must expose the Fuse Online public API endpoints before pipelines can act on integrations that are marked for a particular environment. See Exposing public APIs for external tools.

5.3. Managing environment labels for CI/CD

In the Fuse Online console, you can create, change, or remove CI/CD environment labels. CI/CD environment labels are tags that you can apply to integrations to identify them for CI/CD pipelines.

Prerequisites

  • Fuse Online is running on OCP on-site.
  • External tools use Fuse Online environment labels to identify integrations for CI/CD pipelines.

Procedure

  1. In Fuse Online, in the left navigation panel, click Integrations.
  2. In the upper right, click Manage CI/CD.
  3. On the Manage CI/CD page:

    • To create a CI/CD environment label:

      1. Click Add New.
      2. In the Add Tag Name dialog, in the Tag Name input field, enter a name for a new environment label, for example, test1.
      3. Click Save. On the Manage CI/CD page, there is a new entry for the environment label that you just added.
    • To change a CI/CD environment label:

      1. In the list of CI/CD environment labels, in the entry for the label that you want to change, click Edit.
      2. In the Edit Tag dialog, change the name as needed.
      3. Click Save to see the updated name in the list of environment labels. Fuse Online applies the updated name to every integration that is already marked with the environment label that you changed.
    • To delete a CI/CD environment label:

      1. In the list of CI/CD environment labels, in the entry for the label that you want to delete, click Remove.
      2. In the confirmation dialog, click Yes. Fuse Online deletes the environment label and also removes the deleted environment label from any integrations that have been marked with it.

Next step

Mark integrations with new environment labels. See Marking an integration for CI/CD.

5.4. Invoking the Fuse Online public API export endpoint

Before you can use external tools to copy Fuse Online integrations from one Fuse Online environment to another, the following tasks must be completed:

  • In Fuse Online, an integration that you want to export for a CI/CD pipeline must be marked for a particular environment. See Marking an integration for CI/CD.

    There is an exception to this requirement. When you want to export all integrations from a Fuse Online environment in one export operation, it does not matter whether or not an integration has already been marked for a particular environment.

  • You exposed the Fuse Online public API. See Exposing Fuse Online public API endpoints for external tools.

Endpoint for exporting integrations for a particular environment

To export integrations that have been marked for a particular environment, Fuse Online provides the following GET method endpoint:

/public​/integrations​/{env}​/export.zip

Replace {env} with a CI/CD environment label that you created in the Fuse Online console or by calling a Fuse Online public API endpoint for marking an integration. When an integration is marked for a particular environment, Fuse Online maintains a timestamp that indicates when it was marked. The endpoint exports an integration only if it has not already been exported since it was marked. For example, to export integrations that have been marked for the test1 environment, the endpoint is:

/public/integrations/test1/export.zip

This endpoint exports each integration that has the test1 environment label and that has been marked for the test1 environment since the last time that it was exported. The endpoint packages the integrations in the export.zip file and returns that file.

If no integration that is marked for the specified environment has been marked since the last time that the integration was exported, then the endpoint returns an HTTP 204 response to indicate that there is nothing to return.

Endpoint for exporting all integrations

You can invoke the export endpoint so that it exports all integrations in one Fuse Online environment. This makes it easy to duplicate all integrations in another Fuse Online environment. To do this, add the all=true option to the invocation of the export endpoint:

/public/integrations/{env}/export.zip?all=true

Replace {env} with a CI/CD environment label. It does not matter whether or not you already created this label in the Fuse Online console. The endpoint assigns the specified environment label to each integration that is not already marked for that environment.

When you add the all=true option, you must also explicitly specify that you want the exported integrations to be packaged in the export.zip file. For example:

/public/integrations/test1/export.zip?all=true -o export.zip

This invocation of the endpoint:

  • Marks each integration for the test1 environment.
  • Returns all integrations in the export.zip file.

    If you do not specify the -o export.zip option, then the endpoint returns a file whose name is export.zip?all=true.

Custom headers required by export endpoint

A command that invokes the export endpoint must specify these custom headers:

  • -H "Content-Type: multipart/form-data"
  • -H "SYNDESIS-XSRF-TOKEN: awesome"

    You must specify this custom header exactly as it appears above. The Fuse Online public API requires this header to authenticate the request.

  • -H 'Authorization: Bearer <token>'

    Replace <token> with the secret token that you copied into a file when you created the OpenShift service account that is used to expose the Fuse Online public API.

Sample curl command that exports integrations

Following is an example of a curl command that invokes a Fuse Online API endpoint that exports integrations:

curl -v -k -L -H "Content-Type: multipart/form-data" -H "SYNDESIS-XSRF-TOKEN: awesome" -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJzeW5kZXNpcyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJzeW5kZXNpcy1jZC1jbGllbnQtdG9rZW4tMnZjNmwiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoic3luZGVzaXMtY2QtY2xpZW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiNjUxMjYxNGMtMmYwMS0xMWU5LTk3OWEtNDI1YWNlMzY3MTcyIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50OnN5bmRlc2lzOnN5bmRlc2lzLWNkLWNsaWVudCJ9.uKsri0JSKJDbgHoQwAhBJSNuWKwJgjegf2QlrCkhxVssSK1zIMZQaF9P5a4R7ZcWRnrZ_345UTqxYVeRlfHWVH0PqBkD-n7PAS9dcKJIFdS1jUHOmL1FTGgc3YW-bz1SlWT93tvK1EhorZ4_-EBfXhSAP4Uumi5qAg3_QUTMDstq233NSwBKYtFOw3Pp1ys3p3y0hcaiLMimeCH60vR4iWvptqqzc5QDigHiPySZNWxs_5awZlwdoIDvR-nSj690aC-49UKFgyEEdzdFU4bI2W4hOyDyhN9fVaIAZQKeJUrJBU-lnFTHI_NAd2OwzOEBpWZuj31Za5w9fU4kf4UDGA'
https://public-syndesis.192.168.64.42.nip.io/api/v1/public/integrations/dev1/export.zip

In the command:

  • The URL at the end of the command identifies the Fuse Online environment from which to export integrations.
  • Specification of the dev1 environment label indicates that you want to export integrations that have been marked for the dev1 environment and that have not already been exported since they were marked.

5.5. Invoking the Fuse Online public API import endpoint

You can obtain one or more integrations by invoking a Fuse Online public API export endpoint. To copy exported integrations to another Fuse Online environment, invoke the Fuse Online public API import endpoint.

Endpoint for importing an integration

To import integrations, Fuse Online provides the following POST method endpoint:

​/public​/integrations

In the following example, the endpoint imports the integrations that are in the export.zip file and tags them for the testing environment:

/public/integrations -F data=@export.zip -F environment=testing

An import endpoint always imports the supplied integrations. That is, even if an integration has not changed since the last time it was imported, the endpoint still imports it.

Custom headers required by import endpoint

A command that invokes the import endpoint must specify these custom headers:

  • -H "Content-Type: application/json"
  • -H "SYNDESIS-XSRF-TOKEN: awesome"

    You must specify this custom header exactly as it appears above. The Fuse Online public API requires this header to authenticate the request.

  • -H 'Authorization: Bearer <token>'

    Replace <token> with the secret token that you copied into a file when you created the OpenShift service account that is used to expose the Fuse Online public API.

Sample curl command that imports integrations

Following is an example of a curl command that invokes a Fuse Online API endpoint that imports integrations:

curl -v -k -L -H "Content-Type: application/json" -H "SYNDESIS-XSRF-TOKEN: awesome" -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJzeW5kZXNpcyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJzeW5kZXNpcy1jZC1jbGllbnQtdG9rZW4tMnZjNmwiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoic3luZGVzaXMtY2QtY2xpZW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiNjUxMjYxNGMtMmYwMS0xMWU5LTk3OWEtNDI1YWNlMzY3MTcyIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50OnN5bmRlc2lzOnN5bmRlc2lzLWNkLWNsaWVudCJ9.uKsri0JSKJDbgHoQwAhBJSNuWKwJgjegf2QlrCkhxVssSK1zIMZQaF9P5a4R7ZcWRnrZ_345UTqxYVeRlfHWVH0PqBkD-n7PAS9dcKJIFdS1jUHOmL1FTGgc3YW-bz1SlWT93tvK1EhorZ4_-EBfXhSAP4Uumi5qAg3_QUTMDstq233NSwBKYtFOw3Pp1ys3p3y0hcaiLMimeCH60vR4iWvptqqzc5QDigHiPySZNWxs_5awZlwdoIDvR-nSj690aC-49UKFgyEEdzdFU4bI2W4hOyDyhN9fVaIAZQKeJUrJBU-lnFTHI_NAd2OwzOEBpWZuj31Za5w9fU4kf4UDGA'
https://public-syndesis.192.168.64.45.nip.io/api/v1/public/integrations -F data=@export.zip -F environment=testing

In this command:

  • The URL at the end of the command identifies the Fuse Online environment to import integrations into.
  • The export.zip file contains the integrations to be imported.
  • Specification of environment=testing causes the endpoint to mark each imported integration for the testing environment.

Chapter 6. Fuse Online public REST API endpoints reference

This section provides reference information for each Fuse Online public REST API endpoint. For additional information, see How to invoke Fuse Online public REST API endpoints.

The OpenAPI document that defines the public REST API endpoints is available in your Fuse Online environment at https://<fuse-online-host>/api/v1/swagger.json. However, this document defines the tags object as having three tags: public-api, extensions, and integration-support. Only the public-api tag is accessible when using the OpenShift public OAuth proxy process for Fuse Online. You should ignore the other two tags.

6.1. Endpoint for obtaining the state of an integration

This endpoint returns the state of the specified integration. The state is Running, Stopped, Pending, or Error.

Method and endpoint

GET

/public/integrations/{id}/state

Table 6.1. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{id}

string

Required path parameter. Name or internal ID of the integration whose state you want to obtain. See How to find integration IDs.

Request example

In the following example, the endpoint returns the state of the timer-to-log integration:

/public/integrations/timer-to-log/state

Produces

application/json

Response example

{"currentState":"Unpublished","stateDetails":{"id":"i-Lc0JLrsUFtBJfR_ylfEz:5","integrationId":"i-Lc0JLrsUFtBJfR_ylfEz","deploymentVersion":5,"detailedState":{"value":"BUILDING","currentStep":2,"totalSteps":4},"namespace":"syndesis","podName":"i-timer-to-log-5-build","linkType":"LOGS"}}`

6.2. Endpoint for obtaining a list of an integration’s environment labels

This endpoint returns the environment labels (tags) that have been applied to the specified integration.

Method and endpoint

GET

/public/integrations/{id}/tags

Table 6.2. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{id}

string

Required path parameter. Name or internal ID of the integration whose environment labels you want to obtain. How to find integration IDs.

Request example

In the following example, the endpoint returns the environment labels for the timer-to-log integration:

/public/integrations/timer-to-log/tags

Produces

application/json

Response example

{"test":{"name":"test","releaseTag":"i-Lc5WI16UFtBJfR_ylggz","lastTaggedAt":1554887553159,"lastExportedAt":1554887330152,"lastImportedAt":1554888047271},"staging":{"name":"staging","releaseTag":"i-Lc5WI16UFtBJfR_ylgfz","lastTaggedAt":1554887553159}}

6.3. Endpoint for marking an integration and keeping unspecified tags

This endpoint uses the PATCH method to mark the specified integration for the specified environment(s). If the integration is already marked for a specified environment, the endpoint updates the timestamp for that environment label. If the integration was previously marked for an environment that is not specified in a new request, the endpoint leaves that tag in place and does not update its timestamp.

This PATCH endpoint is a convenience method for CI/CD tools because it adds tags without the need to remove any other existing tags. This is in contrast to the PUT endpoint, which marks the integration for specified environments and removes any tags for environments that are not specified in the request.

Method and endpoint

PATCH

/public/integrations/{id}/tags

Table 6.3. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{id}

string

Required. Name or internal ID of the integration that you want to mark for the specified environment(s). See How to find integration IDs.

Additional Parameters

--request PATCH

 

Specify the PATCH method.

-d [env{,…​}]

string

Required. Specify one or more, comma-separated, environment labels, that you want to add to the specified integration. If the environment label does not already exist, the endpoint creates it. See Marking integrations for CI/CD.

Request example

In the following example, the endpoint marks the timer-to-log integration for the test2 and test3 environments:

public/integrations/timer-to-log/tags --request PATCH -d '["test2","test3"]'

Produces

application/json

Response example

{"test2":{"name":"test2","releaseTag":"i-LcXydouUFtBJfR_ylgrz","lastTaggedAt":1555365010746},"test3":{"name":"test3","releaseTag":"i-LcXydouUFtBJfR_ylgsz","lastTaggedAt":1555365010746},"test":{"name":"test","releaseTag":"i-Lc5WI16UFtBJfR_ylggz","lastTaggedAt":1554887553159,"lastExportedAt":1554887330152,"lastImportedAt":1554888047271},"staging":{"name":"staging","releaseTag":"i-Lc5WI16UFtBJfR_ylgfz","lastTaggedAt":1554887553159}}

6.4. Endpoint for marking an integration and removing unspecified tags

This endpoint uses the PUT method to mark the specified integration for the specified environment(s). If the integration was previously marked for an environment that is not specified in the new request, the endpoint removes that environment label from the integration.

To mark an integration without removing unspecified environment labels, call the PATCH method endpoint instead.

Method and endpoint

PUT

/public/integrations/{id}/tags

Table 6.4. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{id}

string

Required. Name or internal ID of the integration that you want to mark. See How to find integration IDs.

Additional Parameters

--request PUT

 

Specify the PUT method.

-d [env{,…​}]

string

Required. Specify one or more, comma-separated, environment labels. The endpoint marks the specified integration for these environments. If the environment label does not already exist, the endpoint creates it. See Marking integrations for CI/CD.

Request example

In the following example, the endpoint marks the timer-to-log integration for the test2 and test3 environments. If the integration was previously marked for any other environments, the endpoint removes those tags from the integration.

public/integrations/timer-to-log/tags --request PUT -d '["test2","test3"]'

Produces

application/json

Response example

{"test2":{"name":"test2","releaseTag":"i-LcXyw7GUFtBJfR_ylgtz","lastTaggedAt":1555365085713},"test3":{"name":"test3","releaseTag":"i-LcXyw7GUFtBJfR_ylguz","lastTaggedAt":1555365085713}}

6.5. Endpoint for publishing an integration

This endpoint publishes the specified integration. If the integration is already running, then the endpoint stops the integration and re-publishes it.

Method and endpoint

POST

/public/integrations/{id}/deployments

Table 6.5. Parameters
NameTypeDescription

Required Header Parameter

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameters

{id}

string

Required. Name or internal ID of the integration that you want to publish. See How to find integration IDs.

Request example

In the following example, the endpoint publishes the timer-to-log integration.

/public/integrations/timer-to-log/deployments

Produces

application/json

Response example

In this example, the ellipsis indicates the omission of some of the response.

{"id":"i-Lc0JLrsUFtBJfR_ylfEz:8","version":8,"createdAt":1555365135324,"updatedAt":1555365135324,"userId":"system:serviceaccount:syndesis:syndesis-cd-client","currentState":"Pending","targetState":"Published","integrationId":"i-Lc0JLrsUFtBJfR_ylfEz", . .2c+PC9zdmc+","description":"Trigger events based on an interval or a cron expression","isDerived":false},"stepKind":"endpoint"},{"id":"-Lc0I7wqEVfKCDDHC8Jv","configuredProperties":{"bodyLoggingEnabled":"true","contextLoggingEnabled":"true"},"metadata":{"configured":"true"},"stepKind":"log","name":"Log"}]}],"continuousDeliveryState":{"test2":{"name":"test2","releaseTag":"i-LcXyw7GUFtBJfR_ylgtz","lastTaggedAt":1555365085713},"test3":{"name":"test3","releaseTag":"i-LcXyw7GUFtBJfR_ylguz","lastTaggedAt":1555365085713}}}}

6.6. Endpoint for stopping an integration

This endpoint stops the specified integration.

Method and endpoint

PUT

/public/integrations/{id}/deployments/stop

Table 6.6. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{id}

string

Required. Name or internal ID of the integration that you want to stop. See How to find integration IDs.

Request example

In the following example, the endpoint stops the timer-to-log integration.

/public/integrations/timer-to-log/deployments stop

Produces

application/json

Response example

No content with a 204 status code

6.7. Endpoint for exporting integrations

This endpoint exports integrations that are marked for the specified environment and that have never been exported or that have not been exported since the last time that they were marked for that environment. See also: Invoking the Fuse Online public REST API export endpoint.

Method and endpoint

GET

/public/integrations/{env}/export.zip

Table 6.7. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

multipart/form-data

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{env}

string

Required. Environment label that you created in the Fuse Online console. The endpoint exports the integrations that are marked for this environment.

Query Parameter

all=true

string

Optional. Specify this option to export all integrations that are in the Fuse Online environment. The endpoint exports the current version of each integration. If an integration is not already marked for the specified environment, then the endpoint adds the specified environment label to the integration. The specified environment label does not need to have been created in the Fuse Online console.

Additional Parameter

-o export.zip

string

Required if you specify the query parameter. Without this option, the exported integrations are in a file named export.zip?all=true.

Request example

In this example, the endpoint exports integrations that have been marked for the test1 environment:

/public/integrations/test1/export.zip

In the following example, the endpoint ensures that each integration is marked for the test1 environment and returns all integrations in the export.zip file.

/public/integrations/test1/export.zip?all=true -o export.zip

Produces

application/octet-stream

Response

The export.zip file that contains the exported integration(s). The endpoint returns an HTTP status of 204 if there are no integrations to export.

6.8. Endpoint for importing integrations

This endpoint imports the integrations that are in the provided file. See also: Invoking the Fuse Online public REST API import endpoint.

Method and endpoint

POST

/public/integrations

Table 6.8. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Additional Parameters

data=@export.zip

string

Required. This is the file that contains the integrations that you want to import. You must have previously invoked the export endpoint to obtain this file.

environment={env}

string

Required. Environment label that you want to add to each imported integration.

Request example

In the following example, the endpoint imports the integrations that are in the export.zip file and marks them for the testing environment.

/public/integrations -F data=@export.zip -F environment=testing

Produces

application/json

Response example

The response is a list of the imported resources, which includes integrations and connections. In the following example, an ellipsis indicates that part of the response is omitted here.

{"lastImportedAt":1554888047271,"results":[{"id":"i-Lc0JLrsUFtBJfR_ylfEz","version":5,"createdAt":1554800274935,"updatedAt":0,"tags":["timer"],"name":"timer-to-log","flows":[{"id":"-Lc0I5AZEVfKCDDHC8Jv","steps":[{"id":"-Lc0I5jnEVfKCDDHC8Jv","configuredProperties":{"period":"900000"},"metadata":…​"description":"Trigger events based on an interval or a cron expression","isDerived":false},"stepKind":"endpoint"},{"id":"-Lc0I7wqEVfKCDDHC8Jv","configuredProperties":{"bodyLoggingEnabled":"true","contextLoggingEnabled":"true"},"metadata":{"configured":"true"},"stepKind":"log","name":"Log"}]}],"continuousDeliveryState":{"staging":{"name":"staging","releaseTag":"i-Lc5WI16UFtBJfR_ylgfz","lastTaggedAt":1554887553159},"test":{"name":"test","releaseTag":"i-Lc5WI16UFtBJfR_ylggz","lastTaggedAt":1554887553159,"lastExportedAt":1554887330152,"lastImportedAt":1554887859824}}}]}

6.9. Endpoint for removing an environment label from a particular integration

This endpoint removes the specified environment label from the specified integration. The environment label itself continues to exist but it no longer marks the specified integration.

Method and endpoint

DELETE

/public/integrations/{id}/tags/{env}

Table 6.9. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameters

{id}

string

Required path parameter. Name or internal ID of the integration that you want to unmark. See How to find integration IDs.

{env}

string

Required path parameter. Environment label that you want to remove from the specified integration.

Additional Parameter

--request DELETE

 

Specify the DELETE method.

Request example

In the following example, the endpoint removes the dev1 environment label from the timer-to-log integration.

/public/integrations/timer-to-log/tags/dev1 --request DELETE

Response example

No content with a 204 status code

6.10. Endpoint for creating an environment label

This endpoint creates an environment label. No integrations are marked with this label until you explicitly mark them in the Fuse Online console or by invoking a public API endpoint.

Method and endpoint

POST

/public/environments/{env}

Table 6.10. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{env}

string

Required. Environment label that you want to create.

Produces

Does not produce anything but responds as follows:

204 No Content

Success.

400 Bad Request

The environment name you specified already exists.

5xx errors

The server is unable to fulfill the request.

Request example

In the following example, the endpoint creates the dev1 environment label:

/public/environments/dev1 --request POST

The dev1 environment label now exists in the Fuse Online environment in which you invoked this endpoint. There are not yet any integrations that are marked with this label.

Response example

No content with response status code 204

6.11. Endpoint for obtaining a list of environment labels

This endpoint returns a list of environment labels that exist in the Fuse Online environment. You create environment labels in the Fuse Online console. See Managing environment labels for CI/CD.

Method and endpoint

GET

/public/environments[?withUses=true]

Table 6.11. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

withUses

Boolean

Optional. If the command specifies withUses=true, the endpoint returns environment labels and the number of integrations that are marked with that label. If not specified, or set to false, the endpoint returns only environment labels.

Produces

application/json

Request examples

  • /public/environments

    Response example:
    ["env-label-1", "env-label-2"]

  • /public/environments/?withUses=true

    Response example
    [{"name":"env-label-1","uses":1},
    {"name":"env-label-2","uses":0}]

6.12. Endpoint for changing an environment label

This endpoint changes an environment label. Integrations that were marked for the original environment label are now marked for the new environment label.

Method and endpoint

PUT

/public/environments/{env}

Table 6.12. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{env}

string

Required. Environment label that you want to change.

Additional Parameters

-d {env}

string

Required. Specify the new label for the environment.

--request PUT

 

Specify the PUT method.

Request example

In the following example, the endpoint changes the dev1 environment label to dev2:

/public/environments/dev1 -d ‘dev2’ --request PUT

Integrations that were marked for the dev1 environment no longer have that tag. Those integrations are now marked for the dev2 environment.

Response example

No content with response status code 204

6.13. Endpoint for removing an environment label from all integrations

This endpoint removes the specified environment label from each integration to which it has been applied.

Method and endpoint

DELETE

/public/environments/{env}

Table 6.13. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{env}

string

Required. Environment label that you want to remove from integrations that have it.

Additional Parameter

--request DELETE

 

Specify the DELETE method.

Request example

In the following example, the endpoint removes the dev1 tag from any integrations that have it:

/public/environments/dev1 --request DELETE

Response example

No content with response status code 204

6.14. Endpoint for changing a connection’s properties

This endpoint changes the properties of the specified connection. This is often useful after you import an integration that has connections that require configuration. For example, you might need to change the credentials that a connection uses.

Method and endpoint

POST

​/public​/connections​/{id}​/properties

Table 6.14. Parameters
NameTypeDescription

Required Header Parameters

-H "Content-Type: <media-type>"

application/json

Media type that the endpoint requires.

-H "SYNDESIS-XSRF-TOKEN: awesome"

Custom

Required for authentication.

-H 'Authorization: Bearer <token> '

Custom

Secret token for the OpenShift service account that exposes the Fuse Online public REST API. See Obtaining a secret token.

Path Parameter

{id}

string

Required. Replace {id} with the ID of the connection whose properties you want to change. For the connection ID, specify one of the following:

  • The connection’s name, for example: PostgresDB. If the connection name has any spaces or special characters, then you must specify HTML escape characters.
  • The internal connection ID, which is in the Fuse Online console URL when you view a connection’s details. To view a connection’s details, in the left navigation panel, click Connections. Then click the connection whose details you want to view. When the connection details are visible in the browser, you would see something like this at the end of the URL: /connections/i-LaupI8XznJ4LcuWwiwaz. This connection’s ID is i-LaupI8XznJ4LcuWwiwaz.

Request example

The following example changes the properties of the PostgresDB connection. The new value of the user property is myuser, and the new value of the password property is mypassword:

/public/connections/PostgresDB/properties --request POST -d '{ "user": "myuser", "password": "mypassword" }'

Produces

application/json

Sample response

In this example, there is an ellipsis that indicates the omission of a large part of the response.

{"uses":0,"id":"i-LaOziUGpQE45nua4pfCz","name":"TODO app","configuredProperties":{"password":"»ENC:c2cb731046372a275b76beabc92aefa061f79b43fb791fb599d9e85ec0235a7e","basePath":"/api","host":"http://todo-syndesis.my-minishift.syndesis.io/","specification":…​"userId":"admin","lastUpdated":1555365796629,"createdDate":1553066813379,"board":{"id":"i-Lbj4-vqUFtBJfR_ylfCz","metadata":{"connector-id":"i-LaOzcPZpQE45nua4pfBz","connector-version-latest":"1","connector-version-connection":"1"},"messages":[{"level":"WARN","code":"SYNDESIS007"}],"createdAt":1554494263030,"updatedAt":1554494263727,"targetResourceId":"i-LaOziUGpQE45nua4pfCz","notices":0,"warnings":1,"errors":0},"isDerived":false}

Chapter 7. Enabling Apache Camel K to speed up Fuse Online deployments on OCP

You can install Apache Camel K Technology Preview as an optional add-on to Fuse Online to speed up deployment of integrations on OCP.

Important

Camel K is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production.

These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview.

The following topics introduce Apache Camel K and explain how to install it with Fuse Online:

7.1. About Apache Camel K

Apache Camel K is a lightweight cloud integration platform based on the Apache Camel framework for Enterprise Integration Patterns. Camel K runs natively on Kubernetes, OpenShift, and Knative, and is specifically designed and optimized for serverless and microservice architectures.

Camel K provides automation and performance optimizations when running integrations in the cloud. It uses the Kubernetes Operator SDK to deploy integrations (for example, automatically creating services and routes on OCP).

Camel K is a subproject of the Apache Camel open source community. For more details, see https://github.com/apache/camel-k.

7.2. Installing Apache Camel K with Fuse Online on OCP

The Camel K operator is available in Fuse Online to speed up turnaround times when deploying and redeploying integrations on OCP (for example, from 1-2 minutes to a few seconds). This section explains how to install and configure Camel K with Fuse Online from the Syndesis open source project.

Important

The Camel K runtime in the Technology Preview does not support Fuse Online extensions.

Prerequisites

  • You must be connected to the OCP cluster in which you want to install Fuse Online, or to a local cluster created for development.
  • You must have cluster administration privileges.
  • You must have the Docker client installed and the Docker daemon running to extract the Camel K client.
  • You must authenticate in Docker using the following command:

    $ docker login registry.redhat.io

Procedure

  1. Download and unzip the latest Fuse Online 1.7.x release: https://github.com/syndesisio/fuse-online-install/releases/tag/1.7
  2. Set up Fuse Online to use Camel K:

    $ bash install_ocp.sh --setup --camel-k

    This installs the Fuse Online and Camel K operators in your cluster.

  3. Install Fuse Online and Camel K in your cluster:

    $ bash install_ocp.sh --camel-k

    By default, this installs Fuse Online and the Camel K runtime engine in the current OCP project, and the script calculates the route by which Fuse Online is accessed. Only Camel K is installed if Fuse Online is already installed. For more details, see https://github.com/syndesisio/fuse-online-install.

  4. Update the ConfigMap object for syndesis-server-config to enable Camel K:

    $ oc get configmap syndesis-server-config -o yaml | sed 's/controllers:/controllers:\n      integration: camel-k/' | oc apply -f -

    Alternatively, you can manually edit this ConfigMap and add the following setting in the embedded application.yml section:

    controllers:
      integration: camel-k
  5. Restart the syndesis-server:

    Tip

    If existing integrations are running, it is best to stop them all in Fuse Online before restarting the server.

    $ oc delete pod -l syndesis.io/component=syndesis-server
Note

When camel-k is configured as the runtime engine, this replaces the classic Camel integration runtime of spring-boot.

More information

For more details, see Chapter 1, Installation of Fuse Online on OCP.

Legal Notice

Copyright © 2020 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.