summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2022-04-06 13:42:41 +0300
committerGitHub <noreply@github.com>2022-04-06 13:42:41 +0300
commitc98fcf5754f5cce226f8401b6a1e007703af9b20 (patch)
treec6e6b7fa5c09f0f5015789ae87e25e0e87e08c4c /web
parent989121a5a4428e9088d4119b27c1172c9a14a4da (diff)
feat: add support for cloud providers info to /api/v1/info (#12613)
Diffstat (limited to 'web')
-rw-r--r--web/api/web_api_v1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c
index d00dc355f5..3369ab6812 100644
--- a/web/api/web_api_v1.c
+++ b/web/api/web_api_v1.c
@@ -982,6 +982,13 @@ inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb)
buffer_sprintf(wb, "\t\"container\": \"%s\",\n", (host->system_info->container) ? host->system_info->container : "");
buffer_sprintf(wb, "\t\"container_detection\": \"%s\",\n", (host->system_info->container_detection) ? host->system_info->container_detection : "");
+ if (host->system_info->cloud_provider_type)
+ buffer_sprintf(wb, "\t\"cloud_provider_type\": \"%s\",\n", host->system_info->cloud_provider_type);
+ if (host->system_info->cloud_instance_type)
+ buffer_sprintf(wb, "\t\"cloud_instance_type\": \"%s\",\n", host->system_info->cloud_instance_type);
+ if (host->system_info->cloud_instance_region)
+ buffer_sprintf(wb, "\t\"cloud_instance_region\": \"%s\",\n", host->system_info->cloud_instance_region);
+
buffer_strcat(wb, "\t\"host_labels\": {\n");
host_labels2json(host, wb, 2);
buffer_strcat(wb, "\t},\n");