Query SNMP Agent

GET/zstack/v1/snmp/agent
GET/zstack/v1/snmp/agent/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/snmp/agent
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/snmp/agent/18c89b48e653385f83db6ecffb48763f

Queryable Fields

Run the CLI tool, enter QueryLdapServer and press Tab to view all queryable fields and cross-table queryable resource names.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "f0ef8d847b573c6b86565e1d9111723b",
      "version": "v3",
      "userName": "zstack",
      "authAlgorithm": "SHA512",
      "authPassword": "auth_password",
      "privacyAlgorithm": "DES",
      "privacyPassword": "priv_password",
      "port": 161,
      "status": "Enable",
      "securityLevel": "authPriv"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.10.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error4.10.0
inventoriesListSee inventories4.10.0

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10014.10.0
descriptionStringBrief description of the error4.10.0
detailsStringDetailed error information4.10.0
elaborationStringReserved field. Defaults to null4.10.0
opaqueLinkedHashMapReserved field. Defaults to null4.10.0
causeErrorCodeRoot error. The source error that caused this error. Null if no root cause exists4.10.0

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID. Uniquely identifies the resource4.10.0
versionStringSNMP agent protocol version4.10.0
readCommunityStringRead community string (used when version is v2c)4.10.0
userNameStringUsername (used when version is v3)4.10.0
authAlgorithmStringAuthentication algorithm4.10.0
authPasswordStringAuthentication password4.10.0
privacyAlgorithmStringPrivacy algorithm4.10.0
privacyPasswordStringPrivacy password4.10.0
portintPort4.10.0
statusStringWhether the SNMP agent is enabled4.10.0
securityLevelStringSecurity level4.10.0
createDateTimestampCreation time4.10.0
lastOpDateTimestampLast modification time4.10.0

SDK Examples

Java SDK

QuerySnmpAgentAction action = new QuerySnmpAgentAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySnmpAgentAction.Result res = action.call();

Python SDK

QuerySnmpAgentAction action = QuerySnmpAgentAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySnmpAgentAction.Result res = action.call()