Skip to content

Commit d9d3860

Browse files
committed
Make Report URI configurable
1 parent 670c89d commit d9d3860

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

server/src/org/apache/cloudstack/report/UsageReporter.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ public class UsageReporter extends ManagerBase implements ComponentMethodInterce
8181
public static final Logger s_logger = Logger.getLogger(UsageReporter.class.getName());
8282

8383
public static final ConfigKey<Integer> UsageReportInterval = new ConfigKey<>("Advanced", Integer.class,
84-
"usage.report.interval", "7",
85-
"The interval in days between usage reports sent to the CloudStack project. Set to 0 to disable.",
84+
"usage.report.interval", "0",
85+
"The interval in days between usage reports sent to the CloudStack project. 0 is the default (disabled) and when enabled a value of 7 is recommended.",
8686
true, ConfigKey.Scope.Global);
8787

88-
/* !FIX ME! This should point to a Apache Infra host with SSL! */
89-
private String reportHost = "https://call-home.cloudstack.org/report";
88+
public static final ConfigKey<String> UsageReportUri = new ConfigKey<>("Advanced", String.class,
89+
"usage.report.uri", "https://reporting.cloudstack.org/report",
90+
"The URI to which usage reports are sent.",
91+
true, ConfigKey.Scope.Global);
9092

9193
private String uniqueID = null;
9294

@@ -130,7 +132,7 @@ public String getConfigComponentName() {
130132

131133
@Override
132134
public ConfigKey<?>[] getConfigKeys() {
133-
return new ConfigKey<?>[] {UsageReportInterval};
135+
return new ConfigKey<?>[] {UsageReportInterval, UsageReportUri};
134136
}
135137

136138
private void init() {
@@ -478,7 +480,7 @@ protected void runInContext() {
478480
reportMap.put("versions", getVersionReport());
479481
reportMap.put("current_version", getCurrentVersion());
480482

481-
sendReport(reportHost, uniqueID, reportMap);
483+
sendReport(UsageReportUri.value(), uniqueID, reportMap);
482484

483485
} catch (Exception e) {
484486
s_logger.warn("Failed to compile Usage Report: " + e.getMessage());

0 commit comments

Comments
 (0)