文档目录

创建短信插件通知对象(CreateSNSSmsPluginEndpoint)

API请求

URLs
POST zstack/v1/sns/application-endpoints/plugin/sms
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "receivers": [
      "+86-18612345678"
    ],
    "timeoutInSeconds": 30,
    "name": "SMS plugin endpoint",
    "platformUuid": "8d7ef42fe7873d88a59c383b16c96bc3"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"receivers":["+86-18612345678"],"timeoutInSeconds":30,"name":"SMS plugin endpoint","platformUuid":"8d7ef42fe7873d88a59c383b16c96bc3"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/plugin/sms
参数列表
名字 类型 位置 描述 可选值 起始版本
name String body(包含在params结构中) 通知对象名称 5.5.38
description (可选) String body(包含在params结构中) 通知对象描述 5.5.38
platformUuid String body(包含在params结构中) 必填;平台须存在、已启用且当前账户拥有或获共享,关联Driver须为SMS类型并支持SEND_SNS_MESSAGE 5.5.38
timeoutInSeconds long body(包含在params结构中) 发送超时时间 5.5.38
properties (可选) Map body(包含在params结构中) 通知对象配置 5.5.38
receivers List body(包含在params结构中) 1至200个互不重复的短信接收号码 5.5.38
type (可选) String body(包含在params结构中) 可省略;短信Driver由platformUuid关联的平台确定 5.5.38
resourceUuid (可选) String body(包含在params结构中) 资源UUID 5.5.38
tagUuids (可选) List body(包含在params结构中) 标签UUID列表 5.5.38
systemTags (可选) List body 系统标签 5.5.38
userTags (可选) List body 用户标签 5.5.38

API返回

