[英]Can I get gcp compute recommendations to resize the instance using any stackdriver monitoring api or gcloud command
I want to get the recommendation to resize the instances which gcp shows on there ui for compute instances either through any gcloud command or any api which google provides for stackdriver.我想获得建议,通过任何 gcloud 命令或谷歌为 stackdriver 提供的任何 api 来调整 gcp 在 ui 上显示的计算实例的大小。 (any method would work, just need to get the data of there recommendations they provide of resizing the instances)
(任何方法都可以,只需要获取他们提供的调整实例大小的建议的数据)
Google has made this available through its Recommender API (note that it still in beta). Google 已通过其推荐程序 API提供此功能(请注意,它仍处于测试阶段)。
You can interact with it with eitherthe gcloud command-line tool, for example, to list recommendations on Compute Engine instance type:您可以使用 gcloud 命令行工具与之交互,例如,列出有关 Compute Engine 实例类型的建议:
gcloud beta recommender recommendations list \
--project=example-project \
--location=us-central1-a \
--recommender=google.compute.instance.MachineTypeRecommender \
--format=json
or with the REST API.或使用 REST API。 For example:
例如:
curl \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project: example-project" \
"https://recommender.googleapis.com/v1beta1/projects/example-project/locations/us-central1-a/recommenders/google.compute.instance.MachineTypeRecommender/recommendations"
You can have a look here to get more details info about available actions.您可以查看此处以获取有关可用操作的更多详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.