Summary:
Lists attributes of an object.
URL:
http(s)://{server hostname}/api/objects/{swID}/attributes?includeDetails=true&name=name1&name=name2
Methods summary
- GET Method - lists attributes of the object.
GET Method detail
Lists the attributes of the object.
Request:
The request may contain a list of attribute names to retrieve in the format “name=value”. By default, all attributes are returned.
It is also possible to supply “includeDetails” flag. It is assumed to be true if this value is set to one of: “true”, “yes”, “t”, “y” or “1”. If it is set to any other value, it is false. If a value is absent, then it is automatically set to true if there is at least one “name=value” entry, otherwise it is false..
The “includeDetails” controls the level of details returned by this method. If false, only the attribute names will be returned. If true, attribute names together with their values will be returned.
Response:
An array of entries, as described below.
If “includeDetails” is false, every entry has the following format:
Name | Description |
---|---|
name | name of the attribute. |
If “includeDetails” is true, every entry has the following format:
Name | Description |
---|---|
name | value of “name” attribute of the device. |
displayName | value of “displayName” attribute of the device |
userEditable | if the attribute can be modified by the user. |
userOverriden | if the attribute is set to polled or user-defined value. |
values | list of values for the attribute. |
Examples:
INPUT
curl -u admin:admin https://localhost/api/objects/611/attributes?media=json&includeDetails=y
OUTPUT
{
"items" : [ {
"name" : "devType",
"displayName" : "Device Type",
"userEditable" : false,
"userOverriden" : false,
"values" : [ "148" ]
}, {
...removed for brevity...
}, {
"name" : "category",
"displayName" : "category",
"userEditable" : false,
"userOverriden" : false,
"values" : [ "device" ]
} ],
"count" : 30
}
INPUT
curl -u admin:admin https://localhost/api/objects/611/attributes?media=xml&includeDetails=y
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="30">
<item xsi:type="attribute" userOverriden="false" userEditable="false" displayName="Device Type" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
<name>devType</name>
<value>148</value>
</item>
...removed for brevity...
<item xsi:type="attribute" userOverriden="false" userEditable="false" displayName="category" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
<name>category</name>
<value>device</value>
</item>
</items>
Comments
0 comments
Please sign in to leave a comment.