SAS CI360 Connector Framework provides an infrastructure to integrate CI360 applications with other applications. Using the CI360 connector framework customer can connect with third party system directly using Rest API or they may need to write some connectors (example: using AWS Lambda) for massaging the input/output data received from/to the third party system.
This project contains a list of sample connector codes to help you write your connectors using AWS lambda to connect with other applications by writing programs in Python languages.
This topic contains the following sections:
- Prerequisites
- Installation
- Getting Started
- Examples
- Troubleshooting
- Contributing
- License
- Additional Resources
- Amazon Web Service account with access to Lambda and API Gateway service.
To set up and use the sample connector codes you need to perform the following steps :
-
Download a
ci360-connectors
project source code into zip/tar.gz/tar.bz2/tar file format on your local machine.
Note:
You can also clone the project on your local machine -
The project will be downloaded on your local machine in your specified file format. You need to unzip/untar the downloaded project.
-
You can see the folder
ci360-connectors
after unzip/untar the project. -
Open the
ci360-connectors
folder. which will contain theconnectors
folder. -
Navigate into the
connectors
folder which contains below-mentioned sample connector code files for connecting with Jira, MSTeams, and Slack systems.-
ListJiraProjects.py: This connector is used to retrieve a list of projects from a specified Jira board. For example, this connector can be used to fetch the project's keys from the Jira board. By default this connector fetches the details from Apache Jira Board. You can configure your Jira Server by using Attributes Rest APIs or adding values like Jira-server, Jira-username, and Jira-password into this connector code.
-
GetJiraProjectInfo.py: This connector is used to get the details of the specified project ID from a specified Jira board. For example, this connector endpoint can be used to fetch the project details of the selected project key from the Jira board. By default this connector fetches the details from Apache Jira Board. You can configure your Jira Server by using Attributes Rest APIs or adding values like jira-server, Jira-username, and Jira-password into this connector code.
-
PostMsgOnMSTeams.py: Post a user comment in the configured MSTeams channel. By default, this connector will post the details on SAS MSTeams Channel. you can configure your MSTeams channel by using Attributes Rest APIs or adding msteams-url value into this connector code.
-
PostMsgOnSlack.py: Post a user comment in the configured Slack channel. By default, this connector will post the details on SAS Slack Channel. you can configure your Slack channel by using Attributes Rest APIs or adding slack-url value into this connector code.
-
connector_response.py: This is a common file use by all the above-listed connectors for error handling and creating connector response into JSON format. This file is mandatory for all the above sample connector code.
-
You need to create AWS Lambda function using a downloaded connector code. You can create multiple lambda functions for different use cases. In the example section below, I have shown below how I have configured the lambla into example section.
Please refer How to Create a Custom Connector >> Write an AWS Lambda Function Example
section in SAS Customer Intelligence 360 admin guide.
For more information, refer the AWS official documents - Building Lambda functions with Python
Once your lambda function is ready then you need to expose your lambda function using AWS API gateway. The AWS API gateway helps you to deploy your Lambda function on the server and provides REST API which will be accessible in a secure (or open) way. In the example section below, I have shown how I exposed my lambda function using the AWS API Gateway.
Please refer How to Create a Custom Connector >> Expose the AWS Lambda Function by Using the AWS API Gateway
section in SAS Customer Intelligence 360 admin guide.
For more information, refer the AWS official documents - Building Lambda functions with Python
After a successful deployment of your AWS lambda on the API gateway server you should get A Rest API. You need to register the connector and endpoint with these details into the CI360 system to use the connector.
Add and Register a Connector
Please refer to Add and Register a Connector section
in SAS Customer Intelligence 360 admin guide.
Add an Endpoint
Please refer to Add an Endpoint
in SAS Customer Intelligence 360 admin guide.
You can configure the attributes for your connector using Attributes Rest API. Example : If you want to connect with your Jira server than default server then you can configure properties like jira-server, Jira-username, and Jira-password using Attributes Rest API.
Please refer to Configure a Direct Connection to the Atlassian Jira Application
section in the SAS Customer Intelligence 360 admin guide for configuring properties for Jira connector.
Please refer to Configure a Direct Connection to the Microsoft Teams Application
section in the SAS Customer Intelligence 360 admin guide for configuring properties for MSTeams connector.
Please refer to Configure a Direct Connection to the Slack Application
section in the SAS Customer Intelligence 360 admin guide for configuring properties for Slack connector.
This example demonstrates the configuration of ListJiraProjects connector which is used to connect with the Jira server and fetch the project details. Also, this connector prepares the JSON response to require for the Dropdown list.
-
I have downloaded
ci360-connectors
project source code on my local machine.
This project contains sample connectors code intoconnectors
folder
List of sample connector files
-
I have created new AWS Lambda function name as
ListJiraProjectsConnectors
.
Note :
You can provide any name. -
Configure your Lambda function with sample connector code and common file.
I have copied the content of ListJiraProjects.py local file into thelambda_function.py
lambda file. Also, I have created a new file with the nameconnector_response.py
into lambda console and copied content from local file connector_response.py into it.
-
My connector is configured for retrieving Jira project details. Now I need to expose it using API Gateway.
-
After exposing the lambda function I have got a REST API to access my lambda function.
-
I can use this REST API into CI360 to register and invoke the connector.
We welcome your contributions! Please read CONTRIBUTING.md for details on how to submit contributions to this project.
This project is licensed under the Apache 2.0 License.
For more information, see External Data Integration with Connectors.