[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-28。"],[],[],null,["# Recent change recommendations\n=============================\n\n|\n| **Preview\n| --- Recent change recommendations**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nRecent change recommendations automatically flag risky changes made recently to\ncloud resources identified as important based on their usage and other signals\nto help detect and mitigate issues, like service outages, caused by\nmisconfigurations of those important cloud resources. For example, if you\ndeleted a highly used project, recent change recommendations can help identify\nunintended issues by proactively warning you about the risks associated with a\ngiven change.\n\nScope\n-----\n\nThe recent change recommendations only support the resources and actions listed\nin the following table.\n\nTo provide feedback on this capability overall or request additional resources\nand actions you'd like to see supported in future releases, see\n[Troubleshooting, feedback and support](#troubleshooting_feedback_and_support).\n\nBefore you begin\n----------------\n\n1. [Enable the Recommender API](/recommender/docs/enable-api) on a\n single billing project. You can then use this same billing project to\n retrieve recommendations and insights for other projects, the entire\n organization or the billing account, using the billing-project functionality\n of gcloud/API.\n\n2. Grant permissions on the user or service account that you will be used for\n accessing this feature.\n\nPermissions\n-----------\n\nTo view the recommendations for recent change recommendations, you must have the\nspecific permissions for the recent change recommender.\n\n- `recommender.cloudRecentChangeRecommendations.get`\n- `recommender.cloudRecentChangeRecommendations.list`\n- `recommender.cloudRecentChangeInsights.get`\n- `recommender.cloudRecentChangeInsights.list`\n\nYou can also grant\n[roles/recommender.viewer](/iam/docs/understanding-roles#recommender.viewer)\nrole to cover these permissions.\n\nView recent change recommendations\n----------------------------------\n\nThe following sections describe how to view recent change recommendations for\nsupported actions.\n\n### Project deletion\n\n### API\n\n- ListRecommendation:\n\n curl -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \" \\\n \"https://recommender.googleapis.com/v1/organizations/\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e /locations/global/\\\n recommenders/google.cloud.RecentChangeRecommender/recommendations\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n - \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e` `: The organization ID of organization you want to see the recent change risk recommendations.\n- ListInsight:\n\n curl -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \" \\\n \"https://recommender.googleapis.com/v1/organizations/\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e /locations/global/insightTypes/google.cloud.RecentChangeInsight/insights\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n - \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e` `: The organization ID of organization you want to see the recent change risk recommendations.\n\n### Google Cloud CLI\n\n- ListRecommendation:\n\n gcloud recommender recommendations list --recommender=google.cloud.RecentChangeRecommender \\\n --organization=\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e --location=global --format=yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e` `: The organization ID of organization you want to see the recent change risk recommendations.\n- ListInsight\n\n gcloud recommender insights list --insight-type=google.cloud.RecentChangeInsight \\\n --organization=\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e --location=global --format=yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e` `: The organization ID of organization you want to see the recent change risk recommendations.\n\n### Service account deletion\n\n### API\n\n- ListRecommendation:\n\n curl -H \"Authorization: Bearer $(gcloud auth print-access-token)\"\\\n \"https://recommender.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e /locations/global/\\\n recommenders/google.cloud.RecentChangeRecommender/recommendations\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n- ListInsight:\n\n curl -H \"Authorization: Bearer $(gcloud auth print-access-token)\"\\\n -H \"x-goog-user-project: \u003cvar translate=\"no\"\u003eBILLING_PROJECT_ID\u003c/var\u003e \"\\\n \"https://recommender.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e /locations/global/insightTypes/google.cloud.RecentChangeInsight/insights\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n - \u003cvar translate=\"no\"\u003eBILLING_PROJECT_ID\u003c/var\u003e` `: The billing project ID.\n\n### Google Cloud CLI\n\n- ListRecommendation:\n\n gcloud recommender recommendations list --recommender=google.cloud.RecentChangeRecommender \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e --location=global --format=yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n- ListInsight\n\n gcloud recommender insights list --insight-type=google.cloud.RecentChangeInsight \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e --location=global --format=yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n\nUnderstand the response\n-----------------------\n\nThe following tables provide a description of the fields present in the\nrecommendation and insight objects.\n\n### Recommendations\n\n### Insights\n\nLog recent change recommendations\n---------------------------------\n\nOptionally, you can use [Cloud Logging](/logging) to create a log whenever a\nnew recent change recommendation occurs. Note that these logs are\n[platform logs](/logging/docs/api/platform-logs), so additional charges apply\nfor such logs. The logging is turned off by default. You must enable logging\nusing the recommender config to generate logs.\n\nThe logging scope for a recommendation corresponds to the recommendation scope.\nYou can enable logging for an organization or a project separately. The\nrecommendation logging config is not inherited from an organization to a project\nfor this feature. To generate service account deletion recommendations logging,\nyou must enable logging for the corresponding project.\n\nTo viewCloud Logging (if enabled) you need\n[Logs Viewer](/logging/docs/access-control#logging.viewer) permissions.\n\n### Logging configuration\n\nTo view and update recommender configuration, you must have the following\npermissions:\n\n- `recommender.cloudRecentChangeRecommenderConfig.get`\n- `recommender.cloudRecentChangeRecommenderConfig.list`\n- `recommender.cloudRecentChangeRecommenderConfig.update`\n\n### Enable logging\n\nUse the `--project` flag to enable logging for a project or the `--organization`\nflag to enable logging for an organization. The following examples show how to\nenable logging for a project.\n\n1. Check `enable_creation_logs` param in the `recommenderGenerationConfig`:\n\n gcloud recommender recommender-config describe google.cloud.RecentChangeRecommender \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e --location=global\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n\n The output is similar to the following: \n\n \u003cpre class=\"console\"\u003e\n etag: '\"******\"'\n recommenderGenerationConfig:\n params:\n enable_creation_logs: false\n ...\n \u003c/pre\u003e\n\n2. Create a `config.txt`\\` file that contains the following lines:\n\n {\n \"params\": {\n \"enable_creation_logs\": true\n }\n }\n\n3. Update the param:\n\n gcloud recommender recommender-config update google.cloud.RecentChangeRecommender \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e --location=global --config-file=config.txt \\\n --etag=\"\u003cvar translate=\"no\"\u003eETAG\u003c/var\u003e \"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e` `: The project ID of a project where you've enabled the Recommender API.\n - \u003cvar translate=\"no\"\u003eETAG\u003c/var\u003e` `: Where \u003cvar translate=\"no\"\u003eETAG\u003c/var\u003e is the value from the previous describe command.\n\nTroubleshooting, feedback, and support\n--------------------------------------\n\nEmail active-assist-feedback@google.com in case of technical issues, questions\nor feedback."]]