Change SNS Application Platform State
Headers
Authorization: OAuth the-session-uuidBody
{
"changeSNSApplicationPlatformState": {
"stateEvent": "enable"
},
"systemTags": [],
"userTags": []
}In the above example, the systemTags and userTags fields 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 '{"changeSNSApplicationPlatformState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/sns/application-platforms/bf16a9b0315a3942afb8b7f29e1287eb/actionsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | The UUID of the resource, which uniquely identifies the resource |
| 2.3 |
stateEvent | String | body (contained in the changeSNSApplicationPlatformState structure) | State event |
| 2.3 |
systemTags (Optional) | List | body | System tags |
| 2.3 |
userTags (Optional) | List | body | User tags |
| 2.3 |
API Response
Response Example
{
"inventory": {
"uuid": "b7b98fae2d8c48c6acd6e4154faa6b0d",
"name": "email platform",
"description": "example description",
"state": "Enabled",
"type": "Email",
"createDate": "Mar 26, 2024 2:42:04 AM",
"lastOpDate": "Mar 26, 2024 2:42:04 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 5.0.0 | |
| error | ErrorCode | The error code. If not null, the operation failed. This field is null on success. See error | 2.3 |
| inventory | SNSApplicationPlatformInventory | See inventory | 2.3 |
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 | 0.6 |
| description | String | A brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null | 0.6 |
| cause | ErrorCode | The root error that caused the current error. If there is no root error, this field is null | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource, which uniquely identifies the resource | 2.3 |
| name | String | Resource name | 2.3 |
| description | String | Detailed description of the resource | 2.3 |
| type | String | Type | 2.3 |
| lastOpDate | Timestamp | Last modification time | 2.3 |
| createDate | Timestamp | Creation time | 2.3 |
SDK Examples
Java SDK
ChangeSNSApplicationPlatformStateAction action = new ChangeSNSApplicationPlatformStateAction();
action.uuid = "bf16a9b0315a3942afb8b7f29e1287eb";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeSNSApplicationPlatformStateAction.Result res = action.call();Python SDK
ChangeSNSApplicationPlatformStateAction action = ChangeSNSApplicationPlatformStateAction()
action.uuid = "bf16a9b0315a3942afb8b7f29e1287eb"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeSNSApplicationPlatformStateAction.Result res = action.call()