Skip to main content

insights

Creates, updates, deletes, gets or lists an insights resource.

Overview

Nameinsights
TypeResource
Idgoogle.recommender.insights

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Name of the insight.
associatedRecommendationsarrayRecommendations derived from this insight.
categorystringCategory being targeted by the insight.
contentobjectA struct of custom fields to explain the insight. Example: "grantedPermissionsCount": "1000"
descriptionstringFree-form human readable summary in English. The maximum length is 500 characters.
etagstringFingerprint of the Insight. Provides optimistic locking when updating states.
insightSubtypestringInsight subtype. Insight content schema will be stable for a given subtype.
lastRefreshTimestring (google-datetime)Timestamp of the latest data used to generate the insight.
observationPeriodstring (google-duration)Observation period that led to the insight. The source data used to generate the insight ends at last_refresh_time and begins at (last_refresh_time - observation_period).
severitystringInsight's severity.
stateInfoobjectInformation state and metadata. (id: GoogleCloudRecommenderV1InsightStateInfo)
targetResourcesarrayFully qualified resource names that this insight is targeting.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_insight_types_insights_getselectprojectsId, locationsId, insightTypesId, insightsIdGets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type.
billing_accounts_locations_insight_types_insights_getselectbillingAccountsId, locationsId, insightTypesId, insightsIdGets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type.
folders_locations_insight_types_insights_getselectfoldersId, locationsId, insightTypesId, insightsIdGets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type.
organizations_locations_insight_types_insights_getselectorganizationsId, locationsId, insightTypesId, insightsIdGets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type.
projects_locations_insight_types_insights_listselectprojectsId, locationsId, insightTypesIdpageSize, pageToken, filterLists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type.
billing_accounts_locations_insight_types_insights_listselectbillingAccountsId, locationsId, insightTypesIdpageSize, pageToken, filterLists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type.
folders_locations_insight_types_insights_listselectfoldersId, locationsId, insightTypesIdpageSize, pageToken, filterLists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type.
organizations_locations_insight_types_insights_listselectorganizationsId, locationsId, insightTypesIdpageSize, pageToken, filterLists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type.
projects_locations_insight_types_insights_mark_acceptedexecprojectsId, locationsId, insightTypesId, insightsIdMarks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
billing_accounts_locations_insight_types_insights_mark_acceptedexecbillingAccountsId, locationsId, insightTypesId, insightsIdMarks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
folders_locations_insight_types_insights_mark_acceptedexecfoldersId, locationsId, insightTypesId, insightsIdMarks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
organizations_locations_insight_types_insights_mark_acceptedexecorganizationsId, locationsId, insightTypesId, insightsIdMarks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
billingAccountsIdstring
foldersIdstring
insightTypesIdstring
insightsIdstring
locationsIdstring
organizationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type.

SELECT
name,
associatedRecommendations,
category,
content,
description,
etag,
insightSubtype,
lastRefreshTime,
observationPeriod,
severity,
stateInfo,
targetResources
FROM google.recommender.insights
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND insightTypesId = '{{ insightTypesId }}' -- required
AND insightsId = '{{ insightsId }}' -- required;

Lifecycle Methods

Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.

EXEC google.recommender.insights.projects_locations_insight_types_insights_mark_accepted 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@insightTypesId='{{ insightTypesId }}' --required,
@insightsId='{{ insightsId }}' --required
@@json=
'{
"stateMetadata": "{{ stateMetadata }}",
"etag": "{{ etag }}"
}';