To create an integration with GitHub, you make a POST request. The request body includes properties specific to GitHub.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Automation Assembler Infrastructure as a Service (IaaS) service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have a personal access token for authentication to GitHub. See https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html.
Procedure
Example: Create a GitHub integration
Assign the required variables.
$ url='https://appliance.domain.com'
$ api_version='2021-07-15'
$ private_key='8bc9401b5d28f4ec126929af0dc4e99dd0792b0f'
Create the integration.
$ curl -X POST \ "$url/iaas/api/integrations?apiVersion=$api_version" \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "integrationType":"com.github.saas", "name":"Git integration example", "privateKey":"'$private_key'", "integrationProperties":{ "url":"https://api.github.com" }, }' | jq "."
The response includes a selfLink.
{ "progress": 0, "status": "INPROGRESS", "name": "Integration creation/update", "id": "a0c5eb3a-9ffa-4bfb-b63b-c77510bcc597", "selfLink": "/iaas/api/request-tracker/a0c5eb3a-9ffa-4bfb-b63b-c77510bcc597" }
Assign the selfLink variable
selfLink_id='a0c5eb3a-9ffa-4bfb-b63b-c77510bcc597'
Use the selfLink variable to track the request.
curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/request-tracker/$selfLink_id?apiVersion=$api_version" | jq "."
When the request completes successfully, the response includes a resource with the integration ID.
{ "progress": 100, "status": "FINISHED", "resources": [ "/iaas/api/integrations/e5dda941-bb17-4f19bd15-7db0b8eab88c" ], "name": "Integration creation/update", "id": "a0c5eb3a-9ffa-4bfb-b63b-c77510bcc597", "selfLink": "/iaas/api/request-tracker/a0c5eb3a-9ffa-4bfb-b63b-c77510bcc597" }
Assign the integration ID variable
integration_id='e5dda941-bb17-4f19bd15-7db0b8eab88c'
Use the integration ID variable to list the integration.
curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/integrations/$integration_id?apiVersion=$api_version" | jq "."
When the request completes successfully, a snippet of the response shows integration details.
... { "integrationType": "com.github.saas", "integrationProperties": ( "url": "https://api.github.com" }, "name":"Git integration example", "id: "e5dda941-bb17-4f19bd15-7db0b8eab88c" "createdAt":"2022-04-02" "updatedAt": "2022-04-02" "orgId": "ce811934-ea1a-4f53-6bec-4656ca7d126", "_links": { "self": { "href": "/iaas/api/integrations/e5dda941-bb17-4f19bd15-7db0b8eab88c" } } } ...