Change SNS Application Endpoint State

PUT/zstack/v1/sns/application-endpoints/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeSNSApplicationEndpointState": {
    "stateEvent": "disable"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding 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 '{"changeSNSApplicationEndpointState":{"stateEvent":"disable"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/1485ef44ea5234ee83d80d3a15937e19/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

The UUID of the resource, uniquely identifying this resource

 

2.3

stateEvent

String

body (Contained in the changeSNSApplicationEndpointState structure)

State event

  • enable
  • disable

2.3

systemTags (Optional)

List

body

System tags

 

2.3

userTags (Optional)

List

body

User tags

 

2.3

API Response

Response example

{
  "inventory": {
    "name": "example",
    "uuid": "917fe66f76b241f0843dfbd6be685fc1",
    "description": "description example",
    "type": "Email",
    "state": "Enabled",
    "platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
    "createDate": "Mar 26, 2024 2:44:26 AM",
    "lastOpDate": "Mar 26, 2024 2:44:26 AM"
  }
}
NameTypeDescriptionStarting Version
successboolean 5.0.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error2.3
inventorySNSApplicationEndpointInventoryFor details, see inventory2.3

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, for example, SYS.1000 or HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource, uniquely identifying this resource2.3
nameStringResource name2.3
descriptionStringDetailed description of the resource2.3
typeStringType2.3
platformUuidStringApplication platform UUID2.3
lastOpDateTimestampLast modification time2.3
createDateTimestampCreation time2.3

SDK Examples

Java SDK

ChangeSNSApplicationEndpointStateAction action = new ChangeSNSApplicationEndpointStateAction();
action.uuid = "1485ef44ea5234ee83d80d3a15937e19";
action.stateEvent = "disable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeSNSApplicationEndpointStateAction.Result res = action.call();

Python SDK

ChangeSNSApplicationEndpointStateAction action = ChangeSNSApplicationEndpointStateAction()
action.uuid = "1485ef44ea5234ee83d80d3a15937e19"
action.stateEvent = "disable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeSNSApplicationEndpointStateAction.Result res = action.call()