Skip to main content

Import and use external Assets in the Workbench

๐ŸŽฏcontext

You have an asset that was created externally and you want to import into the Workbench and then create a project based on the imported asset. In this How-To, we will import the Narayana LRA Coordinator service and use it within a saga application composition project as an example.

Descriptionโ€‹

The Solution Designer Asset Catalog contains reusable, released components to create own projects based on. To use an imported asset in an application composition project, you have to create and release the project within the Solution Designer.

โ„น๏ธnote

Please note that the links to the workbench tools in this tutorial only apply to the IBM Education Environment we provide. If you are using a different environment, e.g. your own installation, you will need to navigate directly to the required tools.

Preconditionsโ€‹

  • You have configured an asset catalog within Solution Designer.
Asset Catalogs
โ„น๏ธnote

Kindly make sure you have the required permissions for the chosen asset catalog. for more information, please read How-To: Define Permissions on Asset Catalogs and Assets

Stepsโ€‹

Import an external asset into -solutionDesigner Asset Catalogโ€‹

โ—๏ธinfo

We will import the Narayana asset as an example. You can follow the same steps to import any external asset into the Solution Designer.

  1. To get the URL of the Swagger-UI of the K5 Asset Manager, you can do one of the following

    • In your terminal write oc get -n ${ISW installation namespace} route k5-asset-manager-route

    or

    • Open your k5 asset management location and get the needed URL. The URL should look like this k5-asset-manager-${ISW installation namespace}.apps.${cluster base url}
  2. Open the Swagger UI to view all the functions.

๐Ÿ’กtip

Please contact your administrator if you don't have the required access.

Swagger UI
  1. Click on Authorize to start testing the methods.

    Swagger Authentication
  2. Open the method get/asset-catalog/{catalogAlias} to get the needed details for further steps. You need to click on Try it out then add your asset catalog alias name to execute the method.

    Catalog Alias
  3. After executing the method successfully, you will get the following as a part of the output

    • gitProviderAlias: the git provider alias, to import the project sources into.
    • groupKey: group within the git, to store the project into.
    • repositoryKey: name of the git repository, to store the project sources into.
    Catalog Alias Details
  4. Open the Method /{catalogAlias}/assets/importAsset. You need to click on Try it out then add your asset catalog alias name in the parameters.

    Parameters
  5. In the request body section, kindly fill the data as acquired in step 5.

    • file: upload this NLRAC-2.1.3.
    • gitProviderAlias: the git provider alias, to import the project sources into.
    • groupKey: group within the git, to store the project into.
    • repositoryKey: name of the git repository, to store the project sources into.

    Then click on execute.

  6. After the successful upload, go back to your solution designer and check your asset catalog to find the uploaded asset. You can also find the project sources within the git repository.

    Imported Asset

Create a project based on the imported assetโ€‹

Preconditionsโ€‹
  • You have successfully imported your asset into the asset catalog.
โ—๏ธinfo

We will create a Saga application composition project. You can follow the same steps to create any type of project using the imported asset.

  1. Open Solution Designer and click on 'create project from asset'.

    Create Project from Asset
  2. Select the asset catalog you imported the given zip file into. In our case, shared-assets catalog.

    Shared Asset Catalog
  3. Select project 'Narayana LRA Coordinator'.

    Select Asset
  4. In this screen, you can see the details of the Asset

    Asset Details
  5. Use the acronym 'NLRAC' and specify the git provider data to store your project into and then click create.

    Project Details
  6. Open the project and click on "CI/CD" to create and execute a release pipeline. Once the pipeline is created, it will automatically run.

    Create Release Pipeline
  7. Wait for few minutes until the pipeline succeeds.

    Succeeded Pipeline
๐ŸŒŸCongratulations!

You have successfully imported an external asset (Narayana LRA-Coordinator) into Solution Designer Asset Catalog and are ready to use it to support your projects, in our case SAGA projects.

Please find more information about Saga Pattern Support in the Workbench: