Skip to main content
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 for details.
  1. Once data collection succeeds and an analysisId is created for the project, you can check progress via /analysis/cloud/gcp/<analysisId>/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.
  2. 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/<aws|azure|gcp>/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 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 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

Analyze Gcp

Historical Audit Gcp

List Gcp Analyses