Document navigation

CreateSNSSnmpPlatform

API Request

URLs
POST zstack/v1/sns/application-platforms/snmp
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "snmpAddress": "127.0.0.1",
    "snmpPort": 161,
    "name": "snmp platform"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"snmpAddress":"127.0.0.1","snmpPort":161,"name":"snmp platform"}}' \
http://localhost:8080/zstack/v1/sns/application-platforms/snmp
Parameter List
Name Type Location Description Allowed Values Starting Version
snmpAddress String body (contained in the params structure) SNMP server address 4.10.0
snmpPort Integer body (contained in the params structure) SNMP port 4.10.0
name String body (contained in the params structure) Resource name 4.10.0
description (optional) String body (contained in the params structure) Detailed description of the resource 4.10.0
resourceUuid (optional) String body (contained in the params structure) Resource UUID 4.10.0
tagUuids (optional) List body (contained in the params structure) Tag UUID list 4.10.0
systemTags (optional) List body System tags 4.10.0
userTags (optional) List body User tags 4.10.0

API Response

Response Example
{
  "inventory": {
    "uuid": "660744a0d0cd4fe4ad1c11181955f30f",
    "name": "email platform",
    "description": "example description",
    "state": "Enabled",
    "type": "Email",
    "createDate": "Dec 25, 2023 2:07:14 PM",
    "lastOpDate": "Dec 25, 2023 2:07:14 PM"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.0
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 4.10.0
inventory SNSApplicationPlatformInventory For details, see inventory 4.10.0
#error
Name Type Description Starting Version
code String The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. 4.10.0
description String A brief description of the error 4.10.0
details String Detailed information about the error 4.10.0
elaboration String Reserved field. Default is null. 4.10.0
opaque LinkedHashMap Reserved field. Default is null. 4.10.0
cause ErrorCode The root error. The source error that caused the current error. If there is no root error, this field is null. 4.10.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. Uniquely identifies the resource. 4.10.0
name String Resource name 4.10.0
description String Detailed description of the resource 4.10.0
type String Type 4.10.0
createDate Timestamp Creation time 4.10.0
lastOpDate Timestamp Last modification time 4.10.0

SDK Examples

Java SDK
CreateSNSSnmpPlatformAction action = new CreateSNSSnmpPlatformAction();
action.snmpAddress = "127.0.0.1";
action.snmpPort = 161;
action.name = "snmp platform";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSSnmpPlatformAction.Result res = action.call();
Python SDK
CreateSNSSnmpPlatformAction action = CreateSNSSnmpPlatformAction()
action.snmpAddress = "127.0.0.1"
action.snmpPort = 161
action.name = "snmp platform"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSSnmpPlatformAction.Result res = action.call()
API Reference | ZStack ZSphere · ZVF | ZStack Resource Center