REST API XML Elements

Hey Guys,

Is there a resource available to help identify the proper elements when deploying via REST?

What I want to do here, is deploy a fixlet, and specify a name for the action. I can use <Title> when deploying a <singleaction>, but when deploying a <SourcedFixletAction> … is anyone aware of how I can modify the action name?

    <?xml version="1.0" encoding="UTF-8"?> 
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd"> 
<SourcedFixletAction> 
<SourceFixlet> 
<Sitename>ActionSite</Sitename> 
<FixletID>4057</FixletID> 
<Action>Action1</Action> 
</SourceFixlet> 
<Target> 
<ComputerID>15875486</ComputerID> 
</Target> 
</SourcedFixletAction> 
</BES>

From looking at the BES.xsd it does not seem that it is possible to specify the name of the action when using SourcedFixletAction

If you take action on something in the console, change the name of it, then export the resulting XML, it will not be a SourcedFixletAction

In general, I recommend creating something through the console, then export it to XML, then use that as a template to use with the REST API. This will help prevent trying to import invalid XML through the REST API.

I also highly recommend validating any XML you intend to submit with the REST API using the BES.xsd before sending it to the root server. You should also validate the character set is valid for what the system will handle. (which I’m not actually completely sure what this entails entirely, but I do know that in some cases you can get stuff into the root server with invalid characters and cause the root server to stop working until it is removed … stick to ASCII characters as much as possible )

1 Like

Just correcting my above remark, the XML that you export of an action in the console is not the same as the XML used to create an action in the console in most cases.

This is funny that this just popped up again as this is something I have been fighting with.

I was looking to rename the title for a sourced fixlet also, but this does not seem possible. This may need to be an enhancement request.

I did not want to dynamically create the action from scratch as this would allow the person submitting the capability of doing just about anything they want. By using a sourced fixlet, I am calling a specific command that can only do a few functions and they are passing the arguments to the command.

Martin

Well if you’re using the API you’ve probably got a layer of abstraction between the user and your API calls.

You can just grab the contents of the fixlet (with a rest api call) and put them into a new action and have the exact same functionality?

Ugh not a fan of these forums…

Edit: Then what would you suggest (In response to @jgstew’s update)… you answer was to export the action XML, and now your stating that it is not the same? That leaves the original question unanswered, yes?

Why is that? Are you saying you’d prefer the DevWorks Forums?

The exported XML of the action seems to just be the representation of the action itself, not what is required to create one, though it might work to create one as well, I haven’t tried that, but it does seem different.

A SourcedFixletAction is different and very limited.

It seems like if you want to change the name of action you can’t use SourcedFixletAction

If you want to know what XML you need to create an action, then you can look at the BES.XSD file because it is in there.