Summary:
List values of an object attribute, and modify an object attribute.
URL:
http(s)://{server hostname}/api/objects/{swID}/attributes/{attributeName}
Methods summary
- GET Method - lists values of an attribute of the object.
- PUT Method - modifies an attribute of the object.
GET Method detail
Lists the values of an attribute on this object.
Response:
The list of attributes, with entries according to 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/typeName?media=json
OUTPUT
{
"name" : "typeName",
"displayName" : "typeName",
"userEditable" : false,
"userOverriden" : false,
"values" : [ "SwitchDevice" ]
}
INPUT
curl -u admin:admin https://localhost/api/objects/611/attributes/typeName?media=xml
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<objectAttribute userOverriden="false" userEditable="false" displayName="typeName">
<name>typeName</name>
<value>SwitchDevice</value>
</objectAttribute>
PUT Method detail
Modifies an attribute of the object.
Request:
An attribute definition:
Name | Description |
---|---|
name | name of attribute to be changed. |
userOverriden |
if the attribute has user-supplied or polled value. The fields "userOverriden" and "values" are mutually exclusive, meaning that "values" are only permitted if the "userOverriden" is false. |
values | list of values for the attribute. |
Response:
An updated attribute:
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/TransferServer?media=json -X PUT -H "content-type:application/json" -d \
'{
"name" : "TransferServer",
"displayName" : "Configuration Transfer Server",
"userOverriden" : true,
"values" : [ "10.44.2.101" ]
}'
OUTPUT
{
"name" : "TransferServer",
"displayName" : "Configuration Transfer Server",
"userEditable" : true,
"userOverriden" : true,
"values" : [ "10.44.2.101" ]
}
INPUT
curl -u admin:admin https://localhost/api/objects/611/attributes/TransferServer?media=xml -X PUT -H "content-type:application/xml" -d \
'<objectAttribute userOverriden="true" userEditable="true" displayName="Configuration Transfer Server">
<name>TransferServer</name>
<value>10.44.2.101</value>
</objectAttribute>'
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<objectAttribute userOverriden="true" userEditable="true" displayName="Configuration Transfer Server">
<name>TransferServer</name>
<value>10.44.2.101</value>
</objectAttribute>
Comments
0 comments
Please sign in to leave a comment.