Start SNMP Agent

PUT/zstack/v1/snmp/agent/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "startSnmpAgent": {
    "uuid": "2e5ce17390a843da991411d27b67d775"
  },
  "systemTags": [],
  "userTags": []
}

The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"startSnmpAgent":{"uuid":"955799e296a94e4aa2ce063a5b1ea4b8"}}' \
http://localhost:8080/zstack/v1/snmp/agent/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringbody (contained in the startSnmpAgent structure)Resource UUID. Uniquely identifies the resource 4.10.0
systemTags (optional)ListbodySystem tags 4.10.0
userTags (optional)ListbodyUser tags 4.10.0

API Response

Response Example

{
  "inventory": {
    "uuid": "eef797ff89d84305b51cc3edcb597909",
    "version": "v3",
    "userName": "zstack",
    "authAlgorithm": "SHA",
    "authPassword": "authPassword",
    "privacyAlgorithm": "AES128",
    "privacyPassword": "privPassword",
    "port": 162
  }
}
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
inventorySnmpAgentInventorySee inventory4.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

inventory

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

StartSnmpAgentAction action = new StartSnmpAgentAction();
action.uuid = "a74555a81a4244bb9ce0f8f2b5691ac5";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StartSnmpAgentAction.Result res = action.call();

Python SDK

StartSnmpAgentAction action = StartSnmpAgentAction()
action.uuid = "56f7b7cc6f764c55bf4016cc2257f456"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
StartSnmpAgentAction.Result res = action.call()