Rundeck API resources filter

155 views
Skip to first unread message

Yannick LE GOUALHER

unread,
Apr 22, 2016, 10:15:43 AM4/22/16
to rundeck-discuss
Hi,

My goal is to filter nodes to retrieve the parameter "URL". I want to filter nodes on the OS, where OS = Ubuntu

This is my ressources file:
<project>
  <node name="courrier" description="test" tags="courrier" hostname="monhost.mycompany.com" osArch="" osFamily="UNIX" osName="Ubuntu" osVersion="12.04.5" username="" url="monhost.mycompany.com" user="root" box="courrier_test" ip="42.125.80.22"/>
  <node name="localhost" description="Rundeck node" tags="" hostname="rundeck" osArch="amd64" osFamily="unix" osName="Linux" osVersion="2.6.32-39-pve" username="root"/>
</project>

I don't know how to do it with curl.

I try this:
curl --data-urlencode "filter=osName:'Ubuntu'" http://rundeck.mycompany.com/api/14/project/MyProject/resources?authtoken=pcgPvNu556ghhjOp


But the response is:

<result error='true' apiversion='15'>
  <error code='api.error.resources-import.unsupported-format'>
  <message>Unsupported format: No provider available to parse MIME type: application/x-www-form-urlencoded</message>
 </error>

After a lot of search on the web, I didn't find how to proceed.

Thanks for your help.

Alex Honor

unread,
Apr 22, 2016, 11:11:49 AM4/22/16
to rundeck...@googlegroups.com
Hi Yannick,

Try specifying the query param: "format=xml". You might also specify the curl option: -H Accept:application/xml

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/d2bcc562-f316-4c90-a0d5-504193e4830b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alex Honor

[SimplifyOps, Inc | a...@simplifyops.com ]

Be sure to comment and vote on Rundeck Feature Development!

Reply all
Reply to author
Forward
0 new messages