# Kubex Public Cloud Resources Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/API_Reference_Public_Cloud # Onboard AWS Accounts Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_AWS_Analyze The `/analysis/cloud/aws/analyze` resource is used to collect AWS CloudWatch data and initiate optimization analysis with the cloud infrastructure collected. Below are the series of processes that occur when the initial `/analysis/cloud/aws/analyze` request is triggered: 1. Set up and initiate data collection of the specified AWS account and schedule it to run automatically on a nightly basis. 2. Initiate analysis on the data collected using the default policy. * Subsequent analysis is scheduled to run on a nightly basis after the completion of data collection. * Optionally, you can configure the results to be sent to a webhook URI upon analysis completion. See [Add webhook to an analysis](./Analysis_Webhook#_AddWebhook) for details. 3. Once data collection succeeds and an `analysisId` is created for the account, you can check progress with `/analysis/cloud/aws//status` or wait for the results to be published to an optional webhook URI. Accounts that have not produced an `analysisId` (for example, due to unsupported resources or insufficient data) cannot use the status endpoint until an analysis run begins. 4. The reporting database update is scheduled to run automatically on a nightly basis after the completion of the analysis. This process produces reports for each instance recommendation, which is useful for analysts or application owners. These reports are only created after the scheduled analysis is completed, and may therefore only be available on the following day for a new analysis. Exact timing depends on the size of your environment. When onboarding an account using the `/analysis/cloud/aws/analyze` endpoint, receiving a 200 status code signals that the onboarding was successful. #### Analysis Update You can make an ad-hoc request to refresh an existing analysis, outside of the scheduled nightly run using `/analysis/cloud//analyze`. This manual, ad hoc analysis request does not perform data collection or reporting database (RDB) updates. It only runs the analysis on the existing data collected with the following behavior: * The analysis uses the policy that is configured for the analysis. Contact [support@kubex.ai](mailto:support@kubex.ai) to change the configured policy. * If a new webhook is provided, the analysis will send results to the new webhook URI. If no webhook is provided, the analysis will send results to the existing webhook, if configured. * If the same analysis is already running, the request does not proceed and an appropriate message is returned. * If the specified analysis has data collection scheduled within 30 minutes, the request does not proceed and an appropriate message is returned. For example, if data collection is scheduled to run at 12:05 AM, and you initiate a manual, ad hoc analyze request at 11:45 PM, then the analysis will not proceed and an error message is returned. ### Prerequisite Configuration Before you can collect AWS CloudWatch data, you need to create an IAM role for Kubex to have a trust relationship with your AWS account that contains data. See [AWS Data Collection Prerequisites for an IAM Role](/docs/WebHelp_Densify_Cloud/Content/Data_Collection_for_Public_Cloud_Systems/AWS_Data_Collection_Prerequisites_for_an_IAM_Role__CloudWatch_only_) for details on how to set up the IAM role for data collection. ## Resource ``` /analysis/cloud/aws/analyze ``` ``` /analysis/cloud/aws ``` ## Endpoints # Onboard AWS account Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_AWS_Analyze/analyzeAws openapi/public_cloud/Analysis_AWS_Analyze.yaml POST /analysis/cloud/aws/analyze Initiates AWS CloudWatch data collection and runs optimization analysis. Subsequent data collection and analysis are scheduled nightly. If an analysis already exists, this endpoint re-runs analysis and can update the webhook for result delivery. # List AWS accounts being analyzed Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_AWS_Analyze/listAwsAnalyses openapi/public_cloud/Analysis_AWS_Analyze.yaml GET /analysis/cloud/aws Returns the set of analyses that have been created, with details needed to reference them elsewhere. # Offboard AWS Accounts Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_AWS_Delete The `/analysis/cloud/aws/` resource can be used to delete the audit and all associated scheduler entries of the cloud analysis specified by ``. * The single-day and 60-day historical audits are removed, if they exist. * The audit and all associated scheduler entries, are deleted, if they exist. When executing the delete operation in an environment observe the following: * When deleting an audit for an environment associated with a single account, the operation proceeds as outlined above. * When deleting an audit for a payer account with multiple linked accounts, If Kubex determines that there is a many-to-one relationship for this account, then the delete request fails. This type of multi-account connection can only be created through the Cloud Connection Wizard and must be deleted through the Cloud Connection Wizard. During a delete operation, any attempt to access other associated endpoints related to the specified `` (i.e. GET, PUT, POST) will trigger a "400 Bad Request" error response. While the delete operation is in progress, you can check the status (using the `/analysis/cloud/aws/<``analysisId``>/status` resource) or wait for the results to be published to an optional webhook URI. Collected data is saved for the defined retention period and the environment and associated analysis structure are saved in case you want to generate reports on the historical data or restart data collection. Since the environment and analyses are not deleted, a GET call for the specified `` will always succeed regardless of whether the associated connection has been deleted. If you use a GET call to list available environment and analyses, for which the audits have been deleted, they are still listed. You can reestablish the audit without have to re-create the analysis. You will still see the data in the Kubex Console. ## Resource ``` /analysis/cloud/aws/ analysisId ``` ## Endpoints # Delete AWS Cloud Connection and Analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_AWS_Delete/deleteAwsAnalysis openapi/public_cloud/Analysis_AWS_Delete.yaml DELETE /analysis/cloud/aws/{analysisId} Deletes the Cloud Connection and Analysis for the specified AWS account. This API only supports deletion for AWS accounts that have a valid analysisId. If the AWS account was not analyzed (for example, unsupported resources or insufficient data), no analysisId exists and this API cannot be used. In those cases, delete the cloud connection manually and contact support@kubex.ai if assistance is required. # AWS Recommendations Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_AWS_Results ## Description The `/analysis/cloud/aws//results` resource is used to return a collection of AWS system (i.e. EC2 instance, Auto Scaling group, etc.) recommendations for an AWS account defined by a Kubex Analysis entity (see [Analysis: Entity](./Analysis_Entity)). For each system recommendation, you can also download a PDF version of the Impact Analysis and Recommendation Report, which details system impact based on the recommendations. This report is useful to application owners and other system stakeholders who need to review recommended changes to their application resources. See the [rptHref](#_rptHref) resource element for details. To return a collection of all systems included in an AWS optimization analysis, see [Analysis: AWS Systems](./Analysis_AWS_Systems). To see the catalog map for a selected instance, see [Systems: Analysis Details](./Systems_Analysis_Details) ## Resource ``` /analysis/cloud/aws/ /results ``` ## Endpoints # AWS recommendations using analysisId Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_AWS_Results/getAwsRecommendations openapi/public_cloud/Analysis_AWS_Results.yaml GET /analysis/cloud/aws/{analysisId}/results Returns optimization recommendations for systems (EC2, RDS, ASG) in the specified analysis. Use the `Accept` header to choose the representation: `application/json` (array of recommendation objects) or `application/terraform-map` (Terraform-style map where each key is the system's **provisioningId** or name). To include workload collection details per metric, use the `dataQuality` query. To include system attributes, set `includeAttributes=true`. # Analysis: Azure Analyze Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Analyze The `/analysis/azure/analyze` resource is used to collect Microsoft Azure infrastructure data and initiate optimization analysis with the collected data. The following processes occur when the first `/analysis/azure/analyze` request is triggered: 1. Set up and initiate data collection of the specified Azure subscription and schedule it to run automatically on a nightly basis. 2. Initiate analysis on the data collected using the default policy. * Subsequent analysis is scheduled to run on a nightly basis after the completion of data collection. * Optionally, you can configure the results to be sent to a webhook URI upon analysis completion. See [Add webhook to an analysis](./Analysis_Webhook#_AddWebhook) for details. 3. Once data collection succeeds and an `analysisId` is created for the subscription, you can track progress with `/analysis/cloud/azure//status` or wait for the results to be published to an optional webhook URI. Subscriptions that have not produced an `analysisId` (for example, unsupported resources or insufficient data) cannot use the status endpoint until an analysis run begins. 4. The reporting database update is scheduled to run automatically on a nightly basis after the completion of the analysis. This process produces reports for each instance recommendation, which is useful for analysts or application owners. These reports are only created after the scheduled analysis is completed, and may therefore only be available on the following day for a new analysis. Exact timing depends on the size of your environment. When onboarding a subscription using the `/analysis/cloud/azure/analyze` endpoint, receiving a 200 status code signals that the onboarding was successful. The `/analysis/cloud/azure` resource is also used to return a list of Microsoft Azure optimization analyses currently in Kubex. #### Analysis Update You can make an ad-hoc request to refresh an existing analysis, outside of the scheduled nightly run using `/analysis/cloud//analyze`. This manual, ad hoc analysis request does not perform data collection or reporting database updates. It only runs the analysis on the existing data collected with the following behavior: * The analysis uses the policy that is configured for the analysis. Contact [support@kubex.ai](mailto:support@kubex.ai) to change the configured policy. * If a new webhook is provided, the analysis will send results to the new webhook URI. If no webhook is provided, the analysis will send results to the existing webhook, if configured. * If the same analysis is already running, the request does not proceed and an appropriate message is returned. * If the specified analysis has data collection scheduled within 30 minutes, the request does not proceed and an appropriate message is returned. For example, if data collection is scheduled to run at 12:05 AM, and you initiate a manual, ad hoc analyze request at 11:45 PM, then the analysis will not proceed and an error message is returned. ### Prerequisite Configuration Before you can collect Azure cloud infrastructure data in Kubex, you need to create a service principle and configure a secret key. See [Microsoft Azure Data Collection Prerequisites for a Service Principal](/docs/WebHelp_Densify_Cloud/Content/Data_Collection_for_Public_Cloud_Systems/Microsoft_Azure_Data_Collection_Prerequisites_for_a_Service_Principal) for details on creating and configuring the service principle. When using the Kubex API only the Azure "Service Principal" can be used to connect to your Azure subscriptions. If you are using the API, data collection and analysis are created and then refreshed daily on a per subscription basis (1-to-1). You can associate many subscriptions with a service principle, but when using the API to initiate data collection, you must specify a subscription ID and the audit and analysis are created for each subscription, separately. When using the Connection Wizard in the Kubex UI, you do not need the subscription ID, as all subscriptions that are associated with the service principle are collected and listed once the connection has been verified. You can then select one or more of the subscriptions that you want to analyze (1-to-Many). When using the Connection Wizard, data collection and analysis are created and then refreshed daily for all of the subscriptions that you selected when you created the connection. When using the Kubex API only one subscription will be processed per API request. This is the case, even if more than one subscription is associated with the service principle. ### Changing Credentials When you need to change the credentials for the subscription or the service principle, you need to delete the data collection audit and recreate it. When you delete the audit, only the audit and all associated scheduler entries are removed, so you can recreate the audit with the new credentials and continue without any loss of data. ## Resource ``` /analysis/cloud/azure/analyze ``` ``` /analysis/cloud/azure ``` ## Endpoints # Onboard Azure Subscription Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Analyze/analyzeAzure openapi/public_cloud/Analysis_Azure_Analyze.yaml POST /analysis/azure/analyze - **Initial run**: provide subscription and credentials; schedules nightly collection and analysis. - **Re-run analysis**: provide subscription and (optionally) a new webhook; does **not** collect data. - **Historical audit**: set `triggerAdhocAudit=true` and optionally `startDayOffset` / `endDayOffset` to collect up to 30 days of historical data. Notes: request is rejected if collection/analysis is in progress or within ~30 minutes of scheduled time. # Get analysis status by subscription Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Analyze/getAzureAnalysisStatus openapi/public_cloud/Analysis_Azure_Analyze.yaml GET /analysis/azure/{subscriptionId}/status Check the status of collection/analysis for a given Azure subscription. # List Azure subscriptions being analyzed Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Analyze/listAzureAnalyses openapi/public_cloud/Analysis_Azure_Analyze.yaml GET /analysis/cloud/azure Returns analyses created for Azure subscriptions; obtain `analysisId` for other operations. # Analysis: Azure Delete Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Delete The `/analysis/cloud/azure/` resource can be used to delete the audit and all associated scheduler entries of the cloud analysis specified by ``. * The single-day and 60-day historical audits are removed, if they exist. * The audit and all associated scheduler entries, are deleted, if they exist. When executing the delete operation in an environment observe the following: * When deleting an audit for an environment associated with a single account, the operation proceeds as outlined above. * When deleting an audit, if Kubex determines that there is a many-to-one relationship for this connection, then the delete request fails. This type of multi-account connection can only be created through the Cloud Connection Wizard and must be deleted through the Cloud Connection Wizard. During a delete operation, any attempt to access other associated endpoints related to the specified `` (i.e. GET, PUT, POST) will trigger a "400 Bad Request" error response. While the delete operation is in progress, you can check the status (using the `/analysis/cloud/azure/<``analysisId``>/status` resource) or wait for the results to be published to an optional webhook URI. Collected data is saved for the defined retention period and the environment and associated analysis structure are saved in case you want to generate reports on the historical data or restart data collection. Since the environment and analyses are not deleted, a GET call for the specified `` will always succeed regardless of whether the associated connection has been deleted. If you use a GET call to list available environment and analyses, for which the audits have been deleted, they are still listed. You can reestablish the audit without have to re-create the analysis. You will still see the data in the Kubex Console. ## Resource ``` /analysis/cloud/azure/ analysisId ``` ## endpoints # Delete Azure Cloud Connection and Analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Delete/deleteAzureAnalysisAudit openapi/public_cloud/Analysis_Azure_Delete.yaml DELETE /analysis/cloud/azure/{analysisId} Deletes the Cloud Connection and Analysis for the specified Azure subscription. This API only supports deletion for Azure subscriptions that have a valid analysisId. If the Azure subscription was not analyzed (for example, unsupported resources or insufficient data), no analysisId exists and this API cannot be used. In those cases, delete the cloud connection manually and contact support@kubex.ai if assistance is required. # Analysis: Azure Recommendations Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Results The `/analysis/cloud/azure//results` resource is used to return a collection of Azure Virtual Machine instance recommendations after the optimization analysis has been performed on your collected Azure infrastructure data. For each instance recommendation, you can also download a PDF version of the Impact Analysis and Recommendation Report, which details system impact based on the recommendation. This report is useful to application owners who need to review recommended changes to their application resources. See the [rptHref](#_rptHref) resource element for details on how to download this report. To return a collection of all instances included in an Azure optimization analysis, see [Analysis: Azure Systems](./Analysis_Azure_Systems). To see the catalog map for a selected instance, see [Systems: Analysis Details](./Systems_Analysis_Details) When using the Kubex API only one subscription is processed per analysis This is the case, even if more than one subscription is associated with the service principle. If the connection was created through the Cloud Connection wizard in the UI, all subscriptions that were selected, when the connection was created, and associated with the ``are returned. ## Resource ``` /analysis/cloud/azure/ /results ``` ## endpoints # List recommendations for an Azure analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Azure_Results/listAzureRecommendations openapi/public_cloud/Analysis_Azure_Results.yaml GET /analysis/cloud/azure/{analysisId}/results Returns Azure recommendations for a completed analysis. **Content negotiation** - `Accept: application/json` → JSON recommendation objects - `Accept: application/terraform-map` → Terraform-map objects **Filtering** - Element-based filters are supplied as ordinary query pairs named after fields (e.g., `recommendationType=Upsize`). Not all fields are filterable. **Attributes/data quality** - `includeAttributes=true` returns the `attributes` array. - `dataQuality` accepts a quoted, comma-separated list of workload names. # Analysis: GCP Analyze Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_GCP_Analyze The `/analysis/gcp` resource is used to return a list of GCP optimization analyses currently in the Kubex system. An analysis is generated for each GCP project associated with the provided GCP service account used during data collection. The `/analysis/gcp/analyze` resource is used to collect Google Cloud Platform infrastructure data and initiate optimization analysis with the data collected. Below are the series of processes that occur when the initial `/analysis/gcp/analyze` request is triggered: 1. Set up and initiate data collection of the GCP projects based on the associated GCP service account and schedule it to run automatically on a nightly basis. 2. Initiate analysis on the data collected using the default policy. * Subsequent analysis is scheduled to run on a nightly basis after data collection. * You can optionally configure the results to be sent to a webhook URI upon analysis completion. See [Add webhook to an analysis](./Analysis_Webhook#_AddWebhook) for details. 3. Once data collection succeeds and an `analysisId` is created for the project, you can check progress via `/analysis/cloud/gcp//status` or wait for the results to be published to an optional webhook URI. Projects that do not yet have an `analysisId` (for example, unsupported resources or insufficient data) must wait for an analysis run before the status endpoint becomes available. 4. The reporting database update is scheduled to run automatically on a nightly basis after the completion of the analysis. This process produces reports for each instance recommendation, which is useful for analysts or application owners. These reports are only created after the scheduled analysis is completed, and may therefore only be available on the following day for a new analysis. Exact timing depends on the size of your environment. When onboarding a project using the `/analysis/cloud/gcp/analyze` endpoint, receiving a 200 status code signals that the onboarding was successful. #### Analysis Update You can make an ad-hoc request to refresh an existing analysis, outside of the scheduled nightly run using `/analysis/cloud//analyze`. This manual, ad hoc analysis request does not perform data collection or reporting database updates. It only runs the analysis on the existing data collected with the following behavior: * The analysis uses the policy that is configured for the analysis. Contact [support@kubex.ai](mailto:support@kubex.ai) to change the configured policy. * If a new webhook is provided, the analysis will send results to the new webhook URI. If no webhook is provided, the analysis will send results to the existing webhook, if configured. * If the same analysis is already running, the request does not proceed and an appropriate message is returned. * If the specified analysis has data collection scheduled within 30 minutes, the request does not proceed and an appropriate message is returned. For example, if data collection is scheduled to run at 12:05 AM, and you initiate a manual, ad hoc analyze request at 11:45 PM, then the analysis will not proceed and an error message is returned. ### Prerequisite Configuration Before you can collect GCP cloud infrastructure data in Kubex, you need to create a GCP service account with services enabled and permissions configured. See [Google Cloud Platform Data Collection Prerequisites](/docs/WebHelp_Densify_Cloud/Content/Data_Collection_for_Public_Cloud_Systems/Google_Cloud_Platform_Data_Collection_Prerequisites) for details. When using the Kubex API only one project will be processed per API request. This is the case, even if more than one project is associated with the service account. ## Resource ``` /analysis/gcp/analyze ``` ``` /analysis/gcp ``` ## endpoints # Run GCP data collection+analysis, or re-run analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_GCP_Analyze/analyzeGcp openapi/public_cloud/Analysis_GCP_Analyze.yaml POST /analysis/gcp/analyze - **Initial run**: provide a GCP service account credential and `projectId`. Schedules nightly collection and analysis; can set `connectionName` and a `webHook`. - **Re-run**: call again with the same `projectId` (+ optional new `webHook`); does **not** collect data. - Request is rejected if collection/analysis is in progress or within ~30 minutes of the scheduled tasks. # List all generated GCP analyses Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_GCP_Analyze/listGcpAnalyses openapi/public_cloud/Analysis_GCP_Analyze.yaml GET /analysis/cloud/gcp Return analyses with details and links; use this to obtain `analysisId` for other calls. # Analysis: GCP Delete Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_GCP_Delete The `/analysis/cloud/gcp/` resource can be used to delete the audit and all associated scheduler entries of the cloud analysis specified by ``. * The single-day and 60-day historical audits are removed, if they exist. * The audit and all associated scheduler entries, are deleted, if they exist. When executing the delete operation in an environment observe the following: * When deleting an audit for an environment associated with a single account, the operation proceeds as outlined above. * When deleting an audit, if Kubex determines that there is a many-to-one relationship for this connection, then the delete request fails. This type of multi-account connection can only be created through the Cloud Connection Wizard and must be deleted through the Cloud Connection Wizard. During a delete operation, any attempt to access other associated endpoints related to the specified `` (i.e. GET, PUT, POST) will trigger a "400 Bad Request" error response. While the delete operation is in progress, you can check the status (using the `/analysis/cloud/gcp/<``analysisId``>/status` resource) or wait for the results to be published to an optional webhook URI. Collected data is saved for the defined retention period and the environment and associated analysis structure are saved in case you want to generate reports on the historical data or restart data collection. Since the environment and analyses are not deleted, a GET call for the specified `` will always succeed regardless of whether the associated connection has been deleted. If you use a GET call to list available environment and analyses, for which the audits have been deleted, they are still listed. You can reestablish the audit without have to re-create the analysis. You will still see the data in the Kubex Console. ## Resource ``` /analysis/cloud/gcp/ analysisId ``` ## endpoints # Delete GCP Cloud Connection and Analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_GCP_Delete/deleteGcpAnalysisAudit openapi/public_cloud/Analysis_GCP_Delete.yaml DELETE /analysis/cloud/gcp/{analysisId} Deletes the Cloud Connection and Analysis for the specified GCP project. This API only supports deletion for GCP projects that have a valid analysisId. If the GCP project was not analyzed (for example, unsupported resources or insufficient data), no analysisId exists and this API cannot be used. In those cases, delete the cloud connection manually and contact support@kubex.ai if assistance is required. # Analysis: GCP Recommendations Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_GCP_Results The `/analysis/cloud/gcp//results` resource is used to return a collection of Compute Engine instance recommendations after optimization analysis has been performed on your collected GCP infrastructure data. For each instance recommendation, you can also download a PDF version of the Impact Analysis and Recommendation Report, which details system impact based on the recommendations. This report is useful to application owners who need to review recommended changes to their application resources. See the [rptHref](#_rptHref) resource element for details on how to download this report. To return a collection of all instances included in a GCP optimization analysis, see [Analysis: GCP Systems](./Analysis_GCP_Systems). ## Resource ``` /analysis/cloud/gcp//results ``` ## endpoints # List recommendations for a GCP analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_GCP_Results/listGcpRecommendations openapi/public_cloud/Analysis_GCP_Results.yaml GET /analysis/cloud/gcp/{analysisId}/results Returns a collection of recommendations. Content negotiation: - `application/json` → JSON recommendation objects - `application/terraform-map` → terraform-map objects Element filters are standard query pairs (e.g., `recommendationType=Upsize`). `includeAttributes=true` returns the `attributes` array. `dataQuality` takes a quoted, comma-separated list of workload names; unsupported names yield 400. # Analysis: Status Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Status The `/analysis////status` resource is used to return the current status of an analysis in Kubex. ## Resource ``` /analysis////status ``` ## endpoints # Analysis: Webhook Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Webhook The `/webhook/analysis` resource is used to manage the webhook definition for a Kubex 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 can define the webhook when you initiate data collection and analysis with the `/analysis///analyze` request. See the example, [Run AWS data collection and analysis](./Analysis_AWS_Analyze#_runAnalysis) 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 ``` ## endpoints # Add webhook to an analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Webhook/addAnalysisWebhook openapi/public_cloud/Analysis_Webhook.yaml POST /webhook/analysis/{platformType}/{platformSubType}/{analysisId} Only allowed if the analysis does not already have a webhook. # Delete webhook from an analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Webhook/deleteAnalysisWebhook openapi/public_cloud/Analysis_Webhook.yaml DELETE /webhook/analysis/{platformType}/{platformSubType}/{analysisId} # Get webhook definition for an analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Webhook/getAnalysisWebhook openapi/public_cloud/Analysis_Webhook.yaml GET /webhook/analysis/{platformType}/{platformSubType}/{analysisId} # List webhooks by platform Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Webhook/listAnalysisWebhooksByPlatform openapi/public_cloud/Analysis_Webhook.yaml GET /webhook/analysis/{platformType} List all analysis webhooks for a platform (cloud or containers). # Update webhook for an analysis Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Analysis_Webhook/updateAnalysisWebhook openapi/public_cloud/Analysis_Webhook.yaml PUT /webhook/analysis/{platformType}/{platformSubType}/{analysisId} # Authorize Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Authorize The `authorize` resource is used to obtain a JSON Web Token (JWT) for Kubex users to make authorized API requests. The resource will return a token for any active Kubex user when the proper credentials are provided. Only API-enabled users can make authorized API calls. See [Using the API: Authentication](./Using_the_API#_Authentication) for details on API-enabled users. The JWT API token is only valid within the expiry time of the token, which by default is set to 60 minutes. The key used to validate the token is also refreshed every 30 days. To access the Kubex API, you need user credentials with membership in the following Kubex user group: SaaS\_User\_Admin.or SaaS\_User. ## Security Considerations The authorization workflow provides a progressively longer delay each time an invalid password is entered in an Authorize request. This behaviour is applied regardless of whether or not you have enabled the Kubex password policy. The workflow does change if the password policy has been enabled. Contact [support@kubex.ai](mailto:support@kubex.ai) for details. Contact [support@kubex.ai](mailto:support@kubex.ai) for details on configuring the Kubex password policy. ## Resource ``` /authorize ``` ## Endpoints # Obtain a JWT API token Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Authorize/authorize-user openapi/authorize.yaml POST /authorize Returns a JWT token for any **active** Kubex user when valid credentials are provided. Only tokens for **API-enabled** users can be used to make authorized API calls. # Compatible Instances Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/CatalogMap Returns the list of all instance types that the given instance (input parameter=entity\_id) is compatible with. ## Resource ``` https:///api/v2/systems/{{entityId}}/analysis-details?target=compatible_instances/&spendTolerance=1.5&effort_tolerance=low ``` ### Optional parameters: #### Spend Tolerance Specified in terms of a multiplier. E.g., 1.3 means all compatible instance types that are less that 1.3 times the optimal instance type cost. ##### Resource ``` https:///api/v2/systems/{{entityId}}/analysis-details?target=compatible_instances/&spendTolerance=1.3 ``` #### Effort Tolerance Used to only return compatible instance types that are at the provided effort level or lower. Possible values are 'none','low','medium','high' ##### Resource ``` https:///api/v2/systems/{{entityId}}/analysis-details?target=compatible_instances/&spendTolerance=1.3&effort_tolerance=low ``` # Introduction Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Introduction The Kubex API is a REST-based web service that is designed for the following: * Kubernetes Container Recommendations * AWS - Onboard new accounts and retrieve Kubex right-sizing recommendations * Azure - Onboard new subscriptions and retrieve Kubex right-sizing recommendations * GCP - Onboard new projects and retrieve Kubex right-sizing recommendations * Catalog Map - Get a list of how all instance types scored for a given instance * Analysis webhook * Subscriptions (customizable analysis results API) # Kubernetes Clusters Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters This resource is used to return all clusters, as specified in the data forwarder. No filtering is applied. This endpoint does not require the analysis ID that is required when using the [`/systems`](./Analysis_Kubernetes_Systems) and [`/results`](./Analysis_Kubernetes_Results) endpoints. ## Resources * `/kubernetes/clusters` * `/kubernetes/clusters/` ## endpoints # Get details for a Kubernetes cluster Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters/getKubernetesClusterDetails openapi/kubernetes/kubernetes_clusters.yaml GET /kubernetes/clusters/{clusterName} Returns namespaces, pods, and containers for the specified cluster. # List Kubernetes clusters Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters/listKubernetesClusters openapi/kubernetes/kubernetes_clusters.yaml GET /kubernetes/clusters Returns all clusters from which data is being collected. No filtering is applied. # Kubernetes Clusters Results Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters_Results This resource is used to return container recommendations at the cluster level. This endpoint shows all analyzed containers in the specified cluster. ## Resources * `/kubernetes/clusters//containers` * `/analysis/containers/kubernetes/clusters//containers?details=true` ## endpoints # List container recommendations for a cluster Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters_Results/getKubernetesClusterContainers openapi/kubernetes/kubernetes_clusters_results.yaml GET /kubernetes/clusters/{clusterName}/containers Returns recommendation details for container manifests in the specified cluster. This endpoint returns the base set of fields. For additional details including uptime predictions, OOM kill counts, and audit history, use the detailed endpoint with details=true. Fields with no value may be omitted from the response. ## Overview This endpoint returns container recommendation details for a specific cluster. This is the **base response format** without additional details. For extended information including uptime predictions, OOM kill counts, node group associations, and audit history, use the detailed endpoint with `details=true`. See [getKubernetesClusterContainersDetailed](/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters_Results/getKubernetesClusterContainersDetailed) for more information. ## Example Request ```bash theme={null} curl -X GET "https://api.example.com/api/v2/kubernetes/clusters/my-cluster/containers" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ## Example Response ```json theme={null} [ { "cluster": "my-cluster", "namespace": "production", "podOwnerName": "web-app", "podOwnerKind": "Deployment", "container": "nginx", "entityId": "abc123", "containerId": "def456", "avgContainerCount": 3, "currentCpuRequestmCores": 500, "currentCpuLimitmCores": 1000, "currentMemRequestBytes": 536870912, "currentMemLimitBytes": 1073741824, "recommendedCpuRequestmCores": 300, "recommendedCpuLimitmCores": 600, "recommendedMemRequestBytes": 268435456, "recommendedMemLimitBytes": 536870912, "estimatedSavingsPerContainer": 45.50, "analyzedOn": "2026-06-08T10:30:00Z", "hpaMetricName": "cpu", "hpaMetricThreshold": "75%", "currentEphemeralStorageRequestBytes": 1073741824, "currentEphemeralStorageLimitBytes": 2147483648, "recommendedEphemeralStorageRequestBytes": 536870912, "recommendedEphemeralStorageLimitBytes": 1073741824 } ] ``` Fields without values may be omitted from the response. All timestamps are in UTC format (`YYYY-MM-DDTHH:mm:ssZ`). ## Need More Details? If you need additional fields such as: * Predicted uptime percentage * Configuration change history * Node group associations * OOM kill events * Audit timeline information Use the [detailed endpoint](/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters_Results/getKubernetesClusterContainersDetailed) by adding `?details=true` to your request. # List container recommendations with additional details Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters_Results/getKubernetesClusterContainersDetailed openapi/kubernetes/kubernetes_clusters_results.yaml GET /kubernetes/clusters/{clusterName}/containers?details=true Returns recommendation details for container manifests in the specified cluster with additional fields. This endpoint includes all base fields plus: predictedUptime, configLastChangedOn, nodeGroup, oomKills_last7days, dateFirstAudited, and dateLastAudited. Fields with no value may be omitted from the response. ## Overview This endpoint returns container recommendation details for a specific cluster with **additional fields** when `details=true` is included. For the base response format without additional details, see [getKubernetesClusterContainers](/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Kubernetes_Clusters_Results/getKubernetesClusterContainers). ## Additional Fields with details=true When you include `details=true` in the query parameters, the following additional fields are included in each container recommendation: | Field | Type | Description | | --------------------- | ------------------ | ------------------------------------------------------------- | | `predictedUptime` | number (float) | Predicted uptime percentage for the container | | `configLastChangedOn` | string (date-time) | Timestamp of the most recent change to requests/limits | | `nodeGroup` | array of strings | Names of associated node groups | | `oomKills_last7days` | integer | Number of OOM (Out Of Memory) events in the last 7 days | | `dateFirstAudited` | string (date-time) | When this container was first audited (from workload history) | | `dateLastAudited` | string (date-time) | When this container was last audited (from workload history) | ## Example Request ```bash theme={null} curl -X GET "https://api.example.com/api/v2/kubernetes/clusters/my-cluster/containers?details=true" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ## Example Response ```json theme={null} [ { "cluster": "my-cluster", "namespace": "production", "podOwnerName": "web-app", "podOwnerKind": "Deployment", "container": "nginx", "entityId": "abc123", "containerId": "def456", "avgContainerCount": 3, "currentCpuRequestmCores": 500, "currentCpuLimitmCores": 1000, "currentMemRequestBytes": 536870912, "currentMemLimitBytes": 1073741824, "recommendedCpuRequestmCores": 300, "recommendedCpuLimitmCores": 600, "recommendedMemRequestBytes": 268435456, "recommendedMemLimitBytes": 536870912, "estimatedSavingsPerContainer": 45.50, "analyzedOn": "2026-06-08T10:30:00Z", "hpaMetricName": "cpu", "hpaMetricThreshold": "75%", "currentEphemeralStorageRequestBytes": 1073741824, "currentEphemeralStorageLimitBytes": 2147483648, "recommendedEphemeralStorageRequestBytes": 536870912, "recommendedEphemeralStorageLimitBytes": 1073741824, // Additional fields when details=true "predictedUptime": 99.8, "configLastChangedOn": "2026-05-15T14:20:00Z", "nodeGroup": ["node-group-1", "node-group-2"], "oomKills_last7days": 2, "dateFirstAudited": "2026-01-10T08:00:00Z", "dateLastAudited": "2026-06-08T10:30:00Z" } ] ``` ## Use Cases The detailed fields are particularly useful for: * **Stability Monitoring**: `oomKills_last7days` helps identify containers experiencing memory pressure * **Change Tracking**: `configLastChangedOn` shows when resource configurations were last modified * **Historical Analysis**: `dateFirstAudited` and `dateLastAudited` provide audit timeline context * **Infrastructure Planning**: `nodeGroup` information helps with placement and scaling decisions * **Reliability Metrics**: `predictedUptime` aids in understanding container availability patterns Fields without values may be omitted from the response. All timestamps are in UTC format (`YYYY-MM-DDTHH:mm:ssZ`). # AI Tools: MCP Server Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/MCP ## Model Context Protocol The Model Context Protocol, or MCP, is a standard that allows Large Language Models (LLMs) to securely access external systems, tools, and data sources. By connecting through MCP, an LLM can retrieve real-time information and take structured actions, extending its usefulness beyond static chat interactions. In practice, this means that an LLM can integrate live data from trusted systems into its reasoning process, enabling more informed and actionable responses. ## Kubex MCP Kubex MCP extends this capability to your cloud and container environments. It gives LLMs access to detailed operational information about containers, nodes, and cloud instances, including Kubex optimization recommendations. You can use a chat-based LLM interface to review key optimization insights, identify risks, and plan remediation steps interactively. You can also use an LLM-based coding tool to apply Kubex recommendations directly to your infrastructure-as-code definitions. ## Getting Started ### LLM Clients To get started with Kubex MCP, you must use an LLM client that supports the Model Context Protocol. You can choose an existing LLM client application or build your own. Kubex MCP should work with any LLM client that supports MCP. Common chat interfaces that support MCP include Anthropic Claude and ChatGPT when Developer Mode is enabled. Coding-oriented clients such as Cursor, Claude Code, and Gemini CLI also provide MCP support. Alternatively, you can develop your own LLM-based agent using MCP. This approach requires significant development expertise and should only be attempted if you are comfortable building and maintaining your own software. Frameworks such as Microsoft Copilot Studio and Pydantic AI provide a useful starting point for developers who want to build their own MCP-enabled systems. ### Configuring Your Client #### General Each company has a unique Kubex MCP server endpoint. The MCP server URL follows a consistent pattern based on your company dashboard address. * If your Kubex dashboard is [https://corp.kubex.ai](https://corp.kubex.ai/), your MCP server URL is [https://corp-mcp.kubex.ai](https://corp-mcp.kubex.ai/). * If your organization uses a densify.com host such as [https://corp.densify.com/kubex](https://corp.densify.com/kubex), use the corresponding MCP URL: [https://corp-mcp.densify.com](https://corp-mcp.densify.com/). Kubex MCP supports the streamable HTTP transport, using OAuth 2.1 with dynamic client registration for authentication. #### Claude ##### Claude for Web (Claude.ai): Navigate to the [connectors](https://claude.ai/customize/connectors) page and connect Kubex. ##### Claude Desktop: From Claude Settings, go to Connectors and add the Kubex connector. ##### Claude Code: Run the following command: ```bash theme={null} claude mcp add --transport http kubex https://corp-mcp.kubex.ai/ ``` Then run `/mcp` after you open a Claude Code session to sign in with your Kubex account and connect it to Claude Code. #### Codex The setup steps for the MCP server apply to both the IDE extension and the CLI because the configuration is shared. Run the following command in your terminal: ```bash theme={null} codex mcp add kubex --url https://corp-mcp.kubex.ai/ ``` You will be prompted to sign in with your Kubex account and connect it to Codex. #### Cursor 1. Press `Ctrl/Cmd + ,` to open settings. 2. Go to the **Tools & MCPs** tab. 3. Click **Add Custom MCP Server**. 4. Add the following configuration (replace the URL with your Kubex MCP URL): ```json theme={null} { "mcpServers": { "kubex": { "command": "npx", "args": ["-y", "mcp-remote", "https://corp-mcp.kubex.ai/"] } } } ``` You may need to restart Cursor for the MCP tools to appear in chat. #### Visual Studio Code 1. Press `Shift + Ctrl/Cmd + P` and search for **MCP: Add Server**. 2. Select **HTTP**. 3. Enter your Kubex MCP URL and use `kubex` as the server name. 4. Authorize access to your Kubex instance when prompted. 5. Activate the server through **MCP: List Servers**, select `kubex`, then select **Start Server**. You may need to restart Visual Studio Code for the MCP tools to appear in chat. #### Devin Desktop (formerly Windsurf) 1. Press `Ctrl/Cmd + ,` to open settings. 2. Scroll to **Devin Local -> MCP servers**. 3. Select **Open Devin MCP marketplace -> Add custom MCP**. 4. Add the following configuration (replace the URL with your Kubex MCP URL): ```json theme={null} { "mcpServers": { "kubex": { "command": "npx", "args": ["-y", "mcp-remote", "https://corp-mcp.kubex.ai/"] } } } ``` Return to the Devin MCP marketplace and click **Connect** to authorize with Kubex. #### Zed 1. Press `Ctrl/Cmd + ,` to open Zed settings. 2. Add the following configuration (replace the URL with your Kubex MCP URL): ```json theme={null} { "context_servers": { "kubex": { "source": "custom", "command": "npx", "args": ["-y", "mcp-remote", "https://corp-mcp.kubex.ai/"], "env": {} } } } ``` #### Others Many other tools now support MCP servers. You can configure Kubex MCP with the following settings (replace the URL with your Kubex MCP URL): * Command: `npx` * Arguments: `-y mcp-remote https://corp-mcp.kubex.ai/` * Environment: `None` ## Authorization Access to Kubex data through MCP is tightly controlled. Only users who have been properly authenticated and who have explicitly authorized their LLM client application are allowed to retrieve or act on data. Authorization is temporary and must be refreshed daily for security reasons. Some client applications handle expired authorizations gracefully, automatically prompting for reauthorization when required. Others may not, which can lead to connection errors or incomplete responses. If you encounter these issues, the solution is usually to manually reconnect and reauthorize your client with the Kubex MCP server. ## Security Because MCP allows direct integration between an LLM and your operational environment, it is essential to treat security as a first priority. You should only connect to MCP servers that you trust. A malicious MCP server could attempt to manipulate an LLM into revealing sensitive information or performing unwanted actions. Kubex guarantees that the Kubex MCP server is secure and trustworthy. It is designed to provide authorized users with access to relevant data and recommendations without compromising system integrity or user privacy. However, Kubex cannot make any guarantees about the behavior of third-party MCP servers. If you choose to use additional MCP connections, you do so at your own risk and should apply standard best practices for verifying the legitimacy and security of external systems. # Ping API Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Ping The `/ping` resource is used to check the status of the Kubex API subsystem. No credentials are required for this resource to validate the API subsystem. A ping API call performs an end-to-end test from the client to the API subsystem, ensuring that the Kubex database is available and is able to respond to requests. Network elements, such as load balancers, can use this resource to verify that the web server receiving the request can be kept as an active participant in the resource pool. ## Resource ``` /CIRBA/api/ping ``` ## Endpoints # Ping Kubex API subsystem Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Ping/ping openapi/ping.yaml GET /ping End-to-end connectivity check to ensure the API subsystem and database are reachable. # Postman Collection Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Postman_Collection ## Postman Collection Kubex provides a Postman collection of sample API requests for public cloud and containers. Follow the steps below to use the downloaded Postman collection: 1. Unzip the downloaded file and import both the **Kubex API Collection** collection and **Kubex Environment** variables into your Postman workspace. 2. Modify the variables in the **Kubex Environment** to match your Kubex settings and credentials. If you already have a **Kubex** environment in your Postman application, you can either delete the previous version or rename it. Otherwise, you will have duplicate Kubex environments after the new collection is imported. 3. Review the **Documentation** section of the collection for an overview of the workflow and API requests. 4. Use this sample collection to familiarize yourself with Kubex API requests. ### Troubleshooting the Postman Collection When using token-based authentication you need to request a token for each session. Subsequent API requests within the session are automatically authenticated with this token. Then in a future session you need to again request and acquire a token. Postman is only intended to provide the tools for learning and testing Kubex APIs. Once you are comfortable with how the Kubex API works you can start to place the API calls within your code, used to interface with Kubex. For example you could write a call to get all analysis IDs, then loop through each ID making another API call to get the associated recommendations, thus providing the full list of recommendations for the scope of systems. If you use Postman v9.x or later you may encounter a "Bad request, invalid accept header" error. This is due to the fact that the Kubex API does not currently support the **Accept** key value "\*/" for **Headers**. Set the **Accept** key value to "application/json". # Subscriptions Source: https://docs.kubex.ai/docs-api/WebHelp_Densify_API_Cloud/Content/API_Guide/Subscriptions The `/subscriptions/` resource is used to create and manage subscription-based notifications for Kubex cloud and container recommendations. To learn more watch the video,