Analysis: Webhook
Analysis: Webhook
#340490
Description
You can define the webhook when you initiate data collection and analysis with the /analysis/<platformType>/<platformSubType>/analyze request. See the example, Run AWS data collection and analysis for details of specifying webhook input parameters. Results are posted to the webhook location when the analysis is complete. You can edit or delete a webhook at any time.
Resource
/webhook/analysis
Supported Operations
Table: Webhook Supported Operations
Operation |
HTTP Method |
Input |
Output |
Description |
GET /webhook/analysis/<platformType> |
Path Parameter: |
Collection of: |
Use this resource to list all analysis webhook definitions for a particular platform type in Densify. |
|
GET /webhook/analysis/<platformType>/<platformSubType>/<analysisId> |
Path Parameters: |
Use this resource to return the webhook details of a specific analysis in Densify. |
||
POST /webhook/analysis/<platformType>/<platformSubType>/<analysisId> |
Path Parameters: Request Body Parameters: |
Use this resource to add a webhook definition to an existing analysis in Densify. You can only add a webhook to an analysis without a webhook. To update a webhook, use the PUT method. See Update a webhook for an analysis for details. |
||
PUT /webhook/analysis/<platformType>/<platformSubType>/<analysisId> |
Path Parameters: Request Body Parameters: |
Use this resource to update a webhook definition of an existing analysis in Densify. |
||
DELETE /webhook/analysis/<platformType>/<platformSubType>/<analysisId> |
Path Parameters: |
Use this resource to delete a webhook definition from an existing analysis. |
Table: Webhook Path Parameters
Parameter Name |
Type |
Description |
string |
[cloud|containers] The technology platform of the analysis. |
|
string |
The platform sub-type of the analysis. This is the vendor for the cloud platform. Possible platform sub-types depend on the platformType specified:
|
|
string |
The referenced ID of the analysis. |
Table: Webhook Request Body Parameters
Parameter Name |
Type |
Description |
string |
The URI to the webhook application. Note: You must ensure that the webhook URI is accessible from the Densify system with a fully qualified domain name or an IP address. |
|
string |
The authorization type (i.e. Basic, Bearer) for the webhook application. |
|
string |
The authorization value (i.e. username, password, token) for the webhook application. Densify assumes that the authorization value is in standard Base64 encoding, but if a colon (":") is present in the value, then Densify assumes that the value is in plain text with username:password format. |
Table: Webhook Response Schema
Element |
Type |
Sort By/Filter |
Description |
string |
|
The Densify assigned ID for the analysis entity. |
|
string |
|
The analysis webhook resource reference. |
|
string |
|
The webhook URI. |
|
string |
|
The status of the last webhook POST request. Recommendations are pushed to the webhook URI via a POST request after analysis completion. |
|
string |
|
The name assigned to the analysis. The default analysis name is the platform-specific cluster, account, project, or subscription ID. |
|
string |
|
The message for the status response. For example, the following messages are returned for the error codes below:
|
|
number |
|
The HTTP response code of the request. Possible status values include:
|
Examples
Example: Retrieving All Cloud Webhook Definitions
The following example shows you how to list all cloud webhook definitions in Densify.

Request:
GET /webhook/analysis/cloud
Response:
[
{
"analysisId": "f73e13ca-09d3-4395-8e32-894669a6d1eb",
"analysisName": "551345225429"
"href": "/webhook/analysis/cloud/aws/f73e13ca-09d3-4395-8e32-894669a6d1eb",
"uri": "https://webhookdensify:443/results/display/",
"webHookStatus": "success"
},
{
"analysisId": "329959e9-3641-4677-a665-dff754943944",
"analysisName": "330076083786"
"href": "/webhook/analysis/cloud/aws/329959e9-3641-4677-a665-dff754943944",
"uri": "https://webhooknow:443/api/results/test",
"webHookStatus": "An error occured executing POST request"
}
]
Example: Retrieving All Container Webhook Definitions
The following example shows you how to list all container webhook definitions in Densify.

Request:
GET /webhook/analysis/containers
Response:
[
{
"analysisId": "e8298ac3-a143-41bb-b7d7-62f659f43ec5",
"analysisName": "kube-prod-341ops",
"href": "/webhook/analysis/containers/kubernetes/e8298ac3-a143-41bb-b7d7-62f659f43ec5",
"uri": "https://webhookdensify:443/results/display/",
"webHookStatus": "success"
},
{
"analysisId": "d32959e9-3641-4677-a665-dff754943945",
"analysisName": "kube-dev-543",
"href": "/webhook/analysis/containers/kubernetes/d32959e9-3641-4677-a665-dff754943945",
"uri": "https://mycontainerresources:443/api/results/",
"webHookStatus": "An error occured executing POST request"
}
]
Example: Getting a Webhook Definition for an AWS Analysis
The following example shows you how to return the details of a webhook definition for an AWS analysis.

Request:
GET /webhook/analysis/cloud/aws/9a5d2d55-6d85-4fde-8bab-fcd0cef8c5bf
Response:
{
"analysisId": "9a5d2d55-6d85-4fde-8bab-fcd0cef8c5bf",
"analysisName": "775525148221",
"href": "/webhook/analysis/cloud/aws/9a5d2d55-6d85-4fde-8bab-fcd0cef8c5bf",
"uri": "https://Dwebhooks:443/api/test/webhook",
"webHookStatus": "success"
}
Example: Adding a Webhook to an Existing AWS Analysis
The following example shows you how to add a webhook definition to an existing AWS analysis without a webhook.

Request:
POST /webhook/analysis/cloud/aws/9a5d2d55-6d85-4fde-8bab-fcd0cef8c5bf
{
"uri": "https://mycallbackServer:443/api/test/webhook",
"authType": "basic",
"authValue": "saasUser:password1"
}
Response:
{
"message": "ok",
"status": 200
}
Example: Updating an AWS Analysis Webhook
The following example shows you how to update a webhook definition for an AWS analysis.

Request:
PUT /webhook/analysis/cloud/aws/9a5d2d55-6d85-4fde-8bab-fcd0cef8c5bf
{
"uri": "https://myOtherServer:443/api/webhook",
"authType": "bearer ",
"authValue": "eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI0MjRhMGziOC0xMDRlopRiMjItOeg0ZS1lZTJhNmEzZDBlNGIiLCJpYXQiOjE1NDM2MDg1OTMsInN1YiI6ImFkbWluIiwiaXNzIjoiRGVuc2lmeS5jb20iLCJleHAiOjE1NDM2MDg4OTN9.F9VgD918C6WufBajr0ezLd61T6d9ij8z4BmHFzfNmMqCS-9JTDDaxfPmQVZDjeSTo0C-dYWcllwPTcMSUfRnYQ"
}
Response:
{
"message": "ok",
"status": 200
}
Example: Deleting a Webhook from an AWS Analysis
The following example shows you how to delete a webhook definition from an AWS analysis.

Request:
DELETE /webhook/analysis/cloud/aws/329959e9-3641-4677-a665-dff754943944
Response:
{
"message": "ok",
"status": 200
}