ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/snmp/agent
Authorization: OAuth the-session-uuid
{ "params": { "version": "v3", "userName": "zstack", "authAlgorithm": "SHA512", "authPassword": "auth_password", "privacyAlgorithm": "DES", "privacyPassword": "priv_password", "port": 161 }, "systemTags": [], "userTags": [] }
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"version":"v3","userName":"zstack","authAlgorithm":"SHA512","authPassword":"auth_password","privacyAlgorithm":"DES","privacyPassword":"priv_password","port":161}}' http://localhost:8080/zstack/v1/snmp/agent
Name | Type | Location | Description | Valid Values | Starting Version |
---|---|---|---|---|---|
version | String | body (contained in the params structure) | The protocol version. |
| 4.7.21 |
readCommunity | String | body (contained in the params structure) | Optional. The read community (used when for v2c version). | 4.7.21 | |
userName | String | body (contained in the params structure) | Optional. The user name (used for v3 version). | 4.7.21 | |
authAlgorithm | String | body (contained in the params structure) | Optional. The authentication algorithm. |
| 4.7.21 |
authPassword | String | body (contained in the params structure) | Optional. The authentication password. | 4.7.21 | |
privacyAlgorithm | String | body (contained in the params structure) | Optional. The privacy algorithm. |
| 4.7.21 |
privacyPassword | String | body (contained in the params structure) | Optional. The privacy password. | 4.7.21 | |
port | int | body (contained in the params structure) | The port. | 4.7.21 | |
resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. | 4.7.21 | |
tagUuids | List | body (contained in the params structure) | Optional. The tag UUID. | 4.7.21 | |
systemTags | List | body | Optional. the system tags. | 4.7.21 | |
userTags | List | body | Optional. The user tags. | 4.7.21 |
{ "inventory": { "uuid": "6dac2a94d44c3216acc13286a50416aa", "version": "v3", "userName": "zstack", "authAlgorithm": "SHA512", "authPassword": "auth_password", "privacyAlgorithm": "DES", "privacyPassword": "priv_password", "port": 161, "status": "Enable", "securityLevel": "authPriv" } }
Name | Type | Description | Starting Version |
---|---|---|---|
success | boolean | 4.7.21 | |
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.7.21 |
inventory | SnmpAgentInventory | See inventory. | 4.7.21 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.7.21 |
description | String | The brief description of the error. | 4.7.21 |
details | String | The details about the error. | 4.7.21 |
elaboration | String | The reserved field. Default value: null. | 4.7.21 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 4.7.21 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.7.21 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.7.21 |
version | String | The protocol version. | 4.7.21 |
readCommunity | String | The read community (used for the v2c version). | 4.7.21 |
userName | String | The user name (used for the v3 version). | 4.7.21 |
authAlgorithm | String | The authentication algorithm. | 4.7.21 |
authPassword | String | The authentication password. | 4.7.21 |
privacyAlgorithm | String | The privacy algorithm. | 4.7.21 |
privacyPassword | String | The privacy password. | 4.7.21 |
port | int | The port. | 4.7.21 |
status | String | The SNMP agent status. | 4.7.21 |
securityLevel | String | The security level. | 4.7.21 |
createDate | Timestamp | The creation date. | 4.7.21 |
lastOpDate | Timestamp | The last operation date. | 4.7.21 |
CreateSnmpAgentAction action = new CreateSnmpAgentAction(); action.version = "v3"; action.userName = "zstack"; action.authAlgorithm = "SHA512"; action.authPassword = "auth_password"; action.privacyAlgorithm = "DES"; action.privacyPassword = "priv_password"; action.port = 161; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateSnmpAgentAction.Result res = action.call();
CreateSnmpAgentAction action = CreateSnmpAgentAction() action.version = "v3" action.userName = "zstack" action.authAlgorithm = "SHA512" action.authPassword = "auth_password" action.privacyAlgorithm = "DES" action.privacyPassword = "priv_password" action.port = 161 action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" CreateSnmpAgentAction.Result res = action.call()
GET zstack/v1/snmp/agent GET zstack/v1/snmp/agent/{uuid}
Authorization: OAuth the-session-uuid
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
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySnmpAgent, and pressing the Tab key.
{ "inventories": [ { "uuid": "f0ef8d847b573c6b86565e1d9111723b", "version": "v3", "userName": "zstack", "authAlgorithm": "SHA512", "authPassword": "auth_password", "privacyAlgorithm": "DES", "privacyPassword": "priv_password", "port": 161, "status": "Enable", "securityLevel": "authPriv" } ] }
Name | Type | Description | Starting Version |
---|---|---|---|
success | boolean | 4.7.21 | |
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.7.21 |
inventories | List | See inventories. | 4.7.21 |
Name | Type | Description | Sarting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.7.21 |
description | String | The brief description of the error. | 4.7.21 |
details | String | The details about the error. | 4.7.21 |
elaboration | String | The reserved field. Default value: null. | 4.7.21 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 4.7.21 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.7.21 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.7.21 |
version | String | The protocol version. | 4.7.21 |
readCommunity | String | The read community (used for the v2c version). | 4.7.21 |
userName | String | The user name (used for the v3 version). | 4.7.21 |
authAlgorithm | String | The authentication algorithm. | 4.7.21 |
authPassword | String | The authentication password. | 4.7.21 |
privacyAlgorithm | String | The privacy algorithm. | 4.7.21 |
privacyPassword | String | The privacy password. | 4.7.21 |
port | int | The port. | 4.7.21 |
status | String | The SNMP agent status. | 4.7.21 |
securityLevel | String | The security level. | 4.7.21 |
createDate | Timestamp | The creation date. | 4.7.21 |
lastOpDate | Timestamp | The last operation date. | 4.7.21 |
QuerySnmpAgentAction action = new QuerySnmpAgentAction(); action.conditions = asList(); action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; QuerySnmpAgentAction.Result res = action.call();
QuerySnmpAgentAction action = QuerySnmpAgentAction() action.conditions = [] action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" QuerySnmpAgentAction.Result res = action.call()
PUT zstack/v1/snmp/agent/actions
Authrization: OAuth the-session-uuid
{ "startSnmpAgent": { "uuid": "2e5ce17390a843da991411d27b67d775" }, "systemTags": [], "userTags": [] }
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
Name | Type | Location | Description | Valid Values | Starting Version |
---|---|---|---|---|---|
uuid | String | body (contained in the startSnmpAgent structure). | The resource UUID. | 4.7.21 | |
systemTags | List | body | Optional. The system tags. | 4.7.21 | |
userTags | List | body | Optional. The user tags. | 4.7.21 |
{ "inventory": { "uuid": "eef797ff89d84305b51cc3edcb597909", "version": "v3", "userName": "zstack", "authAlgorithm": "SHA", "authPassword": "authPassword", "privacyAlgorithm": "AES128", "privacyPassword": "privPassword", "port": 162 } }
Name | Type | Description | Starting Version |
---|---|---|---|
success | boolean | 4.7.21 | |
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.7.21 |
inventory | SnmpAgentInventory | See inventory. | 4.7.21 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.7.21 |
description | String | The brief description of the error. | 4.7.21 |
details | String | The details about the error. | 4.7.21 |
elaboration | String | The reserved field. Default value: null. | 4.7.21 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 4.7.21 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.7.21 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.7.21 |
version | String | The protocol version. | 4.7.21 |
readCommunity | String | The read community (used for the v2c version) | 4.7.21 |
userName | String | The user name (used for the v3 version) | 4.7.21 |
authAlgorithm | String | The authentication algorithm. | 4.7.21 |
authPassword | String | The authentication password. | 4.7.21 |
privacyAlgorithm | String | The privacy algorithm. | 4.7.21 |
privacyPassword | String | The privacy password. | 4.7.21 |
port | int | The port. | 4.7.21 |
status | String | The SNMP agent status. | 4.7.21 |
securityLevel | String | The security level. | 4.7.21 |
createDate | Timestamp | The creation date. | 4.7.21 |
lastOpDate | Timestamp | The last operation date. | 4.7.21 |
StartSnmpAgentAction action = new StartSnmpAgentAction(); action.uuid = "a74555a81a4244bb9ce0f8f2b5691ac5"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; StartSnmpAgentAction.Result res = action.call();
StartSnmpAgentAction action = StartSnmpAgentAction() action.uuid = "56f7b7cc6f764c55bf4016cc2257f456" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" StartSnmpAgentAction.Result res = action.call()