Posted on 09-27-2012 02:12 PM
I'd like to be able to write data to a couple of Extension Attributes via the API. It doesn't seem to support those fields. Is that true and if so, how have you done it?
Here is a clip of the XML I'm sending to the JSS for a computer record:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<computer>
<extension_attributes>
<equipment_status>In Service</equipment_status>
</extension_attributes>
</computer>
The field is actually called Equipment Status with the "space". Any suggestions would be great.
Posted on 10-03-2012 01:17 PM
I see now that an inventory report is required to update these fields. Thus an API call to update one EA field isn't really feasible. There is the computer table, but then there is a reports table that references the extension_attribute_values table. Thus the dependence on an inventory report to update the EA's.
Will have to start a feature request.
Posted on 10-29-2012 11:01 AM
Hey Jafuller, Not sure if you ever figured this one out, but I just actually started playing with inserting data into the JSS using the REST API. I was able to insert data into an extension attribute. The syntax is just a little different. I created an extension attribute called "Inventory Status" that I'm intending to use once I'm able to pull some data out of our enterprise asset management tool. Here is my xml file that I'm using to input the data. Worked in my environment on Casper 8.6.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<computer>
<general>
<name>TestMachine1</name>
</general>
<extension_attributes>
<attribute>
<name>Inventory Status</name>
<value>Retired</value>
</attribute>
</extension_attributes>
</computer>
Posted on 11-05-2012 10:59 PM
Curl command (using terminal):
curl -k -v -u YourAPIUsername:YourAPIPassword https://jss.some.organisation:8443/JSSResource/computers/name/myComputerName/subset/extensionattributes -T "myXMLFile.xml" -X PUT
myXMLFile.xml (file content):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<computer>
<extension_attributes>
<attribute>
<name>UsefulInformationTitle</name>
<value>UsefulInformationValue</value>
</attribute>
</extension_attributes>
</computer>