Configure Paragon Automation to Route API Calls to Anuta ATOM
To configure Anuta ATOM API credentials in Paragon Automation, you must configure a Kubernetes secret to provide the credentials. The credentials include username, password, client_id, and client_secret.
To configure the Kubernetes secret:
After this configuration, by default, all requests made to https://paragon/anuta/restconf is forwarded to https://anuta/restconf.
You can also configure additional API endpoint mappings by using Kubernetes ConfigMaps. The following example shows how you can access the Anuta ATOM device resources through Paragon Automation.
To access an Anuta ATOM device resource from Paragon Automation:
-
Log in to the primary node of the Paragon Automation installation.
-
Create a file anuta-cmap-ctrldev.yml with a ConfigMap to forward requests matching https://paragon/restconf/data/controller:devices to https://anuta/restconf/data/controller:devices. The following is a sample of the anuta-cmap-ctrldev.yml file.
apiVersion: v1 kind: ConfigMap metadata: name: anuta-proxy-restconf-ctrldev namespace: northstar labels: proxy: anuta-restconf data: prefix: /restconf/data/controller:devices rewrite: /restconf/data/controller:devices
- For any custom mappings, modify the prefix and rewrite sections as required, where prefix specifies the Paragon Automation URL prefix to match, and rewrite specifies the Anuta ATOM URL to where API requests must be forwarded.
-
Apply the ConfigMap using
kubectl
:kubectl apply -f anuta-cmap-ctrldev.yml
After you configure the credentials and endpoints, you can send API requests to a Paragon Automation endpoint. The following example is a request for device information that is fulfilled by Anuta ATOM.
curl -k -X GET 'https://<paragon>/restconf/data/controller:devices.json?fields=device(uuid;device-family-string;device-type;id)' -H "x-iam-token: <token>" { "controller:devices": { ... "device": [ { ... "device-type": "MX960", "id": "vmx101", "device-family-string": "Juniper MX", "uuid": "<uuid>" }, ... ] } }
Delete the ConfigMap if you no longer need the endpoint configuration.
kubectl delete -f
anuta-cmap-ctrldev.yml