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

2017-08-11 Thread Robert Sandell
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 :

> 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,"/job/test/BenchmarkTable/api/json")
>> -> 
>> evaluate(((StaplerProxy)).getTarget(),"/job/test/BenchmarkTable/api/json")
>> -> 
>> evaluate(.getJob("test"),"/BenchmarkTable/api/json")
>> -> evaluate( 
>> :hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
>> -> 
>> evaluate(.getDynamic("BenchmarkTable",...),"/api/json")
>> -> 
>> evaluate( 
>> :org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")-> No 
>> matching rule was found on 
>>  for 
>> "/api/json"
>>
>>  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/ms
>> gid/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 jenkinsci-dev+unsubscr...@googlegroups.com.
> 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.*

-- 

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

2017-08-10 Thread Daniel Mercier
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,"/job/test/BenchmarkTable/api/json")
> -> 
> evaluate(((StaplerProxy)).getTarget(),"/job/test/BenchmarkTable/api/json")
> -> 
> evaluate(.getJob("test"),"/BenchmarkTable/api/json")
> -> evaluate( 
> :hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
> -> 
> evaluate(.getDynamic("BenchmarkTable",...),"/api/json")
> -> evaluate( 
> :org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")-> No 
> matching rule was found on 
>  for 
> "/api/json"
>
>  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 jenkinsci-dev+unsubscr...@googlegroups.com.
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.


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

2017-08-10 Thread 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,"/job/test/BenchmarkTable/api/json")
-> 
evaluate(((StaplerProxy)).getTarget(),"/job/test/BenchmarkTable/api/json")
-> 
evaluate(.getJob("test"),"/BenchmarkTable/api/json")
-> evaluate( 
:hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
-> 
evaluate(.getDynamic("BenchmarkTable",...),"/api/json")
-> evaluate( 
:org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")
-> No matching rule was found on 
 for 
"/api/json"


 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-dev+unsubscr...@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 jenkinsci-dev+unsubscr...@googlegroups.com.
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.


*/api/json fails for a new Jenkins plugin

2017-08-10 Thread Daniel Mercier
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,"/job/test/BenchmarkTable/api/json")
-> 
evaluate(((StaplerProxy)).getTarget(),"/job/test/BenchmarkTable/api/json")
-> 
evaluate(.getJob("test"),"/BenchmarkTable/api/json")
-> evaluate( 
:hudson.model.FreeStyleProject,"/BenchmarkTable/api/json")
-> 
evaluate(.getDynamic("BenchmarkTable",...),"/api/json")
-> evaluate( 
:org.jenkinsci.plugins.benchmark.BenchmarkProjectAction,"/api/json")-> No 
matching rule was found on 
 for 
"/api/json"

 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-dev+unsubscr...@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.