[英]How can I get list of instances where stackdriver monitoring agent is not installed in gcp?
[英]Can I get gcp compute recommendations to resize the instance using any stackdriver monitoring api or gcloud command
我想獲得建議,通過任何 gcloud 命令或谷歌為 stackdriver 提供的任何 api 來調整 gcp 在 ui 上顯示的計算實例的大小。 (任何方法都可以,只需要獲取他們提供的調整實例大小的建議的數據)
Google 已通過其推薦程序 API提供此功能(請注意,它仍處於測試階段)。
您可以使用 gcloud 命令行工具與之交互,例如,列出有關 Compute Engine 實例類型的建議:
gcloud beta recommender recommendations list \
--project=example-project \
--location=us-central1-a \
--recommender=google.compute.instance.MachineTypeRecommender \
--format=json
或使用 REST API。 例如:
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"
您可以查看此處以獲取有關可用操作的更多詳細信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.