Ask the Community
Groups
How to assign shared credentials via Traverse Web Service API - Connect IT Community | Kaseya
<main> <article class="userContent"> <p><strong>QUESTION:</strong></p> <p>How do I assign shared credentials via the Traverse Web Service API?</p> <p><strong>SOLUTION:</strong></p> <h1 data-id="batch-shared-credential-assignment">Batch Shared Credential Assignment</h1> <p>This JSON endpoint assigns shared credentials to one or more tests.</p> <table><tbody><tr><td> <p>Endpoint</p> </td> <td> <p><a rel="nofollow" href="/home/leaving?allowTrusted=1&target=http%3A%2F%2Flocalhost%2Fapi%2Fjson%2Fadmin%2Ftest%2Fupdate">http://localhost/api/json/admin/test/update</a></p> </td> </tr><tr><td> <p>Method</p> </td> <td> <p>POST</p> </td> </tr><tr><td> <p>HTTP Headers</p> </td> <td> <p>Content-Type: application/json</p> <p>Accept: application/json</p> </td> </tr></tbody></table><p><strong><br>Request Parameters</strong></p> <table><tbody><tr><td> <p>username</p> </td> <td> <p>The Traverse username</p> </td> </tr><tr><td> <p>password</p> </td> <td> <p>The Traverse password</p> </td> </tr><tr><td> <p>cleanUpSharedCredential</p> </td> <td> <p>Whether or not to delete the old credentials if there are no more tests using it. Prior to <strong>9.5.060</strong> this parameter was <strong>cleanUpSharedCrendential</strong>, with an extra 'n'.</p> </td> </tr><tr><td> <p>searchCriterias</p> </td> <td> <p>A list of criteria to use to identify the the tests to update</p> </td> </tr><tr><td> <p>testUpdateProperties</p> </td> <td> <p>A property containing the new shared credential serial number</p> </td> </tr></tbody></table><p><strong><br>Search Criterias</strong></p> <p>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. </p> <table><tbody><tr><td> <p>DEVICE_NAME</p> </td> <td> <p>The device name</p> <p>Supports the wildcard character</p> </td> </tr><tr><td> <p>DEVICE_TYPE</p> </td> <td> <p>A comma-separated list of device types</p> </td> </tr><tr><td> <p>DEVICE_ADDRESS</p> </td> <td> <p>The device address</p> <p>Supports the wildcard character</p> </td> </tr><tr><td> <p>DEVICE_SERIAL_NUMBER</p> </td> <td> <p>A comma-separated list of device serial numbers</p> </td> </tr><tr><td> <p>TEST_NAME</p> </td> <td> <p>The test name</p> <p>Supports the wildcard character</p> </td> </tr><tr><td> <p>TEST_TYPE</p> </td> <td> <p>A comma-separated list of test types</p> </td> </tr><tr><td> <p>TEST_SUB_TYPE</p> </td> <td> <p>A comma-separated list of test sub-types</p> </td> </tr><tr><td> <p>TEST_SERIAL_NUMBER</p> </td> <td> <p>A comma-separated list of test serial numbers</p> </td> </tr><tr><td> <p>TAG_[1-5]</p> </td> <td> <p>The test tags value</p> </td> </tr><tr><td> <p>ACTION_PROFILE_SERIAL_NUMBER</p> </td> <td> <p>The test’s action profile assigned</p> </td> </tr><tr><td> <p>DEPARTMENT_SERIAL_NUMBER</p> </td> <td> <p>The test’s department serial number</p> </td> </tr><tr><td> <p>DEPARTMENT_NAME</p> </td> <td> <p>The test’s department name</p> </td> </tr></tbody></table><p> </p> <p><strong>Test Update Property</strong></p> <p>A name value pair containing the new shared credential serial number.</p> <p><strong>Sample Requests</strong></p> <p>Update the SNMP tests with a name starting with ‘CPU’ on the ‘traverse-bve’ device:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">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" } ] }' <a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Ftvreview%2Fapi%2Fjson%2Fadmin%2Ftest%2Fupdate">https://tvreview/api/json/admin/test/update</a></pre> <p>Update two tests with serial numbers 1234 and 5678:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">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" } ] }' <a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Ftvreview%2Fapi%2Fjson%2Fadmin%2Ftest%2Fupdate">https://tvreview/api/json/admin/test/update</a></pre> <p> </p> </article> </main>