Stopping a Action Via the REST API BF 9.1

Hello,

I can’t seem to stop an issued action via the REST API (“issued by” and rest user are the same, and the user is master operator).

GET /api/action/17915/status <----- WORKING
POST /api/action/17915/stop <— NOT WORKING (Response: 404 “Requested resource does not exist.”)
Headers:
Authorization Basic
Content-Type (application/xml)

Any help would be much appreciated :smile:

Thanks,

Try a POST against:

/api/action/{action id}/stop

(above, you have /api/action/id/stop)

See Legacy Communities - IBM TechXchange Community for reference.

Hey Aram,

Thanks for the reply.

I edited my original post to make it a little more clear what I was doing.

Thanks,

Loaded up one of my Postman queries today to stop a action, it magically started working… strange.

Interesting…but glad to hear it’s working! :grinning:

Looks like the /stop is not available over HTTP, SSL needs to be enabled in order to use the stop action over REST.

1 Like

I am extremely new to REST, quick question regarding this., I have looked up lots of information, but I am missing necessary pieces to the puzzle. I have seen the CLI tool, but it does not work with server automation to my knowledge. Where are you guys running the GET and POST commands from, the command line, or from another programming language. I have a need to have a handful of XMLs built from Server Automation, all for different purposes, I will be manually modifying the targets manually and want to fire them off from a script. How would I go about doing this? Any info would be appreciated, particularly the easiest way:) Also, what is the difference between normal REST and SA REST? Thanks guys

I can’t speak to using the CLI tool or SA REST as I have never used them.

In regards to where am I running the REST commands from:

For Testing I use an Application Called POSTman, google it, it will be your first hit, it’s very simple to use.
After I have figured out which API spaces that will be used it will be written into a NodeJS app (javascript) which will be aggregated with other data sources and fed to a front end for interaction.
Get used to how the API works, and the sky is the limit really when it comes to leveraging the data, some have pointed out that WebUI might be of help as well.

Good luck,

I will look it up. Thank you. I did some more testing and I was actually able to POST the SA plan using the CLI, but only after exporting the main action that SA plan produced, which had the same schema. I exported the already stopped main action, which contained the action plan steps inside, and was able to use that. Thanks again for the info

I use cURL to do simple interactions with REST on the command line. I like to use cURL because it is very simple and multi purpose. It is also cross platform, built into most non-windows platforms and can be used on windows as well.

See these examples:

I use python to do more complicated automation with REST.

I also like that python is cross platform, though it is not as easy to use without some installation and setup on Windows.

Many use REST with powershell on windows, but I personally feel that anything that can be cross platform should be, and anything platform specific should be minimized to doing only what would be platform specific anyway.

Hi heagsta,

I’m coming to the party a bit late on this, so sorry about that, but my first bit of advice would be to check out the SA REST documentation:

https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Server%20Automation%20REST%20API

I’ve also responded to folks in the past with details on how you can use the standard platform REST API directly if that’s something you’re already comfortable using:

2 Likes