Analysis: Webhook

Analysis: Webhook

#340490

Description

The /webhook/analysis resource is used to manage the webhook definition for a Densify analysis. The webhook definition is the path and authentication to a third-party application, where recommendation results are sent when the analysis completes. The receiving application can process the resulting data for downstream consumption. For example, the receiving application can route recommendations to an orchestration engine or distribute reports to instance owners.

You have the option to define the webhook when you initiate data collection and analysis with the /analysis/<platformType>/<platformSubType>/analyze request. See Run AWS data collection and analysis for an example of specifying webhook input parameters. Results are posted to the webhook location when analysis is complete. You also have the ability to update or delete a webhook if you no longer want to push results to the webhook.

Resource

/webhook/analysis

Supported Operations

Table: Webhook Supported Operations

Operation

HTTP Method

Input

Output

Description

List all analyses webhooks for a specific platform type

GET /webhook/analysis/<platformType>

Path Parameter:

Collection of:

Use this resource to list all analysis webhook definitions for a particular platform type in Densify.

Example: Retrieving All Cloud Webhook Definitions

Example: Retrieving All Container Webhook Definitions

Get a webhook definition for an analysis

GET /webhook/analysis/<platformType>/<platformSubType>/<analysisId>

Path Parameters:

Use this resource to return the webhook details of a specific analysis in Densify.

Example: Getting a Webhook Definition for an AWS Analysis

Add webhook to an analysis

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.

Example: Adding a Webhook to an Existing AWS Analysis

Update a webhook for an analysis

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.

Example: Updating an AWS Analysis Webhook

Delete a webhook from an analysis

DELETE /webhook/analysis/<platformType>/<platformSubType>/<analysisId>

Path Parameters:

Use this resource to delete a webhook definition from an existing analysis.

Example: Deleting a Webhook from an AWS Analysis

Parameters

Path Parameters

Table: Webhook Path Parameters

Parameter Name

Type

Description

platformType

string

[cloud|containers]

The technology platform of the analysis.

platformSubType

string

The platform sub-type of the analysis. This is typically the vendor/flavor of the technology platform.

Possible platform sub-types depend on the platformType specified:

  • For platformType = cloud, platformSubType = [aws|gcp|azure]
  • For platformType = containers, platformSubType = [kubernetes]

analysisId

string

The referenced ID of the analysis.

Request Body Parameters

Table: Webhook Request Body Parameters

Parameter Name

Type

Description

uri

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.

authType

string

The authorization type (i.e. Basic, Bearer) for the webhook application.

authValue

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.

Response

Table: Webhook Response Schema

Element

Type

Sort By/Filter

Description

analysisId

string

 

The Densify assigned ID for the analysis entity.

href

string

 

The analysis webhook resource reference.

uri

string

 

The webhook URI.

webHookStatus

string

 

The status of the last webhook POST request. Recommendations are pushed to the webhook URI via a POST request after analysis completion.

analysisName

string

 

The name assigned to the analysis. The default analysis name is the platform-specific cluster, account, project, or subscription ID.

message

string

 

The message for the status response.

For example, the following messages are returned for the error codes below:

  • 400—"Analysis webhook already exists."
  • 404—"Analysis webhook not found."

status

number

 

The HTTP response code of the request. Possible status values include:

  • 200—success with webhook request;
  • 400—object already exists or invalid parameters;
  • 401—authentication failed;
  • 404—resource not found.

Examples

Example: Retrieving All Cloud Webhook Definitions

The following example shows you how to list all cloud webhook definitions in Densify.

Example: Retrieving All Container Webhook Definitions

The following example shows you how to list all container webhook definitions in Densify.

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.

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.

Example: Updating an AWS Analysis Webhook

The following example shows you how to update a webhook definition for an AWS analysis.

Example: Deleting a Webhook from an AWS Analysis

The following example shows you how to delete a webhook definition from an AWS analysis.