Create an Amplify Central Integration Webhook Using the Axway CLI

Create an Amplify Central Integration Webhook Using the Axway CLI

In the Amplify Central Integration Webhooks — Basics blog post, we introduced Amplify Central Integration Webhooks and how to create them using APIs. In this blog post, we’ll create the same Integration Webhook using the Axway Central CLI and a YAML file that defines the Integration Webhook.

Prerequisites

* Axway Central CLI installed and working
* Access to Amplify Central

YAML File

We’ll use the following YAML file to define the resources: Integration, Secret, Webhook and Resource Hook. Copy and put in a file called *resources.yaml*. This will create an identical Integration that we created using APIs in the Amplify Central Integration Webhooks – Basics blog post.

name: myintegration
kind: Integration
apiVersion: v1alpha1
title: Integration
tags:
- cloud
spec:
    description: This is an integration.
---
name: webhooksecret
kind: Secret
apiVersion: v1alpha1
title: API Key Secret for Webhook reference
tags:
- saas
- axway
metadata:
  scope:
    kind: Integration
    name: myintegration
spec:
    data:
      apikey: Password123
---
name: webhook
kind: Webhook
apiVersion: v1alpha1
title: Webhook to invoke requestbin.com
tags:
- prod
- saas
- axway
attributes:
  release: 1.0.0
metadata:
  scope:
    kind: Integration
    name: myintegration
spec:
    enabled: true
    url: https://en9c5wvi5vta4.x.pipedream.net
    auth:
      secret:
        name: webhooksecret
        key: apikey
---
group: management
apiVersion: v1alpha1
kind: ResourceHook
name: environments-hook
title: Monitor Environment manualenv and all its resources
metadata:
  scope:
    kind: Integration
    name: myintegration
spec:
  triggers:
    - group: management
      kind: Environment
      name: manualenv
      type:
      - created
      - updated
      - deleted
    - group: management
      kind: "*"
      name: "*"
      type:
      - created
      - updated
      - deleted
      scope:
        kind: Environment
        name: manualenv
  webhooks:
    - webhook

Note that this Integration will trigger on any modification to my environment manualenv and any resources in that environment. Change the environment name to match your environment or replace manualenv with an asterisk (*) for all environments.

Create Integration

Use the CLI to log in and create the integration.

* Log in:

axway auth login

* Get list of existing integrations:

axway central get integ

with the following sample response

✔ Resource(s) successfully retrieved

NAME                            AGE           TITLE
apiscintegration                14 days ago   API Service Created Integration
newapiversionintegration        2 months ago  New API Version Integration
newconsumerinstanceintegration  a month ago   New Consumer Instance Integration

* Create the integration:

axway central create -f resources.yaml

with the following sample response:

✔ "integration/myintegration" has successfully been created.
✔ "secret/webhooksecret" has successfully been created.
✔ "webhook/webhook" has successfully been created.
✔ "resourcehook/environments-hook" has successfully been created.

* Check list of integrations:

axway central get integ

with the following sample response

✔ Resource(s) successfully retrieved

NAME                            AGE            TITLE
apiscintegration                14 days ago    API Service Created Integration
newapiversionintegration        2 months ago   New API Version Integration
newconsumerinstanceintegration  a month ago    New Consumer Instance Integration
myintegration                   2 minutes ago  Integration

Note the new integration, myintegration

Test the Integration Webhook

As in the prior blog post, I added an API to my manualenv environment and got the same three webhook calls to requestbin as shown below:

Note the secret (Password123) received as an authorization header

Summary

In this blog post, we saw how we can use the Axway Central CLI to create an Integration Webhook. This is the exact same Integration Webhook that we created via APIs in a prior blog post so you can see two ways to accomplish the same task depending on your preferences and use case.

Check out this blog post for an example of using Jira, Integration Builder, and Webhook Events as part of an Amplify Central/Unified Catalog API subscription approval workflow.

Previous articleAxway and Trustlink partner up in South Africa with the Amplify API Management Platform solution
Next articleHow Brazilian rewards company Livelo is offering innovative and seamless points programs with Amplify
Principal Presales Architect II – Leor Brenman has over 12 years’ experience in Enterprise Software and more than 30 years working in the tech industry for companies like Vaultus, Antenna, Appcelerator and Axway. He has a strong technology background and specializes in mobile, API, integration and enterprise applications. Leor has a BS and MS in Electrical Engineering from Rutgers University in NJ, USA.

LEAVE A REPLY

Please enter your comment!
Please enter your name here