-
Bug
-
Resolution: Fixed
-
Minor
-
None
Hello,
I am unable to use the dedicated method setAccessKeys() to add a new metric key.
-> the goal is to define the key via the code instead of overriding the generated xml file.
def monitoringKey = new jenkins.metrics.api.MetricsAccessKey ("jenkins_metrics", "monitoring", true, false, true, true, null)
List<jenkins.metrics.api.MetricsAccessKey> metricKeys = new ArrayList<jenkins.metrics.api.MetricsAccessKey> ()
metricKeys.add (monitoringKey)
jenkins.metrics.api.MetricsAccessKey.DescriptorImpl.setAccessKeys (metricKeys)
result:
groovy.lang.MissingMethodException: No signature of method: static jenkins.metrics.api.MetricsAccessKey$DescriptorImpl.setAccessKeys() is applicable for argument types: (java.util.ArrayList) values: [[MetricsAccessKey\{key='monitoring', description='jenkins_metrics', canPing=true, canHealthCheck=true, canMetrics=true, canThreadDump=false, origins='null'}]]
Possible solutions: setAccessKeys(java.util.List), getAccessKeys(), getAccessKey(java.lang.String)