QUESTION:
How do I assign shared credentials via the Traverse Web Service API?
SOLUTION:
Batch Shared Credential Assignment
This JSON endpoint assigns shared credentials to one or more tests.
|
Endpoint |
|
|
Method |
POST |
|
HTTP Headers |
Content-Type: application/json Accept: application/json |
Request Parameters
|
username |
The Traverse username |
|
password |
The Traverse password |
|
cleanUpSharedCredential |
Whether or not to delete the old credentials if there are no more tests using it. Prior to 9.5.060 this parameter was cleanUpSharedCrendential, with an extra 'n'. |
|
searchCriterias |
A list of criteria to use to identify the the tests to update |
|
testUpdateProperties |
A property containing the new shared credential serial number |
Search Criterias
Search criterias are represented as a search option which is a test or parent device property, and a search term which is the value of the property that needs to be matched. Here is a list of the search options.
|
DEVICE_NAME |
The device name Supports the wildcard character |
|
DEVICE_TYPE |
A comma-separated list of device types |
|
DEVICE_ADDRESS |
The device address Supports the wildcard character |
|
DEVICE_SERIAL_NUMBER |
A comma-separated list of device serial numbers |
|
TEST_NAME |
The test name Supports the wildcard character |
|
TEST_TYPE |
A comma-separated list of test types |
|
TEST_SUB_TYPE |
A comma-separated list of test sub-types |
|
TEST_SERIAL_NUMBER |
A comma-separated list of test serial numbers |
|
TAG_[1-5] |
The test tags value |
|
ACTION_PROFILE_SERIAL_NUMBER |
The test’s action profile assigned |
|
DEPARTMENT_SERIAL_NUMBER |
The test’s department serial number |
|
DEPARTMENT_NAME |
The test’s department name |
Test Update Property
A name value pair containing the new shared credential serial number.
Sample Requests
Update the SNMP tests with a name starting with ‘CPU’ on the ‘traverse-bve’ device:
curl -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '
{
"username":"traverse",
"password":"traverse",
"cleanUpSharedCredential": "true",
"searchCriterias": [
{
"searchOption": "DEVICE_NAME",
"searchTerms": "traverse-bve"
},
{
"searchOption": "TEST_NAME",
"searchTerms": "CPU*"
},
{
"searchOption": "TEST_TYPE",
"searchTerms": "snmp"
}
],
"testUpdateProperties": [
{
"propertyName": "SHARED_CREDENTIAL",
"propertyValue": "180000"
}
]
}' https://tvreview/api/json/admin/test/update
Update two tests with serial numbers 1234 and 5678:
curl -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '
"username":"traverse",
"password":"traverse",
"cleanUpSharedCredential": "true",
"searchCriterias": [
{
"searchOption": "TEST_SERIAL_NUMBER",
"searchTerms": "1234,5678"
}
],
"testUpdateProperties": [
{
"propertyName": "SHARED_CREDENTIAL",
"propertyValue": "180000"
}
]
}' https://tvreview/api/json/admin/test/update