Creating a GitHub provider in Enterprise Marketplace
To create a GitHub provider in Enterprise Marketplace so that Enterprise Marketplace can send requests to GitHub, complete these steps:
In the Catalogs section, locate and run the POST /catalog/v3/providers_adapters API with the following payload:
{
"providers_adapters": [
{
"provider": "GitHub",
"providerCode": "github",
"adapter": "http://localhost:5000/genericcontentserver/v1/providers/github",
"discoverContent": true,
"providerOfferingTypes": [
"iaas"
],
"manageSOEnabled": true,
"enableVersion": false
}
]
}
The container is automatically connected to Enterprise Marketplace using
wsmesh
: <BASE_HOST_URL >/api/wsmesh/v3/proxy/<proxy_id>?timeout=600 with the header {"Authorization": "Bearer <wsmesh token>"} with the following request body. No intervention is needed.
{
"body": {
"request_id": random_uuid,
"request_resource": encoded base64 provisioning request data
},
"type": "proxy"
}
The request_resource should contain the API definition that needs to be passed to the proxy container. The GPA will parse this body and execute the API as per API definition. The following is sample request_resource code:
{
"url": "url",
"method": "method",
"headers": {},
"body": {},
"tags": {
"orderNumber": "",
"serviceFulfillmentId":"",
"requestTrackingId": ""
},
"failureCallback": {
"url": "url",
"method": "method",
"headers": {},
"body": {}
}
}
In the sample code,
failureCallback
is the object that contains the URL, method, headers and body (if needed) to make an API call back to the source that needs to be notified if a failure occurs where the proxy container is not able to reach git actions.
The
Tags
parameter is optional. You can pass it as empty {} => “tags”:{}
The connection is now established between the Enterprise Marketplace and the proxy adapter container, which is running in private network. Place orders to test the connection and the end-to-end flow.