Update SNS Topic

PUT/zstack/v1/sns/topics/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateSNSTopic": {
    "name": "new name",
    "locale": "zh_CN"
  },
  "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 '{"updateSNSTopic":{"name":"new name","locale":"zh_CN"}}' \
http://localhost:8080/zstack/v1/sns/topics/3e7550bf8ead3f02b366df6e499dc285/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

The UUID of the resource, which uniquely identifies the resource

 

2.3

name (Optional)

String

body (contained in the updateSNSTopic structure)

Resource name

 

2.3

description (Optional)

String

body (contained in the updateSNSTopic structure)

Detailed description of the resource

 

2.3

systemTags (Optional)

List

body

System tags

 

2.3

userTags (Optional)

List

body

User tags

 

2.3

locale (Optional)

String

body (contained in the updateSNSTopic structure)

Internationalization language

  • zh_CN
  • en_US

5.0.0

API Response

Response Example

{
  "inventory": {
    "uuid": "adf76a202bd64d7f827ca262d899d5bd",
    "name": "new name",
    "state": "Enabled",
    "locale": "zh_CN",
    "createDate": "Mar 26, 2024 2:44:38 AM",
    "lastOpDate": "Mar 26, 2024 2:44:38 AM"
  }
}
NameTypeDescriptionStarting Version
successboolean 5.0.0
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. See error2.3
inventorySNSTopicInventorySee inventory2.3

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error that caused the current error. If there is no root error, this field is null0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource, which uniquely identifies the resource2.3
nameStringResource name2.3
descriptionStringDetailed description of the resource2.3
stateStringState2.3
createDateTimestampCreation time2.3
lastOpDateTimestampLast modification time2.3

SDK Examples

Java SDK

UpdateSNSTopicAction action = new UpdateSNSTopicAction();
action.uuid = "3e7550bf8ead3f02b366df6e499dc285";
action.name = "new name";
action.locale = "zh_CN";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSNSTopicAction.Result res = action.call();

Python SDK

UpdateSNSTopicAction action = UpdateSNSTopicAction()
action.uuid = "3e7550bf8ead3f02b366df6e499dc285"
action.name = "new name"
action.locale = "zh_CN"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSNSTopicAction.Result res = action.call()