Credentials
Credentials API allows to get information and remove credentials in NetCrunch
get-credential-types
Get Credential Types
Get a list of credential types as an array.
GET/api/rest/2/credentials
cURL
curl --url "http://localhost/api/rest/2/credentials?api_key=<your-api-key>""
Node.js
const http = require('http'); http.get('http://localhost/api/rest/2/credentials?api_key=<your-api-key>', (res) => { res.setEncoding('utf8'); res.on('error', (error) => { console.log(error) }); res.on('data', (chunk) => { console.log(chunk) }) });
PowerShell
Invoke-RestMethod -Uri "http://localhost/api/rest/2/credentials?api_key=<your-api-key>"
Python
import requests requests.get('http://localhost/api/rest/2/credentials?api_key=<your-api-key>')
Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 401 | Access denied |
Result
["BSD","ESXi","Linux","macOS","Solaris","Windows","Database Connection","HTTP","Email incoming","IPMI","Email (SMTP)","Simple"]
get-names-of-defined-credentials
Get Names of Defined Credentials
Get a list of defined credentials.
GET/api/rest/2/credentials/<type>
cURL
curl --url "http://localhost/api/rest/2/credentials/Windows?api_key=<your-api-key>"
Node.js
const http = require('http'); http.get('http://localhost/api/rest/2/credentials/Windows?api_key=<your-api-key>', (res) => { res.setEncoding('utf8'); res.on('error', (error) => { console.log(error) }); res.on('data', (chunk) => { console.log(chunk) }) });
PowerShell
Invoke-RestMethod -Uri "http://localhost/api/rest/2/credentials/Windows?api_key=<your-api-key>"
Python
import requests requests.get('http://localhost/api/rest/2/credentials/Windows?api_key=<your-api-key>')
Parameters
| Name | Description |
|---|---|
| type | Type of credentials |
Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 401 | Access denied |
Result
["<Default>","New Profile"]
remove-credentials
Remove Credentials
The API has been deprecated for security reasons.