*/api/json fails for a new Jenkins plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

*/api/json fails for a new Jenkins plugin

Daniel Mercier-2
Hi everyone,

I created a new Jenkins plugin and while everything seems to work. The API/JSON fails consistently. The same behavior can be experienced with the pugin: Test_Analyzer_Plugin.

The answer on my plugin comes as a 404:

404 Not Found

Stapler processed this HTTP request as follows, but couldn't find the resource to consume the request

-> evaluate(<hudson.model.Hudson@a25d803> :hudson.model.Hudson,"/job/test/BenchmarkTable/api/json")
-> evaluate(((StaplerProxy)<hudson.model.Hudson@a25d803>).getTarget(),"/job/test/BenchmarkTable/api/json")
-> evaluate(<hudson.model.Hudson@a25d803>.getJob("test"),"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]> :hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]>.getDynamic("BenchmarkTable",...),"/api/json")
-> evaluate(<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> :org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")
-> No matching rule was found on <org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> for "/api/json"

<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> has the following URL mappings, in the order of preference:

  1. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.setResultSelected(...) for url=/setResultSelected/...
  2. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.ResetClock(...) for url=/ResetClock/...
  3. TOKEN.groovy for url=/TOKEN
  4. VIEW.jelly for url=/VIEW
  5. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getDisplayName() for url=/displayName/...
  6. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getProject() for url=/project/...
  7. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getUrlName() for url=/urlName/...
  8. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getIconFileName() for url=/iconFileName/...
  9. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getResultPageURL() for url=/resultPageURL/...
  10. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRootPageURL() for url=/rootPageURL/...
  11. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getNumberOfHeads() for url=/numberOfHeads/...
  12. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRawTable() for url=/rawTable/...
  13. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCondensedTable() for url=/condensedTable/...
  14. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getContentAvailable() for url=/contentAvailable/...
  15. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCore() for url=/core/...
  16. java.lang.Object.getClass() for url=/class/...

If anyone faced the same issue, any help will be greatly appreciated.

Best regards,

Daniel Mercier

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e1c4bec7-99e0-4c37-bd8e-d8a84043490b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: */api/json fails for a new Jenkins plugin

Markus Winter
you need a method getApi() that returns an Api [1]

public Api getApi() {
        return new Api(this);
    }


[1] http://javadoc.jenkins.io/hudson/model/Api.html


On 10.08.2017 21:28, Daniel Mercier wrote:
Hi everyone,

I created a new Jenkins plugin and while everything seems to work. The API/JSON fails consistently. The same behavior can be experienced with the pugin: Test_Analyzer_Plugin.

The answer on my plugin comes as a 404:

404 Not Found

Stapler processed this HTTP request as follows, but couldn't find the resource to consume the request

-> evaluate(<hudson.model.Hudson@a25d803> :hudson.model.Hudson,"/job/test/BenchmarkTable/api/json")
-> evaluate(((StaplerProxy)<hudson.model.Hudson@a25d803>).getTarget(),"/job/test/BenchmarkTable/api/json")
-> evaluate(<hudson.model.Hudson@a25d803>.getJob("test"),"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]> :hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]>.getDynamic("BenchmarkTable",...),"/api/json")
-> evaluate(<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> :org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")
-> No matching rule was found on <org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> for "/api/json"

<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> has the following URL mappings, in the order of preference:

  1. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.setResultSelected(...) for url=/setResultSelected/...
  2. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.ResetClock(...) for url=/ResetClock/...
  3. TOKEN.groovy for url=/TOKEN
  4. VIEW.jelly for url=/VIEW
  5. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getDisplayName() for url=/displayName/...
  6. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getProject() for url=/project/...
  7. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getUrlName() for url=/urlName/...
  8. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getIconFileName() for url=/iconFileName/...
  9. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getResultPageURL() for url=/resultPageURL/...
  10. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRootPageURL() for url=/rootPageURL/...
  11. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getNumberOfHeads() for url=/numberOfHeads/...
  12. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRawTable() for url=/rawTable/...
  13. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCondensedTable() for url=/condensedTable/...
  14. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getContentAvailable() for url=/contentAvailable/...
  15. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCore() for url=/core/...
  16. java.lang.Object.getClass() for url=/class/...

If anyone faced the same issue, any help will be greatly appreciated.

Best regards,

Daniel Mercier
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e1c4bec7-99e0-4c37-bd8e-d8a84043490b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/3d6517d2-e7f3-da56-fc46-479f77813594%40gmx.de.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: */api/json fails for a new Jenkins plugin

Daniel Mercier-2
Thank you very much.

Daniel Mercier

On Thursday, 10 August 2017 15:49:52 UTC-4, Markus Winter wrote:
you need a method getApi() that returns an Api [1]

public Api getApi() {
        return new Api(this);
    }


[1] <a href="http://javadoc.jenkins.io/hudson/model/Api.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjavadoc.jenkins.io%2Fhudson%2Fmodel%2FApi.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFV4urB4MFu-Bf9lIxCpEMmsreqSg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjavadoc.jenkins.io%2Fhudson%2Fmodel%2FApi.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFV4urB4MFu-Bf9lIxCpEMmsreqSg&#39;;return true;">http://javadoc.jenkins.io/hudson/model/Api.html


On 10.08.2017 21:28, Daniel Mercier wrote:
Hi everyone,

I created a new Jenkins plugin and while everything seems to work. The API/JSON fails consistently. The same behavior can be experienced with the pugin: Test_Analyzer_Plugin.

The answer on my plugin comes as a 404:

404 Not Found

Stapler processed this HTTP request as follows, but couldn't find the resource to consume the request

-> evaluate(<hudson.model.Hudson@a25d803> :hudson.model.Hudson,"/job/test/BenchmarkTable/api/json")
-> evaluate(((StaplerProxy)<hudson.model.Hudson@a25d803>).getTarget(),"/job/test/BenchmarkTable/api/json")
-> evaluate(<hudson.model.Hudson@a25d803>.getJob("test"),"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]> :hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]>.getDynamic("BenchmarkTable",...),"/api/json")
-> evaluate(<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> :org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")
-> No matching rule was found on <org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> for "/api/json"

<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> has the following URL mappings, in the order of preference:

  1. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.setResultSelected(...) for url=/setResultSelected/...
  2. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.ResetClock(...) for url=/ResetClock/...
  3. TOKEN.groovy for url=/TOKEN
  4. VIEW.jelly for url=/VIEW
  5. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getDisplayName() for url=/displayName/...
  6. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getProject() for url=/project/...
  7. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getUrlName() for url=/urlName/...
  8. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getIconFileName() for url=/iconFileName/...
  9. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getResultPageURL() for url=/resultPageURL/...
  10. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRootPageURL() for url=/rootPageURL/...
  11. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getNumberOfHeads() for url=/numberOfHeads/...
  12. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRawTable() for url=/rawTable/...
  13. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCondensedTable() for url=/condensedTable/...
  14. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getContentAvailable() for url=/contentAvailable/...
  15. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCore() for url=/core/...
  16. java.lang.Object.getClass() for url=/class/...

If anyone faced the same issue, any help will be greatly appreciated.

Best regards,

Daniel Mercier
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="XoBSrVOVAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/e1c4bec7-99e0-4c37-bd8e-d8a84043490b%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/e1c4bec7-99e0-4c37-bd8e-d8a84043490b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/e1c4bec7-99e0-4c37-bd8e-d8a84043490b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/e1c4bec7-99e0-4c37-bd8e-d8a84043490b%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b9453824-0c36-40b5-a974-673ca191d4a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: */api/json fails for a new Jenkins plugin

Robert Sandell-2
But it looks like your action is attached to a job. So instead you could/should just put @Exported on the getters in the action that you want exposed and then get it via the /job/test/api/json endpoint instead.

/B

2017-08-10 22:55 GMT+02:00 Daniel Mercier <[hidden email]>:
Thank you very much.

Daniel Mercier


On Thursday, 10 August 2017 15:49:52 UTC-4, Markus Winter wrote:
you need a method getApi() that returns an Api [1]

public Api getApi() {
        return new Api(this);
    }


[1] http://javadoc.jenkins.io/hudson/model/Api.html


On 10.08.2017 21:28, Daniel Mercier wrote:
Hi everyone,

I created a new Jenkins plugin and while everything seems to work. The API/JSON fails consistently. The same behavior can be experienced with the pugin: Test_Analyzer_Plugin.

The answer on my plugin comes as a 404:

404 Not Found

Stapler processed this HTTP request as follows, but couldn't find the resource to consume the request

-> evaluate(<hudson.model.Hudson@a25d803> :hudson.model.Hudson,"/job/test/BenchmarkTable/api/json")
-> evaluate(((StaplerProxy)<hudson.model.Hudson@a25d803>).getTarget(),"/job/test/BenchmarkTable/api/json")
-> evaluate(<hudson.model.Hudson@a25d803>.getJob("test"),"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]> :hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
-> evaluate(<hudson.model.FreeStyleProject@6135ae8a[test]>.getDynamic("BenchmarkTable",...),"/api/json")
-> evaluate(<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> :org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")
-> No matching rule was found on <org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> for "/api/json"

<org.jenkinsci.plugins.benchmark.BenchmarkProjectAction@5dcde26d> has the following URL mappings, in the order of preference:

  1. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.setResultSelected(...) for url=/setResultSelected/...
  2. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.ResetClock(...) for url=/ResetClock/...
  3. TOKEN.groovy for url=/TOKEN
  4. VIEW.jelly for url=/VIEW
  5. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getDisplayName() for url=/displayName/...
  6. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getProject() for url=/project/...
  7. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getUrlName() for url=/urlName/...
  8. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getIconFileName() for url=/iconFileName/...
  9. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getResultPageURL() for url=/resultPageURL/...
  10. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRootPageURL() for url=/rootPageURL/...
  11. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getNumberOfHeads() for url=/numberOfHeads/...
  12. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getRawTable() for url=/rawTable/...
  13. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCondensedTable() for url=/condensedTable/...
  14. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getContentAvailable() for url=/contentAvailable/...
  15. org.jenkinsci.plugins.benchmark.BenchmarkProjectAction.getCore() for url=/core/...
  16. java.lang.Object.getClass() for url=/class/...

If anyone faced the same issue, any help will be greatly appreciated.

Best regards,

Daniel Mercier
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e1c4bec7-99e0-4c37-bd8e-d8a84043490b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b9453824-0c36-40b5-a974-673ca191d4a2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS3%2BW5NjAPJcCgCsgT%2Bbkf1US8vZ_mXJR5fH7PVWBmKkwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...