文档目录

更改接收端(ChangeSNSApplicationEndpointState)

API请求

URLs

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

Headers

Authorization: OAuth the-session-uuid

Body

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

Curl示例

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

参数列表

名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 2.3
stateEvent String body(包含在changeSNSApplicationEndpointState结构中) 状态事件
  • enable
  • disable
2.3
systemTags (可选) List body 系统标签 2.3
userTags (可选) List body 用户标签 2.3

API返回

返回示例

{
  "inventory": {
    "name": "example",
    "uuid": "917fe66f76b241f0843dfbd6be685fc1",
    "description": "description example",
    "type": "Email",
    "state": "Enabled",
    "platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
    "createDate": "Dec 25, 2023 2:06:05 PM",
    "lastOpDate": "Dec 25, 2023 2:06:05 PM"
  }
}
名字 类型 描述 起始版本
success boolean 5.0.0
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 0.6
inventory SNSApplicationEndpointInventory 详情参考inventory 0.6

#error

名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6

#inventory

名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 2.3
name String 资源名称 2.3
description String 资源的详细描述 2.3
type String 类型 2.3
platformUuid String 应用平台UUID 2.3
lastOpDate Timestamp 最后一次修改时间 2.3
createDate Timestamp 创建时间 2.3

SDK示例

Java SDK

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

Python SDK

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