返回示例
{
  "inventory": {
    "uuid": "9ba1ed979c7c4774b30292bc683141b6",
    "name": "SMS plugin endpoint",
    "type": "Plugin",
    "state": "Enabled",
    "pluginDriverUuid": "b8fbed0254193eae88617f83930e0ca8",
    "properties": {},
    "platformUuid": "8d7ef42fe7873d88a59c383b16c96bc3",
    "timeoutInSeconds": 30
  }
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 2.3
inventory SNSPluginEndpointInventory 详情参考inventory 2.3
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.3.20
description String 错误的概要描述 5.3.20
details String 错误的详细信息 5.3.20
elaboration String 保留字段,默认为null 5.3.20
opaque LinkedHashMap 保留字段,默认为null 5.3.20
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.3.20
#inventory
名字 类型 描述 起始版本
pluginDriverUuid String 5.3.0
timeoutInSeconds long 5.3.0
properties Map 5.3.0
name String 资源名称 5.3.0
uuid String 资源的UUID,唯一标示该资源 5.3.0
description String 资源的详细描述 5.3.0
type String 5.3.0
state String 5.3.0
platformUuid String 5.3.0
createDate Timestamp 创建时间 5.3.0
lastOpDate Timestamp 最后一次修改时间 5.3.0
connectionStatus String 5.3.0
driver PluginDriverInventory 详情参考driver 5.3.0
platform SNSApplicationPlatformInventory 详情参考platform 5.3.0
#driver
名字 类型 描述 起始版本
uuid String 插件Driver UUID 5.3.28
name String 资源名称 5.3.0
type String 资源类型 5.3.0
vendor String 插件供应商 5.3.0
features String 插件特性 5.3.0
deleted boolean 插件是否已被软删除 5.3.28
license String 插件许可证 5.3.0
version String 插件版本 5.3.0
description String 资源的详细描述 5.3.0
createDate Timestamp 创建时间 5.3.28
lastOpDate Timestamp 最后一次修改时间 5.3.28
optionTypes Collection 详情参考optionTypes 5.3.28
#optionTypes
名字 类型 描述 起始版本
uuid String 配置字段UUID 5.3.28
name String 配置字段名称 5.3.28
code String 配置字段唯一编码 5.3.28
category String 配置字段分类 5.3.28
required Boolean 是否必填 5.3.28
editable Boolean 是否允许编辑 5.3.28
enabled Boolean 是否启用 5.3.28
displayOrder Integer 字段显示顺序 5.3.28
placeHolderText String 输入框占位提示 5.3.28
defaultValue String 字段默认值 5.3.28
noSelection String 未选择选项时使用的值 5.3.28
noBlank Boolean 是否禁止空白值 5.3.28
secretField Boolean 是否为敏感字段 5.3.28
minVal Long 允许的最小数值 5.3.28
maxVal Long 允许的最大数值 5.3.28
minLength Long 允许的最小输入长度 5.3.28
maxLength Long 允许的最大输入长度 5.3.28
fieldContext String 字段所属配置上下文 5.3.28
fieldClass String 字段展示样式类 5.3.28
fieldLabel String 字段展示名称 5.3.28
fieldCode String 字段国际化编码 5.3.28
fieldName String 字段保存键名 5.3.28
fieldGetName String 读取字段值时使用的键名 5.3.28
fieldSetName String 保存字段值时使用的键名 5.3.28
fieldGetContext String 读取字段值时使用的配置上下文 5.3.28
fieldSetContext String 保存字段值时使用的配置上下文 5.3.28
fieldGroup String 字段所属展示分组 5.3.28
fieldGroupI18nCode String 字段分组国际化编码 5.3.28
helpText String 字段帮助信息 5.3.28
helpTextI18nCode String 字段帮助信息国际化编码 5.3.28
optionSourceType String 动态选项的数据源类型 5.3.28
optionSource String 动态选项的数据源 5.3.28
dependsOn String 当前字段依赖的其他字段 5.3.28
showOnEdit Boolean 编辑时是否显示 5.3.28
displayValueOnDetails Boolean 详情页是否显示字段值 5.3.28
showOnCreate Boolean 创建时是否显示 5.3.28
verifyPattern String 字段值校验正则表达式 5.3.28
inputType InputType 详情参考inputType 5.3.28
#inputType
名字 类型 描述 起始版本
text InputType 单行文本输入框 5.3.28
password InputType 密码输入框 5.3.28
number InputType 数字输入框 5.3.28
textarea InputType 多行文本输入框 5.3.28
select InputType 单选下拉框 5.3.28
multiSelect InputType 多选下拉框 5.3.28
checkbox InputType 复选框 5.3.28
radio InputType 单选按钮 5.3.28
credential InputType 凭证选择器 5.3.28
typeahead InputType 支持搜索的单选输入框 5.3.28
multiTypeahead InputType 支持搜索的多选输入框 5.3.28
code-editor InputType 代码编辑器 5.3.28
hidden InputType 隐藏字段 5.3.28
#platform
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 2.3
name String 资源名称 2.3
description String 资源的详细描述 2.3
state String 资源的状态 2.3
type String 类型 2.3
createDate Timestamp 创建时间 2.3
lastOpDate Timestamp 最后一次修改时间 2.3

SDK示例

Java SDK
CreateSNSSmsPluginEndpointAction action = new CreateSNSSmsPluginEndpointAction();
action.receivers = java.util.Arrays.asList("+86-18612345678");
action.timeoutInSeconds = 30;
action.name = "SMS plugin endpoint";
action.platformUuid = "8d7ef42fe7873d88a59c383b16c96bc3";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSSmsPluginEndpointAction.Result res = action.call();
Python SDK
action = CreateSNSSmsPluginEndpointAction()
action.receivers = ["+86-18612345678"]
action.timeoutInSeconds = 30
action.name = "SMS plugin endpoint"
action.platformUuid = "8d7ef42fe7873d88a59c383b16c96bc3"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
开发手册 | 5.5.38 | ZStack Cloud · ZCF | ZStack 资源中心