Sign inSign up

lbrenman/agentstatuschangenotifier

By lbrenman

•Updated over 4 years ago

Amplify Central Agent Status Change Notifier

Image
0

916

lbrenman/agentstatuschangenotifier repository overview

API Builder container that implements the Amplify Central Agent Status Change Notifier described here⁠ but implemented using Axway's API Builder.

The API Builder source code can be found here⁠

The container requires these env vars:

  • API_KEY - an API Builder API Key that you provide. You pass this key as a header using apikey as the key and the value you enter here. This is configured in your Integration Resource definition
  • MS_TEAMS_WEBHOOK_URL - the URL for your Microsoft Teams Incoming Webhook Connector
  • API_CENTRAL_URL - The base path for your Amplify Central (defaults to https://apicentral.axway.com⁠)

Deploy the container and get the public URL. Use the URL in the Amplify YAML file, agentstatuschangesint.yaml, below:

name: agentstatuschangesint
kind: Integration
apiVersion: v1alpha1
title: Agents Status Changes Integration
tags:
- Agents
spec:
  description: Agents Status Changes Integration
---
name: agentstatuschangesintwh
kind: Webhook
apiVersion: v1alpha1
title: Agents Status Changes Integration Webhook
attributes:
release: 1.0.0
metadata:
  scope:
    kind: Integration
    name: agentstatuschangesint
spec:
  enabled: true
  url: https://<YOUR CONTAINER PUBLIC URL>/api/amplifycentralwebhookhandler
  headers:
      apikey: <API KEY YOU PROVIDE>
---
group: management
apiVersion: v1alpha1
kind: ResourceHook
name: agentstatuschangesintrh
title: Agents Status Changes Integration Resource Hook
metadata:
  scope:
    kind: Integration
    name: agentstatuschangesint
spec:
  triggers:
    - group: management
      kind: DiscoveryAgent
      name: "*"
      scope:
        kind: Environment
        name: "*"
      type:
      - updated
    - group: management
      kind: TraceabilityAgent
      name: "*"
      scope:
        kind: Environment
        name: "*"
      type:
      - updated
  webhooks:
    - agentstatuschangesintwh

Configure your Integration Resource Webhook using the following Axway CLI commands:

axway auth login
axway central create -f agentstatuschangesint.yaml

This will enable agent status reporting in all environments to an MS Teams channel as follows:

You can pull the image and run as follows:

docker run --rm -e MS_TEAMS_WEBHOOK_URL=<MS TEAMS CHANNEL INCOMING WEBHOOK CONNECTOR URL> -e API_CENTRAL_URL=https://apicentral.axway.com -e API_KEY=<AN API KEY OF YOUR CHOICE> -e PORT=8080 -p 8080:8080 --name agentstatuschangenotifier agentstatuschangenotifier

Tag summary

Content type

Image

Digest

Size

60.1 MB

Last updated

over 4 years ago

docker pull lbrenman/agentstatuschangenotifier