SNS Operations
CreateSNSTopic
API Request
POST zstack/v1/sns/topicsAuthorization: OAuth the-session-uuid{
"params": {
"name": "api topic"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"api topic"}}' \
http://localhost:8080/zstack/v1/sns/topics| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| name | String | body (contained in the params structure) | The resource name. | 2.3 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 2.3 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"uuid": "a3a307316bb543e786b6dcac39847642",
"name": "new name",
"state": "Enabled",
"createDate": "Feb 28, 2018 9:46:35 AM",
"lastOpDate": "Feb 28, 2018 9:46:35 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| state | String | The state. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
SDK Sample
CreateSNSTopicAction action = new CreateSNSTopicAction();
action.name = "api topic";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSTopicAction.Result res = action.call();CreateSNSTopicAction action = CreateSNSTopicAction()
action.name = "api topic"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSTopicAction.Result res = action.call()DeleteSNSTopic
API Request
DELETE zstack/v1/sns/topics/{uuid}?deleteMode={deleteMode}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sns/topics/2e5e362e1a7836618d6cce49fba21e78?deleteMode=Permissive| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| deleteMode | String | url | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
DeleteSNSTopicAction action = new DeleteSNSTopicAction();
action.uuid = "2e5e362e1a7836618d6cce49fba21e78";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteSNSTopicAction.Result res = action.call();DeleteSNSTopicAction action = DeleteSNSTopicAction()
action.uuid = "2e5e362e1a7836618d6cce49fba21e78"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteSNSTopicAction.Result res = action.call()ChangeSNSTopicState
API Request
PUT zstack/v1/zwatch/topics/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"changeSNSTopicState": {
"stateEvent": "disable"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeSNSTopicState":{"stateEvent":"disable"}}' \
http://localhost:8080/zstack/v1/zwatch/topics/89f0adcff110385a8a8fa2568a744ab5/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| stateEvent | String | body (contained in the changeSNSTopicState structure) | The state event. |
|
2.3 |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"uuid": "00f71b1cd92144d68d2f7d0aa3e2e77a",
"name": "new name",
"state": "Enabled",
"createDate": "Feb 28, 2018 9:47:02 AM",
"lastOpDate": "Feb 28, 2018 9:47:02 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.3 |
| inventory | SNSTopicInventory | See inventory. | 2.3 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| state | String | The state. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
SDK Sample
ChangeSNSTopicStateAction action = new ChangeSNSTopicStateAction();
action.uuid = "89f0adcff110385a8a8fa2568a744ab5";
action.stateEvent = "disable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeSNSTopicStateAction.Result res = action.call();ChangeSNSTopicStateAction action = ChangeSNSTopicStateAction()
action.uuid = "89f0adcff110385a8a8fa2568a744ab5"
action.stateEvent = "disable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeSNSTopicStateAction.Result res = action.call()UpdateSNSTopic
API Request
PUT zstack/v1/sns/topics/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateSNSTopic": {
"name": "new name"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateSNSTopic":{"name":"new name"}}' \
http://localhost:8080/zstack/v1/sns/topics/3e7550bf8ead3f02b366df6e499dc285/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| name | String | body (contained in the updateSNSTopic structure) | Optional. The resource name. | 2.3 | |
| description | String | body (contained in the updateSNSTopic structure) | Optional. The detailed description of the resource. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"uuid": "c3c748d9e08e4e61a03228ca0e6f2eef",
"name": "new name",
"state": "Enabled",
"createDate": "Feb 28, 2018 9:47:49 AM",
"lastOpDate": "Feb 28, 2018 9:47:49 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| state | String | The state. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
UpdateSNSTopicAction action = new UpdateSNSTopicAction();
action.uuid = "3e7550bf8ead3f02b366df6e499dc285";
action.name = "new name";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSNSTopicAction.Result res = action.call();UpdateSNSTopicAction action = UpdateSNSTopicAction()
action.uuid = "3e7550bf8ead3f02b366df6e499dc285"
action.name = "new name"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSNSTopicAction.Result res = action.call()QuerySNSTopic
API Request
GET zstack/v1/sns/topics
GET zstack/v1/sns/topics/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/topics?q=name=apicurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/topics/b47d348c8c4a3559af1b09f31f7c26ebQueryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QuerySNSTopic, and pressing the Tab key.
API Response
{
"inventories": [
{
"uuid": "ccbec7ca092e40e0bfdfbd98563cb6da",
"name": "new name",
"state": "Enabled",
"createDate": "Feb 28, 2018 9:47:31 AM",
"lastOpDate": "Feb 28, 2018 9:47:31 AM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.3 |
| inventories | List | See inventories. | 2.3 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| state | String | The state. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
QuerySNSTopicAction action = new QuerySNSTopicAction();
action.conditions = asList("name=api");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSTopicAction.Result res = action.call();QuerySNSTopicAction action = QuerySNSTopicAction()
action.conditions = ["name=api"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSTopicAction.Result res = action.call()CreateSNSEmailPlatform
API Request
POST zstack/v1/sns/application-platforms/emailAuthorization: OAuth the-session-uuid{
"params": {
"smtpServer": "email.zstack.io",
"smtpPort": 20.0,
"username": "example@zstack.io",
"password": "password",
"encryptType": "STARTTLS",
"name": "email platform"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"smtpServer":"email.zstack.io","smtpPort":20.0,"username":"example@zstack.io","password":"password","encryptType":"STARTTLS","name":"email platform"}}' \
http://localhost:8080/zstack/v1/sns/application-platforms/email| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| smtpServer | String | body (contained in the params structure) | The SMTP server address. | 2.3 | |
| smtpPort | Integer | body (contained in the params structure) | The SMTP port. | 2.3 | |
| username | String | body (contained in the params structure) | The username. | 2.3 | |
| password | String | body (contained in the params structure) | Optional. The password. | 2.3 | |
| name | String | body (contained in the params structure) | The resource name. | 2.3 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 2.3 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 2.3 | |
| encryptType | String | body (contained in the params structure) | Optional. |
|
2.3 |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
Note:
- When you add an email server, the system will automatically detect whether the username, password, email server address, email server port, and encryption type are correct. The waiting time does not exceed 5 seconds.
API Response
{
"inventory": {
"uuid": "f6122105d8994b498e6184efcf03bb64",
"name": "email platform",
"description": "example description",
"state": "Enabled",
"type": "Email",
"createDate": "Feb 28, 2018 9:47:35 AM",
"lastOpDate": "Feb 28, 2018 9:47:35 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The type. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
CreateSNSEmailPlatformAction action = new CreateSNSEmailPlatformAction();
action.smtpServer = "email.zstack.io";
action.smtpPort = 20.0;
action.username = "example@zstack.io";
action.password = "password";
action.encryptType = "STARTTLS";
action.name = "email platform";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSEmailPlatformAction.Result res = action.call();CreateSNSEmailPlatformAction action = CreateSNSEmailPlatformAction()
action.smtpServer = "email.zstack.io"
action.smtpPort = 20.0
action.username = "example@zstack.io"
action.password = "password"
action.encryptType = "STARTTLS"
action.name = "email platform"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSEmailPlatformAction.Result res = action.call()ValidateSNSEmailPlatform
API Request
PUT zstack/v1/sns/application-platforms/email/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"validateSNSEmailPlatform": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"validateSNSEmailPlatform":{}}' \
http://localhost:8080/zstack/v1/sns/application-platforms/email/ee6f4b67dc7e3b298353a6fe2b5d0a6f/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
ValidateSNSEmailPlatformAction action = new ValidateSNSEmailPlatformAction();
action.uuid = "ee6f4b67dc7e3b298353a6fe2b5d0a6f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ValidateSNSEmailPlatformAction.Result res = action.call();ValidateSNSEmailPlatformAction action = ValidateSNSEmailPlatformAction()
action.uuid = "ee6f4b67dc7e3b298353a6fe2b5d0a6f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ValidateSNSEmailPlatformAction.Result res = action.call()DeleteSNSApplicationPlatform
API Request
DELETE zstack/v1/sns/application-platforms/{uuid}?deleteMode={deleteMode}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sns/application-platforms/992bf9e24f6f3f25866956f8079ffadc?deleteMode=Permissive| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| deleteMode | String | url | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
DeleteSNSApplicationPlatformAction action = new DeleteSNSApplicationPlatformAction();
action.uuid = "992bf9e24f6f3f25866956f8079ffadc";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteSNSApplicationPlatformAction.Result res = action.call();DeleteSNSApplicationPlatformAction action = DeleteSNSApplicationPlatformAction()
action.uuid = "992bf9e24f6f3f25866956f8079ffadc"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteSNSApplicationPlatformAction.Result res = action.call()QuerySNSEmailPlatform
API Request
GET zstack/v1/sns/application-platforms/email
GET zstack/v1/sns/application-platforms/email/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-platforms/email?q=name=emailcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-platforms/email/fe6d6cd0fbf53a4eaa772f326972d765Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QuerySNSEmailPlatform, and pressing the Tab key.
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
QuerySNSEmailPlatformAction action = new QuerySNSEmailPlatformAction();
action.conditions = asList("name=email");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSEmailPlatformAction.Result res = action.call();QuerySNSEmailPlatformAction action = QuerySNSEmailPlatformAction()
action.conditions = ["name=email"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSEmailPlatformAction.Result res = action.call()UpdateSNSApplicationPlatform
API Request
PUT zstack/v1/sns/application-platforms/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateSNSApplicationPlatform": {
"name": "new name"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateSNSApplicationPlatform":{"name":"new name"}}' \
http://localhost:8080/zstack/v1/sns/application-platforms/577aff1dcbe932798fd615e88813c7ce/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Optional. The resource UUID. | 2.3 | |
| name | String | body (contained in the updateSNSApplicationPlatform structure) | Optional. The resource name. | 2.3 | |
| description | String | body (contained in the updateSNSApplicationPlatform structure) | Optional. The detailed description of the resource. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"uuid": "f0f61510039d48709f4bb7804588bb4f",
"name": "email platform",
"description": "example description",
"state": "Enabled",
"type": "Email",
"createDate": "Feb 28, 2018 9:47:13 AM",
"lastOpDate": "Feb 28, 2018 9:47:13 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The type. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
UpdateSNSApplicationPlatformAction action = new UpdateSNSApplicationPlatformAction();
action.uuid = "577aff1dcbe932798fd615e88813c7ce";
action.name = "new name";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSNSApplicationPlatformAction.Result res = action.call();UpdateSNSApplicationPlatformAction action = UpdateSNSApplicationPlatformAction()
action.uuid = "577aff1dcbe932798fd615e88813c7ce"
action.name = "new name"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSNSApplicationPlatformAction.Result res = action.call()QuerySNSApplicationPlatform
API Request
GET zstack/v1/sns/application-platforms
GET zstack/v1/sns/application-platforms/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-platforms?q=state=Enabledcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-platforms/b9a635c9ff7c3544a232cad5b9a4aaf7Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QuerySNSApplicationPlatform, and pressing the Tab
key.
API Response
{
"inventories": [
{
"uuid": "c418160d00ff407986dde8bd10a7f0c4",
"name": "email platform",
"description": "example description",
"state": "Enabled",
"type": "Email",
"createDate": "Feb 28, 2018 9:46:58 AM",
"lastOpDate": "Feb 28, 2018 9:46:58 AM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.3 |
| inventories | List | See inventories. | 2.3 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The type. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
QuerySNSApplicationPlatformAction action = new QuerySNSApplicationPlatformAction();
action.conditions = asList("state=Enabled");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSApplicationPlatformAction.Result res = action.call();QuerySNSApplicationPlatformAction action = QuerySNSApplicationPlatformAction()
action.conditions = ["state=Enabled"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSApplicationPlatformAction.Result res = action.call()ChangeSNSApplicationPlatformState
API Request
PUT zstack/v1/sns/application-platforms/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"changeSNSApplicationPlatformState": {
"stateEvent": "enable"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.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/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| stateEvent | String | body (contained in the changeSNSApplicationPlatformState structure) | The state event. |
|
2.3 |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"uuid": "cce6611ab37f4e16b4e95a08d31838b1",
"name": "email platform",
"description": "example description",
"state": "Enabled",
"type": "Email",
"createDate": "Feb 28, 2018 9:45:19 AM",
"lastOpDate": "Feb 28, 2018 9:45:19 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The type. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
SDK Sample
ChangeSNSApplicationPlatformStateAction action = new ChangeSNSApplicationPlatformStateAction();
action.uuid = "bf16a9b0315a3942afb8b7f29e1287eb";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeSNSApplicationPlatformStateAction.Result res = action.call();ChangeSNSApplicationPlatformStateAction action = ChangeSNSApplicationPlatformStateAction()
action.uuid = "bf16a9b0315a3942afb8b7f29e1287eb"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeSNSApplicationPlatformStateAction.Result res = action.call()CreateSNSEmailEndpoint
API Request
POST zstack/v1/sns/application-endpoints/emailsAuthorization: OAuth the-session-uuid{
"params": {
"email": "example@zstack.io",
"emails": [
"example@zstack.io"
],
"name": "email",
"platformUuid": "5efc525948a537e39a91290c57d6d37b"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"email":"example@zstack.io","emails":["example@zstack.io"],"name":"email","platformUuid":"5efc525948a537e39a91290c57d6d37b"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/emails| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| String | body | The email address. | 2.3.0 | ||
| emails | List | body (contained in the params structure) | Optional. | 3.7.0 | |
| name | String | body | The resource name. | 2.3.0 | |
| description | String | body | Optional. The detailed description of the resource. | 2.3.0 | |
| platformUuid | String | body | Optional. The application platform UUID. | 2.3.0 | |
| resourceUuid | String | body | Optional. | 2.3.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 2.3.0 | |
| userTags | List | body | Optional. The user tags. | 2.3.0 |
API Response
{
"inventory": {
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Sep 6, 2019 2:52:41 PM",
"lastOpDate": "Sep 6, 2019 2:52:41 PM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 2.3 |
| uuid | String | The resource UUID. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The type. | 2.3 |
| state | String | 2.3 | |
| platformUuid | String | The application platform UUID. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
CreateSNSEmailEndpointAction action = new CreateSNSEmailEndpointAction();
action.email = "example@zstack.io";
action.emails = asList("example@zstack.io");
action.name = "email";
action.platformUuid = "5efc525948a537e39a91290c57d6d37b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSEmailEndpointAction.Result res = action.call();CreateSNSEmailEndpointAction action = CreateSNSEmailEndpointAction()
action.email = "example@zstack.io"
action.emails = [example@zstack.io]
action.name = "email"
action.platformUuid = "5efc525948a537e39a91290c57d6d37b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSEmailEndpointAction.Result res = action.call()QuerySNSEmailEndpoint
API Request
GET zstack/v1/sns/application-endpoints/emails
GET zstack/v1/sns/application-endpoints/emails/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/emails?q=email=test@zstack.iocurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/emails/bbae379b811f3d18a422d73557ece1b1Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QuerySNSEmailEndpoint, and pressing the Tab key.
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
QuerySNSEmailEndpointAction action = new QuerySNSEmailEndpointAction();
action.conditions = asList("email=test@zstack.io");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSEmailEndpointAction.Result res = action.call();QuerySNSEmailEndpointAction action = QuerySNSEmailEndpointAction()
action.conditions = ["email=test@zstack.io"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSEmailEndpointAction.Result res = action.call()CreateSNSHttpEndpoint
API Request
POST zstack/v1/sns/application-endpoints/httpAuthorization: OAuth the-session-uuid{
"params": {
"url": "http://127.0.0.1:6666/test-url",
"username": "username",
"password": "password",
"name": "http"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"http://127.0.0.1:6666/test-url","username":"username","password":"password","name":"http"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/http| Name | Type | Location | Description | Optimal Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the params structure) | The HTTP webhook URL. | 2.3 | |
| username | String | body (contained in the params structure) | Optional. The username of the URL. | 2.3 | |
| password | String | body (contained in the params structure) | Optional. The password of the URL. | 2.3 | |
| name | String | body (contained in the params structure) | The resource name. | 2.3 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 2.3 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 | |
| platformUuid | String | body (contained in the params structure) | Optional. | 0.6 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
CreateSNSHttpEndpointAction action = new CreateSNSHttpEndpointAction();
action.url = "http://127.0.0.1:6666/test-url";
action.username = "username";
action.password = "password";
action.name = "http";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSHttpEndpointAction.Result res = action.call();CreateSNSHttpEndpointAction action = CreateSNSHttpEndpointAction()
action.url = "http://127.0.0.1:6666/test-url"
action.username = "username"
action.password = "password"
action.name = "http"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSHttpEndpointAction.Result res = action.call()QuerySNSHttpEndpoint
API Request
GET zstack/v1/sns/application-endpoints/http
GET zstack/v1/sns/application-endpoints/http/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/http?q=url=http://urlcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/http/cbd9163bb4683e10b8a5025621e36862Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QuerySNSHttpEndpoint, and pressing the Tab key.
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
QuerySNSHttpEndpointAction action = new QuerySNSHttpEndpointAction();
action.conditions = asList("url=http://url");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSHttpEndpointAction.Result res = action.call();QuerySNSHttpEndpointAction action = QuerySNSHttpEndpointAction()
action.conditions = ["url=http://url"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSHttpEndpointAction.Result res = action.call()CreateSNSDingTalkEndpoint
API Request
POST zstack/v1/sns/application-endpoints/ding-talkAuthorization: OAuth the-session-uuid{
"params": {
"url": "http://dingding-robot-url",
"atAll": false,
"atPersonPhoneNumbers": [
"18900002222",
"13377778888"
],
"name": "dinding"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"http://dingding-robot-url","atAll":false,"atPersonPhoneNumbers":["18900002222","13377778888"],"name":"dinding"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk| Name | Type | Location | Description | Options Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the params structure) | The URL of the DingTalk robot. | 2.3 | |
| atAll | Boolean | body (contained in the params structure) | Optional. Whether to notify all (@All) members in a DingTalk group. | 2.3 | |
| atPersonPhoneNumbers | List | body (contained in the params structure) | Optional. The phone number of the group member to be notified (the @member). | 2.3 | |
| name | String | body (contained in the params structure) | The resource name. | 2.3 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 2.3 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 | |
| platformUuid | String | body (contained in the params structure) | Optional. | 2.3 |
API Response
{
"inventory": {
"url": "http://dingding-url",
"atAll": false,
"atPersonPhoneNumbers": [
"18900001111"
],
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Feb 28, 2018 9:47:10 AM",
"lastOpDate": "Feb 28, 2018 9:47:10 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| url | String | The URL of the DingTalk robot. | 2.3 |
| atAll | boolean | Whether to notify all (@All) members in a DingTalk group. | 2.3 |
| atPersonPhoneNumbers | List | The phone number of the group member to be notified (the @member). | 2.3 |
| name | String | The resource name. | 2.3 |
| uuid | String | The resource UUID. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The endpoint type. | 2.3 |
| platformUuid | String | The application platform UUID. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
CreateSNSDingTalkEndpointAction action = new CreateSNSDingTalkEndpointAction();
action.url = "http://dingding-robot-url";
action.atAll = false;
action.atPersonPhoneNumbers = asList("18900002222","13377778888");
action.name = "dinding";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSDingTalkEndpointAction.Result res = action.call();CreateSNSDingTalkEndpointAction action = CreateSNSDingTalkEndpointAction()
action.url = "http://dingding-robot-url"
action.atAll = false
action.atPersonPhoneNumbers = [18900002222, 13377778888]
action.name = "dinding"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSDingTalkEndpointAction.Result res = action.call()AddSNSDingTalkAtPerson
API Request
POST zstack/v1/sns/application-endpoints/ding-talk/at-personsAuthorization: OAuth the-session-uuid{
"params": {
"phoneNumber": "18099997777",
"endpointUuid": "5b9b95ca0cda3ab4bb51b5a4e1965305"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"phoneNumber":"18099997777","endpointUuid":"5b9b95ca0cda3ab4bb51b5a4e1965305"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk/at-persons| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| phoneNumber | String | body (contained in the params structure) | The phone number of the DingTalk user. (Users register DingTalk with their phone numbers.) | 2.3 | |
| endpointUuid | String | body (contained in the params structure) | The UUID of the DingTalk endpoint. | 2.3 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"uuid": "a72aa83b023744828f52adf83d850ed7",
"phoneNumber": "18988887777",
"endpointUuid": "ad5dc331264c4bcbbe56ee2523cde7a2"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| phoneNumber | String | The phone number of the DingTalk user. | 2.3 |
| endpointUuid | String | The UUID of the DingTalk endpoint. | 2.3 |
SDK Sample
AddSNSDingTalkAtPersonAction action = new AddSNSDingTalkAtPersonAction();
action.phoneNumber = "18099997777";
action.endpointUuid = "5b9b95ca0cda3ab4bb51b5a4e1965305";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSNSDingTalkAtPersonAction.Result res = action.call();AddSNSDingTalkAtPersonAction action = AddSNSDingTalkAtPersonAction()
action.phoneNumber = "18099997777"
action.endpointUuid = "5b9b95ca0cda3ab4bb51b5a4e1965305"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSNSDingTalkAtPersonAction.Result res = action.call()RemoveSNSDingTalkAtPerson
API Request
DELETE zstack/v1/sns/application-endpoints/ding-talk/{endpointUuid}/at-persons/{phoneNumber}?deleteMode={deleteMode}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk/696e69a1023f323ca147be82ed7f13cd/at-persons/18988887777?deleteMode=Permissive| Name | Type | Location | Description | Optional Version | Starting Version |
|---|---|---|---|---|---|
| deleteMode | String | url | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 | |
| endpointUuid | String | url | The UUID of the DingTalk endpoint. | 2.3 | |
| phoneNumber | String | url | The phone number of the user to be removed. | 2.3 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
RemoveSNSDingTalkAtPersonAction action = new RemoveSNSDingTalkAtPersonAction();
action.endpointUuid = "696e69a1023f323ca147be82ed7f13cd";
action.phoneNumber = "18988887777";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveSNSDingTalkAtPersonAction.Result res = action.call();RemoveSNSDingTalkAtPersonAction action = RemoveSNSDingTalkAtPersonAction()
action.endpointUuid = "696e69a1023f323ca147be82ed7f13cd"
action.phoneNumber = "18988887777"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveSNSDingTalkAtPersonAction.Result res = action.call()QuerySNSDingTalkEndpoint
API Request
GET zstack/v1/sns/application-endpoints/ding-talk
GET zstack/v1/sns/application-endpoints/ding-talk/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk?q=url=http://dingding-urlcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk/69658f91a1f130e0986fbfb19de1b3c9Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QuerySNSDingTalkEndpoint, and pressing the Tab key.
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
QuerySNSDingTalkEndpointAction action = new QuerySNSDingTalkEndpointAction();
action.conditions = asList("url=http://dingding-url");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSDingTalkEndpointAction.Result res = action.call();QuerySNSDingTalkEndpointAction action = QuerySNSDingTalkEndpointAction()
action.conditions = ["url=http://dingding-url"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSDingTalkEndpointAction.Result res = action.call()DeleteSNSApplicationEndpoint
API Request
DELETE zstack/v1/sns/application-endpoints/{uuid}?deleteMode={deleteMode}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sns/application-endpoints/f068da2f92f7354cbc9054a6c14989ea?deleteMode=Permissive| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| deleteMode | String | body | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
DeleteSNSApplicationEndpointAction action = new DeleteSNSApplicationEndpointAction();
action.uuid = "f068da2f92f7354cbc9054a6c14989ea";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteSNSApplicationEndpointAction.Result res = action.call();DeleteSNSApplicationEndpointAction action = DeleteSNSApplicationEndpointAction()
action.uuid = "f068da2f92f7354cbc9054a6c14989ea"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteSNSApplicationEndpointAction.Result res = action.call()UpdateSNSApplicationEndpoint
API Request
PUT zstack/v1/sns/application-endpoints/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateSNSApplicationEndpoint": {
"name": "new name"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateSNSApplicationEndpoint":{"name":"new name"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/7d6155384f4e3cdaa6e877ecec59318c/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| name | String | body (contained in the updateSNSApplicationEndpoint structure) | Optional. The resource name. | 2.3 | |
| description | String | body (contained in the updateSNSApplicationEndpoint structure) | Optional. The detailed description of the resource. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Feb 28, 2018 9:46:19 AM",
"lastOpDate": "Feb 28, 2018 9:46:19 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 2.3 |
| uuid | String | The resource UUID. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The type. | 2.3 |
| platformUuid | String | The application platform UUID. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
UpdateSNSApplicationEndpointAction action = new UpdateSNSApplicationEndpointAction();
action.uuid = "7d6155384f4e3cdaa6e877ecec59318c";
action.name = "new name";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSNSApplicationEndpointAction.Result res = action.call();UpdateSNSApplicationEndpointAction action = UpdateSNSApplicationEndpointAction()
action.uuid = "7d6155384f4e3cdaa6e877ecec59318c"
action.name = "new name"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSNSApplicationEndpointAction.Result res = action.call()QuerySNSApplicationEndpoint
API Request
GET zstack/v1/sns/application-endpoints
GET zstack/v1/sns/application-endpoints/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints?q=name=httpcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/b8a4be12db8237a1a42f897402afd4e8Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySNSApplicationEndpoint, and pressing the Tab key.
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
QuerySNSApplicationEndpointAction action = new QuerySNSApplicationEndpointAction();
action.conditions = asList("name=http");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSApplicationEndpointAction.Result res = action.call();QuerySNSApplicationEndpointAction action = QuerySNSApplicationEndpointAction()
action.conditions = ["name=http"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSApplicationEndpointAction.Result res = action.call()ChangeSNSApplicationEndpointState
API Request
PUT zstack/v1/sns/application-endpoints/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"changeSNSApplicationEndpointState": {
"stateEvent": "disable"
},
"systemTags": [],
"userTags": []
}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| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| stateEvent | String | body (contained in the changeSNSApplicationEndpointState structure) | The state event. |
|
2.3 |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"inventory": {
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Feb 28, 2018 9:47:32 AM",
"lastOpDate": "Feb 28, 2018 9:47:32 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| type | String | The type. | 2.3 |
| platformUuid | String | The application platform UUID. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
SDK Sample
ChangeSNSApplicationEndpointStateAction action = new ChangeSNSApplicationEndpointStateAction();
action.uuid = "1485ef44ea5234ee83d80d3a15937e19";
action.stateEvent = "disable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeSNSApplicationEndpointStateAction.Result res = action.call();ChangeSNSApplicationEndpointStateAction action = ChangeSNSApplicationEndpointStateAction()
action.uuid = "1485ef44ea5234ee83d80d3a15937e19"
action.stateEvent = "disable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeSNSApplicationEndpointStateAction.Result res = action.call()CreateSNSAliyunSmsEndpoint
API Request
POST zstack/v1/sns/sms-endpoints/aliyunsmsAuthorization: OAuth the-session-uuid{
"params": {
"accessKeyUuid": "4eb00e2bf95bp5s505e6eccd647d9k35",
"receivers": [
"13555555555",
"18666666666"
],
"name": "AliyunSms",
"description": "This is an Aliyun SMS Endpoint"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"accessKeyUuid":"4eb00e2bf95bp5s505e6eccd647d9k35","receivers":["13555555555","18666666666"],"name":"AliyunSms","description":"This is an Aliyun SMS Endpoint"}}' http://localhost:8080/zstack/v1/sns/sms-endpoints/aliyunsms| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| accessKeyUuid | String | body (contained in the params structure) | The UUID of the Aliyun access key. | 3.7.0 | |
| receivers | List | body (contained in the params structure) | Optional. The SMS message receivers. | 3.7.0 | |
| name | String | body (contained in the params structure) | The endpoint name. | 3.7.0 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the endpoint. | 3.7.0 | |
| platformUuid | String | body (contained in the params structure) | Optional. | 3.7.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 3.7.0 | |
| tagUuids | List | body (contained in the params structure) | The tag UUID list. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
{
"inventory": {
"name": "example",
"uuid": "041723a4d9d14e8686dbec7d1369c05e",
"description": "example SNSSmsEndpoint Description",
"type": "AliyunSms",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Oct 8, 2019 5:32:15 PM",
"lastOpDate": "Oct 8, 2019 5:32:15 PM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventory | SNSSmsEndpointInventory | See inventory. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| receivers | List | The SMS message receivers. | 3.7.0 |
| name | String | The name of the SMS message endpoint. | 3.7.0 |
| uuid | String | The UUID of the SMS message endpoint. | 3.7.0 |
| description | String | The detailed description of the SMS message endpoint. | 3.7.0 |
| type | String | The type of the SMS message endpoint. | 3.7.0 |
| state | String | The state of the SMS message endpoint. | 3.7.0 |
| platformUuid | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
SDK Sample
CreateSNSAliyunSmsEndpointAction action = new CreateSNSAliyunSmsEndpointAction();
action.accessKeyUuid = "4eb00e2bf95bp5s505e6eccd647d9k35";
action.receivers = asList("13555555555","18666666666");
action.name = "AliyunSms";
action.description = "This is an Aliyun SMS Endpoint";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSAliyunSmsEndpointAction.Result res = action.call();CreateSNSAliyunSmsEndpointAction action = CreateSNSAliyunSmsEndpointAction()
action.accessKeyUuid = "4eb00e2bf95bp5s505e6eccd647d9k35"
action.receivers = [13555555555, 18666666666]
action.name = "AliyunSms"
action.description = "This is an Aliyun SMS Endpoint"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSAliyunSmsEndpointAction.Result res = action.call()ValidateSNSAliyunSmsEndpoint
API Request
PUT zstack/v1/sns/sms-endpoints/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"validateSNSAliyunSmsEndpoint": {
"phoneNumbers": [
"134567898765",
"18654321234"
]
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"validateSNSAliyunSmsEndpoint":{"phoneNumbers":["134567898765","18654321234"]}}' http://localhost:8080/zstack/v1/sns/sms-endpoints/56304854f10730adac30a81c1e8e8de4/actions| Name | Type | Location | Description | Options Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The endpoint UUID. | 3.7.0 | |
| phoneNumbers | List | body (contained in the validateSNSAliyunSmsEndpoint structure) | The phone numbers to receive SMS verification messages. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
ValidateSNSAliyunSmsEndpointAction action = new ValidateSNSAliyunSmsEndpointAction();
action.uuid = "56304854f10730adac30a81c1e8e8de4";
action.phoneNumbers = asList("134567898765","18654321234");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ValidateSNSAliyunSmsEndpointAction.Result res = action.call();ValidateSNSAliyunSmsEndpointAction action = ValidateSNSAliyunSmsEndpointAction()
action.uuid = "56304854f10730adac30a81c1e8e8de4"
action.phoneNumbers = [134567898765, 18654321234]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ValidateSNSAliyunSmsEndpointAction.Result res = action.call()AddSNSSmsReceiver
API Request
POST zstack/v1/sns/sms-endpoints/receiversAuthorization: OAuth the-session-uuid{
"params": {
"phoneNumber": "13333333333",
"endpointUuid": "467e77c4cc42492f9794429e689a9874",
"type": "AliyunSms",
"description": "description"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"phoneNumber":"13333333333","endpointUuid":"467e77c4cc42492f9794429e689a9874","type":"AliyunSms","description":"description"}}' http://localhost:8080/zstack/v1/sns/sms-endpoints/receivers| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| phoneNumber | String | body (contained in the params structure) | The phone number to receive SMS messages. | 3.7.0 | |
| endpointUuid | String | body (contained in the params structure) | The UUID of the SMS message endpoint. | 3.7.0 | |
| type | String | body (contained in the params structure) | The type of the SMS message endpoint. |
|
3.7.0 |
| description | String | body (contained in the params structure) | Optional. The description of the SMS message receiver. | 3.7.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 3.7.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
{
"inventory": {
"uuid": "54f2c73bbdd24bd383bc898c94e4e157",
"phoneNumber": "18912345678",
"endpointUuid": "e0a8e9de43774027a486f3a47fa0b46c",
"type": "AliyunSms",
"description": "description",
"createDate": "Oct 11, 2019 2:55:42 PM",
"lastOpDate": "Oct 11, 2019 2:55:42 PM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventory | SNSSmsReceiverInventory | See inventory. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| phoneNumber | String | The phone number to receive SMS messages. | 3.7.0 |
| endpointUuid | String | The UUID of the SMS message endpoint. | 3.7.0 |
| description | String | The description of the SMS message receiver. | 3.7.0 |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| type | SmsReceiverType | See type. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| AliyunSms | SmsReceiverType | The Aliyun SMS message. | 3.7.0 |
SDK Sample
AddSNSSmsReceiverAction action = new AddSNSSmsReceiverAction();
action.phoneNumber = "13333333333";
action.endpointUuid = "467e77c4cc42492f9794429e689a9874";
action.type = "AliyunSms";
action.description = "description";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSNSSmsReceiverAction.Result res = action.call();AddSNSSmsReceiverAction action = AddSNSSmsReceiverAction()
action.phoneNumber = "13333333333"
action.endpointUuid = "467e77c4cc42492f9794429e689a9874"
action.type = "AliyunSms"
action.description = "description"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSNSSmsReceiverAction.Result res = action.call()RemoveSNSSmsReceiver
API Request
DELETE zstack/v1/sns/sms-endpoints/{endpointUuid}/receivers/{phoneNumber}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sns/sms-endpoints/196b91815e983d1397cb336a4fc9d054/receivers/18812345678?deleteMode=Permissive
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| endpointUuid | String | url | The UUID of the SMS endpoint. | 3.7.0 | |
| phoneNumber | String | url | The phone number to receive SMS messages. | 3.7.0 | |
| deleteMode | String | body | Optional. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
RemoveSNSSmsReceiverAction action = new RemoveSNSSmsReceiverAction();
action.endpointUuid = "196b91815e983d1397cb336a4fc9d054";
action.phoneNumber = "18812345678";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveSNSSmsReceiverAction.Result res = action.call();RemoveSNSSmsReceiverAction action = RemoveSNSSmsReceiverAction()
action.endpointUuid = "196b91815e983d1397cb336a4fc9d054"
action.phoneNumber = "18812345678"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveSNSSmsReceiverAction.Result res = action.call()QuerySNSSmsEndpoint
API Request
GET zstack/v1/sns/sms-endpoints
GET zstack/v1/sns/sms-endpoints/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/sms-endpoints?q=name=SmsEndpointcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/sms-endpoints/5efca3a7d67031fbba5bc512e52a4798Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySNSSmsEndpoint, and pressing the Tab key.
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
QuerySNSSmsEndpointAction action = new QuerySNSSmsEndpointAction();
action.conditions = asList("name=SmsEndpoint");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSSmsEndpointAction.Result res = action.call();QuerySNSSmsEndpointAction action = QuerySNSSmsEndpointAction()
action.conditions = ["name=SmsEndpoint"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSSmsEndpointAction.Result res = action.call()AddEmailAddressToSNSEmailEndpoint
API Request
POST zstack/v1/sns/application-endpoints/emails/email-addressesAuthorization: OAuth the-session-uuid{
"params": {
"emailAddress": "example@zstack.io",
"endpointUuid": "74220bbf0d8b3c6b943a294c2679ca69"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"emailAddress":"example@zstack.io","endpointUuid":"74220bbf0d8b3c6b943a294c2679ca69"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/emails/email-addresses| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| emailAddress | String | body (contained in the params structure) | The email address. | 3.7.0 | |
| endpointUuid | String | body (contained in the params structure) | The endpoint UUID. | 3.7.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 3.7.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
{
"inventory": {
"uuid": "f5682eb7abaa4bbe9bfd35b271138e9f",
"emailAddress": "example@zstack.io",
"endpointUuid": "a6bc3b6aa6b749db88a465530ea23f9e"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventory | SNSEmailAddressInventory | See inventory. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| emailAddress | String | 3.7.0 | |
| endpointUuid | String | 3.7.0 |
SDK Sample
AddEmailAddressToSNSEmailEndpointAction action = new AddEmailAddressToSNSEmailEndpointAction();
action.emailAddress = "example@zstack.io";
action.endpointUuid = "74220bbf0d8b3c6b943a294c2679ca69";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddEmailAddressToSNSEmailEndpointAction.Result res = action.call();AddEmailAddressToSNSEmailEndpointAction action = AddEmailAddressToSNSEmailEndpointAction()
action.emailAddress = "example@zstack.io"
action.endpointUuid = "74220bbf0d8b3c6b943a294c2679ca69"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddEmailAddressToSNSEmailEndpointAction.Result res = action.call()UpdateEmailAddressOfSNSEmailEndpoint
API Request
PUT zstack/v1/sns/application-endpoints/emails/email-addressesAuthorization: OAuth the-session-uuid{
"updateEmailAddressOfSNSEmailEndpoint": {
"emailAddressUuid": "cb2b3d85e0da3a299c52c23510ba15dd",
"endpointUuid": "f305528eb6773a73beac3f94f79d3017",
"emailAddress": "example@zstack.io"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateEmailAddressOfSNSEmailEndpoint":{"emailAddressUuid":"cb2b3d85e0da3a299c52c23510ba15dd","endpointUuid":"f305528eb6773a73beac3f94f79d3017","emailAddress":"example@zstack.io"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/emails/email-addresses| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| emailAddressUuid | String | body (contained in the updateEmailAddress structure) | The email address UUID. | 3.7.0 | |
| endpointUuid | String | body (contained in the updateEmailAddress structure) | The endpoint UUID. | 3.7.0 | |
| emailAddress | String | body (contained in the updateEmailAddress structure) | Optional. The address of the new email. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
{
"inventory": {
"uuid": "a78dca4fecd0475c8c164758e653631e",
"emailAddress": "example@zstack.io",
"endpointUuid": "bc36eb9b20cc481ebaf251ec0b51c386"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventory | SNSEmailAddressInventory | See inventory. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| emailAddress | String | 3.7.0 | |
| endpointUuid | String | 3.7.0 |
SDK Sample
UpdateEmailAddressOfSNSEmailEndpointAction action = new UpdateEmailAddressOfSNSEmailEndpointAction();
action.emailAddressUuid = "cb2b3d85e0da3a299c52c23510ba15dd";
action.endpointUuid = "f305528eb6773a73beac3f94f79d3017";
action.emailAddress = "example@zstack.io";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateEmailAddressOfSNSEmailEndpointAction.Result res = action.call();UpdateEmailAddressOfSNSEmailEndpointAction action = UpdateEmailAddressOfSNSEmailEndpointAction()
action.emailAddressUuid = "cb2b3d85e0da3a299c52c23510ba15dd"
action.endpointUuid = "f305528eb6773a73beac3f94f79d3017"
action.emailAddress = "example@zstack.io"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateEmailAddressOfSNSEmailEndpointAction.Result res = action.call()DeleteEmailAddressOfSNSEmailEndpoint
API Request
DELETE zstack/v1/sns/application-endpoints/emails/{endpointUuid}/email-addresses/{emailAddressUuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sns/application-endpoints/emails/c9d1789432133840862986db31a8e3fb/email-addresses/7671c40279e23d1cba927a5726957fcb| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| emailAddressUuid | String | url | 3.7.0 | ||
| endpointUuid | String | url | 3.7.0 | ||
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
DeleteEmailAddressOfSNSEmailEndpointAction action = new DeleteEmailAddressOfSNSEmailEndpointAction();
action.emailAddressUuid = "7671c40279e23d1cba927a5726957fcb";
action.endpointUuid = "c9d1789432133840862986db31a8e3fb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteEmailAddressOfSNSEmailEndpointAction.Result res = action.call();DeleteEmailAddressOfSNSEmailEndpointAction action = DeleteEmailAddressOfSNSEmailEndpointAction()
action.emailAddressUuid = "7671c40279e23d1cba927a5726957fcb"
action.endpointUuid = "c9d1789432133840862986db31a8e3fb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteEmailAddressOfSNSEmailEndpointAction.Result res = action.call()QuerySNSEmailAddress
API Request
GET zstack/v1/sns/application-endpoints/emails/email-addressesGET zstack/v1/sns/application-endpoints/{endpointUuid}/emails/email-addresses/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/emails/email-addresses?q=uuid=b1a8e21bed1e3592af8ba5ffff497af6&q=endpointUuid=547ffd3cbdb2399d8c6dde2d983502d5curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/emails/email-addresses/9c1b8131d9a03e3b88602a5072a89c0bQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySNSEmailAddress, and pressing the Tab key.
API Response
{
"inventories": [
{
"uuid": "102431efdb133a70b7e04347de22e396",
"emailAddress": "test@zstack.io",
"endpointUuid": "4ff65a1d7762348495dd0c4da110d7cd",
"createDate": "Oct 9, 2019 10:45:40 AM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventories | List | See inventories. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| emailAddress | String | 3.7.0 | |
| endpointUuid | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
SDK Sample
QuerySNSEmailAddressAction action = new QuerySNSEmailAddressAction();
action.conditions = asList("uuid=19beae4d7df63aa6ba24b7422521af7b","endpointUuid=4758483d0db33c6bb82961d4c1e837aa");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSEmailAddressAction.Result res = action.call();QuerySNSEmailAddressAction action = QuerySNSEmailAddressAction()
action.conditions = ["uuid=2ab2f6138c1c3b98b5834764c29dd596","endpointUuid=01106fe537473575be43fec7173e2dd1"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSEmailAddressAction.Result res = action.call()CreateSNSMicrosoftTeamsEndpoint
API Request
POST zstack/v1/sns/application-endpoints/microsoft-teamsAuthorization: OAuth the-session-uuid{
"params": {
"url": "http://teams-robot-url",
"name": "Microsoft teams"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"http://teams-robot-url","name":"Microsoft teams"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/microsoft-teams| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the params structure) | The connector URL. | 3.10.0 | |
| name | String | body (contained in the params structure) | The resource name. | 3.10.0 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 3.10.0 | |
| platformUuid | String | body (contained in the params structure) | Optional. | 3.10.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. | 3.10.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.10.0 | |
| systemTags | List | body | Optional. The system tags. | 3.10.0 | |
| userTags | List | body | Optional. The user tags. | 3.10.0 |
API Response
{
"inventory": {
"url": "http://teams-robot-url",
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Aug 21, 2020 2:17:23 PM",
"lastOpDate": "Aug 21, 2020 2:17:23 PM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.10.0 |
| inventory | SNSSmsEndpointInventory | See inventory. | 3.10.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.10.0 |
| description | String | The brief description of the error. | 3.10.0 |
| details | String | The details about the error. | 3.10.0 |
| elaboration | String | The reserved field. Default value: null. | 3.10.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.10.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.10.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| url | String | The connector URL. | 3.10.0 |
| name | String | The resource name. | 3.10.0 |
| uuid | String | The resource UUID. | 3.10.0 |
| description | String | The detailed description of the resource. | 3.10.0 |
| type | String | 3.10.0 | |
| state | String | 3.10.0 | |
| platformUuid | String | 3.10.0 | |
| createDate | Timestamp | The creation date. | 3.10.0 |
| lastOpDate | Timestamp | The last operation date. | 3.10.0 |
SDK Sample
CreateSNSMicrosoftTeamsEndpointAction action = new CreateSNSMicrosoftTeamsEndpointAction();
action.url = "http://teams-robot-url";
action.name = "Microsoft teams";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSMicrosoftTeamsEndpointAction.Result res = action.call();CreateSNSMicrosoftTeamsEndpointAction action = CreateSNSMicrosoftTeamsEndpointAction()
action.url = "http://teams-robot-url"
action.name = "Microsoft teams"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSMicrosoftTeamsEndpointAction.Result res = action.call()QuerySNSMicrosoftTeamsEndpoint
API Request
GET zstack/v1/sns/application-endpoints/microsoft-teamsGET zstack/v1/sns/application-endpoints/microsoft-teams/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/microsoft-teams?q=url=http://teams-urlQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySNSMicrosoftTeamsEndpoint, and pressing the Tab key.
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
QuerySNSMicrosoftTeamsEndpointAction action = new QuerySNSMicrosoftTeamsEndpointAction();
action.conditions = asList("url=http://teams-url");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSMicrosoftTeamsEndpointAction.Result res = action.call();QuerySNSMicrosoftTeamsEndpointAction action = QuerySNSMicrosoftTeamsEndpointAction()
action.conditions = ["url=http://teams-url"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSMicrosoftTeamsEndpointAction.Result res = action.call()SubscribeSNSTopic
API Request
POST zstack/v1/sns/topics/{topicUuid}/endpoints/{endpointUuid}Authorization: OAuth the-session-uuid{
"params": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' \
http://localhost:8080/zstack/v1/sns/topics/755ac6aea82f3365a66b86258c55189e/endpoints/c1f5c1e23ff13001b249c18253984741| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| topicUuid | String | url | The application topic UUID. | 2.3 | |
| endpointUuid | String | url | The endpoint UUID. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
SubscribeSNSTopicAction action = new SubscribeSNSTopicAction();
action.topicUuid = "755ac6aea82f3365a66b86258c55189e";
action.endpointUuid = "c1f5c1e23ff13001b249c18253984741";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SubscribeSNSTopicAction.Result res = action.call();SubscribeSNSTopicAction action = SubscribeSNSTopicAction()
action.topicUuid = "755ac6aea82f3365a66b86258c55189e"
action.endpointUuid = "c1f5c1e23ff13001b249c18253984741"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SubscribeSNSTopicAction.Result res = action.call()QuerySNSTopicSubscriber
API Request
GET zstack/v1/sns/topics/subscribers
GET zstack/v1/sns/topics/subscribers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/topics/subscribers?q=topicUuid=3677dc0f00964b80886f3b2bbf9338cdcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/topics/subscribers/15b4071325193fdcbae66b6388ea9c6fQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySNSTopicSubscriber, and pressing the Tab key.
API Response
{
"inventories": [
{
"topicUuid": "3677dc0f00964b80886f3b2bbf9338cd",
"endpointUuid": "f8c5c56233844126ad5f5a0174da3098"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.3.1 |
| inventories | List | See inventories. | 2.3.1 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 2.3.1 |
| description | String | The brief description of the error. | 2.3.1 |
| details | String | The details about the error. | 2.3.1 |
| elaboration | String | The reserved field. Default value: null. | 2.3.1 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 2.3.1 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.3.1 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| topicUuid | String | The topic UUID. | 2.3.1 |
| endpointUuid | String | The endpoint UUID. | 2.3.1 |
| createDate | Timestamp | The creation date. | 2.3.1 |
| lastOpDate | Timestamp | The last operation date. | 2.3.1 |
SDK Sample
QuerySNSTopicSubscriberAction action = new QuerySNSTopicSubscriberAction();
action.conditions = asList("topicUuid=3677dc0f00964b80886f3b2bbf9338cd");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSTopicSubscriberAction.Result res = action.call();QuerySNSTopicSubscriberAction action = QuerySNSTopicSubscriberAction()
action.conditions = ["topicUuid=3677dc0f00964b80886f3b2bbf9338cd"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSTopicSubscriberAction.Result res = action.call()UnsubscribeSNSTopic
API Request
DELETE zstack/v1/sns/topics/{topicUuid}/endpoints/{endpointUuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sns/topics/bd6c49ad623a3740880ca6d3ed3bb793/endpoints/36d6eb53f7c23fbca1ac72008940efc8?| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| topicUuid | String | url | The topic UUID. | 2.3 | |
| endpointUuid | String | url | The endpoint UUID. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
UnsubscribeSNSTopicAction action = new UnsubscribeSNSTopicAction();
action.topicUuid = "bd6c49ad623a3740880ca6d3ed3bb793";
action.endpointUuid = "36d6eb53f7c23fbca1ac72008940efc8";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UnsubscribeSNSTopicAction.Result res = action.call();UnsubscribeSNSTopicAction action = UnsubscribeSNSTopicAction()
action.topicUuid = "bd6c49ad623a3740880ca6d3ed3bb793"
action.endpointUuid = "36d6eb53f7c23fbca1ac72008940efc8"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UnsubscribeSNSTopicAction.Result res = action.call()