简体   繁体   English

Sonar Web客户端-更新值失败

[英]Sonar web client- Updating a value fails

I am trying to modify an existing manual metric in sonar from externally supplied value using the web service client. 我正在尝试使用Web Service客户端从外部提供的值修改声纳中的现有手动指标。 So far I am able to read the existing metric value from the plugin, but am having doubts in updating the values. 到目前为止,我已经能够从插件读取现有的指标值,但是在更新值方面存在疑问。

Also, on updating the metric like 另外,在更新指标时,例如

sonar.update(new PropertyUpdateQuery("<metric_key>, "Metric Value"));

Nothing happens, but the javadocs mention about the PUT operation in the UpdateQuery class. 没有任何反应,但是javadocs在UpdateQuery类中提到了PUT操作。 Edit: I have also tried to update the method using this approach : 编辑:我也试图使用这种方法来更新方法:

        UpdateQuery<Metric> update = new UpdateQuery<Metric>() {
        @Override
        public Class<Metric> getModelClass() {
            return Metric.class;
        }
        @Override
        public String getUrl() {
            return "/drilldown/measures/70?metric=<Metric Key>";
        }
    };
    sonar.update(update);

Is this the correct method of updating a manual metric ? 这是更新手动指标的正确方法吗? Also, should the model class and url be something more specific ? 此外,模型类和url是否应该更具体? - No documentation for this exists so far. -到目前为止,尚无与此相关的文档。

When dealing with the REST API, the best is to visit the following page: http://docs.codehaus.org/display/SONAR/Web+Service+API 在处理REST API时,最好的方法是访问以下页面: http : //docs.codehaus.org/display/SONAR/Web+Service+API

There, you can find the available operations on manual measures : get, create and delete. 在那里,您可以找到有关手动测量可用操作 :获取,创建和删除。 There's no update operation on manual measures. 手动测量没有更新操作。

BTW, the equivalent in the Java Web Service Client are ManualMeasure*Query, not PropertyUpdateQuery which updates Sonar properties. 顺便说一句,Java Web Service客户端中的等效项是ManualMeasure * Query,而不是用来更新Sonar属性的PropertyUpdateQuery。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM